diff --git a/Jamfile b/Jamfile new file mode 100644 index 0000000..461a3e3 --- /dev/null +++ b/Jamfile @@ -0,0 +1,6 @@ +SubDir TOP ; +#SubInclude TOP sources ; +SubInclude TOP sources-experimental ; +MakeDistro distro ; + + diff --git a/Jamrules b/Jamrules new file mode 100644 index 0000000..098624d --- /dev/null +++ b/Jamrules @@ -0,0 +1,55 @@ +BUILD_DIR = [ FDirName $(TOP) build ] ; +GENERATED_DIR = [ FDirName $(TOP) generated ] ; +DISTRO_DIR = [ FDirName $(TOP) generated distro ] ; + +include [ FDirName $(BUILD_DIR) HelperRules ] ; +include [ FDirName $(BUILD_DIR) ConfigRules ] ; +include [ FDirName $(BUILD_DIR) OverriddenJamRules ] ; +include [ FDirName $(BUILD_DIR) MainBuildRules ] ; +include [ FDirName $(BUILD_DIR) BuildSettings ] ; + + +# Include UserBuildConfig. +{ + local userBuildConfig = [ GLOB $(BUILD_DIR) : UserBuildConfig ] ; + if $(userBuildConfig) + { + LOCATE on UserBuildConfig = $(BUILD_DIR) ; + include UserBuildConfig ; + } +} + +# default to strip generated apps if not specified otherwise: +STRIP_APPS ?= 1 ; + +# Cache files for header scanning and jamfile caching. +HCACHEFILE = header_cache ; +JCACHEFILE = jamfile_cache ; +LOCATE on $(HCACHEFILE) $(JCACHEFILE) = $(GENERATED_DIR) ; + + +rule MakeDistro +{ + # MakeDistro + + local target = $1 ; + + NotFile $(target) ; + Always $(target) ; +} + +actions MakeDistro +{ + #jam + cp $(DISTRO_DIR)/BePodder $(TOP)/release + xres -o $(TOP)/release/BePodder $(TOP)/resources/Icons.rsrc $(TOP)/resources/BePodder.rsrc + + if [ -f /boot/beos/bin/IconTool ] ; then + echo "Adding SVG Icon" + IconTool $(TOP)/release/BePodder Build STD_ICON 1 -1 SVG $(TOP)/resources/AppIcon.svg + fi + + mimeset -f $(TOP)/release/BePodder + +} + diff --git a/bepodder_podcasts.opml b/bepodder_podcasts.opml new file mode 100644 index 0000000..44b7222 --- /dev/null +++ b/bepodder_podcasts.opml @@ -0,0 +1,2862 @@ + +BePodder Podcast Directory +Wed, 28 Dec 2005 03:18:34 GMT +Sunday, 4 November 2006 13:45:00 GMT +Funky Idea Software +bepodder.team@gmail.com + + +############## + +---------------- + + + + + --------------------- + + + +--------------------- + + + +--------------------- + + + + + +############## + +--------------------- + + + +--------------------- + + + + + + + + + + + + + + + + + + + + + + + + + + + +--------------------- + + + + + + + + +--------------------- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +--------------------- + + + + +----------------------------------- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +----------------------------------- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +--------------------- + + + + +--------------------- + + + + + + + + + + + + + + + + + + + + + + + + + + + + +############## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +############## + +--------------------- + + + +--------------------- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +--------------------- + + + + + + + + + + +--------------------- + + + + + + + + + +--------------------- + + + + + +--------------------- + + + + +--------------------- + + + +--------------------- + + + +--------------------- + + + + + +############## + + + + + + + + + + + + + + + + + + + + + +############## + +--------------------- + + + + +--------------------- + + + + + +--------------------- + + + + + + +--------------------- + + + + + +############## + + + + + + + + + + + + + + + +############## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ndweavers"/> + + + +---------------------------------------------------------------------------------------------- + + + + + +############## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +------------------------------------------------------------------------------------------------------ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +############## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +############## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +############## + +--------------------- + + + + + + + + + + + + + + + +------------------------------------------------------------------------------------------------------------ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +--------------------- + + + + + + + + + +############## + +----------------------------------- + + + + + + + + + + + + + + + + + + + + + + +----------------------------------- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +--------------------- + + + + + +--------------------- + + + + + +--------------------- + + + +--------------------- + + + + + + + +---------------------------------------------------------------------------------------------------------------------- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +--------------------- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +--------------------- + + + + + + + + + + + + +----------------------------------------------------------------------------------------------------------------- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +--------------------- + + + +--------------------- + + + + + + + + + + + +--------------------- + + + + +--------------------- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +--------------------- + + + + + + + + + + + + + + + + +--------------------- + + + +--------------------- + + + + + +--------------------- + + + +--------------------- + + + + + + + + + + + + + + + + + + + + + +--------------------- + + + + + + + + + + + + + + + + + +--------------------- + + + + + + + + + + +------------------------------------------------------------------------------------------------------------------- + + + + + + + + + + + + +--------------------- + + + + + + + + + + + + + + + + +--------------------- + + + + + + + + + + + + + + + + + + + + + +--------------------- + + + + + + + + + + + +############## + +--------------------- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-------------------------------------------------------------------------------------------------- + + + + + + + + + + + + + + + + + + + + +--------------------- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +--------------------- + + + + + + + + + + + +--------------------- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +############## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +############## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +############## + +--------------------- + + + + +--------------------- + + + + +--------------------- + + + + +--------------------- + + + + + + + + + + + +############## + +--------------------- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +--------------------- + + + + + + + + +--------------------- + + + + + + + +--------------------- + + + + + + + + + + + + + + + +--------------------- + + + + + + + + + + + + + + + + +--------------------------------------------------------------------------------------------------------- + + + + + + + + + + + + + + +--------------------- + + + + + + +--------------------- + + + + + + + + + +--------------------- + + + + +--------------------- + + + +--------------------- + + + +--------------------- + + + + + + + + +--------------------- + + + + + +############## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +############## + + + + + + + + + + + + + + + + + + + + diff --git a/build/BuildSettings b/build/BuildSettings new file mode 100644 index 0000000..efbe698 --- /dev/null +++ b/build/BuildSettings @@ -0,0 +1,127 @@ +# BuildSettings +# +# Setup global variables. + +# C and C++ flags +if $(OSPLAT) = PPC { + # filter out -nosyspath + CFLAGS = [ FFilter $(CFLAGS) : -nosyspath ] ; + C++FLAGS = [ FFilter $(C++FLAGS) : -nosyspath ] ; + LINKFLAGS += -warn -export pragma ; + + # set file containing preprocessed headers: + PREFIX_FILE ?= [ FDirName $(LOCATE_TARGET) pe.headers ] ; +} + +if $(OSPLAT) = X86 { + # check for BONE... + local haveBone = [ GLOB /boot/develop/headers/be/bone/arpa : inet.h ] ; + if $(haveBone) { + CCFLAGS += -DBONE_BUILD ; + C++FLAGS += -DBONE_BUILD ; + SYSHDRS += /boot/develop/headers/be/bone /boot/develop/headers/be/bone/sys ; + LINKLIBS += -lsocket -lbind ; + } else { + LINKLIBS += -lnet ; + } + # check for Zeta... + local haveZeta = [ GLOB /boot/beos/system/lib : libzeta.so ] ; + if $(haveZeta) { + LINKLIBS += -lzeta ; + DEFINES += ZETA ; + } +} + +# Use copyattr for copying. +CP = copyattr --data ; + +# Default paths for bison and flex: +BISON = bison ; +LEX = flex ; + +# mkdir shall not fail, if the directory already exists. +MKDIR = mkdir -p ; + +# Modify the main target dirs for languages and extensions. +SetConfigVar LOCATE_MAIN_TARGET : TOP Languages + : [ FDirName $(DISTRO_DIR) Languages ] ; +SetConfigVar LOCATE_MAIN_TARGET : TOP Extensions + : [ FDirName $(DISTRO_DIR) Extensions ] ; + +rule SetUpSubDirBuildSettings { + # SetUpSubDirBuildSettings ; + # + # Sets up the compiler flags and defines based on the WARNINGS, DEBUG, and + # OPTIMIZE variables. Also sets the locations for the targets (objects, + # libraries and executables). + # + # : Parameters as passed to the SubDir rule, i.e. the name of the + # TOP variable and the subdir tokens. + # + local dir = $(1) ; + + # warnings settings + if $(WARNINGS) != 0 { + if $(OSPLAT) = X86 { + CCFLAGS += -Wall -Wno-multichar -Wmissing-prototypes ; + CCFLAGS += -Wpointer-arith -Wcast-align -Wsign-compare ; + C++FLAGS += -Wall -Wno-multichar ; + C++FLAGS += -Wno-ctor-dtor-privacy -Woverloaded-virtual ; + C++FLAGS += -Wpointer-arith -Wcast-align -Wsign-compare ; + C++FLAGS += -Wno-unknown-pragmas ; + } else { + CCFLAGS += -w on -requireprotos ; + } + } + + # set the objects-folder according to debugging settings: + if $(DEBUG) && $(DEBUG) != 0 + { + OBJECTS_DIR = [ FDirName $(TOP) generated objects-debug ] ; + } + else + { + OBJECTS_DIR = [ FDirName $(TOP) generated objects-nodebug ] ; + } + + # debugging settings + if $(DEBUG) > 0 { + OPTIMIZE = 0 ; + STRIP_APPS = 0 ; + DEFINES += DEBUG=$(DEBUG) ; + CCFLAGS += -g ; + C++FLAGS += -g ; + LINKFLAGS += -g ; + } + + # optimization settings + if $(OPTIMIZE) = 0 { + if $(OSPLAT) = X86 { + OPTIM = -O0 ; + } else { + OPTIM = -O0 ; + } + } else { + if $(OSPLAT) = X86 { + OPTIM ?= -O2 ; + } else { + OPTIM ?= -O7 ; + } + } + + # setup objects location + local objdir = [ FDirName $(OBJECTS_DIR) $(dir[2-]) ] ; + SEARCH_SOURCE += $(objdir) ; + LOCATE_SOURCE = $(objdir) ; + LOCATE_TARGET = $(objdir) ; + + # setup main targets location + LOCATE_MAIN_TARGET ?= [ FDirName $(DISTRO_DIR) ] ; +} + +# The LOCATE_MAIN_TARGET variable shall be reset for each subdirectory. +AUTO_SET_UP_CONFIG_VARIABLES += LOCATE_MAIN_TARGET ; + +# Add the rules setting up the build settings for a subdirectory to the +# rules invoked by SubDir. +SUBDIRRULES += SetUpSubDirBuildSettings ; diff --git a/build/ConfigRules b/build/ConfigRules new file mode 100644 index 0000000..082ec46 --- /dev/null +++ b/build/ConfigRules @@ -0,0 +1,146 @@ +# ConfigRules +# +# Contains rules providing the config variable feature. It allows to set the +# values for certain variables for subdirectories in a central place. That is +# one can, for instance, specify in a file like UserBuildConfig for which +# directories to enable debugging, warnings, set special defines, compiler +# flags and the like without needing to edit the Jamfiles for the respective +# dirs. + +rule ConfigObject +{ + # ConfigObject ; + # + # Private rule. Returns the dummy object on which the config variables are + # set for a given subdir. + # + # : Parameters as passed to the SubDir rule, i.e. the name of the + # TOP variable and the subdir tokens. + # + local config = __config__ ; + local grist = [ FGrist root $(1) ] ; + return $(config:G=$(grist)) ; +} + +rule SetConfigVar +{ + # SetConfigVar : : [ : ] ; + # + # Sets a config variable for a specified directory to the given value. + # + # : The name of the variable to be set. + # : Parameters as passed to the SubDir rule, i.e. the name of the + # TOP variable and the subdir tokens. + # : The value to which the variable shall be set. + # : Either "global" or "local". The former implies that the variable + # value shall also be used for subdirectories (recursively), if + # for them the variable has not been set. The latter has the same + # effect regarding subdirs as if the variable for the directory + # is not set. Defaults to "global". + # + local var = $(1[1]) ; + local config = [ ConfigObject $(2) ] ; + local scope = $(4) ; + if ! $(scope) { + scope = global ; + } + $(var) on $(config) = $(3) ; + __set_$(var) on $(config) = $(scope) ; +} + +rule AppendToConfigVar +{ + # AppendToConfigVar : : [ : ] ; + # + # Appends a value to a config variable for a specified directory. Shortcut + # for + # SetConfigVar : : [ ConfigVar : ] ; + # + # : The name of the variable to be set. + # : Parameters as passed to the SubDir rule, i.e. the name of the + # TOP variable and the subdir tokens. + # : The value which to append to the variables current value. + # : Either "global" or "local". The former implies that the variable + # value shall also be used for subdirectories (recursively), if + # for them the variable has not been set. The latter has the same + # effect regarding subdirs as if the variable for the directory + # is not set. Defaults to "global". + # + SetConfigVar $(1) : $(2) : [ ConfigVar $(1) : $(2) ] $(3) : $(4) ; +} + +rule ConfigVar +{ + # ConfigVar : [ : ] ; + # + # Returns the value of a configuration variable for a given subdir. + # If the variable is not set for the subdir, the rule is invoked + # recursively for the parent directory with the scope "global". When + # the root is reached without yielding a value, the value of the global + # variable is returned. + # + # : The name of the variable whose value shall be returned. + # : Parameters as passed to the SubDir rule, i.e. the name of the + # TOP variable and the subdir tokens. + # : If not given any scope passed to SetConfigVar for the given + # directory will be accepted, otherwise it must match the scope + # passed to SetConfigVar. + # + local var = $(1[1]) ; + local dir = $(2) ; + local config = [ ConfigObject $(dir) ] ; + local scope = $(3) ; + local varScope = [ on $(config) return $(__set_$(var)) ] ; + if ( ! $(scope) && $(varScope) ) + || ( $(scope) && $(scope) = $(varScope) ) + || ! $(dir) { + on $(config) return $($(var)) ; + } else { + dir = [ FReverse $(dir) ] ; + return [ ConfigVar $(var) : [ FReverse $(dir[2-]) ] : global ] ; + } +} + +rule SetUpConfigVars { + # SetUpConfigVars ; + # + # Sets the global variables defined in AUTO_SET_UP_CONFIG_VARIABLES to the + # values specified for the subdirectory . + # + # : Parameters as passed to the SubDir rule, i.e. the name of the + # TOP variable and the subdir tokens. + # + local dir = $(1) ; + + # Backup the global variable value on first invocation, otherwise restore + # them, so that ConfigVar returns the right values for not explicity set + # local variables. + local var ; + if ! $(__config_var_backup__) { + __config_var_backup__ = true ; + for var in $(AUTO_SET_UP_CONFIG_VARIABLES) { + __config_var_backup_$(var)__ = $($(var)) ; + } + } else { + for var in $(AUTO_SET_UP_CONFIG_VARIABLES) { + $(var) = $(__config_var_backup_$(var)__) ; + } + } + + # Set the variables to their configured values. + for var in $(AUTO_SET_UP_CONFIG_VARIABLES) { + $(var) = [ ConfigVar $(var) : $(dir) ] ; + } +} + +# Add the SetUpConfigVars rule to the rules that are invoked at the end of the +# SubDir rule. Prepend it, so that the variables are set up before any other +# rule is invoked. +SUBDIRRULES = SetUpConfigVars $(SUBDIRRULES) ; + +# Some config variables that should be set up automatically for subdirs. +AUTO_SET_UP_CONFIG_VARIABLES += + CCFLAGS C++FLAGS DEBUG DEFINES HDRS LINKFLAGS OPTIM OPTIMIZE + SYSHDRS WARNINGS +; diff --git a/build/HelperRules b/build/HelperRules new file mode 100644 index 0000000..dda3e89 --- /dev/null +++ b/build/HelperRules @@ -0,0 +1,51 @@ +# HelperRules +# +# Helper rules without side effects. + +rule FFilter +{ + # FFilter : ; + # + # Removes all occurrences of in . + + local list = $(1) ; + local excludes = $(2) ; + local newList ; + local item ; + for item in $(list) { + local skip ; + local exclude ; + for exclude in $(excludes) { + if $(item) = $(exclude) { + skip = true ; + } + } + if ! $(skip) { + newList += $(item) ; + } + } + return $(newList) ; +} + +rule FSplitPath +{ + # FSplitPath ; + # + # Decomposes a path into its components. + # + # : The path to be decomposed. + # + local path = $(1:G=) ; + + local components ; + # $(path:D) for "/" is "/". Therefore the second condition. + while $(path:D) && $(path:D) != $(path) + { + # Note: $(path:B) returns "." for "..", but $(path:D=) is fine. + components = $(path:D=) $(components) ; + path = $(path:D) ; + } + components = $(path) $(components) ; + return $(components) ; +} + diff --git a/build/MainBuildRules b/build/MainBuildRules new file mode 100644 index 0000000..8ceb8a5 --- /dev/null +++ b/build/MainBuildRules @@ -0,0 +1,427 @@ +# MainBuildRules +# +# Rules that specify what to build and how to do it. + +rule Application +{ + # Application : : ; + # + # Creates an application from sources. + # + # : Name of the application. Grist is allowed. + # : List of source files. Grist will be set. + # : List of libraries to link against. + # + local app = $(1) ; + local sources = $(2) ; + local libs = $(3) ; + + Main $(app) : $(sources) ; + MakeLocate $(app) : $(LOCATE_MAIN_TARGET) ; + LinkAgainst $(app) : $(libs) ; +} + +actions Strip +{ + strip "$(1)" ; +} + +rule AddOn +{ + # AddOn : : ; + # + # Creates an add-on from sources. + # + # : Name of the add-on. Grist is allowed. + # : List of source files. Grist will be set. + # : List of libraries to link against. + # + SharedLibrary $(1) : $(2) : $(3) ; +} + +rule SharedLibrary +{ + # SharedLibrary : : ; + # + # Creates a shared library from sources. + # + # : Name of the shared library. Grist is allowed. + # : List of source files. Grist will be set. + # : List of libraries to link against. + # + local lib = $(1) ; + local sources = $(2) ; + local libs = $(3) ; + + Main $(lib) : $(sources) ; + MakeLocate $(lib) : $(LOCATE_MAIN_TARGET) ; + local linkFlags ; + if $(OSPLAT) = X86 { + linkFlags = -nostart -Xlinker -soname=\"$(lib)\" ; + } else { + linkFlags = -xms ; + } + LINKFLAGS on $(lib) = [ on $(lib) return $(LINKFLAGS) ] $(linkFlags) ; + LinkAgainst $(lib) : $(libs) ; +} + +rule StaticLibrary +{ + # StaticLibrary : ; + # + # Creates a static library from sources. + # + # : Name of the static library. Grist is allowed. + # : List of source files. Grist will be set. + # + local lib = $(1) ; + Library $(lib) : $(2) ; + MakeLocate $(lib) : $(LOCATE_MAIN_TARGET) ; + + # If KEEPOBJS is set, Library doesn't make the library depend on `lib'. + if $(KEEPOBJS) { + Depends lib : $(lib) ; + } +} + +rule LinkAgainst +{ + # LinkAgainst : ; + # + # Adds libraries to the list of libraries a (Main) target shall be linked + # against. + # + # : The name of the target for which to add libraries. + # : The libraries (actually arbitrary shared objects and static + # libraries) to be added. Valid elements are e.g. "be" or + # "libopenbeos.so" or "/boot/.../libfoo.so". If the basename starts + # with "lib" or the thingy has a dirname or grist, it is added to + # the NEEDLIBS variable (i.e. the file will be bound!), otherwise + # it is prefixed "-l" and added to LINKLIBS. If you want to specify + # a target that isn't a library and also has neither grist nor a + # dirname, you can prepend "" as grist; it will be + # stripped by this rule. + # + for i in $(>) + { + local isfile = ; + if $(i:D) || $(i:G) { + isfile = true ; + if $(i:G) = { + i = $(i:G=) ; + } + } else { + switch $(i:B) + { + # XXX: _APP_ and _KERNEL_ should not be needed for ELF. + case _APP_ : isfile = true ; + case _KERNEL_ : isfile = true ; + case lib* : isfile = true ; + case * : isfile = ; + } + if ! $(isfile) && ( $(i:S) = .so || $(i:S) = .a ) { + isfile = true ; + } + } + if $(isfile) { + NEEDLIBS on $(1) = [ on $(1) return $(NEEDLIBS) ] $(i) ; + Depends $(1) : $(i) ; + } else { + LINKLIBS on $(1) = [ on $(1) return $(LINKLIBS) ] -l$(i) ; + } + } +} + +rule XRes +{ + # XRes : ; + # + # Adds resources to a file. + # + # : The files to which resources shall be added. + # : The resource files. + # + if $(2) + { + Depends $(1) : $(2) ; + XRes1 $(1) : $(2) ; + } +} + +actions XRes1 +{ + xres -o "$(1)" "$(2)" ; +} + +actions MimeSet +{ + mimeset -f "$(1)" ; +} + +rule LexC++ +{ + Depends $(1) : $(2) ; + MakeLocate $(1) : $(LOCATE_SOURCE) ; + Clean clean : $(1) ; +} + +actions LexC++ +{ + $(LEX) -i -o$(1) $(2) +} + +rule Bison +{ + local _h ; + + _h = $(1).h ; + + MakeLocate $(<) $(_h) : $(LOCATE_SOURCE) ; + + Depends $(<) $(_h) : $(>) ; + BisonC++ $(<) $(_h) : $(>) ; + Clean clean : $(<) $(_h) ; + + # make sure someone includes $(_h) else it will be + # a deadly independent target + + Includes $(<) : $(_h) ; +} + +actions BisonC++ +{ + $(BISON) $(YACCFLAGS) -o $(1[1]) $(2) +} + +rule Rez +{ + # Rez : [ : ] ; + # + local output = $(1) ; + local rezFile = $(2) ; + local flags = $(3) ; + + REZHDRS on $(output) = [ on $(output) FIncludes $(HDRS) ] ; + REZFLAGS on $(output) = [ on $(output) return $(REZFLAGS) ] $(flags) ; + Depends $(output) : rez $(rezFile) ; + Rez1 $(output) : rez $(rezFile) ; +} + +actions Rez1 +{ + $(2[1]) $(REZFLAGS) $(REZHDRS) -o "$(1)" "$(2[2-])" ; +} + +rule RezObjects +{ + local rezFiles = $(1) ; + local rezFile ; + for rezFile in $(rezFiles) { + local rsrcFile = $(rezFile:BS=.rsrc) ; + RezObject $(rsrcFile) : [ FGristFiles $(rezFile) ] ; + } +} + +rule RezObject +{ + # RezObject : ; + # + local _rsrc = $(1) ; + local _r = $(2) ; + + local tmp = [ FGristFiles $(_rsrc)_tmp ] ; + + SEARCH on $(_r) = $(SEARCH_SOURCE) ; + + # include directories to by used + HDRS on $(_rsrc) $(tmp) = $(SEARCH_SOURCE) $(SUBDIRHDRS) $(HDRS) ; + + # preprocess the rez file + PreProcess $(tmp) : $(_r) ; + + # generate the resource file from the preprocessed rez file + MakeLocate $(_rsrc) : $(LOCATE_TARGET) ; + Rez $(_rsrc) : $(tmp) : -t ; + + RmTemps $(_rsrc) : $(tmp) ; + Clean clean : $(_rsrc) ; +} + +rule PreProcess +{ + # PreProcess : ; + # + local target = $(1) ; + local source = $(2) ; + + Depends $(target) : $(source) ; + + CPPHDRS on $(target) = [ on $(target) FIncludes $(HDRS) ] ; + + MakeLocate $(target) : $(LOCATE_SOURCE) ; +} + +if $(OSPLAT) = PPC { + actions PreProcess + { + mwcc -preprocess $(CPPHDRS) -o "$(1)" $(2) + } +} else { + actions PreProcess + { + gcc -E -x c $(CPPHDRS) -o "$(1)" $(2) + } +} + +rule RezHeader +{ + # RezHeader : : + # + # generates a header from a given resource file. + # + local _hdr = $(1) ; + local _rsrc = $(2) ; + + SEARCH on $(_rsrc) = $(SEARCH_SOURCE) ; + HDRS on $(_hdr) = $(SEARCH_SOURCE) $(SUBDIRHDRS) $(HDRS) ; + MakeLocate $(_hdr) : $(LOCATE_SOURCE) ; + Clean clean : $(_hdr) ; + + Rez $(_hdr) : $(_rsrc) : -h ; +} + +rule PreCompile +{ + # PreCompile : + # + # precompiles the given src (a headerfile) into the specified header. + # + local _hdr = $(1) ; + local _src = $(2) ; + MakeLocate $(_hdr) : $(LOCATE_TARGET) ; + PreComp $(_hdr) : $(_src) ; + Clean clean : $(_hdr) ; +} + +rule PreComp +{ + Depends $(<) : $(>) ; +} + +actions PreComp +{ + mwcc -precompile $(<) -lang cplus "$(>)" ; +} + +rule PeLanguage +{ + # PeLanguage : : : + # + # generates a SharedLib which extends Pe with syntax-highlighting for + # that specific language. + # + local lang = $(1) ; + local srcs = $(2) ; + local libs = $(3) ; + local rsrc = $(4) ; # contains keywords + + SharedLibrary $(lang) : $(srcs) : $(libs) ; + XRes $(lang) : $(rsrc) ; +} + +rule PeExtension +{ + # PeExtension : : : + # + # generates a SharedLib which extends Pe with a specific feature. + # + local ext = $(1) ; + local srcs = [ FGristFiles $(2) ] ; + local libs = $(3) ; + local rsrc = [ FGristFiles $(4) ] ; # optional resource file + + if $(rsrc) { + local header = $(rsrc:BS=.r.h) ; + + Includes $(srcs) : $(header) ; + RezHeader $(header) : $(rsrc) ; + } + SharedLibrary $(ext) : $(srcs) : $(libs) ; + + SymlinkDistroExtensionsLibDir $(ext) ; +} + +rule SymlinkDistroExtensionsLibDir +{ + # SymlinkDistroExtensionsLibDir ; + # + local extension = $(1) ; + + Depends $(extension) : lib ; + NoUpdate lib ; + MakeLocate lib : $(DISTRO_DIR)/Extensions ; + + SymlinkDistroExtensionsLibDir1 lib ; +} + +actions together SymlinkDistroExtensionsLibDir1 +{ # create a link to the folder where libhekkel.so lives + ln -sfn ../lib $(1) ; +} + +rule SubDirSysHdrs +{ + # SubDirSysHdrs ; + # + # Adds directories to the system include search paths for the current + # subdirectory. Counterpart of SubDirHdrs which adds non-system include + # search paths. + # + # : The directories to be added to the current subdir's system + # include search paths. + # + SUBDIRSYSHDRS += [ FDirName $(1) ] ; +} + +rule ObjectSysHdrs +{ + # SubDirSysHdrs : ; + # + # Adds directories to the system include search paths for the given + # sources or objects. Counterpart of ObjectHdrs which adds non-system + # include search paths. + # + # NOTE: This rule must be invoked *after* the rule that generates the + # objects. + # + # : The targets for which to add system include + # search paths. + # : The directories to be added to the given objects' system + # include search paths. + # + + local s ; + for s in [ FGristFiles $(<:S=$(SUFOBJ)) ] { + SYSHDRS on $(s) += $(>) ; + CCHDRS on $(s) = [ on $(s) FIncludes $(HDRS) ] + $(HDRS_INCLUDES_SEPARATOR) [ on $(s) FSysIncludes $(SYSHDRS) ] ; + } +} + + +# FSysIncludes ; +# +# Counterpart of FIncludes for system include search paths. +# +if $(OSPLAT) = X86 { + rule FSysIncludes { return -I$(<) ; } +} else { + rule FSysIncludes { return "-i "$(<) ; } +} + +# Variable referring to the STL. +if $(OSPLAT) = X86 { + STDC++LIB = stdc++.r4 ; +} else { + STDC++LIB = mslcpp_4_0 ; +} diff --git a/build/OverriddenJamRules b/build/OverriddenJamRules new file mode 100644 index 0000000..c0fef0c --- /dev/null +++ b/build/OverriddenJamRules @@ -0,0 +1,214 @@ +# OverriddenJamRules +# +# Jam rules that need to be overridden for good reasons. + +# Overridden to allow for spaces in file names and to support resources. +# Also set the on target LINKFLAGS variable to prevent later changes to +# the global variable from having an effect on the setting for the target. +rule Link +{ + local dbg = [ on $(1) return $(DEBUG) ] ; + if $(STRIP_APPS) && $(STRIP_APPS) != 0 && (!$(dbg) || $(dbg) = 0) { + # strip app if requested so and if not in debug mode! + Strip $(1) ; + } + # Note: RESFILES must be set before invocation. + MODE on $(1) = $(EXEMODE) ; + on $(1) XRes $(1) : $(RESFILES) ; + Chmod $(1) ; + MimeSet $(1) ; + LINKFLAGS on $(1) = [ on $(1) return $(LINKFLAGS) ] ; +} + +actions Link bind NEEDLIBS +{ + $(LINK) $(LINKFLAGS) -o "$(1)" $(UNDEFS) "$(2)" "$(NEEDLIBS)" $(LINKLIBS) +} + + +# Overridden to allow for spaces in file names. +actions Chmod1 +{ + $(CHMOD) "$(MODE)" "$(1)" +} + +# Overridden to allow for spaces in file names. +actions piecemeal together existing Clean +{ + $(RM) "$(>)" +} + +# Changes to rules for sake of discrimination between system and non-system +# headers. + +if $(OSPLAT) = X86 { + HDRS_INCLUDES_SEPARATOR = -I- ; +} else { + HDRS_INCLUDES_SEPARATOR = -i- ; +} + +rule Cc +{ + Depends $(<) : $(>) ; + + # If the compiler's -o flag doesn't work, relocate the .o + + if $(RELOCATE) + { + CcMv $(<) : $(>) ; + } + + # Just to clarify here: this sets the per-target CCFLAGS to + # be the current value of (global) CCFLAGS and SUBDIRCCFLAGS. + # CCHDRS and CCDEFS must be reformatted each time for some + # compiles (VMS, NT) that malign multiple -D or -I flags. + + CCFLAGS on $(<) += $(CCFLAGS) $(SUBDIRCCFLAGS) $(OPTIM) ; + + CCHDRS on $(<) = [ on $(<) FIncludes $(HDRS) ] + $(HDRS_INCLUDES_SEPARATOR) [ on $(<) FSysIncludes $(SYSHDRS) ] ; + CCDEFS on $(<) = [ on $(<) FDefines $(DEFINES) ] ; +} + +rule C++ +{ + Depends $(<) : $(>) ; + + if $(RELOCATE) + { + CcMv $(<) : $(>) ; + } + + C++FLAGS on $(<) += $(C++FLAGS) $(SUBDIRC++FLAGS) $(OPTIM) ; + + CCHDRS on $(<) = [ on $(<) FIncludes $(HDRS) ] + $(HDRS_INCLUDES_SEPARATOR) [ on $(<) FSysIncludes $(SYSHDRS) ] ; + CCDEFS on $(<) = [ on $(<) FDefines $(DEFINES) ] ; +} + +rule Object +{ + # locate object and search for source, if wanted + + Clean clean : $(<) ; + + MakeLocate $(<) : $(LOCATE_TARGET) ; + SEARCH on $(>) = $(SEARCH_SOURCE) ; + + # Save HDRS for -I$(HDRS) on compile. + # We shouldn't need -I$(SEARCH_SOURCE) as cc can find headers + # in the .c file's directory, but generated .c files (from + # yacc, lex, etc) are located in $(LOCATE_TARGET), possibly + # different from $(SEARCH_SOURCE). + + HDRS on $(<) = $(SEARCH_SOURCE) $(SUBDIRHDRS) $(HDRS) ; + SYSHDRS on $(<) = $(SUBDIRSYSHDRS) $(SYSHDRS) ; + + # handle #includes for source: Jam scans for headers with + # the regexp pattern $(HDRSCAN) and then invokes $(HDRRULE) + # with the scanned file as the target and the found headers + # as the sources. HDRSEARCH is the value of SEARCH used for + # the found header files. Finally, if jam must deal with + # header files of the same name in different directories, + # they can be distinguished with HDRGRIST. + + # $(SEARCH_SOURCE:E) is where cc first looks for #include + # "foo.h" files. If the source file is in a distant directory, + # look there. Else, look in "" (the current directory). + + HDRRULE on $(>) = HdrRule ; + HDRSCAN on $(>) = $(HDRPATTERN) ; + HDRSEARCH on $(>) = + $(SEARCH_SOURCE:E) $(SUBDIRHDRS) $(HDRS) $(SYSHDRS) $(STDHDRS) ; + + HDRGRIST on $(>) = $(HDRGRIST) ; + + # propagate target specific-defines + + DEFINES on $(<) += $(DEFINES) ; + + # if source is not .c, generate .c with specific rule + + switch $(>:S) + { + case .asm : As $(<) : $(>) ; + case .c : Cc $(<) : $(>) ; + case .C : C++ $(<) : $(>) ; + case .cc : C++ $(<) : $(>) ; + case .cpp : C++ $(<) : $(>) ; + case .f : Fortran $(<) : $(>) ; + case .l : C++ $(<) : $(<:S=.cpp) ; + LexC++ $(<:S=.cpp) : $(>) ; + case .s : As $(<) : $(>) ; + case .y : C++ $(<) : $(<:S=.cpp) ; + Bison $(<:S=.cpp) : $(>) ; + case * : UserObject $(<) : $(>) ; + } +} + +rule ObjectHdrs +{ + local s ; + for s in [ FGristFiles $(<:S=$(SUFOBJ)) ] { + HDRS on $(s) += $(>) ; + CCHDRS on $(s) = [ on $(s) FIncludes $(HDRS) ] + $(HDRS_INCLUDES_SEPARATOR) [ on $(s) FSysIncludes $(SYSHDRS) ] ; + } +} + +# Override Jam 2.5rc3 MakeLocate and MkDir to deal more intelligently +# with grist set on the supplied directory name. +rule MakeLocate +{ + if $(2[1]) + { + local dir = $(2[1]) ; + if ! $(dir:G) { + dir = $(dir:G=dir) ; + } + LOCATE on $(1) = $(dir:G=) ; + Depends $(1) : $(dir) ; + MkDir $(dir) ; + } +} + +rule MkDir +{ + # If dir exists, don't update it + # Do this even for $(DOT). + + local dir = $(<) ; + if ! $(dir:G) { + dir = $(dir:G=dir) ; + } + + NoUpdate $(dir) ; + + if $(dir:G=) != $(DOT) && ! $($(dir:G=)-mkdir) { + local s ; + + # Cheesy gate to prevent multiple invocations on same dir + # MkDir1 has the actions + # Arrange for jam dirs + + $(dir:G=)-mkdir = true ; + MkDir1 $(dir) ; + Depends dirs : $(dir) ; + + # Recursively make parent directories. + # $(dir:P) = $(dir)'s parent, & we recurse until root + + s = $(dir:P) ; # parent keeps grist + + if $(s:G=) && $(s) != $(dir) { + Depends $(dir) : $(s) ; + MkDir $(s) ; + } else if $(s) { + NotFile $(s) ; + } + } +} + +# Add SUBDIRSYSHDRS to the variables that shall be reset automatically by the +# SubDir rule. +SUBDIRRESET += SYSHDRS ; diff --git a/build/UserBuildConfig b/build/UserBuildConfig new file mode 100644 index 0000000..67cf7c7 --- /dev/null +++ b/build/UserBuildConfig @@ -0,0 +1,61 @@ +# UserBuildConfig +# +# Sample of a UserBuildConfig file. It is a central place where the user can +# set variables affecting certain aspects of the build, such as debug, +# warnings and optimization settings. The file is ignored by CVS. +# +# The following variables can be set: +# +# CCFLAGS, C++FLAGS - Flags passed to the C/C++ compiler. +# DEBUG - If not empty, will turn on debugging, i.e. will +# add respective C/C++ compiler and linker flags and +# the CPP DEBUG macro. +# DEFINES - CPP macros to be defined, e.g. something like +# `SPECIAL_FEATURE' or `CACHE_SIZE=1024'. +# HDRS - List of directories to be added to the local include +# search paths. +# LINKFLAGS - Flags passed to the linker. +# LOCATE_MAIN_TARGET - Directory where the main targets (i.e. applications, +# libraries shall be placed). Should usually not be +# tampered with by the user. +# OPTIM - Optimization specific flags passed to the C/C++ +# compiler. Usually you want to use OPTIMIZE instead. +# OPTIMIZE - If not set to `0', will turn on optimization, i.e. +# will set the respective C/C++ compiler flags +# (i.e. the OPTIM variable). +# STRIP_APPS - if not set to '0', will cause all generated apps to +# be stripped. Default is '0', i.e. no stripping +# SYSHDRS - List of directories to be added to the system include +# search paths. +# WARNINGS - If not set to `0', will turn on warnings, i.e. will +# set the respective C/C++ compiler flags. + +# Examples: + +# Globally turn off debugging: +# +# DEBUG = 0 ; + +# Globally activate debugging: +# +# DEBUG = 1 ; + +# ... e.g. like this, for the `add-ons/catalogs' directory and all its +# subdirectories. +# +# SetConfigVar WARNINGS : TOP add-ons catalogs : 1 ; + +# Turn on debugging for the the directory `Languages' and all its subdirectories. +# +# SetConfigVar DEBUG : TOP Languages : 1 ; + +# Turn off optimization for the `rez' directory and all its subdirectories. +# +# SetConfigVar OPTIMIZE : TOP rez : 0 ; + +# Define the CPP macro INSANE_DEBUGGING_LEVEL to the value `100' in the +# `lpe' directory, but NOT in its subdirectories (note the use of the +# optional fourth parameter `local', which works for both SetConfigVar and +# AppendToConfigVar). +# +# AppendToConfigVar DEFINES : TOP lpe : INSANE_DEBUGGING_LEVEL=100 : local ; diff --git a/build/UserBuildConfig.sample b/build/UserBuildConfig.sample new file mode 100644 index 0000000..67cf7c7 --- /dev/null +++ b/build/UserBuildConfig.sample @@ -0,0 +1,61 @@ +# UserBuildConfig +# +# Sample of a UserBuildConfig file. It is a central place where the user can +# set variables affecting certain aspects of the build, such as debug, +# warnings and optimization settings. The file is ignored by CVS. +# +# The following variables can be set: +# +# CCFLAGS, C++FLAGS - Flags passed to the C/C++ compiler. +# DEBUG - If not empty, will turn on debugging, i.e. will +# add respective C/C++ compiler and linker flags and +# the CPP DEBUG macro. +# DEFINES - CPP macros to be defined, e.g. something like +# `SPECIAL_FEATURE' or `CACHE_SIZE=1024'. +# HDRS - List of directories to be added to the local include +# search paths. +# LINKFLAGS - Flags passed to the linker. +# LOCATE_MAIN_TARGET - Directory where the main targets (i.e. applications, +# libraries shall be placed). Should usually not be +# tampered with by the user. +# OPTIM - Optimization specific flags passed to the C/C++ +# compiler. Usually you want to use OPTIMIZE instead. +# OPTIMIZE - If not set to `0', will turn on optimization, i.e. +# will set the respective C/C++ compiler flags +# (i.e. the OPTIM variable). +# STRIP_APPS - if not set to '0', will cause all generated apps to +# be stripped. Default is '0', i.e. no stripping +# SYSHDRS - List of directories to be added to the system include +# search paths. +# WARNINGS - If not set to `0', will turn on warnings, i.e. will +# set the respective C/C++ compiler flags. + +# Examples: + +# Globally turn off debugging: +# +# DEBUG = 0 ; + +# Globally activate debugging: +# +# DEBUG = 1 ; + +# ... e.g. like this, for the `add-ons/catalogs' directory and all its +# subdirectories. +# +# SetConfigVar WARNINGS : TOP add-ons catalogs : 1 ; + +# Turn on debugging for the the directory `Languages' and all its subdirectories. +# +# SetConfigVar DEBUG : TOP Languages : 1 ; + +# Turn off optimization for the `rez' directory and all its subdirectories. +# +# SetConfigVar OPTIMIZE : TOP rez : 0 ; + +# Define the CPP macro INSANE_DEBUGGING_LEVEL to the value `100' in the +# `lpe' directory, but NOT in its subdirectories (note the use of the +# optional fourth parameter `local', which works for both SetConfigVar and +# AppendToConfigVar). +# +# AppendToConfigVar DEFINES : TOP lpe : INSANE_DEBUGGING_LEVEL=100 : local ; diff --git a/documents/ChangeLog.txt b/documents/ChangeLog.txt new file mode 100644 index 0000000..2a8bc00 --- /dev/null +++ b/documents/ChangeLog.txt @@ -0,0 +1,52 @@ +since 1.2.5 + - prima implementazione di una metodo visivo per vedere il drag di un canale. + - fixed big/small view per i canali e i gruppi + - le info di cache e dei gruppi sono salvate come attributi della + 'archive' directory.. questo rende possibile più usi di BP. + - se l'archive directory non esiste, viene creata! + - groups : + - add + - rename [ICONA??] + - check channel + - remove group + - da fixare il riordino. + - fast browsing (da testare e finire) + - multi selection (da finire) + - per channel settings. [DA RIPENSARE] + + +since 1.2 bebits release: + + +-release 1.2.5 (riassunto dei cambiamenti per gli utenti) + + - better MimeType recognition (after downloading a file). + - Fixed some drawing issues. Less useless re-drawing (less flickering while checking channels). + - the 'archive' folder can now be a symlink. + - Fixed a bug that prevent to load preferences in the Light version. + - Added a paperclip icon for episodes with enclosure. + - Added a "Check for updates" feature + + + +- added "check for update" + - engine + - setting + - menu + +- added 'paperclip' icon. + +- fixed the light-preference bug + +- archive can now be replaced with a link to a folder. + +- removed useless printfs (Committed revision 57.) + +- speeded up the redrawing function in MainController: now the Subscription view in not always redrawen. (added main_win->RefreshSubscription(SubscriptionListItem* row);) Also the EpisodeList gains a LOT of drawing speed.. with the function ( fView->RefreshEpisode(dx_list,sel);) + + +- introduced ActionSync (later should be moved to a libfunky, and maybe do a libcurlaction.a with action based on curl) + +- fileType fix: se non viene scoperto e settato il filetype dal downloader, si chiede a beos di identificarlo. + +- fixed CLV color drawing. diff --git a/documents/Difference_between_version.txt b/documents/Difference_between_version.txt new file mode 100644 index 0000000..cb5d805 --- /dev/null +++ b/documents/Difference_between_version.txt @@ -0,0 +1,124 @@ + + +Difference between version 1.0 and 1.2 --------------------------------------- +- Added RDF and Atom support +- Better multilanguage support +- Added bittorrentfeeds built-in OPML directories +- Extended podcat OPML list from 3000 podcast to more than 10000 podcast +- Zeta (multilanguage) and BeOS R5 (english only) +- better players integration with a new Auto option +- online opml directory + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +BePodder Light is the basic version (free download and no time-limited). +The registered version adds some nice features + +- Easy to use yet powerful Graphical User Interface +- Handles all news/podcast feeds in RSS 0.9, 2.0, Atom, RDF and iTunes +- Fully integrated with BFS (BeOS/Zeta file system) +- Integrated podcast, videoblog, imagefeeds, BitTorrentfeeds, newsfeeds and Iternationalfeeds built-in OPML directories with thousands of feeds +- Advanced channels/lists management with drag and drop support +- Support for more than 10 languages +- Easy to integrate with other applications like BitTorrent/ Installer / Unzip / etc. +- players integration with a new Auto option +- BePodder is 100% adwares/spywares free +- Support for multithreading podcast download (available only in registered version) +- Small Channel view (available only in registered version) +- Support for Proxy (available only in registered version) +- No limited number in channel subscription (available only in registered version) +- Automatic channel control (available only in registered version) +- Low price 15€ only +- Zeta (multilanguage) and BeOS R5 (english only) +- You don't need an iPod or any kind of MP3 player to use and enjoy BePodder +- The same licence-keyfile can be use on to unlock BeOS R5 and Zeta version + + + + + + + + + + + + + + + +BePodder will be shareware, and in a very altruistic move by the team, they will donate 20% of the sales to Haiku, to support their development. Like BePodder's quality wasn't a good enough reason to buy it, you now have the added incentive of supporting Haiku through your purchase. The next beta stage will begin next week and a final version is expected around spring time. The main features include: + + * Easy to use yet powerful Graphical User Interface + * Full integration with BFS + * Integrated OPML Podcasts and Videoblog Directories + * Built-in support for RSS 0.9, RSS 2.0 and iTunes + + + + 1. Easy to use yet powerful Graphical User Interface + 2. Handles all news/podcast feeds in RSS 0.9, 2.0 and iTunes + 3. Fully integrated with BFS (BeOS/Zeta file system) + 4. Integrated podcast, videoblog, imagefeeds and newsfeeds built-in OPML directories with thousands of feeds + 5. Advanced channels/lists management with drag and drop support + 6. Support for more than 10 languages + 7. Easy to integrate with other applications like BitTorrent/ Installer / Unzip / etc. + 8. Support for multithreading podcast download + 9. BePodder is 100% adwares/spywares free + 10. Low price + 11. You don't need an iPod or any kind of MP3 player to use and enjoy BePodder + 12. The same licence-keyfile can be use on to unlock BeOS R5 and Zeta version + + + + diff --git a/documents/Releases b/documents/Releases new file mode 100644 index 0000000..1152ccd --- /dev/null +++ b/documents/Releases @@ -0,0 +1,22 @@ +- Added Icons to splitPane. +- Replaced the application icon with the old new by zuMi (Haiku only format :) + +1.3.0 ALPHA 2 + +- Better OPML Parser: works also with ITunes exported files. +- Fixed VLC loading + +1.3.0 ALPHA 1 + +- Redrawed Add Subscription panel +- Adding Import OPML +- Fixed bugs when removing a channel + - if it was the last channel the right list is cleaned. + - it actually fire a new channel selection. + +OPEN BUG: adding a channel fuck the selection of the current selected. + +1.3.0 +- Fixed open directory bug +- Fixed setting filetype' enclosure bug +- DISABLED check version \ No newline at end of file diff --git a/documents/comunicati_comunity.txt b/documents/comunicati_comunity.txt new file mode 100644 index 0000000..e7d4f07 --- /dev/null +++ b/documents/comunicati_comunity.txt @@ -0,0 +1,80 @@ +During the next BeGeistert (8-9 Dec, Milan - Italy) , Funky Idea Software will show the new version of BePodder mediafeeds agreggator for BeOS, Haiku and Zeta. A tool that brings news, journals, broadcasts and images from all around the world direct to your desktop. + +BePodder Light is the basic version (free download and no time limited) that includes many cool features: + +- Easy to use yet powerful Graphical User Interface +- Handles all news/podcast feeds in RSS 0.9, 2.0, Atom, RDF and iTunes (up to 10 feeds in the Light version) +- Fully integrated with BFS (BeOS/Haiku/Zeta file system) +- Integrated podcast, videoblog, imagefeeds, BitTorrentfeeds, newsfeeds and Iternationalfeeds built-in OPML directories with thousands of feeds +- Advanced channels/lists management with drag and drop support +- Support for more than 10 languages +- Easy to integrate with other applications like BitTorrent/ Installer / Unzip / etc. +- players integration with a new Auto option +- BePodder is 100% adwares/spywares free +- Zeta (multilanguage) and BeOS R5/Haiku (english only) +- You don't need an iPod or any kind of MP3 player to use and enjoy BePodder +- The same licence-keyfile can be use on to unlock BeOS R5, Haiku and Zeta version + +The registered version adds some more nice features: + +- Unlimited number of channels +- Small Channel view +- Proxy support +- Automatic channels check +- Up to 5 enclosure downloads at the same time. (multithreading) +- Low price, only 15€ (BePodder team will support the Haiku project donating 20% of the cost for every copy sold) + + + + +------------------------------------------------------------------------------------------------------------------ +Funky Idea Software (http://www.funkyideasoft.com) proudly presents BePodder 1.0 a new Mediafeed aggregator (Podcaster) developed for the BeOS/Zeta platform. +It helps you to find, subscribe to, and download multimedia contents. It +allows you to easily enjoy audio, video, images and news published around the web in RSS format. Screenshots can be found here (http://www.funkyideasoft.com/screenshots3_bp.html). +BePodder has a cheap shareware licence (15 euros + VAT); this allows the authors to provide support and updates. They will also provide support to the Haiku project by donating 20% of the revenue of every sold copy. + +Main Features : + +- Easy to use yet powerful Graphical User Interface +- Handles all news/podcast feeds in RSS 0.9, 2.0, and iTunes +- Fully integrated with BFS (BeOS/Zeta file system) +- Integrated podcast, videoblog, imagefeeds and newsfeeds built-in OPML directories + with thousands of feeds +- Advanced channels/lists management with drag and drop support +- Multilanguage support +- Easy to integrate with other applications like BitTorrent/ Installer / Unzip / etc. +- Supports multiple downloads at the same time. +- BePodder is 100% adwares/spywares free +- Low price +- You don't need an iPod or any kind of MP3 player to use and enjoy BePodder. +- The same licence-keyfile can be use on to unlock R5 and Zeta version. + +The demo version can be unlocked by purchasing a licence-keyfile. + +Right now, only Zeta version is available. The team is also working on a BeOS R5 version that will be released soon. + +banner url: +http://www.funkyideasoft.com/logos/bepodder_ban1.png + +---italiano + +Funky Idea Software (http://www.funkyideasoft.com) è orgogliosa di presentare BePodder 1.0 un nuovo Mediafeed aggregator (Podcaster) sviluppato per la piattaforma BeOS/Zeta. Questo software ti aiuta nel trovare e scaricando contenuti multimediali. Ti potrai godere audio, video, immagini e notizie pubblicate per tutti il web attraverso il formato RSS. Immagini del programma possono essere trovate qui (http://www.funkyideasoft.com/screenshots3_bp.html). +BePodder ha una licenza shareware molto economica: solo 15 euro (piu IVA). Questo per permettere agli autori di provvedere in futuro a supporto e nuovi aggiornamenti. Inoltre per ogni copia venduta il 20% verrà donato al progetto Haiku. + +Caratteristiche principali: +- Semplice e potente Interfaccia Grafica +- Supporta tutti i feeds nei formati RSS 0.9, 2.0 e iTunes. +- Integrato con BFS (il file system di BeOS/Zeta) +- Supporto multilingua +- Facile da integrare con altre applicazioni come BitTorrent/Installer/Unzio/etc.. +- Supporta multipli download contemporanei +- BePodder è al 100% libero da adwares/spywares +- Prezzo basso. +- Non serve un iPod o un player mp3 per usare e goderti BePodder. +- Lo stesso file di licenza può essere usato sia per sbloccare la versione per R5 sia quella per Zeta. + +Al momento è disponibile solo la versione per Zeta. Il team sta attivamente lavorando alla versione per BeOS R5 che verrà rilasciata a breve. + +banner url: +http://www.funkyideasoft.com/logos/bepodder_ban1.png + diff --git a/documents/elenco_clienti.txt b/documents/elenco_clienti.txt new file mode 100644 index 0000000..b5a2711 --- /dev/null +++ b/documents/elenco_clienti.txt @@ -0,0 +1,233 @@ +LISTA CHIAVI INVIATE GRATUITAMENTE (BETATESTER E SPONSOR) + +Dane Scott ( dane@tunetrackersystems.com ) + Rémi Grumeau ( remi@beosfrance.com ) +Bernd Korz ( btk@yellowtab.com ) +Jorge G.Mare ( koki@aequus.net ) +Frank Paul Silye ( frankps@gmail.com ) +Maurice Kalinowski ( maurice.kalinowski@yellowtab.com ) +Daniel Texeira ( daat@iscomputeron.com ) +Begasus ( Begasus@skynet.be) +Kim ( bem@jcom.home.ne.jp) +Alan Westbrook ( alan.westbrook@yellowtab.com ) +Steven D. Blackford ( kb7sqi@yahoo.com ) + +######################################################### + +LISTA CLIENTI CHE HANNO PAGATO DIRETTAMENTE + +Christian Celona ( christian@celona.it ) (pagata a Giuseppe) + + + +########################################################## + +LISTA CLIENTI A CUI E' GIA' STATA INVIATA LA CHIAVE +--------------------------------------------------- + +United States 7 +Germany 4 +Japan 2 +Brasil 1 +Sweden 1 +Italy 1 +Portugal 1 +-------------------------------------------- +totale 17 + + +17)Registered-To: Paul Artz +Email: paulartz@mac.com +Postal: 15 Channel Center St 310, Boston MA 02210, United States +Total Amount Paid: USD 18.22 +Date: 2006-09-27 +Processed: 2006-09-27 +PaymentMethod: card +Invoice: I530387774 +TransactionID: CHQ9PQZJG688 +Comment: Though I don't have a Be up at the moment, I wanted to help ASAP. Even at that, I waited too long. +Note: SSL from 66.171.79.179 via KOOP 5.6.4aen for supplier 6FCQZ. + +16)Registered-To: Armin Hald +Email: a-hald@ti.com +Postal: Freisinger Str, Langenbach , Germany +Total Amount Paid: EUR 17.4 +Date: 2006-09-16 +Processed: 2006-09-16 +PaymentMethod: card +Invoice: I529452879 +TransactionID: CHQQ1YSTHAW7 +Note: SSL from 212.144.156.73 via KOOP 5.6.4aen for supplier 6FCQZ. + + +15)Registered-To: john skinner +Email: olivero604@comcast.net +Postal: 604 olivero rd # 13, modesto CA 95358, United States +Total Amount Paid: EUR 15 +Date: 2006-06-08 +Processed: 2006-06-08 +PaymentMethod: card +Invoice: I520840924 +TransactionID: CHCNWD7S3D3K +Note: SSL from 67.187.147.82 via KOOP 5.6.2en for supplier 6FCQZ. + + +14)Registered-To: Liz Holt +Email: lizholt@mac.com +Postal: 7510 W. 57th Ave, Suite B, Arvada Colorado 80002, United States +Total Amount Paid: USD 18.32 +Date: 2006-06-08 +Processed: 2006-06-08 +PaymentMethod: card +Invoice: I520782913 +TransactionID: CHC5HK3K1WH5 +Note: SSL from 71.56.221.226 via KOOP 5.6.2en for supplier 6FCQZ. + +13)Registered-To: Edward Falis +Email: falis@verizon.net +Postal: 26 Topsfield Rd, Ipswich MA 01938, United States +Total Amount Paid: USD 18.3 +Date: 2006-06-01 +Processed: 2006-06-01 +PaymentMethod: card +Invoice: I520198475 +TransactionID: CHCTXFZ5T7Q6 +Note: SSL from 70.19.195.67 via KOOP 5.6.2en for supplier 6FCQZ. + +12)Registered-To: Kristof Doebner +Email: kristof.doebner@arcor.de +Postal: Kristof Doebner / Kattowitzer Str. 27, Muenchen Bavaria D-81929, Germany +Total Amount Paid: EUR 17.4 +Date: 2006-05-27 +Processed: 2006-05-27 +PaymentMethod: card +Invoice: I519740154 +TransactionID: CHQYRXYY2TYN +Note: SSL from 84.56.50.122 via KOOP 5.6.2en for supplier 6FCQZ. + +11)Registered-To: Mats Borg +Email: mats_borg@bredband.net +Postal: Värmlandsv 8D, Karlskoga Värmland 69132, Sweden +Total Amount Paid: EUR 18.75 +Date: 2006-05-20 +Processed: 2006-05-20 +PaymentMethod: card +Invoice: I519142904 +TransactionID: CHCE5FANUXAY +Note: SSL from 83.226.1.6 via KOOP 5.6.1en for supplier 6FCQZ. + +10)Registered-To: Christian Winkler +Email: bestellungen@cwinkler.net +Postal: Bothestr. 23, Leipzig 04155, Germany +Total Amount Paid: EUR 17.4 +Date: 2006-05-17 +Processed: 2006-05-17 +PaymentMethod: card +Invoice: I518882946 +TransactionID: CHCUQRSJSA22 +Note: SSL from 194.138.39.54 via KOOP 5.6.1en for supplier 6FCQZ. + +9)Registered-To: Adam McNutt +Email: kancept@nylonoxygen.com +Postal: PO Box 4018, Hailey ID 83333, United States +Total Amount Paid: USD 17.82 +Date: 2006-04-27 +Processed: 2006-04-27 +PaymentMethod: card +Invoice: I517196426 +TransactionID: CHCQVMDFQE7T +Comment: Sweet! +Note: SSL from 204.134.212.146 via KOOP 5.6.0en for supplier 6FCQZ. + +8)Registered-To: Daniel Alexandre Arsénio Teixeira +Email: daat.teixeira@gmail.com +Postal: Av. Sto. António, 63 - 2 Dto, Tercena Oeiras 2730-164 Barcarena, Portugal +Total Amount Paid: EUR 18.15 +Date: 2006-04-27 +Processed: 2006-04-27 +PaymentMethod: card +Invoice: I517178335 +TransactionID: CHCX0W731C28 +Note: SSL from 85.138.152.213 via KOOP 5.6.0en for supplier 6FCQZ. + +7)Registered-To: Andrea Bernardi +Email: bernardi.andrea@gmail.com +Postal: Via N.Tommaseo, 3, Scaltenigo di Mirano Venezia 30035, Italy +Total Amount Paid: EUR 18 +Date: 2006-04-27 +Processed: 2006-04-27 +PaymentMethod: card +Invoice: I517147269 +TransactionID: CHCNNS316S18 +Note: SSL from 87.5.240.235 via KOOP 5.6.0it for supplier 6FCQZ. + +6)Registered-To: Bruno Gonçalves de Albuquerque +Email: bga@bug-br.org.br +Postal: R. Voluntarios da Patria, 41/603A - Botafogo, Rio de Janeiro RJ 22270-000, Brazil +Total Amount Paid: EUR 15 +Date: 2006-04-25 +Processed: 2006-04-25 +PaymentMethod: card +Invoice: I517015790 +TransactionID: CHCJUPFUHNFK +Comment: Thansk for this great program. +Note: SSL from 200.165.235.197 via KOOP 5.6.0en for supplier 6FCQZ. + +5) Registered-To: Joseph Allen +Email: josallen@newsguy.com +Postal: 715 Hidden Creek Lane, North Aurora IL 60542, United States +Total Amount Paid: USD 17.68 +Date: 2006-04-23 +Processed: 2006-04-23 +PaymentMethod: card +Invoice: 1081312031 +TransactionID: CHCG0X8ACH8E +Note: SSL from 67.184.27.203 via KOOP 5.5.2en for supplier 6FCQZ. + + +4) Registered-To: Gregory North +Email: gregnorth@sbcglobal.net +Postal: 11355 Richmond Ave #1507, Houston TX 77082, United States +Total Amount Paid: USD 17.68 +Date: 2006-04-23 +Processed: 2006-04-23 +PaymentMethod: card +Invoice: I516810978 +TransactionID: CHC8ZE2V8F5S +Note: SSL from 67.65.166.129 via KOOP 5.5.2en for supplier 6FCQZ. + +3) Registered-To: Toshihiro Kodera +Email: mizki@gem.bekkoame.ne.jp +Postal: 3701-6 fukami, yamato kanagawa 242-0011, Japan +Total Amount Paid: EUR 15 +Date: 2006-04-23 +Processed: 2006-04-23 +PaymentMethod: card +Invoice: I516805500 +TransactionID: CHCKWPRXU4T1 +Note: SSL from 210.79.164.82 via KOOP 5.5.2ja for supplier 6FCQZ. + +2) Registered-To: Koichi Kimura +Email: bem@jcom.home.ne.jp +Postal: Igusa 1-15-4, Suginami-ku Tokyo 167-0021, Japan +Total Amount Paid: JPY 2168 +Date: 2006-04-11 +Processed: 2006-04-11 +PaymentMethod: card +Invoice: I515798726 +TransactionID: CHCX17JHTQ12 +Note: SSL from 203.165.232.114 via KOOP 5.5.1ja for supplier 6FCQZ. + +1) Registered-To: Sebastian Bernstein +Email: sebe@blue-cable.de +Postal: Moltkestr. 19, Plauen Sachsen 08523, Germany +Total Amount Paid: EUR 17.4 +Date: 2006-04-11 +Processed: 2006-04-11 +PaymentMethod: card +Invoice: I515787525 +TransactionID: CHCSM2XQPRDD +Note: SSL from 62.117.2.174 via KOOP 5.5.1en for supplier 6FCQZ. + + + diff --git a/documents/email_betatester.txt b/documents/email_betatester.txt new file mode 100644 index 0000000..4d11464 --- /dev/null +++ b/documents/email_betatester.txt @@ -0,0 +1,49 @@ +subject: BePodder testing + +body: + +Hi, +The BePodder Team is looking for beta testers for its new application: BePodder. +You can find information about this incoming application for Zeta here: +http://www.iltuosistema.it/news_sing.php?id=282 + +If you are not interested in this kind of activity please DON'T reply to this email. Discard it and sorry for boring you. + +The software is developed and compiled under Zeta 1.1 (build 13538) +We can't garantee that it will works on different (newer or older) O.S. versions. +(Please notify us if you are going to test our application with a different OS version) + +What we expect from you collaboration: +- Your ideas and suggestion for new features and for getting better the one already implemented. +- Your help in adding support for your language. +- Your help for finding the best podcast and videocast in your language. +- Your reports for bug or strange behaviours of the application. + +Before we can send you the first beta you must have a look at the following EULA (end user license agreement). +Please read it carefully (it takes 20 seconds) and replay to this email by confirming that you read the license and you agree with it. + + +Beta Test / End User License Agreement (EULA) + + PLEASE READ CAREFULLY: This EULA is a legal Agreement between BePodder Team (BPT) and you (either an individual or a single entity). This Agreement covers all software, data, documentation, written materials, files and information ("Software") which it accompanies. This Agreement takes precedence over any other agreement embedded within the software. + + Confidentiality: The enclosed Software is Confidential Information. You will not disclose Software or any comments regarding Software to any third party without the prior written approval of BPT. You will maintain the confidentiality of Softwae with at least the same degree of care that you use to protect your own confidential and proprietary information, but not less than a reasonable degree of care under the circumstances. You will not be liable for the disclosure of any Confidential Information which is: (a) in the public domain other than by a breach of this Agreement on your part; or (b) rightfully received from a third party without any obligation of confidentiality; or (c) rightfully known to you without any limitation on use or disclosure prior to its receipt from BPT; or (d) independently developed by your employees; or (e) generally made available to third parties by BPT without restriction on disclosure. + + License: BPT grants you the right to copy the software onto a single computer for your internal use. You will not use, copy, modify, sell or transfer any part of the Software except as provided in this Agreement. + + Restrictions: Except as specifically permitted in writing, you may not: (a) Copy the Software except as provided in this Agreement or elsewhere by BPT. (b) Sublicense or permit simultaneous use of the Software by more than one user. (c) Reverse engineer, decompile, or disassemble the Software. (d) rent, lease, or lend the Software. You may NOT transfer the Software under any circumstances. + + Ownership And Copyright Of Software: Title to the Software and all copies thereof remain with BPT or its suppliers. You agree to prevent any unauthorized copying of the Software. Except as expressly provided herein, BPT does not grant any express or implied right to you under BPT patents, copyrights, trademarks, or trade secret information. + + Term Of This Agreement: If not terminated sooner by BPT, this license to use Software expires one year after the date of delivery of Software from BPT to you, after which you shall either return all Software to BPT or shall certify that the Software has been destroyed, with no copies of any kind remaining. BPT may terminate this license at any time without any liability. + + No Obligation Created: Provision of any Software under this Agreement is experimental and shall not create any obligation for BPT to continue to develop, productize, support, repair, offer for sale or in any other way continue to provide or develop Software either to you or to any other party. + + THE SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY EXPRESS OR IMPLIED WARRANTY OF ANY KIND INCLUDING WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE. IN NO EVENT SHALL BPT OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, BUSINESS INTERRUPTION, LOSS OF INFORMATION) ARISING OUT OF THE USE OF OR INABILITY TO USE THE SOFTWARE, EVEN IF BPT HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + + SOFTWARE IS BELIEVED TO CONTAIN DEFECTS AND ONE PURPOSE OF THIS BETA TEST LICENSE IS TO IDENTIFY DEFECTS. YOU ARE ADVISED TO SAFEGUARD IMPORTANT DATA, TO USE CAUTION AND TO NOT RELY IN ANY WAY ON THE CORRECT FUNCTIONING OR PERFORMANCE OF SOFTWARE. + +------------- + +Best Regards, +BePodder Team. diff --git a/documents/email_user.txt b/documents/email_user.txt new file mode 100644 index 0000000..5ea7b1c --- /dev/null +++ b/documents/email_user.txt @@ -0,0 +1,16 @@ +Dear BeOS/Zeta user, + +Here is your purchased licence-keyfile for BePodder 1.0. +We would like to thank you for supporting us and we hope you will enjoy our product. + +For support and updates please visit our website (http://www.funkyideasoft.com) or write us and email (bepodder.team@gmail.com) + +Please unzip the attached file and read the file README.txt in order to install your keyfile. + +NOTE: If this email doesn't contains an attachment or if it's corruped please contact us! + +Best Regards, +BePodder Team + +Funky Idea Soft +http://www.funkyideasoft.com \ No newline at end of file diff --git a/documents/feeds_per_prove_su_formati_particolari.txt b/documents/feeds_per_prove_su_formati_particolari.txt new file mode 100644 index 0000000..9e75899 --- /dev/null +++ b/documents/feeds_per_prove_su_formati_particolari.txt @@ -0,0 +1,7 @@ + +Formato feed +------------------------------------------------------------- + +.3gp http://spreeblick.com/category/toni-mahoni/feed/rss2 + +.swf http://dok.info/rss/podcast.php?feed=videocast \ No newline at end of file diff --git a/documents/license.txt b/documents/license.txt new file mode 100644 index 0000000..b45ecf3 --- /dev/null +++ b/documents/license.txt @@ -0,0 +1,20 @@ +BePodder for BeOS/ZETA +End-user License Agreement + +NO WARRANTY + +BEPODDER IS DISTRIBUTED "AS IS" AND WITHOUT ANY WARRANTY AS TO MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR ANY OTHER WARRANTIES EITHER EXPRESSED OR IMPLIED. THE AUTHOR WILL NOT BE LIABLE FOR DATA LOSS, DAMAGES, LOSS OF PROFITS OR ANY OTHER KIND OF LOSS WHILE USING OR MISUSING THIS SOFTWARE. + +Any attempts at reverse-engineering or thwarting the license protection scheme of this software is prohibited. Any evidence of tampering will be investigated and may lead to prosecution according to all applicable laws. + + +Distribution of the Demo version + +You may copy the Demo version of this software and documentation as you wish, and give exact copies of the original Demo version to anyone, and distribute the Demo version of the software and documentation in its unmodified form via electronic means. But you should not charge or request donations for any such copies however made, or from distributing the software and/or documentation with other products without the author's written permission. + +Registered Edition + +One registered copy of BePodder may either be used by a single person who uses the software personally on one or more computers. + +You should have received a license key which is necessary to enable the registered edition of the software. This code must be kept in the strictest confidence and must not be given or revealed to anyone but the registered owner. Failure to abide by these provisions may result in severe legal penalties and will result in revocation of the license which will cause the program to no longer work. + diff --git a/documents/link_a_directory_internazionali_di_podcast_e_RSS_feed.txt b/documents/link_a_directory_internazionali_di_podcast_e_RSS_feed.txt new file mode 100644 index 0000000..48815b0 --- /dev/null +++ b/documents/link_a_directory_internazionali_di_podcast_e_RSS_feed.txt @@ -0,0 +1,25 @@ +Link a directory internazionali di podcast e RSS feed +############################# + +Argentina---------------------------------------------- +http://www.podcast.com.ar/ + +Australia----------------------------------------------- +http://www.digitalpodcast.com/browse-australia-8-1.html +http://www.podcastingnews.com/forum/links.php?id=27&sid=6901b11f54b75a5ce93df08ffff28cad + +Danimarca-------------------------------------------- +http://www.overskrift.dk/ +http://www.overskrift.dk/feedsearchresult.php?q=podcast +http://www.podcastdirectory.com/search/keyword.php?page=1&search=Denmark +http://www.podcastingnews.com/forum/links.php?id=301&sid=c4d2a069267a5609d039c0fac51c137b +http://www.podcastingnews.com/forum/links.php?id=300&sid=1717a8e0b8c65056f640549f8343dfcf +http://rss.spontek.dk/ (Newsfeed) +http://www.djh.dk/ejour/arkiv/RSS.html (Danmark, Finland, Island, Norge, Sverige ecc.) +http://www.syndic8.com/feedlist.php?ShowGeoIPLocation=dk%3BDenmark + +Ungheria----------------------------------------------- +http://podcasting.lap.hu/ + +Russia-------------------------------------------------- +http://podstars.ru/ \ No newline at end of file diff --git a/documents/lista_siti_di_news.txt b/documents/lista_siti_di_news.txt new file mode 100644 index 0000000..97dbe8e --- /dev/null +++ b/documents/lista_siti_di_news.txt @@ -0,0 +1,26 @@ + +NOME LINK CONTACT +------------------------------------------------------------------------------------------------------------------------------------------- + +IsComputerOn http://www.iscomputeron.com/ daat@iscomputeron.com + frankps@gmail.com + +BeOSNews http://www.beosnews.com/ stephenb@beosnews.com + +Haiku Podcast http://haikupodcast.com/ sikosis@haikupodcast.com + +Haiku News http://haikunews.org/ kianduffy@iol.ie + +lebuzz's Xanga Site http://www.xanga.com/home.aspx?user=lebuzz dane@tunetrackersystems.com + + Haiku OS Il Nuovo... http://latere.blogspot.com/ agenio@gmail.com + +BeGroovy http://www.begroovy.com/ news@begroovy.com. + +ItBug http://www.itbug.org/ andrea@itbug.org + +BeBug http://www.bebug.be/index.php Begasus@skynet.be + +JPBE http://www.jpbe.net/ webmaster@jpbe.net + + \ No newline at end of file diff --git a/gfx/100/add-channel-button.png b/gfx/100/add-channel-button.png new file mode 100644 index 0000000..4ecda99 Binary files /dev/null and b/gfx/100/add-channel-button.png differ diff --git a/gfx/100/add-channel-file.png b/gfx/100/add-channel-file.png new file mode 100644 index 0000000..ebc14d0 Binary files /dev/null and b/gfx/100/add-channel-file.png differ diff --git a/gfx/100/add-item-button.png b/gfx/100/add-item-button.png new file mode 100644 index 0000000..2927cae Binary files /dev/null and b/gfx/100/add-item-button.png differ diff --git a/gfx/100/add-item-file.png b/gfx/100/add-item-file.png new file mode 100644 index 0000000..58b1139 Binary files /dev/null and b/gfx/100/add-item-file.png differ diff --git a/gfx/100/bepodder-logo1.png b/gfx/100/bepodder-logo1.png new file mode 100644 index 0000000..a16cb83 Binary files /dev/null and b/gfx/100/bepodder-logo1.png differ diff --git a/gfx/100/bepodder-logo2.png b/gfx/100/bepodder-logo2.png new file mode 100644 index 0000000..bb53498 Binary files /dev/null and b/gfx/100/bepodder-logo2.png differ diff --git a/gfx/100/channel-button.png b/gfx/100/channel-button.png new file mode 100644 index 0000000..64468cb Binary files /dev/null and b/gfx/100/channel-button.png differ diff --git a/gfx/100/channel-file.png b/gfx/100/channel-file.png new file mode 100644 index 0000000..a16d15f Binary files /dev/null and b/gfx/100/channel-file.png differ diff --git a/gfx/100/delete-channel-button.png b/gfx/100/delete-channel-button.png new file mode 100644 index 0000000..2b1f063 Binary files /dev/null and b/gfx/100/delete-channel-button.png differ diff --git a/gfx/100/delete-channel-file.png b/gfx/100/delete-channel-file.png new file mode 100644 index 0000000..602f4aa Binary files /dev/null and b/gfx/100/delete-channel-file.png differ diff --git a/gfx/100/delete-item-button.png b/gfx/100/delete-item-button.png new file mode 100644 index 0000000..96de244 Binary files /dev/null and b/gfx/100/delete-item-button.png differ diff --git a/gfx/100/delete-item-file.png b/gfx/100/delete-item-file.png new file mode 100644 index 0000000..305beec Binary files /dev/null and b/gfx/100/delete-item-file.png differ diff --git a/gfx/100/done-channel-button.png b/gfx/100/done-channel-button.png new file mode 100644 index 0000000..f1960d2 Binary files /dev/null and b/gfx/100/done-channel-button.png differ diff --git a/gfx/100/done-channel-file.png b/gfx/100/done-channel-file.png new file mode 100644 index 0000000..5e52db1 Binary files /dev/null and b/gfx/100/done-channel-file.png differ diff --git a/gfx/100/done-item-button.png b/gfx/100/done-item-button.png new file mode 100644 index 0000000..11bfccb Binary files /dev/null and b/gfx/100/done-item-button.png differ diff --git a/gfx/100/done-item-file.png b/gfx/100/done-item-file.png new file mode 100644 index 0000000..e91ec58 Binary files /dev/null and b/gfx/100/done-item-file.png differ diff --git a/gfx/100/download-channel-button.png b/gfx/100/download-channel-button.png new file mode 100644 index 0000000..18afc7a Binary files /dev/null and b/gfx/100/download-channel-button.png differ diff --git a/gfx/100/download-channel-file.png b/gfx/100/download-channel-file.png new file mode 100644 index 0000000..eaf98dc Binary files /dev/null and b/gfx/100/download-channel-file.png differ diff --git a/gfx/100/download-item-button.png b/gfx/100/download-item-button.png new file mode 100644 index 0000000..749b548 Binary files /dev/null and b/gfx/100/download-item-button.png differ diff --git a/gfx/100/download-item-file.png b/gfx/100/download-item-file.png new file mode 100644 index 0000000..cb8c3de Binary files /dev/null and b/gfx/100/download-item-file.png differ diff --git a/gfx/100/emblem-add.png b/gfx/100/emblem-add.png new file mode 100644 index 0000000..461d1f6 Binary files /dev/null and b/gfx/100/emblem-add.png differ diff --git a/gfx/100/emblem-delete.png b/gfx/100/emblem-delete.png new file mode 100644 index 0000000..0581d7c Binary files /dev/null and b/gfx/100/emblem-delete.png differ diff --git a/gfx/100/emblem-done.png b/gfx/100/emblem-done.png new file mode 100644 index 0000000..20def51 Binary files /dev/null and b/gfx/100/emblem-done.png differ diff --git a/gfx/100/emblem-download.png b/gfx/100/emblem-download.png new file mode 100644 index 0000000..9d1c25a Binary files /dev/null and b/gfx/100/emblem-download.png differ diff --git a/gfx/100/emblem-enqueued.png b/gfx/100/emblem-enqueued.png new file mode 100644 index 0000000..774b3e3 Binary files /dev/null and b/gfx/100/emblem-enqueued.png differ diff --git a/gfx/100/emblem-error.png b/gfx/100/emblem-error.png new file mode 100644 index 0000000..30e1758 Binary files /dev/null and b/gfx/100/emblem-error.png differ diff --git a/gfx/100/emblem-kill.png b/gfx/100/emblem-kill.png new file mode 100644 index 0000000..d0ec8c3 Binary files /dev/null and b/gfx/100/emblem-kill.png differ diff --git a/gfx/100/emblem-play.png b/gfx/100/emblem-play.png new file mode 100644 index 0000000..f320946 Binary files /dev/null and b/gfx/100/emblem-play.png differ diff --git a/gfx/100/emblem-refresh.png b/gfx/100/emblem-refresh.png new file mode 100644 index 0000000..3539acb Binary files /dev/null and b/gfx/100/emblem-refresh.png differ diff --git a/gfx/100/emblem-remove.png b/gfx/100/emblem-remove.png new file mode 100644 index 0000000..d2e9219 Binary files /dev/null and b/gfx/100/emblem-remove.png differ diff --git a/gfx/100/emblem-stop.png b/gfx/100/emblem-stop.png new file mode 100644 index 0000000..cef341b Binary files /dev/null and b/gfx/100/emblem-stop.png differ diff --git a/gfx/100/emblem-www.png b/gfx/100/emblem-www.png new file mode 100644 index 0000000..4bd4176 Binary files /dev/null and b/gfx/100/emblem-www.png differ diff --git a/gfx/100/enqueued-channel-button.png b/gfx/100/enqueued-channel-button.png new file mode 100644 index 0000000..9ab5f04 Binary files /dev/null and b/gfx/100/enqueued-channel-button.png differ diff --git a/gfx/100/enqueued-channel-file.png b/gfx/100/enqueued-channel-file.png new file mode 100644 index 0000000..1fba39d Binary files /dev/null and b/gfx/100/enqueued-channel-file.png differ diff --git a/gfx/100/enqueued-item-button.png b/gfx/100/enqueued-item-button.png new file mode 100644 index 0000000..0e003e6 Binary files /dev/null and b/gfx/100/enqueued-item-button.png differ diff --git a/gfx/100/enqueued-item-file.png b/gfx/100/enqueued-item-file.png new file mode 100644 index 0000000..6a46e1f Binary files /dev/null and b/gfx/100/enqueued-item-file.png differ diff --git a/gfx/100/error-channel-button.png b/gfx/100/error-channel-button.png new file mode 100644 index 0000000..bcbd011 Binary files /dev/null and b/gfx/100/error-channel-button.png differ diff --git a/gfx/100/error-channel-file.png b/gfx/100/error-channel-file.png new file mode 100644 index 0000000..e2a3120 Binary files /dev/null and b/gfx/100/error-channel-file.png differ diff --git a/gfx/100/error-item-button.png b/gfx/100/error-item-button.png new file mode 100644 index 0000000..093455d Binary files /dev/null and b/gfx/100/error-item-button.png differ diff --git a/gfx/100/error-item-file.png b/gfx/100/error-item-file.png new file mode 100644 index 0000000..a4b098d Binary files /dev/null and b/gfx/100/error-item-file.png differ diff --git a/gfx/100/index.html b/gfx/100/index.html new file mode 100644 index 0000000..8dee7b2 --- /dev/null +++ b/gfx/100/index.html @@ -0,0 +1,89 @@ + + +Index of /mushaspot/50/ + + +
+
+

Index of /mushaspot/50/

+
+
+

Thumbnails

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + +
+
+ + diff --git a/gfx/100/item-button.png b/gfx/100/item-button.png new file mode 100644 index 0000000..f1610af Binary files /dev/null and b/gfx/100/item-button.png differ diff --git a/gfx/100/item-file.png b/gfx/100/item-file.png new file mode 100644 index 0000000..6e4c30c Binary files /dev/null and b/gfx/100/item-file.png differ diff --git a/gfx/100/kill-channel-button.png b/gfx/100/kill-channel-button.png new file mode 100644 index 0000000..c6be1bf Binary files /dev/null and b/gfx/100/kill-channel-button.png differ diff --git a/gfx/100/kill-channel-file.png b/gfx/100/kill-channel-file.png new file mode 100644 index 0000000..f84a450 Binary files /dev/null and b/gfx/100/kill-channel-file.png differ diff --git a/gfx/100/kill-item-button.png b/gfx/100/kill-item-button.png new file mode 100644 index 0000000..32e6436 Binary files /dev/null and b/gfx/100/kill-item-button.png differ diff --git a/gfx/100/kill-item-file.png b/gfx/100/kill-item-file.png new file mode 100644 index 0000000..5113e25 Binary files /dev/null and b/gfx/100/kill-item-file.png differ diff --git a/gfx/100/play-channel-button.png b/gfx/100/play-channel-button.png new file mode 100644 index 0000000..097714b Binary files /dev/null and b/gfx/100/play-channel-button.png differ diff --git a/gfx/100/play-channel-file.png b/gfx/100/play-channel-file.png new file mode 100644 index 0000000..e82529c Binary files /dev/null and b/gfx/100/play-channel-file.png differ diff --git a/gfx/100/play-item-button.png b/gfx/100/play-item-button.png new file mode 100644 index 0000000..88775cd Binary files /dev/null and b/gfx/100/play-item-button.png differ diff --git a/gfx/100/play-item-file.png b/gfx/100/play-item-file.png new file mode 100644 index 0000000..0b45a30 Binary files /dev/null and b/gfx/100/play-item-file.png differ diff --git a/gfx/100/refresh-channel-button.png b/gfx/100/refresh-channel-button.png new file mode 100644 index 0000000..b208002 Binary files /dev/null and b/gfx/100/refresh-channel-button.png differ diff --git a/gfx/100/refresh-channel-file.png b/gfx/100/refresh-channel-file.png new file mode 100644 index 0000000..45ed6ef Binary files /dev/null and b/gfx/100/refresh-channel-file.png differ diff --git a/gfx/100/refresh-item-button.png b/gfx/100/refresh-item-button.png new file mode 100644 index 0000000..8896587 Binary files /dev/null and b/gfx/100/refresh-item-button.png differ diff --git a/gfx/100/refresh-item-file.png b/gfx/100/refresh-item-file.png new file mode 100644 index 0000000..b4a0400 Binary files /dev/null and b/gfx/100/refresh-item-file.png differ diff --git a/gfx/100/remove-channel-button.png b/gfx/100/remove-channel-button.png new file mode 100644 index 0000000..fee4573 Binary files /dev/null and b/gfx/100/remove-channel-button.png differ diff --git a/gfx/100/remove-channel-file.png b/gfx/100/remove-channel-file.png new file mode 100644 index 0000000..652ea85 Binary files /dev/null and b/gfx/100/remove-channel-file.png differ diff --git a/gfx/100/remove-item-button.png b/gfx/100/remove-item-button.png new file mode 100644 index 0000000..f51b7ab Binary files /dev/null and b/gfx/100/remove-item-button.png differ diff --git a/gfx/100/remove-item-file.png b/gfx/100/remove-item-file.png new file mode 100644 index 0000000..1c013ef Binary files /dev/null and b/gfx/100/remove-item-file.png differ diff --git a/gfx/100/stop-channel-button.png b/gfx/100/stop-channel-button.png new file mode 100644 index 0000000..559c758 Binary files /dev/null and b/gfx/100/stop-channel-button.png differ diff --git a/gfx/100/stop-channel-file.png b/gfx/100/stop-channel-file.png new file mode 100644 index 0000000..fcc47cd Binary files /dev/null and b/gfx/100/stop-channel-file.png differ diff --git a/gfx/100/stop-item-button.png b/gfx/100/stop-item-button.png new file mode 100644 index 0000000..12d10de Binary files /dev/null and b/gfx/100/stop-item-button.png differ diff --git a/gfx/100/stop-item-file.png b/gfx/100/stop-item-file.png new file mode 100644 index 0000000..c3bc0dc Binary files /dev/null and b/gfx/100/stop-item-file.png differ diff --git a/gfx/100/www-channel-button.png b/gfx/100/www-channel-button.png new file mode 100644 index 0000000..c2b95ca Binary files /dev/null and b/gfx/100/www-channel-button.png differ diff --git a/gfx/100/www-channel-file.png b/gfx/100/www-channel-file.png new file mode 100644 index 0000000..c3f2f89 Binary files /dev/null and b/gfx/100/www-channel-file.png differ diff --git a/gfx/100/www-item-button.png b/gfx/100/www-item-button.png new file mode 100644 index 0000000..eb71ed6 Binary files /dev/null and b/gfx/100/www-item-button.png differ diff --git a/gfx/100/www-item-file.png b/gfx/100/www-item-file.png new file mode 100644 index 0000000..6985fdf Binary files /dev/null and b/gfx/100/www-item-file.png differ diff --git a/gfx/50/Thumbs.db b/gfx/50/Thumbs.db new file mode 100644 index 0000000..b6c6b72 Binary files /dev/null and b/gfx/50/Thumbs.db differ diff --git a/gfx/50/add-channel-button.png b/gfx/50/add-channel-button.png new file mode 100644 index 0000000..3c1acdc Binary files /dev/null and b/gfx/50/add-channel-button.png differ diff --git a/gfx/50/add-channel-file.png b/gfx/50/add-channel-file.png new file mode 100644 index 0000000..2ee36e0 Binary files /dev/null and b/gfx/50/add-channel-file.png differ diff --git a/gfx/50/add-item-button.png b/gfx/50/add-item-button.png new file mode 100644 index 0000000..ad04ac5 Binary files /dev/null and b/gfx/50/add-item-button.png differ diff --git a/gfx/50/add-item-file.png b/gfx/50/add-item-file.png new file mode 100644 index 0000000..33a78db Binary files /dev/null and b/gfx/50/add-item-file.png differ diff --git a/gfx/50/bepodder-logo1.png b/gfx/50/bepodder-logo1.png new file mode 100644 index 0000000..42fa999 Binary files /dev/null and b/gfx/50/bepodder-logo1.png differ diff --git a/gfx/50/bepodder-logo2.png b/gfx/50/bepodder-logo2.png new file mode 100644 index 0000000..1e31746 Binary files /dev/null and b/gfx/50/bepodder-logo2.png differ diff --git a/gfx/50/channel-button.png b/gfx/50/channel-button.png new file mode 100644 index 0000000..ce44213 Binary files /dev/null and b/gfx/50/channel-button.png differ diff --git a/gfx/50/channel-file.png b/gfx/50/channel-file.png new file mode 100644 index 0000000..83ad18a Binary files /dev/null and b/gfx/50/channel-file.png differ diff --git a/gfx/50/delete-channel-button.png b/gfx/50/delete-channel-button.png new file mode 100644 index 0000000..49666d9 Binary files /dev/null and b/gfx/50/delete-channel-button.png differ diff --git a/gfx/50/delete-channel-file.png b/gfx/50/delete-channel-file.png new file mode 100644 index 0000000..cc31138 Binary files /dev/null and b/gfx/50/delete-channel-file.png differ diff --git a/gfx/50/delete-item-button.png b/gfx/50/delete-item-button.png new file mode 100644 index 0000000..3e6581a Binary files /dev/null and b/gfx/50/delete-item-button.png differ diff --git a/gfx/50/delete-item-file.png b/gfx/50/delete-item-file.png new file mode 100644 index 0000000..1f24847 Binary files /dev/null and b/gfx/50/delete-item-file.png differ diff --git a/gfx/50/done-channel-button.png b/gfx/50/done-channel-button.png new file mode 100644 index 0000000..45add87 Binary files /dev/null and b/gfx/50/done-channel-button.png differ diff --git a/gfx/50/done-channel-file.png b/gfx/50/done-channel-file.png new file mode 100644 index 0000000..a1336e9 Binary files /dev/null and b/gfx/50/done-channel-file.png differ diff --git a/gfx/50/done-item-button.png b/gfx/50/done-item-button.png new file mode 100644 index 0000000..cf1cf32 Binary files /dev/null and b/gfx/50/done-item-button.png differ diff --git a/gfx/50/done-item-file.png b/gfx/50/done-item-file.png new file mode 100644 index 0000000..9e4b1c5 Binary files /dev/null and b/gfx/50/done-item-file.png differ diff --git a/gfx/50/download-channel-button.png b/gfx/50/download-channel-button.png new file mode 100644 index 0000000..37fedbe Binary files /dev/null and b/gfx/50/download-channel-button.png differ diff --git a/gfx/50/download-channel-file.png b/gfx/50/download-channel-file.png new file mode 100644 index 0000000..fb12b1e Binary files /dev/null and b/gfx/50/download-channel-file.png differ diff --git a/gfx/50/download-item-button.png b/gfx/50/download-item-button.png new file mode 100644 index 0000000..7061546 Binary files /dev/null and b/gfx/50/download-item-button.png differ diff --git a/gfx/50/download-item-file.png b/gfx/50/download-item-file.png new file mode 100644 index 0000000..7b9befd Binary files /dev/null and b/gfx/50/download-item-file.png differ diff --git a/gfx/50/emblem-add.png b/gfx/50/emblem-add.png new file mode 100644 index 0000000..8ff014b Binary files /dev/null and b/gfx/50/emblem-add.png differ diff --git a/gfx/50/emblem-delete.png b/gfx/50/emblem-delete.png new file mode 100644 index 0000000..3953ec7 Binary files /dev/null and b/gfx/50/emblem-delete.png differ diff --git a/gfx/50/emblem-done.png b/gfx/50/emblem-done.png new file mode 100644 index 0000000..7027b0a Binary files /dev/null and b/gfx/50/emblem-done.png differ diff --git a/gfx/50/emblem-download.png b/gfx/50/emblem-download.png new file mode 100644 index 0000000..8cbb101 Binary files /dev/null and b/gfx/50/emblem-download.png differ diff --git a/gfx/50/emblem-enqueued.png b/gfx/50/emblem-enqueued.png new file mode 100644 index 0000000..550145a Binary files /dev/null and b/gfx/50/emblem-enqueued.png differ diff --git a/gfx/50/emblem-error.png b/gfx/50/emblem-error.png new file mode 100644 index 0000000..aeff7b4 Binary files /dev/null and b/gfx/50/emblem-error.png differ diff --git a/gfx/50/emblem-kill.png b/gfx/50/emblem-kill.png new file mode 100644 index 0000000..4892b9d Binary files /dev/null and b/gfx/50/emblem-kill.png differ diff --git a/gfx/50/emblem-play.png b/gfx/50/emblem-play.png new file mode 100644 index 0000000..74eab80 Binary files /dev/null and b/gfx/50/emblem-play.png differ diff --git a/gfx/50/emblem-refresh.png b/gfx/50/emblem-refresh.png new file mode 100644 index 0000000..65fe35f Binary files /dev/null and b/gfx/50/emblem-refresh.png differ diff --git a/gfx/50/emblem-remove.png b/gfx/50/emblem-remove.png new file mode 100644 index 0000000..83b165c Binary files /dev/null and b/gfx/50/emblem-remove.png differ diff --git a/gfx/50/emblem-stop.png b/gfx/50/emblem-stop.png new file mode 100644 index 0000000..5aaf28e Binary files /dev/null and b/gfx/50/emblem-stop.png differ diff --git a/gfx/50/emblem-www.png b/gfx/50/emblem-www.png new file mode 100644 index 0000000..d49b76e Binary files /dev/null and b/gfx/50/emblem-www.png differ diff --git a/gfx/50/enqueued-channel-button.png b/gfx/50/enqueued-channel-button.png new file mode 100644 index 0000000..8ad51af Binary files /dev/null and b/gfx/50/enqueued-channel-button.png differ diff --git a/gfx/50/enqueued-channel-file.png b/gfx/50/enqueued-channel-file.png new file mode 100644 index 0000000..7ec5730 Binary files /dev/null and b/gfx/50/enqueued-channel-file.png differ diff --git a/gfx/50/enqueued-item-button.png b/gfx/50/enqueued-item-button.png new file mode 100644 index 0000000..2ee45f8 Binary files /dev/null and b/gfx/50/enqueued-item-button.png differ diff --git a/gfx/50/enqueued-item-file.png b/gfx/50/enqueued-item-file.png new file mode 100644 index 0000000..c5ae841 Binary files /dev/null and b/gfx/50/enqueued-item-file.png differ diff --git a/gfx/50/error-channel-button.png b/gfx/50/error-channel-button.png new file mode 100644 index 0000000..576888f Binary files /dev/null and b/gfx/50/error-channel-button.png differ diff --git a/gfx/50/error-channel-file.png b/gfx/50/error-channel-file.png new file mode 100644 index 0000000..a6f3c47 Binary files /dev/null and b/gfx/50/error-channel-file.png differ diff --git a/gfx/50/error-item-button.png b/gfx/50/error-item-button.png new file mode 100644 index 0000000..2082a48 Binary files /dev/null and b/gfx/50/error-item-button.png differ diff --git a/gfx/50/error-item-file.png b/gfx/50/error-item-file.png new file mode 100644 index 0000000..51de387 Binary files /dev/null and b/gfx/50/error-item-file.png differ diff --git a/gfx/50/index.html b/gfx/50/index.html new file mode 100644 index 0000000..8dee7b2 --- /dev/null +++ b/gfx/50/index.html @@ -0,0 +1,89 @@ + + +Index of /mushaspot/50/ + + +
+
+

Index of /mushaspot/50/

+
+
+

Thumbnails

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + +
+
+ + diff --git a/gfx/50/item-button.png b/gfx/50/item-button.png new file mode 100644 index 0000000..ebeece6 Binary files /dev/null and b/gfx/50/item-button.png differ diff --git a/gfx/50/item-file.png b/gfx/50/item-file.png new file mode 100644 index 0000000..f2ff67d Binary files /dev/null and b/gfx/50/item-file.png differ diff --git a/gfx/50/kill-channel-button.png b/gfx/50/kill-channel-button.png new file mode 100644 index 0000000..2960c51 Binary files /dev/null and b/gfx/50/kill-channel-button.png differ diff --git a/gfx/50/kill-channel-file.png b/gfx/50/kill-channel-file.png new file mode 100644 index 0000000..a134be8 Binary files /dev/null and b/gfx/50/kill-channel-file.png differ diff --git a/gfx/50/kill-item-button.png b/gfx/50/kill-item-button.png new file mode 100644 index 0000000..5ed8cb7 Binary files /dev/null and b/gfx/50/kill-item-button.png differ diff --git a/gfx/50/kill-item-file.png b/gfx/50/kill-item-file.png new file mode 100644 index 0000000..37d5fb2 Binary files /dev/null and b/gfx/50/kill-item-file.png differ diff --git a/gfx/50/play-channel-button.png b/gfx/50/play-channel-button.png new file mode 100644 index 0000000..dbdc84d Binary files /dev/null and b/gfx/50/play-channel-button.png differ diff --git a/gfx/50/play-channel-file.png b/gfx/50/play-channel-file.png new file mode 100644 index 0000000..12d0331 Binary files /dev/null and b/gfx/50/play-channel-file.png differ diff --git a/gfx/50/play-item-button.png b/gfx/50/play-item-button.png new file mode 100644 index 0000000..78b8a54 Binary files /dev/null and b/gfx/50/play-item-button.png differ diff --git a/gfx/50/play-item-file.png b/gfx/50/play-item-file.png new file mode 100644 index 0000000..3be6193 Binary files /dev/null and b/gfx/50/play-item-file.png differ diff --git a/gfx/50/refresh-channel-button.png b/gfx/50/refresh-channel-button.png new file mode 100644 index 0000000..65d1b1b Binary files /dev/null and b/gfx/50/refresh-channel-button.png differ diff --git a/gfx/50/refresh-channel-file.png b/gfx/50/refresh-channel-file.png new file mode 100644 index 0000000..24772e5 Binary files /dev/null and b/gfx/50/refresh-channel-file.png differ diff --git a/gfx/50/refresh-item-button.png b/gfx/50/refresh-item-button.png new file mode 100644 index 0000000..a2ea0aa Binary files /dev/null and b/gfx/50/refresh-item-button.png differ diff --git a/gfx/50/refresh-item-file.png b/gfx/50/refresh-item-file.png new file mode 100644 index 0000000..88a24c8 Binary files /dev/null and b/gfx/50/refresh-item-file.png differ diff --git a/gfx/50/remove-channel-button.png b/gfx/50/remove-channel-button.png new file mode 100644 index 0000000..4d7b97b Binary files /dev/null and b/gfx/50/remove-channel-button.png differ diff --git a/gfx/50/remove-channel-file.png b/gfx/50/remove-channel-file.png new file mode 100644 index 0000000..f5a5bd8 Binary files /dev/null and b/gfx/50/remove-channel-file.png differ diff --git a/gfx/50/remove-item-button.png b/gfx/50/remove-item-button.png new file mode 100644 index 0000000..2bdb803 Binary files /dev/null and b/gfx/50/remove-item-button.png differ diff --git a/gfx/50/remove-item-file.png b/gfx/50/remove-item-file.png new file mode 100644 index 0000000..945bc3d Binary files /dev/null and b/gfx/50/remove-item-file.png differ diff --git a/gfx/50/stop-channel-button.png b/gfx/50/stop-channel-button.png new file mode 100644 index 0000000..4ecc87e Binary files /dev/null and b/gfx/50/stop-channel-button.png differ diff --git a/gfx/50/stop-channel-file.png b/gfx/50/stop-channel-file.png new file mode 100644 index 0000000..cf856a9 Binary files /dev/null and b/gfx/50/stop-channel-file.png differ diff --git a/gfx/50/stop-item-button.png b/gfx/50/stop-item-button.png new file mode 100644 index 0000000..868fee2 Binary files /dev/null and b/gfx/50/stop-item-button.png differ diff --git a/gfx/50/stop-item-file.png b/gfx/50/stop-item-file.png new file mode 100644 index 0000000..e1576c7 Binary files /dev/null and b/gfx/50/stop-item-file.png differ diff --git a/gfx/50/www-channel-button.png b/gfx/50/www-channel-button.png new file mode 100644 index 0000000..7a58a9d Binary files /dev/null and b/gfx/50/www-channel-button.png differ diff --git a/gfx/50/www-channel-file.png b/gfx/50/www-channel-file.png new file mode 100644 index 0000000..0516b6a Binary files /dev/null and b/gfx/50/www-channel-file.png differ diff --git a/gfx/50/www-item-button.png b/gfx/50/www-item-button.png new file mode 100644 index 0000000..f06917f Binary files /dev/null and b/gfx/50/www-item-button.png differ diff --git a/gfx/50/www-item-file.png b/gfx/50/www-item-file.png new file mode 100644 index 0000000..333fa90 Binary files /dev/null and b/gfx/50/www-item-file.png differ diff --git a/gfx/75/Thumbs.db b/gfx/75/Thumbs.db new file mode 100644 index 0000000..e40142e Binary files /dev/null and b/gfx/75/Thumbs.db differ diff --git a/gfx/75/add-channel-button.png b/gfx/75/add-channel-button.png new file mode 100644 index 0000000..18bcb7a Binary files /dev/null and b/gfx/75/add-channel-button.png differ diff --git a/gfx/75/add-channel-file.png b/gfx/75/add-channel-file.png new file mode 100644 index 0000000..e4b9bc5 Binary files /dev/null and b/gfx/75/add-channel-file.png differ diff --git a/gfx/75/add-item-button.png b/gfx/75/add-item-button.png new file mode 100644 index 0000000..2290c76 Binary files /dev/null and b/gfx/75/add-item-button.png differ diff --git a/gfx/75/add-item-file.png b/gfx/75/add-item-file.png new file mode 100644 index 0000000..2a5e388 Binary files /dev/null and b/gfx/75/add-item-file.png differ diff --git a/gfx/75/bepodder-logo1.png b/gfx/75/bepodder-logo1.png new file mode 100644 index 0000000..470a239 Binary files /dev/null and b/gfx/75/bepodder-logo1.png differ diff --git a/gfx/75/bepodder-logo2.png b/gfx/75/bepodder-logo2.png new file mode 100644 index 0000000..dddd13b Binary files /dev/null and b/gfx/75/bepodder-logo2.png differ diff --git a/gfx/75/channel-button.png b/gfx/75/channel-button.png new file mode 100644 index 0000000..c15b7fd Binary files /dev/null and b/gfx/75/channel-button.png differ diff --git a/gfx/75/channel-file.png b/gfx/75/channel-file.png new file mode 100644 index 0000000..d638c17 Binary files /dev/null and b/gfx/75/channel-file.png differ diff --git a/gfx/75/delete-channel-button.png b/gfx/75/delete-channel-button.png new file mode 100644 index 0000000..0aaeba8 Binary files /dev/null and b/gfx/75/delete-channel-button.png differ diff --git a/gfx/75/delete-channel-file.png b/gfx/75/delete-channel-file.png new file mode 100644 index 0000000..ed1f4ec Binary files /dev/null and b/gfx/75/delete-channel-file.png differ diff --git a/gfx/75/delete-item-button.png b/gfx/75/delete-item-button.png new file mode 100644 index 0000000..22dcb53 Binary files /dev/null and b/gfx/75/delete-item-button.png differ diff --git a/gfx/75/delete-item-file.png b/gfx/75/delete-item-file.png new file mode 100644 index 0000000..ffdc9f1 Binary files /dev/null and b/gfx/75/delete-item-file.png differ diff --git a/gfx/75/done-channel-button.png b/gfx/75/done-channel-button.png new file mode 100644 index 0000000..f9162ac Binary files /dev/null and b/gfx/75/done-channel-button.png differ diff --git a/gfx/75/done-channel-file.png b/gfx/75/done-channel-file.png new file mode 100644 index 0000000..03afad8 Binary files /dev/null and b/gfx/75/done-channel-file.png differ diff --git a/gfx/75/done-item-button.png b/gfx/75/done-item-button.png new file mode 100644 index 0000000..bc3d667 Binary files /dev/null and b/gfx/75/done-item-button.png differ diff --git a/gfx/75/done-item-file.png b/gfx/75/done-item-file.png new file mode 100644 index 0000000..12893a2 Binary files /dev/null and b/gfx/75/done-item-file.png differ diff --git a/gfx/75/download-channel-button.png b/gfx/75/download-channel-button.png new file mode 100644 index 0000000..7251673 Binary files /dev/null and b/gfx/75/download-channel-button.png differ diff --git a/gfx/75/download-channel-file.png b/gfx/75/download-channel-file.png new file mode 100644 index 0000000..ed934ff Binary files /dev/null and b/gfx/75/download-channel-file.png differ diff --git a/gfx/75/download-item-button.png b/gfx/75/download-item-button.png new file mode 100644 index 0000000..f4c1f16 Binary files /dev/null and b/gfx/75/download-item-button.png differ diff --git a/gfx/75/download-item-file.png b/gfx/75/download-item-file.png new file mode 100644 index 0000000..e698b5f Binary files /dev/null and b/gfx/75/download-item-file.png differ diff --git a/gfx/75/emblem-add.png b/gfx/75/emblem-add.png new file mode 100644 index 0000000..e17fabe Binary files /dev/null and b/gfx/75/emblem-add.png differ diff --git a/gfx/75/emblem-delete.png b/gfx/75/emblem-delete.png new file mode 100644 index 0000000..9f9506e Binary files /dev/null and b/gfx/75/emblem-delete.png differ diff --git a/gfx/75/emblem-done.png b/gfx/75/emblem-done.png new file mode 100644 index 0000000..d86c05a Binary files /dev/null and b/gfx/75/emblem-done.png differ diff --git a/gfx/75/emblem-download.png b/gfx/75/emblem-download.png new file mode 100644 index 0000000..6db19d5 Binary files /dev/null and b/gfx/75/emblem-download.png differ diff --git a/gfx/75/emblem-enqueued.png b/gfx/75/emblem-enqueued.png new file mode 100644 index 0000000..d1276be Binary files /dev/null and b/gfx/75/emblem-enqueued.png differ diff --git a/gfx/75/emblem-error.png b/gfx/75/emblem-error.png new file mode 100644 index 0000000..bba0e96 Binary files /dev/null and b/gfx/75/emblem-error.png differ diff --git a/gfx/75/emblem-kill.png b/gfx/75/emblem-kill.png new file mode 100644 index 0000000..fa310cc Binary files /dev/null and b/gfx/75/emblem-kill.png differ diff --git a/gfx/75/emblem-play.png b/gfx/75/emblem-play.png new file mode 100644 index 0000000..ff02970 Binary files /dev/null and b/gfx/75/emblem-play.png differ diff --git a/gfx/75/emblem-refresh.png b/gfx/75/emblem-refresh.png new file mode 100644 index 0000000..080cdc3 Binary files /dev/null and b/gfx/75/emblem-refresh.png differ diff --git a/gfx/75/emblem-remove.png b/gfx/75/emblem-remove.png new file mode 100644 index 0000000..14b8a1f Binary files /dev/null and b/gfx/75/emblem-remove.png differ diff --git a/gfx/75/emblem-stop.png b/gfx/75/emblem-stop.png new file mode 100644 index 0000000..c15b1f5 Binary files /dev/null and b/gfx/75/emblem-stop.png differ diff --git a/gfx/75/emblem-www.png b/gfx/75/emblem-www.png new file mode 100644 index 0000000..1bf61e9 Binary files /dev/null and b/gfx/75/emblem-www.png differ diff --git a/gfx/75/enqueued-channel-button.png b/gfx/75/enqueued-channel-button.png new file mode 100644 index 0000000..b63ead7 Binary files /dev/null and b/gfx/75/enqueued-channel-button.png differ diff --git a/gfx/75/enqueued-channel-file.png b/gfx/75/enqueued-channel-file.png new file mode 100644 index 0000000..126d90d Binary files /dev/null and b/gfx/75/enqueued-channel-file.png differ diff --git a/gfx/75/enqueued-item-button.png b/gfx/75/enqueued-item-button.png new file mode 100644 index 0000000..fe287b3 Binary files /dev/null and b/gfx/75/enqueued-item-button.png differ diff --git a/gfx/75/enqueued-item-file.png b/gfx/75/enqueued-item-file.png new file mode 100644 index 0000000..40643b2 Binary files /dev/null and b/gfx/75/enqueued-item-file.png differ diff --git a/gfx/75/error-channel-button.png b/gfx/75/error-channel-button.png new file mode 100644 index 0000000..8efd3a1 Binary files /dev/null and b/gfx/75/error-channel-button.png differ diff --git a/gfx/75/error-channel-file.png b/gfx/75/error-channel-file.png new file mode 100644 index 0000000..f5c1d6b Binary files /dev/null and b/gfx/75/error-channel-file.png differ diff --git a/gfx/75/error-item-button.png b/gfx/75/error-item-button.png new file mode 100644 index 0000000..3873ad1 Binary files /dev/null and b/gfx/75/error-item-button.png differ diff --git a/gfx/75/error-item-file.png b/gfx/75/error-item-file.png new file mode 100644 index 0000000..4e809f5 Binary files /dev/null and b/gfx/75/error-item-file.png differ diff --git a/gfx/75/index.html b/gfx/75/index.html new file mode 100644 index 0000000..8dee7b2 --- /dev/null +++ b/gfx/75/index.html @@ -0,0 +1,89 @@ + + +Index of /mushaspot/50/ + + +
+
+

Index of /mushaspot/50/

+
+
+

Thumbnails

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + +
+
+ + diff --git a/gfx/75/item-button.png b/gfx/75/item-button.png new file mode 100644 index 0000000..278eaf2 Binary files /dev/null and b/gfx/75/item-button.png differ diff --git a/gfx/75/item-file.png b/gfx/75/item-file.png new file mode 100644 index 0000000..9e5cc4c Binary files /dev/null and b/gfx/75/item-file.png differ diff --git a/gfx/75/kill-channel-button.png b/gfx/75/kill-channel-button.png new file mode 100644 index 0000000..878683e Binary files /dev/null and b/gfx/75/kill-channel-button.png differ diff --git a/gfx/75/kill-channel-file.png b/gfx/75/kill-channel-file.png new file mode 100644 index 0000000..8c971cb Binary files /dev/null and b/gfx/75/kill-channel-file.png differ diff --git a/gfx/75/kill-item-button.png b/gfx/75/kill-item-button.png new file mode 100644 index 0000000..e73350c Binary files /dev/null and b/gfx/75/kill-item-button.png differ diff --git a/gfx/75/kill-item-file.png b/gfx/75/kill-item-file.png new file mode 100644 index 0000000..c8c4980 Binary files /dev/null and b/gfx/75/kill-item-file.png differ diff --git a/gfx/75/play-channel-button.png b/gfx/75/play-channel-button.png new file mode 100644 index 0000000..86728df Binary files /dev/null and b/gfx/75/play-channel-button.png differ diff --git a/gfx/75/play-channel-file.png b/gfx/75/play-channel-file.png new file mode 100644 index 0000000..b310817 Binary files /dev/null and b/gfx/75/play-channel-file.png differ diff --git a/gfx/75/play-item-button.png b/gfx/75/play-item-button.png new file mode 100644 index 0000000..b94fea0 Binary files /dev/null and b/gfx/75/play-item-button.png differ diff --git a/gfx/75/play-item-file.png b/gfx/75/play-item-file.png new file mode 100644 index 0000000..fc4c754 Binary files /dev/null and b/gfx/75/play-item-file.png differ diff --git a/gfx/75/refresh-channel-button.png b/gfx/75/refresh-channel-button.png new file mode 100644 index 0000000..3a4950a Binary files /dev/null and b/gfx/75/refresh-channel-button.png differ diff --git a/gfx/75/refresh-channel-file.png b/gfx/75/refresh-channel-file.png new file mode 100644 index 0000000..7fa4313 Binary files /dev/null and b/gfx/75/refresh-channel-file.png differ diff --git a/gfx/75/refresh-item-button.png b/gfx/75/refresh-item-button.png new file mode 100644 index 0000000..7c340c9 Binary files /dev/null and b/gfx/75/refresh-item-button.png differ diff --git a/gfx/75/refresh-item-file.png b/gfx/75/refresh-item-file.png new file mode 100644 index 0000000..6f9fb87 Binary files /dev/null and b/gfx/75/refresh-item-file.png differ diff --git a/gfx/75/remove-channel-button.png b/gfx/75/remove-channel-button.png new file mode 100644 index 0000000..49479ec Binary files /dev/null and b/gfx/75/remove-channel-button.png differ diff --git a/gfx/75/remove-channel-file.png b/gfx/75/remove-channel-file.png new file mode 100644 index 0000000..6cc0910 Binary files /dev/null and b/gfx/75/remove-channel-file.png differ diff --git a/gfx/75/remove-item-button.png b/gfx/75/remove-item-button.png new file mode 100644 index 0000000..b0c7079 Binary files /dev/null and b/gfx/75/remove-item-button.png differ diff --git a/gfx/75/remove-item-file.png b/gfx/75/remove-item-file.png new file mode 100644 index 0000000..2a24d94 Binary files /dev/null and b/gfx/75/remove-item-file.png differ diff --git a/gfx/75/stop-channel-button.png b/gfx/75/stop-channel-button.png new file mode 100644 index 0000000..8befb50 Binary files /dev/null and b/gfx/75/stop-channel-button.png differ diff --git a/gfx/75/stop-channel-file.png b/gfx/75/stop-channel-file.png new file mode 100644 index 0000000..288df3a Binary files /dev/null and b/gfx/75/stop-channel-file.png differ diff --git a/gfx/75/stop-item-button.png b/gfx/75/stop-item-button.png new file mode 100644 index 0000000..31ddf8b Binary files /dev/null and b/gfx/75/stop-item-button.png differ diff --git a/gfx/75/stop-item-file.png b/gfx/75/stop-item-file.png new file mode 100644 index 0000000..3857741 Binary files /dev/null and b/gfx/75/stop-item-file.png differ diff --git a/gfx/75/www-channel-button.png b/gfx/75/www-channel-button.png new file mode 100644 index 0000000..31859cb Binary files /dev/null and b/gfx/75/www-channel-button.png differ diff --git a/gfx/75/www-channel-file.png b/gfx/75/www-channel-file.png new file mode 100644 index 0000000..e81cb7f Binary files /dev/null and b/gfx/75/www-channel-file.png differ diff --git a/gfx/75/www-item-button.png b/gfx/75/www-item-button.png new file mode 100644 index 0000000..681fe09 Binary files /dev/null and b/gfx/75/www-item-button.png differ diff --git a/gfx/75/www-item-file.png b/gfx/75/www-item-file.png new file mode 100644 index 0000000..9879d5c Binary files /dev/null and b/gfx/75/www-item-file.png differ diff --git a/gfx/AppIcon.svg b/gfx/AppIcon.svg new file mode 100644 index 0000000..9d4fb0a --- /dev/null +++ b/gfx/AppIcon.svg @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gfx/Icone_source_misterytrain/bepodder-logo1.svg b/gfx/Icone_source_misterytrain/bepodder-logo1.svg new file mode 100644 index 0000000..0216928 --- /dev/null +++ b/gfx/Icone_source_misterytrain/bepodder-logo1.svg @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gfx/Icone_source_misterytrain/bepodder-logo2.svg b/gfx/Icone_source_misterytrain/bepodder-logo2.svg new file mode 100644 index 0000000..18e2ece --- /dev/null +++ b/gfx/Icone_source_misterytrain/bepodder-logo2.svg @@ -0,0 +1,184 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gfx/Icone_source_misterytrain/emblem-add.svg b/gfx/Icone_source_misterytrain/emblem-add.svg new file mode 100644 index 0000000..537737f --- /dev/null +++ b/gfx/Icone_source_misterytrain/emblem-add.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/gfx/Icone_source_misterytrain/emblem-delete.svg b/gfx/Icone_source_misterytrain/emblem-delete.svg new file mode 100644 index 0000000..9b34854 --- /dev/null +++ b/gfx/Icone_source_misterytrain/emblem-delete.svg @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gfx/Icone_source_misterytrain/emblem-done.svg b/gfx/Icone_source_misterytrain/emblem-done.svg new file mode 100644 index 0000000..36139fc --- /dev/null +++ b/gfx/Icone_source_misterytrain/emblem-done.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/gfx/Icone_source_misterytrain/emblem-download.svg b/gfx/Icone_source_misterytrain/emblem-download.svg new file mode 100644 index 0000000..f8dc83f --- /dev/null +++ b/gfx/Icone_source_misterytrain/emblem-download.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gfx/Icone_source_misterytrain/emblem-enqueued.svg b/gfx/Icone_source_misterytrain/emblem-enqueued.svg new file mode 100644 index 0000000..774288f --- /dev/null +++ b/gfx/Icone_source_misterytrain/emblem-enqueued.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gfx/Icone_source_misterytrain/emblem-error.svg b/gfx/Icone_source_misterytrain/emblem-error.svg new file mode 100644 index 0000000..fac690b --- /dev/null +++ b/gfx/Icone_source_misterytrain/emblem-error.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/gfx/Icone_source_misterytrain/emblem-kill.svg b/gfx/Icone_source_misterytrain/emblem-kill.svg new file mode 100644 index 0000000..8ad5d76 --- /dev/null +++ b/gfx/Icone_source_misterytrain/emblem-kill.svg @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gfx/Icone_source_misterytrain/emblem-play.svg b/gfx/Icone_source_misterytrain/emblem-play.svg new file mode 100644 index 0000000..f7c6443 --- /dev/null +++ b/gfx/Icone_source_misterytrain/emblem-play.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gfx/Icone_source_misterytrain/emblem-refresh.svg b/gfx/Icone_source_misterytrain/emblem-refresh.svg new file mode 100644 index 0000000..73ec10c --- /dev/null +++ b/gfx/Icone_source_misterytrain/emblem-refresh.svg @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gfx/Icone_source_misterytrain/emblem-remove.svg b/gfx/Icone_source_misterytrain/emblem-remove.svg new file mode 100644 index 0000000..9ab384b --- /dev/null +++ b/gfx/Icone_source_misterytrain/emblem-remove.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/gfx/Icone_source_misterytrain/emblem-stop.svg b/gfx/Icone_source_misterytrain/emblem-stop.svg new file mode 100644 index 0000000..1404869 --- /dev/null +++ b/gfx/Icone_source_misterytrain/emblem-stop.svg @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gfx/Icone_source_misterytrain/emblem-www.svg b/gfx/Icone_source_misterytrain/emblem-www.svg new file mode 100644 index 0000000..57a2662 --- /dev/null +++ b/gfx/Icone_source_misterytrain/emblem-www.svg @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gfx/Icone_source_misterytrain/kind-button.svg b/gfx/Icone_source_misterytrain/kind-button.svg new file mode 100644 index 0000000..598f548 --- /dev/null +++ b/gfx/Icone_source_misterytrain/kind-button.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/gfx/Icone_source_misterytrain/kind-file.svg b/gfx/Icone_source_misterytrain/kind-file.svg new file mode 100644 index 0000000..558e902 --- /dev/null +++ b/gfx/Icone_source_misterytrain/kind-file.svg @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gfx/Icone_source_misterytrain/logo-channel.svg b/gfx/Icone_source_misterytrain/logo-channel.svg new file mode 100644 index 0000000..7840c1e --- /dev/null +++ b/gfx/Icone_source_misterytrain/logo-channel.svg @@ -0,0 +1,106 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + diff --git a/gfx/Icone_source_misterytrain/logo-item.svg b/gfx/Icone_source_misterytrain/logo-item.svg new file mode 100644 index 0000000..efd1378 --- /dev/null +++ b/gfx/Icone_source_misterytrain/logo-item.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/gfx/Icone_source_misterytrain/make.sh b/gfx/Icone_source_misterytrain/make.sh new file mode 100644 index 0000000..ce4eafa --- /dev/null +++ b/gfx/Icone_source_misterytrain/make.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +cd $(dirname $0) + +mkdir distro + +for a in kind*; do +widget=$(echo "$a" | sed 's/.svg//g' | sed 's/kind-//g') +for b in logo*; do +type=$(echo "$b" | sed 's/.svg//g' | sed 's/logo-//g') +for c in emblem*; do +name=$(echo "$c" | sed 's/.svg//g' | sed 's/emblem-//g') +file="distro/$name-$type-$widget.svg" + +if [ "$widget" == "button" ] +then +echo "" > "$file" +else +echo "" > "$file" +fi + +cat "$a" | sed '/svg/d' >> "$file" +if [ "$widget" == "button" ] +then +echo "" >> "$file" +else +echo "" >> "$file" +fi +cat "$b" | sed '/svg/d' >> "$file" +echo "" >> "$file" +if [ "$widget" == "button" ] +then +echo "" >> "$file" +else +echo "" >> "$file" +fi +cat "$c" | sed '/svg/d' >> "$file" +echo "" >> "$file" +echo "" >> "$file" +echo "$file - FATTO" +done +done +done \ No newline at end of file diff --git a/gfx/bebits_logo.gif b/gfx/bebits_logo.gif new file mode 100644 index 0000000..092b6f4 Binary files /dev/null and b/gfx/bebits_logo.gif differ diff --git a/gfx/bepodder_ban1.png b/gfx/bepodder_ban1.png new file mode 100644 index 0000000..b7a2ed9 Binary files /dev/null and b/gfx/bepodder_ban1.png differ diff --git a/gfx/bepodder_splashscreen_prova1.jpg b/gfx/bepodder_splashscreen_prova1.jpg new file mode 100644 index 0000000..a0eae5b Binary files /dev/null and b/gfx/bepodder_splashscreen_prova1.jpg differ diff --git a/gfx/bepodder_splashscreen_prova2.jpg b/gfx/bepodder_splashscreen_prova2.jpg new file mode 100644 index 0000000..7bd3f2a Binary files /dev/null and b/gfx/bepodder_splashscreen_prova2.jpg differ diff --git a/gfx/bepodder_splashscreen_prova3.jpg b/gfx/bepodder_splashscreen_prova3.jpg new file mode 100644 index 0000000..ec9843c Binary files /dev/null and b/gfx/bepodder_splashscreen_prova3.jpg differ diff --git a/gfx/bp_icon.bmp b/gfx/bp_icon.bmp new file mode 100644 index 0000000..814408a Binary files /dev/null and b/gfx/bp_icon.bmp differ diff --git a/gfx/item.png b/gfx/item.png new file mode 100644 index 0000000..6b05dc9 Binary files /dev/null and b/gfx/item.png differ diff --git a/gfx/logo2.svg b/gfx/logo2.svg new file mode 100644 index 0000000..423f05c --- /dev/null +++ b/gfx/logo2.svg @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/icons/Application/bebits_logo.gif b/icons/Application/bebits_logo.gif new file mode 100644 index 0000000..092b6f4 Binary files /dev/null and b/icons/Application/bebits_logo.gif differ diff --git a/icons/Application/bepodder-logo1.png b/icons/Application/bepodder-logo1.png new file mode 100644 index 0000000..470a239 Binary files /dev/null and b/icons/Application/bepodder-logo1.png differ diff --git a/icons/Application/bepodder-logo2.png b/icons/Application/bepodder-logo2.png new file mode 100644 index 0000000..dddd13b Binary files /dev/null and b/icons/Application/bepodder-logo2.png differ diff --git a/icons/Application/bepodder_bianco.png b/icons/Application/bepodder_bianco.png new file mode 100644 index 0000000..6c96246 Binary files /dev/null and b/icons/Application/bepodder_bianco.png differ diff --git a/icons/Application/bp_icon.bmp b/icons/Application/bp_icon.bmp new file mode 100644 index 0000000..814408a Binary files /dev/null and b/icons/Application/bp_icon.bmp differ diff --git a/icons/Application/logo1.svg b/icons/Application/logo1.svg new file mode 100644 index 0000000..9d4fb0a --- /dev/null +++ b/icons/Application/logo1.svg @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/icons/Application/logo2.svg b/icons/Application/logo2.svg new file mode 100644 index 0000000..423f05c --- /dev/null +++ b/icons/Application/logo2.svg @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/icons/Application/podder.hkv b/icons/Application/podder.hkv new file mode 100644 index 0000000..68a0c19 Binary files /dev/null and b/icons/Application/podder.hkv differ diff --git a/icons/Application/podder.png b/icons/Application/podder.png new file mode 100644 index 0000000..dc2a784 Binary files /dev/null and b/icons/Application/podder.png differ diff --git a/icons/Application/podder.svg b/icons/Application/podder.svg new file mode 100644 index 0000000..181a945 --- /dev/null +++ b/icons/Application/podder.svg @@ -0,0 +1,68 @@ + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/include/curl/curl.h b/include/curl/curl.h new file mode 100644 index 0000000..08bf8fa --- /dev/null +++ b/include/curl/curl.h @@ -0,0 +1,968 @@ +#ifndef __CURL_CURL_H +#define __CURL_CURL_H +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 1998 - 2002, Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at http://curl.haxx.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + * $Id: curl.h,v 1.175 2002/11/18 21:58:46 bagder Exp $ + ***************************************************************************/ + +#include +/* The include stuff here is mainly for time_t! */ +#ifdef vms +# include +# include +#else +# include +# ifdef TIME_WITH_SYS_TIME +# include +# include +# else +# ifdef HAVE_SYS_TIME_H +# include +# else +# include +# endif +# endif +#endif /* defined (vms) */ + +#ifndef TRUE +#define TRUE 1 +#endif +#ifndef FALSE +#define FALSE 0 +#endif + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* stupid #define trick to preserve functionality with older code, but + making it use our name space for the future */ +#define HttpPost curl_httppost + +struct curl_httppost { + struct curl_httppost *next; /* next entry in the list */ + char *name; /* pointer to allocated name */ + long namelength; /* length of name length */ + char *contents; /* pointer to allocated data contents */ + long contentslength; /* length of contents field */ + + /* CMC: Added support for buffer uploads */ + char *buffer; /* pointer to allocated buffer contents */ + long bufferlength; /* length of buffer field */ + + char *contenttype; /* Content-Type */ + struct curl_slist* contentheader; /* list of extra headers for this form */ + struct curl_httppost *more; /* if one field name has more than one file, this + link should link to following files */ + long flags; /* as defined below */ +#define HTTPPOST_FILENAME (1<<0) /* specified content is a file name */ +#define HTTPPOST_READFILE (1<<1) /* specified content is a file name */ +#define HTTPPOST_PTRNAME (1<<2) /* name is only stored pointer + do not free in formfree */ +#define HTTPPOST_PTRCONTENTS (1<<3) /* contents is only stored pointer + do not free in formfree */ + +/* CMC: Added support for buffer uploads */ +#define HTTPPOST_BUFFER (1<<4) /* upload file from buffer */ +#define HTTPPOST_PTRBUFFER (1<<5) /* upload file from pointer contents */ + + char *showfilename; /* The file name to show. If not set, the actual + file name will be used (if this is a file part) */ +}; + +typedef int (*curl_progress_callback)(void *clientp, + double dltotal, + double dlnow, + double ultotal, + double ulnow); + +#define CURL_MAX_WRITE_SIZE 20480 + +typedef size_t (*curl_write_callback)(char *buffer, + size_t size, + size_t nitems, + void *outstream); + +typedef size_t (*curl_read_callback)(char *buffer, + size_t size, + size_t nitems, + void *instream); + +typedef int (*curl_passwd_callback)(void *clientp, + const char *prompt, + char *buffer, + int buflen); + +/* the kind of data that is passed to information_callback*/ +typedef enum { + CURLINFO_TEXT = 0, + CURLINFO_HEADER_IN, /* 1 */ + CURLINFO_HEADER_OUT, /* 2 */ + CURLINFO_DATA_IN, /* 3 */ + CURLINFO_DATA_OUT, /* 4 */ + CURLINFO_END +} curl_infotype; + +typedef int (*curl_debug_callback) + (CURL *handle, /* the handle/transfer this concerns */ + curl_infotype type, /* what kind of data */ + char *data, /* points to the data */ + size_t size, /* size of the data pointed to */ + void *userp); /* whatever the user please */ + +/* All possible error codes from all sorts of curl functions. Future versions + may return other values, stay prepared. + + Always add new return codes last. Never *EVER* remove any. The return + codes must remain the same! + */ + +typedef enum { + CURLE_OK = 0, + CURLE_UNSUPPORTED_PROTOCOL, /* 1 */ + CURLE_FAILED_INIT, /* 2 */ + CURLE_URL_MALFORMAT, /* 3 */ + CURLE_URL_MALFORMAT_USER, /* 4 */ + CURLE_COULDNT_RESOLVE_PROXY, /* 5 */ + CURLE_COULDNT_RESOLVE_HOST, /* 6 */ + CURLE_COULDNT_CONNECT, /* 7 */ + CURLE_FTP_WEIRD_SERVER_REPLY, /* 8 */ + CURLE_FTP_ACCESS_DENIED, /* 9 */ + CURLE_FTP_USER_PASSWORD_INCORRECT, /* 10 */ + CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */ + CURLE_FTP_WEIRD_USER_REPLY, /* 12 */ + CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */ + CURLE_FTP_WEIRD_227_FORMAT, /* 14 */ + CURLE_FTP_CANT_GET_HOST, /* 15 */ + CURLE_FTP_CANT_RECONNECT, /* 16 */ + CURLE_FTP_COULDNT_SET_BINARY, /* 17 */ + CURLE_PARTIAL_FILE, /* 18 */ + CURLE_FTP_COULDNT_RETR_FILE, /* 19 */ + CURLE_FTP_WRITE_ERROR, /* 20 */ + CURLE_FTP_QUOTE_ERROR, /* 21 */ + CURLE_HTTP_NOT_FOUND, /* 22 */ + CURLE_WRITE_ERROR, /* 23 */ + CURLE_MALFORMAT_USER, /* 24 - user name is illegally specified */ + CURLE_FTP_COULDNT_STOR_FILE, /* 25 - failed FTP upload */ + CURLE_READ_ERROR, /* 26 - could open/read from file */ + CURLE_OUT_OF_MEMORY, /* 27 */ + CURLE_OPERATION_TIMEOUTED, /* 28 - the timeout time was reached */ + CURLE_FTP_COULDNT_SET_ASCII, /* 29 - TYPE A failed */ + CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */ + CURLE_FTP_COULDNT_USE_REST, /* 31 - the REST command failed */ + CURLE_FTP_COULDNT_GET_SIZE, /* 32 - the SIZE command failed */ + CURLE_HTTP_RANGE_ERROR, /* 33 - RANGE "command" didn't work */ + CURLE_HTTP_POST_ERROR, /* 34 */ + CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */ + CURLE_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */ + CURLE_FILE_COULDNT_READ_FILE, /* 37 */ + CURLE_LDAP_CANNOT_BIND, /* 38 */ + CURLE_LDAP_SEARCH_FAILED, /* 39 */ + CURLE_LIBRARY_NOT_FOUND, /* 40 */ + CURLE_FUNCTION_NOT_FOUND, /* 41 */ + CURLE_ABORTED_BY_CALLBACK, /* 42 */ + CURLE_BAD_FUNCTION_ARGUMENT, /* 43 */ + CURLE_BAD_CALLING_ORDER, /* 44 */ + CURLE_HTTP_PORT_FAILED, /* 45 - HTTP Interface operation failed */ + CURLE_BAD_PASSWORD_ENTERED, /* 46 - my_getpass() returns fail */ + CURLE_TOO_MANY_REDIRECTS , /* 47 - catch endless re-direct loops */ + CURLE_UNKNOWN_TELNET_OPTION, /* 48 - User specified an unknown option */ + CURLE_TELNET_OPTION_SYNTAX , /* 49 - Malformed telnet option */ + CURLE_OBSOLETE, /* 50 - removed after 7.7.3 */ + CURLE_SSL_PEER_CERTIFICATE, /* 51 - peer's certificate wasn't ok */ + CURLE_GOT_NOTHING, /* 52 - when this is a specific error */ + CURLE_SSL_ENGINE_NOTFOUND, /* 53 - SSL crypto engine not found */ + CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as + default */ + CURLE_SEND_ERROR, /* 55 - failed sending network data */ + CURLE_RECV_ERROR, /* 56 - failure in receiving network data */ + CURLE_SHARE_IN_USE, /* 57 - share is in use */ + CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */ + CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */ + CURLE_SSL_CACERT, /* 60 - problem with the CA cert (path?) */ + CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized transfer encoding */ + + CURL_LAST /* never use! */ +} CURLcode; + +/* Make a spelling correction for the operation timed-out define */ +#define CURLE_OPERATION_TIMEDOUT CURLE_OPERATION_TIMEOUTED + +typedef enum { + CURLPROXY_HTTP = 0, + CURLPROXY_SOCKS4 = 4, + CURLPROXY_SOCKS5 = 5 +} curl_proxytype; + +/* this was the error code 50 in 7.7.3 and a few earlier versions, this + is no longer used by libcurl but is instead #defined here only to not + make programs break */ +#define CURLE_ALREADY_COMPLETE 99999 + +/* This is just to make older programs not break: */ +#define CURLE_FTP_PARTIAL_FILE CURLE_PARTIAL_FILE +#define CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_BAD_DOWNLOAD_RESUME + +#define CURL_ERROR_SIZE 256 + +/* long may be 32 or 64 bits, but we should never depend on anything else + but 32 */ +#define CURLOPTTYPE_LONG 0 +#define CURLOPTTYPE_OBJECTPOINT 10000 +#define CURLOPTTYPE_FUNCTIONPOINT 20000 + +/* name is uppercase CURLOPT_, + type is one of the defined CURLOPTTYPE_ + number is unique identifier */ +#ifdef CINIT +#undef CINIT +#endif +/* + * Figure out if we can use the ## operator, which is supported by ISO/ANSI C + * and C++. Some compilers support it without setting __STDC__ or __cplusplus + * so we need to carefully check for them too. We don't use configure-checks + * for these since we want these headers to remain generic and working for all + * platforms. + */ +#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \ + defined(__HP_aCC) || defined(__BORLANDC__) + /* This compiler is believed to have an ISO compatible preprocessor */ +#define CURL_ISOCPP +#else + /* This compiler is believed NOT to have an ISO compatible preprocessor */ +#undef CURL_ISOCPP +#endif + +#ifdef CURL_ISOCPP +#define CINIT(name,type,number) CURLOPT_ ## name = CURLOPTTYPE_ ## type + number +#else +/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ +#define LONG CURLOPTTYPE_LONG +#define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT +#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT +#define CINIT(name,type,number) CURLOPT_/**/name = type + number +#endif + +typedef enum { + CINIT(NOTHING, LONG, 0), /********* the first one is unused ************/ + + /* This is the FILE * or void * the regular output should be written to. */ + CINIT(FILE, OBJECTPOINT, 1), + + /* The full URL to get/put */ + CINIT(URL, OBJECTPOINT, 2), + + /* Port number to connect to, if other than default. Specify the CONF_PORT + flag in the CURLOPT_FLAGS to activate this */ + CINIT(PORT, LONG, 3), + + /* Name of proxy to use. Specify the CONF_PROXY flag in the CURLOPT_FLAGS to + activate this */ + CINIT(PROXY, OBJECTPOINT, 4), + + /* Name and password to use when fetching. Specify the CONF_USERPWD flag in + the CURLOPT_FLAGS to activate this */ + CINIT(USERPWD, OBJECTPOINT, 5), + + /* Name and password to use with Proxy. Specify the CONF_PROXYUSERPWD + flag in the CURLOPT_FLAGS to activate this */ + CINIT(PROXYUSERPWD, OBJECTPOINT, 6), + + /* Range to get, specified as an ASCII string. Specify the CONF_RANGE flag + in the CURLOPT_FLAGS to activate this */ + CINIT(RANGE, OBJECTPOINT, 7), + + /* not used */ + + /* Specified file stream to upload from (use as input): */ + CINIT(INFILE, OBJECTPOINT, 9), + + /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE + * bytes big. If this is not used, error messages go to stderr instead: */ + CINIT(ERRORBUFFER, OBJECTPOINT, 10), + + /* Function that will be called to store the output (instead of fwrite). The + * parameters will use fwrite() syntax, make sure to follow them. */ + CINIT(WRITEFUNCTION, FUNCTIONPOINT, 11), + + /* Function that will be called to read the input (instead of fread). The + * parameters will use fread() syntax, make sure to follow them. */ + CINIT(READFUNCTION, FUNCTIONPOINT, 12), + + /* Time-out the read operation after this amount of seconds */ + CINIT(TIMEOUT, LONG, 13), + + /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about + * how large the file being sent really is. That allows better error + * checking and better verifies that the upload was succcessful. -1 means + * unknown size. */ + CINIT(INFILESIZE, LONG, 14), + + /* POST input fields. */ + CINIT(POSTFIELDS, OBJECTPOINT, 15), + + /* Set the referer page (needed by some CGIs) */ + CINIT(REFERER, OBJECTPOINT, 16), + + /* Set the FTP PORT string (interface name, named or numerical IP address) + Use i.e '-' to use default address. */ + CINIT(FTPPORT, OBJECTPOINT, 17), + + /* Set the User-Agent string (examined by some CGIs) */ + CINIT(USERAGENT, OBJECTPOINT, 18), + + /* If the download receives less than "low speed limit" bytes/second + * during "low speed time" seconds, the operations is aborted. + * You could i.e if you have a pretty high speed connection, abort if + * it is less than 2000 bytes/sec during 20 seconds. + */ + + /* Set the "low speed limit" */ + CINIT(LOW_SPEED_LIMIT, LONG , 19), + + /* Set the "low speed time" */ + CINIT(LOW_SPEED_TIME, LONG, 20), + + /* Set the continuation offset */ + CINIT(RESUME_FROM, LONG, 21), + + /* Set cookie in request: */ + CINIT(COOKIE, OBJECTPOINT, 22), + + /* This points to a linked list of headers, struct curl_slist kind */ + CINIT(HTTPHEADER, OBJECTPOINT, 23), + + /* This points to a linked list of post entries, struct HttpPost */ + CINIT(HTTPPOST, OBJECTPOINT, 24), + + /* name of the file keeping your private SSL-certificate */ + CINIT(SSLCERT, OBJECTPOINT, 25), + + /* password for the SSL-private key, keep this for compatibility */ + CINIT(SSLCERTPASSWD, OBJECTPOINT, 26), + /* password for the SSL private key */ + CINIT(SSLKEYPASSWD, OBJECTPOINT, 26), + + /* send TYPE parameter? */ + CINIT(CRLF, LONG, 27), + + /* send linked-list of QUOTE commands */ + CINIT(QUOTE, OBJECTPOINT, 28), + + /* send FILE * or void * to store headers to, if you use a callback it + is simply passed to the callback unmodified */ + CINIT(WRITEHEADER, OBJECTPOINT, 29), + + /* point to a file to read the initial cookies from, also enables + "cookie awareness" */ + CINIT(COOKIEFILE, OBJECTPOINT, 31), + + /* What version to specifly try to use. + See CURL_SSLVERSION defines below. */ + CINIT(SSLVERSION, LONG, 32), + + /* What kind of HTTP time condition to use, see defines */ + CINIT(TIMECONDITION, LONG, 33), + + /* Time to use with the above condition. Specified in number of seconds + since 1 Jan 1970 */ + CINIT(TIMEVALUE, LONG, 34), + + /* HTTP request, for odd commands like DELETE, TRACE and others */ + /* OBSOLETE DEFINE, left for tradition only */ + CINIT(HTTPREQUEST, OBJECTPOINT, 35), + + /* Custom request, for customizing the get command like + HTTP: DELETE, TRACE and others + FTP: to use a different list command + */ + CINIT(CUSTOMREQUEST, OBJECTPOINT, 36), + + /* HTTP request, for odd commands like DELETE, TRACE and others */ + CINIT(STDERR, OBJECTPOINT, 37), + + /* 38 is not used */ + + /* send linked-list of post-transfer QUOTE commands */ + CINIT(POSTQUOTE, OBJECTPOINT, 39), + + /* Pass a pointer to string of the output using full variable-replacement + as described elsewhere. */ + CINIT(WRITEINFO, OBJECTPOINT, 40), + + /* Previous FLAG bits */ + CINIT(VERBOSE, LONG, 41), /* talk a lot */ + CINIT(HEADER, LONG, 42), /* throw the header out too */ + CINIT(NOPROGRESS, LONG, 43), /* shut off the progress meter */ + CINIT(NOBODY, LONG, 44), /* use HEAD to get http document */ + CINIT(FAILONERROR, LONG, 45), /* no output on http error codes >= 300 */ + CINIT(UPLOAD, LONG, 46), /* this is an upload */ + CINIT(POST, LONG, 47), /* HTTP POST method */ + CINIT(FTPLISTONLY, LONG, 48), /* Use NLST when listing ftp dir */ + + CINIT(FTPAPPEND, LONG, 50), /* Append instead of overwrite on upload! */ + + /* Specify whether to read the user+password from the .netrc or the URL. + * This must be one of the CURL_NETRC_* enums below. */ + CINIT(NETRC, LONG, 51), + + CINIT(FOLLOWLOCATION, LONG, 52), /* use Location: Luke! */ + + /* This FTPASCII name is now obsolete, to be removed, use the TRANSFERTEXT + instead. It goes for more protocols than just ftp... */ + CINIT(FTPASCII, LONG, 53), /* use TYPE A for transfer */ + + CINIT(TRANSFERTEXT, LONG, 53), /* transfer data in text/ASCII format */ + CINIT(PUT, LONG, 54), /* PUT the input file */ + + CINIT(MUTE, LONG, 55), /* OBSOLETE OPTION, removed in 7.8 */ + + /* Function that will be called instead of the internal progress display + * function. This function should be defined as the curl_progress_callback + * prototype defines. */ + CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56), + + /* Data passed to the progress callback */ + CINIT(PROGRESSDATA, OBJECTPOINT, 57), + + /* We want the referer field set automatically when following locations */ + CINIT(AUTOREFERER, LONG, 58), + + /* Port of the proxy, can be set in the proxy string as well with: + "[host]:[port]" */ + CINIT(PROXYPORT, LONG, 59), + + /* size of the POST input data, if strlen() is not good to use */ + CINIT(POSTFIELDSIZE, LONG, 60), + + /* tunnel non-http operations through a HTTP proxy */ + CINIT(HTTPPROXYTUNNEL, LONG, 61), + + /* Set the interface string to use as outgoing network interface */ + CINIT(INTERFACE, OBJECTPOINT, 62), + + /* Set the krb4 security level, this also enables krb4 awareness. This is a + * string, 'clear', 'safe', 'confidential' or 'private'. If the string is + * set but doesn't match one of these, 'private' will be used. */ + CINIT(KRB4LEVEL, OBJECTPOINT, 63), + + /* Set if we should verify the peer in ssl handshake, set 1 to verify. */ + CINIT(SSL_VERIFYPEER, LONG, 64), + + /* The CApath or CAfile used to validate the peer certificate + this option is used only if SSL_VERIFYPEER is true */ + CINIT(CAINFO, OBJECTPOINT, 65), + + /* Function pointer to replace the internal password prompt */ + CINIT(PASSWDFUNCTION, FUNCTIONPOINT, 66), + + /* Custom pointer that gets passed as first argument to the password + function */ + CINIT(PASSWDDATA, OBJECTPOINT, 67), + + /* Maximum number of http redirects to follow */ + CINIT(MAXREDIRS, LONG, 68), + + /* Pass a pointer to a time_t to get a possible date of the requested + document! Pass a NULL to shut it off. */ + CINIT(FILETIME, OBJECTPOINT, 69), + + /* This points to a linked list of telnet options */ + CINIT(TELNETOPTIONS, OBJECTPOINT, 70), + + /* Max amount of cached alive connections */ + CINIT(MAXCONNECTS, LONG, 71), + + /* What policy to use when closing connections when the cache is filled + up */ + CINIT(CLOSEPOLICY, LONG, 72), + + /* Callback to use when CURLCLOSEPOLICY_CALLBACK is set */ + CINIT(CLOSEFUNCTION, FUNCTIONPOINT, 73), + + /* Set to explicitly use a new connection for the upcoming transfer. + Do not use this unless you're absolutely sure of this, as it makes the + operation slower and is less friendly for the network. */ + CINIT(FRESH_CONNECT, LONG, 74), + + /* Set to explicitly forbid the upcoming transfer's connection to be re-used + when done. Do not use this unless you're absolutely sure of this, as it + makes the operation slower and is less friendly for the network. */ + CINIT(FORBID_REUSE, LONG, 75), + + /* Set to a file name that contains random data for libcurl to use to + seed the random engine when doing SSL connects. */ + CINIT(RANDOM_FILE, OBJECTPOINT, 76), + + /* Set to the Entropy Gathering Daemon socket pathname */ + CINIT(EGDSOCKET, OBJECTPOINT, 77), + + /* Time-out connect operations after this amount of seconds, if connects + are OK within this time, then fine... This only aborts the connect + phase. [Only works on unix-style/SIGALRM operating systems] */ + CINIT(CONNECTTIMEOUT, LONG, 78), + + /* Function that will be called to store headers (instead of fwrite). The + * parameters will use fwrite() syntax, make sure to follow them. */ + CINIT(HEADERFUNCTION, FUNCTIONPOINT, 79), + + /* Set this to force the HTTP request to get back to GET. Only really usable + if POST, PUT or a custom request have been used first. + */ + CINIT(HTTPGET, LONG, 80), + + /* Set if we should verify the Common name from the peer certificate in ssl + * handshake, set 1 to check existence, 2 to ensure that it matches the + * provided hostname. */ + CINIT(SSL_VERIFYHOST, LONG, 81), + + /* Specify which file name to write all known cookies in after completed + operation. Set file name to "-" (dash) to make it go to stdout. */ + CINIT(COOKIEJAR, OBJECTPOINT, 82), + + /* Specify which SSL ciphers to use */ + CINIT(SSL_CIPHER_LIST, OBJECTPOINT, 83), + + /* Specify which HTTP version to use! This must be set to one of the + CURL_HTTP_VERSION* enums set below. */ + CINIT(HTTP_VERSION, LONG, 84), + + /* Specificly switch on or off the FTP engine's use of the EPSV command. By + default, that one will always be attempted before the more traditional + PASV command. */ + CINIT(FTP_USE_EPSV, LONG, 85), + + /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */ + CINIT(SSLCERTTYPE, OBJECTPOINT, 86), + + /* name of the file keeping your private SSL-key */ + CINIT(SSLKEY, OBJECTPOINT, 87), + + /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */ + CINIT(SSLKEYTYPE, OBJECTPOINT, 88), + + /* crypto engine for the SSL-sub system */ + CINIT(SSLENGINE, OBJECTPOINT, 89), + + /* set the crypto engine for the SSL-sub system as default + the param has no meaning... + */ + CINIT(SSLENGINE_DEFAULT, LONG, 90), + + /* Non-zero value means to use the global dns cache */ + CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), + + /* DNS cache timeout */ + CINIT(DNS_CACHE_TIMEOUT, LONG, 92), + + /* send linked-list of pre-transfer QUOTE commands (Wesley Laxton)*/ + CINIT(PREQUOTE, OBJECTPOINT, 93), + + /* set the debug function */ + CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94), + + /* set the data for the debug function */ + CINIT(DEBUGDATA, OBJECTPOINT, 95), + + /* mark this as start of a cookie session */ + CINIT(COOKIESESSION, LONG, 96), + + /* The CApath directory used to validate the peer certificate + this option is used only if SSL_VERIFYPEER is true */ + CINIT(CAPATH, OBJECTPOINT, 97), + + /* Instruct libcurl to use a smaller receive buffer */ + CINIT(BUFFERSIZE, LONG, 98), + + /* Instruct libcurl to not use any signal/alarm handlers, even when using + timeouts. This option is useful for multi-threaded applications. + See libcurl-the-guide for more background information. */ + CINIT(NOSIGNAL, LONG, 99), + + /* Provide a CURLShare for mutexing non-ts data */ + CINIT(SHARE, OBJECTPOINT, 100), + + /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default), + CURLPROXY_SOCKS4 and CURLPROXY_SOCKS5. */ + CINIT(PROXYTYPE, LONG, 101), + + /* Set the Accept-Encoding string. Use this to tell a server you would like + the response to be compressed. */ + CINIT(ENCODING, OBJECTPOINT, 102), + + + CURLOPT_LASTENTRY /* the last unused */ +} CURLoption; + + /* two convenient "aliases" that follow the name scheme better */ +#define CURLOPT_WRITEDATA CURLOPT_FILE +#define CURLOPT_READDATA CURLOPT_INFILE +#define CURLOPT_HEADERDATA CURLOPT_WRITEHEADER + + + /* These enums are for use with the CURLOPT_HTTP_VERSION option. */ +enum { + CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd + like the library to choose the best possible + for us! */ + CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */ + CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */ + + CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */ +}; + + /* These enums are for use with the CURLOPT_NETRC option. */ +enum CURL_NETRC_OPTION { + CURL_NETRC_IGNORED, /* The .netrc will never be read. + * This is the default. */ + CURL_NETRC_OPTIONAL, /* A user:password in the URL will be preferred + * to one in the .netrc. */ + CURL_NETRC_REQUIRED, /* A user:password in the URL will be ignored. + * Unless one is set programmatically, the .netrc + * will be queried. */ + CURL_NETRC_LAST +}; + +enum { + CURL_SSLVERSION_DEFAULT, + CURL_SSLVERSION_TLSv1, + CURL_SSLVERSION_SSLv2, + CURL_SSLVERSION_SSLv3, + + CURL_SSLVERSION_LAST /* never use, keep last */ +}; + + +typedef enum { + CURL_TIMECOND_NONE, + + CURL_TIMECOND_IFMODSINCE, + CURL_TIMECOND_IFUNMODSINCE, + CURL_TIMECOND_LASTMOD, + + CURL_TIMECOND_LAST +} curl_TimeCond; + +/* for backwards compatibility */ +#ifndef TIMECOND_IFMODSINCE +#define TIMECOND_IFMODSINCE CURL_TIMECOND_IFMODSINCE +#endif +#ifndef TIMECOND_IFUNMODSINCE +#define TIMECOND_IFUNMODSINCE CURL_TIMECOND_IFUNMODSINCE +#endif +#ifndef TIMECOND_LASTMOD +#define TIMECOND_LASTMOD CURL_TIMECOND_LASTMOD +#endif + +#ifdef __BEOS__ +#include +#endif + + +/* These functions are in the libcurl, they're here for portable reasons and + they are used by the 'curl' client. They really should be moved to some kind + of "portability library" since it has nothing to do with file transfers and + might be usable to other programs... + + NOTE: they return TRUE if the strings match *case insensitively*. + */ +extern int (curl_strequal)(const char *s1, const char *s2); +extern int (curl_strnequal)(const char *s1, const char *s2, size_t n); +#define strequal(a,b) curl_strequal(a,b) +#define strnequal(a,b,c) curl_strnequal(a,b,c) + +/* DEPRECATED function to build formdata */ +int curl_formparse(char *, struct curl_httppost **, + struct curl_httppost **_post); + +/* name is uppercase CURLFORM_ */ +#ifdef CFINIT +#undef CFINIT +#endif + +#ifdef CURL_ISOCPP +#define CFINIT(name) CURLFORM_ ## name +#else +/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ +#define CFINIT(name) CURLFORM_/**/name +#endif + +typedef enum { + CFINIT(NOTHING), /********* the first one is unused ************/ + + /* */ + CFINIT(COPYNAME), + CFINIT(PTRNAME), + CFINIT(NAMELENGTH), + CFINIT(COPYCONTENTS), + CFINIT(PTRCONTENTS), + CFINIT(CONTENTSLENGTH), + CFINIT(FILECONTENT), + CFINIT(ARRAY), + CFINIT(OBSOLETE), + CFINIT(FILE), + + CFINIT(BUFFER), + CFINIT(BUFFERPTR), + CFINIT(BUFFERLENGTH), + + CFINIT(CONTENTTYPE), + CFINIT(CONTENTHEADER), + CFINIT(FILENAME), + CFINIT(END), + CFINIT(OBSOLETE2), + + CURLFORM_LASTENTRY /* the last unusued */ +} CURLformoption; + +#undef CFINIT /* done */ + +/* structure to be used as parameter for CURLFORM_ARRAY */ +struct curl_forms { + CURLformoption option; + const char *value; +}; + +/* use this for multipart formpost building */ +/* Returns code for curl_formadd() + * + * Returns: + * CURL_FORMADD_OK on success + * CURL_FORMADD_MEMORY if the FormInfo allocation fails + * CURL_FORMADD_OPTION_TWICE if one option is given twice for one Form + * CURL_FORMADD_NULL if a null pointer was given for a char + * CURL_FORMADD_MEMORY if the allocation of a FormInfo struct failed + * CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used + * CURL_FORMADD_INCOMPLETE if the some FormInfo is not complete (or error) + * CURL_FORMADD_MEMORY if a HttpPost struct cannot be allocated + * CURL_FORMADD_MEMORY if some allocation for string copying failed. + * CURL_FORMADD_ILLEGAL_ARRAY if an illegal option is used in an array + * + ***************************************************************************/ +typedef enum { + CURL_FORMADD_OK, /* first, no error */ + + CURL_FORMADD_MEMORY, + CURL_FORMADD_OPTION_TWICE, + CURL_FORMADD_NULL, + CURL_FORMADD_UNKNOWN_OPTION, + CURL_FORMADD_INCOMPLETE, + CURL_FORMADD_ILLEGAL_ARRAY, + + CURL_FORMADD_LAST /* last */ +} CURLFORMcode; + +CURLFORMcode curl_formadd(struct curl_httppost **httppost, + struct curl_httppost **last_post, + ...); + +/* cleanup a form: */ +void curl_formfree(struct curl_httppost *form); + +/* Unix and Win32 getenv function call, this returns a malloc()'ed string that + MUST be free()ed after usage is complete. */ +char *curl_getenv(const char *variable); + +/* Returns a static ascii string of the libcurl version. */ +char *curl_version(void); + +/* Escape and unescape URL encoding in strings. The functions return a new + * allocated string or NULL if an error occurred. */ +char *curl_escape(const char *string, int length); +char *curl_unescape(const char *string, int length); +/* 20020912 WJM. Provide for a de-allocation in the same translation unit + that did the allocation. Added in libcurl 7.10 */ +void curl_free(void *p); + +/* curl_global_init() should be invoked exactly once for each application that + uses libcurl */ +CURLcode curl_global_init(long flags); + +/* curl_global_cleanup() should be invoked exactly once for each application + that uses libcurl */ +void curl_global_cleanup(void); + +/* This is the version number */ +#define LIBCURL_VERSION "7.10.2" +#define LIBCURL_VERSION_NUM 0x070a02 + +/* linked-list structure for the CURLOPT_QUOTE option (and other) */ +struct curl_slist { + char *data; + struct curl_slist *next; +}; + +struct curl_slist *curl_slist_append(struct curl_slist *, const char *); +void curl_slist_free_all(struct curl_slist *); + +/* + * NAME curl_getdate() + * + * DESCRIPTION + * + * Returns the time, in seconds since 1 Jan 1970 of the time string given in + * the first argument. The time argument in the second parameter is for cases + * where the specified time is relative now, like 'two weeks' or 'tomorrow' + * etc. + */ +time_t curl_getdate(const char *p, const time_t *now); + + +#define CURLINFO_STRING 0x100000 +#define CURLINFO_LONG 0x200000 +#define CURLINFO_DOUBLE 0x300000 +#define CURLINFO_MASK 0x0fffff +#define CURLINFO_TYPEMASK 0xf00000 + +typedef enum { + CURLINFO_NONE, /* first, never use this */ + CURLINFO_EFFECTIVE_URL = CURLINFO_STRING + 1, + CURLINFO_HTTP_CODE = CURLINFO_LONG + 2, + CURLINFO_TOTAL_TIME = CURLINFO_DOUBLE + 3, + CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE + 4, + CURLINFO_CONNECT_TIME = CURLINFO_DOUBLE + 5, + CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6, + CURLINFO_SIZE_UPLOAD = CURLINFO_DOUBLE + 7, + CURLINFO_SIZE_DOWNLOAD = CURLINFO_DOUBLE + 8, + CURLINFO_SPEED_DOWNLOAD = CURLINFO_DOUBLE + 9, + CURLINFO_SPEED_UPLOAD = CURLINFO_DOUBLE + 10, + CURLINFO_HEADER_SIZE = CURLINFO_LONG + 11, + CURLINFO_REQUEST_SIZE = CURLINFO_LONG + 12, + CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG + 13, + CURLINFO_FILETIME = CURLINFO_LONG + 14, + + CURLINFO_CONTENT_LENGTH_DOWNLOAD = CURLINFO_DOUBLE + 15, + CURLINFO_CONTENT_LENGTH_UPLOAD = CURLINFO_DOUBLE + 16, + + CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17, + + CURLINFO_CONTENT_TYPE = CURLINFO_STRING + 18, + + CURLINFO_REDIRECT_TIME = CURLINFO_DOUBLE + 19, + CURLINFO_REDIRECT_COUNT = CURLINFO_LONG + 20, + + /* Fill in new entries here! */ + + CURLINFO_LASTONE = 21 +} CURLINFO; + +/* unfortunately, the easy.h and multi.h include files need options and info + stuff before they can be included! */ +#include "easy.h" /* nothing in curl is fun without the easy stuff */ +#include "multi.h" + +typedef enum { + CURLCLOSEPOLICY_NONE, /* first, never use this */ + + CURLCLOSEPOLICY_OLDEST, + CURLCLOSEPOLICY_LEAST_RECENTLY_USED, + CURLCLOSEPOLICY_LEAST_TRAFFIC, + CURLCLOSEPOLICY_SLOWEST, + CURLCLOSEPOLICY_CALLBACK, + + CURLCLOSEPOLICY_LAST /* last, never use this */ +} curl_closepolicy; + +#define CURL_GLOBAL_SSL (1<<0) +#define CURL_GLOBAL_WIN32 (1<<1) +#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32) +#define CURL_GLOBAL_NOTHING 0 +#define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL + + +/***************************************************************************** + * Setup defines, protos etc for the sharing stuff. + */ + +/* Different types of locks that a share can aquire */ +typedef enum { + CURL_LOCK_TYPE_NONE = 0, + CURL_LOCK_TYPE_COOKIE = 1<<0, + CURL_LOCK_TYPE_DNS = 1<<1, + CURL_LOCK_TYPE_SSL_SESSION = 2<<1, + CURL_LOCK_TYPE_CONNECT = 2<<2, + CURL_LOCK_TYPE_LAST +} curl_lock_type; + +typedef void (*curl_lock_function)(CURL *, curl_lock_type, void *); +typedef void (*curl_unlock_function)(CURL *, curl_lock_type, void *); + +typedef struct { + unsigned int specifier; + unsigned int locked; + unsigned int dirty; + + curl_lock_function lockfunc; + curl_unlock_function unlockfunc; + void *clientdata; +} curl_share; + +curl_share *curl_share_init (void); +CURLcode curl_share_setopt (curl_share *, curl_lock_type, int); +CURLcode curl_share_set_lock_function (curl_share *, curl_lock_function); +CURLcode curl_share_set_unlock_function (curl_share *, curl_unlock_function); +CURLcode curl_share_set_lock_data (curl_share *, void *); +CURLcode curl_share_destroy (curl_share *); + +/**************************************************************************** + * Structures for querying information about the curl library at runtime. + */ + +typedef enum { + CURLVERSION_FIRST, + CURLVERSION_LAST /* never actually use this */ +} CURLversion; + +/* The 'CURLVERSION_NOW' is the symbolic name meant to be used by + basicly all programs ever, that want to get version information. It is + meant to be a built-in version number for what kind of struct the caller + expects. If the struct ever changes, we redfine the NOW to another enum + from above. */ +#define CURLVERSION_NOW CURLVERSION_FIRST + +typedef struct { + CURLversion age; /* age of the returned struct */ + const char *version; /* LIBCURL_VERSION */ + unsigned int version_num; /* LIBCURL_VERSION_NUM */ + const char *host; /* OS/host/cpu/machine when configured */ + int features; /* bitmask, see defines below */ + char *ssl_version; /* human readable string */ + long ssl_version_num; /* number */ + const char *libz_version; /* human readable string */ + /* protocols is terminated by an entry with a NULL protoname */ + const char **protocols; +} curl_version_info_data; + +#define CURL_VERSION_IPV6 (1<<0) +#define CURL_VERSION_KERBEROS4 (1<<1) +#define CURL_VERSION_SSL (1<<2) +#define CURL_VERSION_LIBZ (1<<3) + +/* returns a pointer to a static copy of the version info struct */ +curl_version_info_data *curl_version_info(CURLversion); + +#ifdef __cplusplus +} +#endif + +#endif /* __CURL_CURL_H */ diff --git a/include/curl/easy.h b/include/curl/easy.h new file mode 100644 index 0000000..42a2264 --- /dev/null +++ b/include/curl/easy.h @@ -0,0 +1,68 @@ +#ifndef __CURL_EASY_H +#define __CURL_EASY_H +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 1998 - 2002, Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at http://curl.haxx.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + * $Id: easy.h,v 1.7 2002/09/03 11:53:00 bagder Exp $ + ***************************************************************************/ +#ifdef __cplusplus +extern "C" { +#endif + +CURL *curl_easy_init(void); +CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...); +CURLcode curl_easy_perform(CURL *curl); +void curl_easy_cleanup(CURL *curl); + +/* + * NAME curl_easy_getinfo() + * + * DESCRIPTION + * + * Request internal information from the curl session with this function. The + * third argument MUST be a pointer to a long, a pointer to a char * or a + * pointer to a double (as the documentation describes elsewhere). The data + * pointed to will be filled in accordingly and can be relied upon only if the + * function returns CURLE_OK. This function is intended to get used *AFTER* a + * performed transfer, all results from this function are undefined until the + * transfer is completed. + */ +CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...); + + +/* + * NAME curl_easy_duphandle() + * + * DESCRIPTION + * + * Creates a new curl session handle with the same options set for the handle + * passed in. Duplicating a handle could only be a matter of cloning data and + * options, internal state info and things like persistant connections cannot + * be transfered. It is useful in multithreaded applications when you can run + * curl_easy_duphandle() for each new thread to avoid a series of identical + * curl_easy_setopt() invokes in every thread. + */ +CURL* curl_easy_duphandle(CURL *curl); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/curl/mprintf.h b/include/curl/mprintf.h new file mode 100644 index 0000000..4017f67 --- /dev/null +++ b/include/curl/mprintf.h @@ -0,0 +1,83 @@ +/************************************************************************* + * + * $Id: mprintf.h,v 1.6 2001/08/15 18:17:14 bagder Exp $ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND + * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER. + * + ************************************************************************* + * + * Preliminary documentation + * + * printf conversions: + * + * conversion ::= '%%' | '%' [position] ( number | float | string ) + * position ::= digits '$' + * number ::= [number-flags] ( 'd' | 'i' | 'o' | 'x' | 'X' | 'u') + * number-flags ::= 'h' | 'l' | 'L' ... + * float ::= [float-flags] ( 'f' | 'e' | 'E' | 'g' | 'G' ) + * string ::= [string-flags] 's' + * string-flags ::= padding | '#' + * digits ::= (digit)+ + * digit ::= 0-9 + * + * c + * p + * n + * + * qualifiers + * + * - : left adjustment + * + : show sign + * SPACE : padding + * # : alterative + * . : precision + * * : width + * 0 : padding / size + * 1-9 : size + * h : short + * l : long + * ll : longlong + * L : long double + * Z : long / longlong + * q : longlong + * + ************************************************************************/ + +#ifndef H_MPRINTF +#define H_MPRINTF + +#include +#include /* needed for FILE */ + +int curl_mprintf(const char *format, ...); +int curl_mfprintf(FILE *fd, const char *format, ...); +int curl_msprintf(char *buffer, const char *format, ...); +int curl_msnprintf(char *buffer, size_t maxlength, const char *format, ...); +int curl_mvprintf(const char *format, va_list args); +int curl_mvfprintf(FILE *fd, const char *format, va_list args); +int curl_mvsprintf(char *buffer, const char *format, va_list args); +int curl_mvsnprintf(char *buffer, size_t maxlength, const char *format, va_list args); +char *curl_maprintf(const char *format, ...); +char *curl_mvaprintf(const char *format, va_list args); + +#ifdef _MPRINTF_REPLACE +# define printf curl_mprintf +# define fprintf curl_mfprintf +# define sprintf curl_msprintf +# define snprintf curl_msnprintf +# define vprintf curl_mvprintf +# define vfprintf curl_mvfprintf +# define vsprintf curl_mvsprintf +# define vsnprintf curl_mvsnprintf +# define aprintf curl_maprintf +# define vaprintf curl_mvaprintf +#endif + +#endif /* H_MPRINTF */ diff --git a/include/curl/multi.h b/include/curl/multi.h new file mode 100644 index 0000000..e5b2a72 --- /dev/null +++ b/include/curl/multi.h @@ -0,0 +1,190 @@ +#ifndef __CURL_MULTI_H +#define __CURL_MULTI_H +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 1998 - 2002, Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at http://curl.haxx.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + * $Id: multi.h,v 1.4 2002/09/03 11:53:00 bagder Exp $ + ***************************************************************************/ +/* + This is meant to be the "external" header file. Don't give away any + internals here! + + This document presents a mixture of ideas from at least: + - Daniel Stenberg + - Steve Dekorte + - Sterling Hughes + - Ben Greear + + ------------------------------------------- + GOALS + + o Enable a "pull" interface. The application that uses libcurl decides where + and when to ask libcurl to get/send data. + + o Enable multiple simultaneous transfers in the same thread without making it + complicated for the application. + + o Enable the application to select() on its own file descriptors and curl's + file descriptors simultaneous easily. + + Example sources using this interface is here: ../multi/ + +*/ + +#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) +#include +#else +#include +#include +#endif + +#include "curl.h" + +typedef void CURLM; + +typedef enum { + CURLM_CALL_MULTI_PERFORM=-1, /* please call curl_multi_perform() soon */ + CURLM_OK, + CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */ + CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */ + CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */ + CURLM_INTERNAL_ERROR, /* this is a libcurl bug */ + CURLM_LAST +} CURLMcode; + +typedef enum { + CURLMSG_NONE, /* first, not used */ + CURLMSG_DONE, /* This easy handle has completed. 'whatever' points to + the CURLcode of the transfer */ + CURLMSG_LAST /* last, not used */ +} CURLMSG; + +struct CURLMsg { + CURLMSG msg; /* what this message means */ + CURL *easy_handle; /* the handle it concerns */ + union { + void *whatever; /* message-specific data */ + CURLcode result; /* return code for transfer */ + } data; +}; +typedef struct CURLMsg CURLMsg; + +/* + * Name: curl_multi_init() + * + * Desc: inititalize multi-style curl usage + * Returns: a new CURLM handle to use in all 'curl_multi' functions. + */ +CURLM *curl_multi_init(void); + +/* + * Name: curl_multi_add_handle() + * + * Desc: add a standard curl handle to the multi stack + * Returns: CURLMcode type, general multi error code. + */ +CURLMcode curl_multi_add_handle(CURLM *multi_handle, + CURL *curl_handle); + + /* + * Name: curl_multi_remove_handle() + * + * Desc: removes a curl handle from the multi stack again + * Returns: CURLMcode type, general multi error code. + */ +CURLMcode curl_multi_remove_handle(CURLM *multi_handle, + CURL *curl_handle); + + /* + * Name: curl_multi_fdset() + * + * Desc: Ask curl for its fd_set sets. The app can use these to select() or + * poll() on. We want curl_multi_perform() called as soon as one of + * them are ready. + * Returns: CURLMcode type, general multi error code. + */ +CURLMcode curl_multi_fdset(CURLM *multi_handle, + fd_set *read_fd_set, + fd_set *write_fd_set, + fd_set *exc_fd_set, + int *max_fd); + + /* + * Name: curl_multi_perform() + * + * Desc: When the app thinks there's data available for curl it calls this + * function to read/write whatever there is right now. This returns + * as soon as the reads and writes are done. This function does not + * require that there actually is data available for reading or that + * data can be written, it can be called just in case. It returns + * the number of handles that still transfer data in the second + * argument's integer-pointer. + * + * Returns: CURLMcode type, general multi error code. *NOTE* that this only + * returns errors etc regarding the whole multi stack. There might + * still have occurred problems on invidual transfers even when this + * returns OK. + */ +CURLMcode curl_multi_perform(CURLM *multi_handle, + int *running_handles); + + /* + * Name: curl_multi_cleanup() + * + * Desc: Cleans up and removes a whole multi stack. It does not free or + * touch any individual easy handles in any way. We need to define + * in what state those handles will be if this function is called + * in the middle of a transfer. + * Returns: CURLMcode type, general multi error code. + */ +CURLMcode curl_multi_cleanup(CURLM *multi_handle); + +/* + * Name: curl_multi_info_read() + * + * Desc: Ask the multi handle if there's any messages/informationals from + * the individual transfers. Messages include informationals such as + * error code from the transfer or just the fact that a transfer is + * completed. More details on these should be written down as well. + * + * Repeated calls to this function will return a new struct each + * time, until a special "end of msgs" struct is returned as a signal + * that there is no more to get at this point. + * + * The data the returned pointer points to will not survive calling + * curl_multi_cleanup(). + * + * The 'CURLMsg' struct is meant to be very simple and only contain + * very basic informations. If more involved information is wanted, + * we will provide the particular "transfer handle" in that struct + * and that should/could/would be used in subsequent + * curl_easy_getinfo() calls (or similar). The point being that we + * must never expose complex structs to applications, as then we'll + * undoubtably get backwards compatibility problems in the future. + * + * Returns: A pointer to a filled-in struct, or NULL if it failed or ran out + * of structs. It also writes the number of messages left in the + * queue (after this read) in the integer the second argument points + * to. + */ +CURLMsg *curl_multi_info_read(CURLM *multi_handle, + int *msgs_in_queue); + +#endif diff --git a/include/curl/stdcheaders.h b/include/curl/stdcheaders.h new file mode 100644 index 0000000..1b9e9fa --- /dev/null +++ b/include/curl/stdcheaders.h @@ -0,0 +1,36 @@ +#ifndef __STDC_HEADERS_H +#define __STDC_HEADERS_H +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 1998 - 2002, Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at http://curl.haxx.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + * $Id: stdcheaders.h,v 1.5 2002/09/03 11:53:00 bagder Exp $ + ***************************************************************************/ + +#ifdef HAVE_SYS_TYPES_H +#include +#endif + +size_t fread (void *, size_t, size_t, FILE *); +size_t fwrite (const void *, size_t, size_t, FILE *); + +int strcasecmp(const char *, const char *); +int strncasecmp(const char *, const char *, size_t); + +#endif diff --git a/include/curl/types.h b/include/curl/types.h new file mode 100644 index 0000000..d762de8 --- /dev/null +++ b/include/curl/types.h @@ -0,0 +1,28 @@ +#ifndef __CURL_TYPES_H +#define __CURL_TYPES_H +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 1998 - 2002, Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at http://curl.haxx.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + * $Id: types.h,v 1.5 2002/09/03 11:53:00 bagder Exp $ + ***************************************************************************/ +typedef void CURL; +typedef void CURLconnect; + +#endif /* __CURL_TYPES_H */ diff --git a/include/libclv/ColorTools.h b/include/libclv/ColorTools.h new file mode 100644 index 0000000..ad23154 --- /dev/null +++ b/include/libclv/ColorTools.h @@ -0,0 +1,69 @@ +/******************************************************************************* +/ +/ File: ColorTools.h +/ +/ Description: Additional experimental color manipulation functions. +/ +/ Copyright 2000, Be Incorporated, All Rights Reserved +/ +*******************************************************************************/ + + +#ifndef _COLOR_TOOLS_H +#define _COLOR_TOOLS_H + +#include + +#if B_BEOS_VERSION <= B_BEOS_VERSION_MAUI + +namespace BExperimental { + +// Comparison operators. + +inline bool operator==(const rgb_color c1, const rgb_color c2) +{ + return (*((uint32*)&c1)) == (*((uint32*)&c2)); +} + +inline bool operator!=(const rgb_color c1, const rgb_color c2) +{ + return (*((uint32*)&c1)) != (*((uint32*)&c2)); +} + +// Color creation. +/* +inline rgb_color make_color(uint8 red, uint8 green, uint8 blue, uint8 alpha=255) +{ + rgb_color c; + c.red = red; + c.green = green; + c.blue = blue; + c.alpha = alpha; + return c; +}*/ + +// Mix two colors together, ignoring their relative alpha channels. +// If amount is 0, the result is color1; if 255, the result is color2; +// if another value, it is somewhere in-between. The resulting alpha +// channel is mixed exactly like the other color channels. +rgb_color mix_color(rgb_color color1, rgb_color color2, uint8 amount); + +// Blend two colors together, weighting by their relative alpha channels. +// The resulting color is the same as mix_color(), except that the amount +// used from color1 and color2's color channels is dependent on that color's +// alpha channel. For example, if color1.alpha is 0 and color2.alpha is +// 255, the resulting red, green, and blue values will be the same as those +// in color2, regardless of 'amount'. +rgb_color blend_color(rgb_color color1, rgb_color color2, uint8 amount); + +// Return a color that is the disabled representation of 'color' when drawn +// on a solid color 'background'. +rgb_color disable_color(rgb_color color, rgb_color background); + +} // namespace BExperimental + +using namespace BExperimental; + +#endif + +#endif diff --git a/include/libclv/ColumnListView.h b/include/libclv/ColumnListView.h new file mode 100644 index 0000000..6df9d99 --- /dev/null +++ b/include/libclv/ColumnListView.h @@ -0,0 +1,343 @@ +/******************************************************************************* +/ +/ File: ColumnListView.h +/ +/ Description: Experimental multi-column list view. +/ +/ Copyright 2000+, Be Incorporated, All Rights Reserved +/ +*******************************************************************************/ + + +#ifndef _COLUMN_LIST_VIEW_H +#define _COLUMN_LIST_VIEW_H + +#include +#include +#include +#include +#include + +class BScrollBar; + +namespace BPrivate { + +class OutlineView; +class TitleView; +class BRowContainer; +class RecursiveOutlineIterator; + +} // ns BPrivate + +class BField; +class BRow; +class BColumn; +class BColumnListView; + +enum LatchType { + B_NO_LATCH, + B_OPEN_LATCH, + B_PRESSED_LATCH, + B_CLOSED_LATCH +}; + +typedef enum { + B_ALLOW_COLUMN_NONE = 0, + B_ALLOW_COLUMN_MOVE = 1, + B_ALLOW_COLUMN_RESIZE = 2, + B_ALLOW_COLUMN_POPUP = 4, + B_ALLOW_COLUMN_REMOVE = 8, +} column_flags; + +enum ColumnListViewColor { + B_COLOR_BACKGROUND = 0, + B_COLOR_TEXT = 1, + B_COLOR_ROW_DIVIDER = 2, + B_COLOR_SELECTION = 3, + B_COLOR_SELECTION_TEXT = 4, + B_COLOR_NON_FOCUS_SELECTION = 5, + B_COLOR_EDIT_BACKGROUND = 6, + B_COLOR_EDIT_TEXT = 7, + B_COLOR_HEADER_BACKGROUND = 8, + B_COLOR_HEADER_TEXT = 9, + B_COLOR_SEPARATOR_LINE = 10, + B_COLOR_SEPARATOR_BORDER = 11, + + B_COLOR_TOTAL = 12 +}; + +enum ColumnListViewFont { + B_FONT_ROW = 0, + B_FONT_HEADER = 1, + + B_FONT_TOTAL = 2 +}; + + +// A single row/column intersection in the list. +class BField { +public: + BField(); + virtual ~BField(); +}; + +// A single line in the list. Each line contains a BField object +// for each column in the list, associated by their "logical field" +// index. Hierarchies are formed by adding other BRow objects as +// a parent of a row, using the AddRow() function in BColumnListView(). +class BRow { +public: + BRow(float height = 16.0); + virtual ~BRow(); + virtual bool HasLatch() const; + + int32 CountFields() const; + BField* GetField(int32 logicalFieldIndex); + const BField* GetField(int32 logicalFieldIndex) const; + void SetField(BField* field, int32 logicalFieldIndex); + + float Height() const; + void SetHeight(float h){fHeight=h;}; + bool IsExpanded() const; + + virtual void DrawBackground( + BRect /*_rect*/, + BView* /*_target_view*/, + bool /*_is_selected*/, + bool /*_is_focus */){} +private: + // Blows up into the debugger if the validation fails. + void ValidateFields() const; + void ValidateField(const BField *field, int32 logicalFieldIndex) const; +private: + BList fFields; + BPrivate:: + BRowContainer* fChildList; + bool fIsExpanded; + float fHeight; + BRow* fNextSelected; + BRow* fPrevSelected; + BRow* fParent; +protected: + BColumnListView* fList; +private: + + friend class BColumnListView; + friend class BPrivate::RecursiveOutlineIterator; + friend class BPrivate::OutlineView; +}; + +// Information about a single column in the list. A column knows +// how to display the BField objects that occur at its location in +// each of the list's rows. See ColumnTypes.h for particular +// subclasses of BField and BColumn that handle common data types. +class BColumn +{ +public: + BColumn(float width, + float minWidth, + float maxWidth, + alignment align = B_ALIGN_LEFT); + virtual ~BColumn(); + + float Width() const; + void SetWidth(float width); + float MinWidth() const; + float MaxWidth() const; + + virtual void DrawTitle(BRect rect, BView *targetView); + virtual void DrawField(BField *field, BRect rect, BView *targetView); + virtual int CompareFields(BField *field1, BField *field2); + + virtual void MouseMoved(BColumnListView *parent, BRow *row, BField *field, + BRect field_rect, BPoint point, uint32 buttons, int32 code); + virtual void MouseDown(BColumnListView *parent, BRow *row, BField *field, + BRect field_rect, BPoint point, uint32 buttons); + virtual void MouseUp(BColumnListView *parent, BRow *row, BField *field); + + virtual void GetColumnName(BString* into) const; + + bool IsVisible() const; + void SetVisible(bool); + + bool WantsEvents() const; + void SetWantsEvents(bool); + + bool ShowHeading() const; + void SetShowHeading(bool); + + alignment Alignment() const; + void SetAlignment(alignment); + + int32 LogicalFieldNum() const; + + /*! + \param field The BField derivative to validate. + + Implement this function on your BColumn derivatives to validate BField derivatives + that your BColumn will be drawing/manipulating. + + This function will be called when BFields are added to the Column, use dynamic_cast<> to + determine if it is of a kind that your BColumn know how ot handle. return false if it is not. + + \note The debugger will be called if you return false from here with information about + what type of BField and BColumn and the logical field index where it occured. + + \note Do not call the inherited version of this, it just returns true; + */ + virtual bool AcceptsField(const BField* field) const; + +private: + float fWidth; + float fMinWidth; + float fMaxWidth; + bool fVisible; + int32 fFieldID; + BColumnListView *fList; + bool fSortAscending; + bool fWantsEvents; + bool fShowHeading; + alignment fAlignment; + + friend class BPrivate::OutlineView; + friend class BColumnListView; + friend class BPrivate::TitleView; +}; + +// The column list view class. +class BColumnListView : public BView, public BInvoker +{ +public: + BColumnListView(BRect rect, + const char *name, + uint32 resizingMode, + uint32 drawFlags, + border_style = B_NO_BORDER, + bool showHorizontalScrollbar = true); + virtual ~BColumnListView(); + + // Interaction + virtual bool InitiateDrag(BPoint, bool wasSelected); + virtual void MessageDropped(BMessage*, BPoint point); + virtual void ExpandOrCollapse(BRow *row, bool expand); + virtual status_t Invoke(BMessage *message = NULL); + virtual void ItemInvoked(); + virtual void SetInvocationMessage(BMessage*); + BMessage* InvocationMessage() const; + uint32 InvocationCommand() const; + BRow* FocusRow() const; + void SetFocusRow(int32 index, bool select=false); + void SetFocusRow(BRow *row, bool select=false); + void SetMouseTrackingEnabled(bool); + + // Selection + list_view_type SelectionMode() const; + void Deselect(BRow *row); + void AddToSelection(BRow *row); + void DeselectAll(); + BRow* CurrentSelection(BRow *lastSelected = 0) const; + virtual void SelectionChanged(); + virtual void SetSelectionMessage(BMessage *); + BMessage* SelectionMessage(); + uint32 SelectionCommand() const; + void SetSelectionMode(list_view_type); // list_view_type is defined in ListView.h. + + // Sorting + void SetSortingEnabled(bool); + bool SortingEnabled() const; + void SetSortColumn(BColumn *column, bool add, bool ascending); + void ClearSortColumns(); + + // The status view is a little area in the lower left hand corner. + void AddStatusView(BView *view); + BView* RemoveStatusView(); + + // Column Manipulation + void AddColumn(BColumn*, int32 logicalFieldIndex); + void MoveColumn(BColumn*, int32 index); + void RemoveColumn(BColumn*); + int32 CountColumns() const; + BColumn* ColumnAt(int32 index) const; + void SetColumnVisible(BColumn*, bool isVisible); + void SetColumnVisible(int32, bool); + bool IsColumnVisible(int32) const; + void SetColumnFlags(column_flags flags); + + // Row manipulation + const BRow* RowAt(int32 index, BRow *parent = 0) const; + BRow* RowAt(int32 index, BRow *parent = 0); + const BRow* RowAt(BPoint) const; + BRow* RowAt(BPoint); + bool GetRowRect(const BRow *row, BRect *outRect) const; + bool FindParent(BRow *row, BRow **outs_parent, bool *out_isVisible) const; + int32 IndexOf(BRow *row); + int32 CountRows(BRow *parent = 0) const; + void AddRow(BRow*, BRow *parent = 0); + void AddRow(BRow*, int32 index, BRow *parent = 0); + + void ScrollTo(const BRow* Row); + + // Does not delete row or children at this time. + // todo: Make delete row and children + void RemoveRow(BRow*); + + void UpdateRow(BRow*); + void Clear(); + + // Appearance (DEPRECATED) + void GetFont(BFont* font) const {BView::GetFont(font);} + virtual void SetFont(const BFont *font, uint32 mask = B_FONT_ALL); + virtual void SetHighColor(rgb_color); + void SetSelectionColor(rgb_color); + void SetBackgroundColor(rgb_color); + void SetEditColor(rgb_color); + const rgb_color SelectionColor() const; + const rgb_color BackgroundColor() const; + const rgb_color EditColor() const; + + // Appearance (NEW STYLE) + void SetColor(ColumnListViewColor color_num, rgb_color color); + void SetFont(ColumnListViewFont font_num, const BFont* font, uint32 mask = B_FONT_ALL); + rgb_color Color(ColumnListViewColor color_num) const; + void GetFont(ColumnListViewFont font_num, BFont* font) const; + + BPoint SuggestTextPosition(const BRow* row, const BColumn* column=NULL) const; + + void SetLatchWidth(float width); + float LatchWidth() const; + virtual void DrawLatch(BView*, BRect, LatchType, BRow*); + virtual void MakeFocus(bool isfocus = true); + void SaveState(BMessage *msg); + void LoadState(BMessage *msg); + + BView* ScrollView() const { return (BView *)fOutlineView; } + void SetEditMode(bool state); + void Refresh(); + BView* GetScrollView(){ return (BView*)fOutlineView;} + BView* GetTitleView(){ return (BView*)fTitleView;} +protected: + virtual void MessageReceived(BMessage *message); + virtual void KeyDown(const char *bytes, int32 numBytes); + virtual void AttachedToWindow(); + virtual void WindowActivated(bool active); + virtual void Draw(BRect); + + + + +private: + rgb_color fColorList[B_COLOR_TOTAL]; + BPrivate::TitleView* fTitleView; + BPrivate::OutlineView* fOutlineView; + BList fColumns; + BScrollBar* fHorizontalScrollBar; + BScrollBar* fVerticalScrollBar; + BList fSortColumns; + BView* fStatusView; + BMessage* fSelectionMessage; + bool fSortingEnabled; + float fLatchWidth; + border_style fBorderStyle; +}; + +#endif diff --git a/include/libclv/ColumnTypes.h b/include/libclv/ColumnTypes.h new file mode 100644 index 0000000..9a02beb --- /dev/null +++ b/include/libclv/ColumnTypes.h @@ -0,0 +1,254 @@ +/******************************************************************************* +/ +/ File: ColumnTypes.h +/ +/ Description: Experimental classes that implement particular column/field +/ data types for use in BColumnListView. +/ +/ Copyright 2000+, Be Incorporated, All Rights Reserved +/ +*******************************************************************************/ + + +#ifndef _COLUMN_TYPES_H +#define _COLUMN_TYPES_H + +#include "ColumnListView.h" +#include +#include +#include + + +//===================================================================== +// Common base-class: a column that draws a standard title at its top. + +class BTitledColumn : public BColumn +{ + public: + BTitledColumn (const char *title, + float width, + float minWidth, + float maxWidth, + alignment align = B_ALIGN_LEFT); + virtual void DrawTitle (BRect rect, + BView* parent); + virtual void GetColumnName (BString* into) const; + + void DrawString (const char*, + BView*, + BRect); + void SetTitle (const char* title); + void Title (BString* forTitle) const; // sets the BString arg to be the title + float FontHeight () const; + + private: + float fFontHeight; + BString fTitle; +}; + + +//===================================================================== +// Field and column classes for strings. + +class BStringField : public BField +{ + public: + BStringField (const char* string); + + void SetString (const char* string); + const char* String () const; + void SetClippedString (const char* string); + const char* ClippedString (); + void SetWidth (float); + float Width (); + + private: + float fWidth; + BString fString; + BString fClippedString; +}; + + +//-------------------------------------------------------------------- + +class BStringColumn : public BTitledColumn +{ + public: + BStringColumn (const char *title, + float width, + float maxWidth, + float minWidth, + uint32 truncate, + alignment align = B_ALIGN_LEFT); + virtual void DrawField (BField* field, + BRect rect, + BView* parent); + virtual int CompareFields (BField* field1, + BField* field2); + virtual bool AcceptsField (const BField* field) const; + + private: + uint32 fTruncate; +}; + + +//===================================================================== +// Field and column classes for dates. + +class BDateField : public BField +{ + public: + BDateField (time_t* t); + void SetWidth (float); + float Width (); + void SetClippedString (const char*); + const char* ClippedString (); + time_t Seconds (); + time_t UnixTime (); + + private: + struct tm fTime; + time_t fUnixTime; + time_t fSeconds; + BString fClippedString; + float fWidth; +}; + + +//-------------------------------------------------------------------- + +class BDateColumn : public BTitledColumn +{ + public: + BDateColumn (const char* title, + float width, + float minWidth, + float maxWidth, + alignment align = B_ALIGN_LEFT); + virtual void DrawField (BField* field, + BRect rect, + BView* parent); + virtual int CompareFields (BField* field1, + BField* field2); + private: + BString fTitle; +}; + + +//===================================================================== +// Field and column classes for numeric sizes. + +class BSizeField : public BField +{ + public: + BSizeField (off_t size); + void SetSize (off_t); + off_t Size (); + + private: + off_t fSize; +}; + + +//-------------------------------------------------------------------- + +class BSizeColumn : public BTitledColumn +{ + public: + BSizeColumn (const char* title, + float width, + float minWidth, + float maxWidth, + alignment align = B_ALIGN_LEFT); + virtual void DrawField (BField* field, + BRect rect, + BView* parent); + virtual int CompareFields (BField* field1, + BField* field2); +}; + + +//===================================================================== +// Field and column classes for integers. + +class BIntegerField : public BField +{ + public: + BIntegerField (int32 number); + void SetValue (int32); + int32 Value (); + + private: + int32 fInteger; +}; + + +//-------------------------------------------------------------------- + +class BIntegerColumn : public BTitledColumn +{ + public: + BIntegerColumn (const char* title, + float width, + float minWidth, + float maxWidth, + alignment align = B_ALIGN_LEFT); + virtual void DrawField (BField* field, + BRect rect, + BView* parent); + virtual int CompareFields (BField* field1, + BField* field2); +}; + + +//===================================================================== +// Field and column classes for bitmaps + +class BBitmapField : public BField +{ + public: + BBitmapField (BBitmap* bitmap); + const BBitmap* Bitmap (); + void SetBitmap (BBitmap* bitmap); + + private: + BBitmap* fBitmap; +}; + + +//-------------------------------------------------------------------- + +class BBitmapColumn : public BTitledColumn +{ + public: + BBitmapColumn (const char* title, + float width, + float minWidth, + float maxWidth, + alignment align = B_ALIGN_LEFT); + virtual void DrawField (BField*field, + BRect rect, + BView* parent); + virtual int CompareFields (BField* field1, BField* field2); + virtual bool AcceptsField (const BField* field) const; +}; + + +//===================================================================== +// Column to display BIntegerField objects as a graph. + +class GraphColumn : public BIntegerColumn +{ + public: + GraphColumn (const char* name, + float width, + float minWidth, + float maxWidth, + alignment align = B_ALIGN_LEFT); + virtual void DrawField (BField*field, + BRect rect, + BView* parent); +}; + +#endif + diff --git a/include/libfish/HelpViewer.h b/include/libfish/HelpViewer.h new file mode 100644 index 0000000..2776013 --- /dev/null +++ b/include/libfish/HelpViewer.h @@ -0,0 +1,60 @@ +#ifndef HelpViewer_H_ +#define HelpViewer_H_ + +#include + +//#include "KeyMap.h" +#include +#include "libxml/tree.h" +#include "libxml/xpath.h" +#include "libxml/xpathInternals.h" +#include "libxml/parserInternals.h" +#include "libxml/debugXML.h" + +class HDoc; + +#define HELPVIEWER_OPEN_URL 'opur' +#define HELPVIEWER_GOTO 'goto' + +class HelpViewer : public BView { + + public: + HelpViewer(BRect r); + virtual ~HelpViewer(); + + void LoadFile(const char* file); + void ParsePage(xmlNodePtr node); + + void SetPage(uint); + int CountPage(); + + void SetForeColor(rgb_color c); + void SetBackColor(rgb_color c); + + void SetOpenUrlHandler(BHandler* hand); + void SetGotoHandler(BHandler* hand); + + void MessageReceived(BMessage* msg); + void SearchSetPage(BString id); + + void AttachedToWindow(); + + private: + + + void RecalcScrollbar(); + void findAttribute(xmlNodePtr node,BMessage*); + + + + //KeyMap fPages; + BObjectList fPages; + int16 Selected; + + rgb_color foreColor; + rgb_color backColor; + BHandler *fGotoHand; + +}; +#endif +// -- diff --git a/include/libfunky/Colors.h b/include/libfunky/Colors.h new file mode 100644 index 0000000..42a582f --- /dev/null +++ b/include/libfunky/Colors.h @@ -0,0 +1,53 @@ +//Useful until be gets around to making these sorts of things +//globals akin to be_plain_font, etc. + + +#ifndef _SGB_COLORS_H_ +#define _SGB_COLORS_H_ + + +//****************************************************************************************************** +//**** SYSTEM HEADER FILES +//****************************************************************************************************** +#include + + +//****************************************************************************************************** +//**** CONSTANT DEFINITIONS +//****************************************************************************************************** +//Be standard UI colors +const rgb_color BeBackgroundGrey = {216,216,216, 255}; +const rgb_color BeInactiveControlGrey = {240,240,240, 255}; +const rgb_color BeFocusBlue = {0, 0, 229, 255}; +const rgb_color BeHighlight = {255,255,255, 255}; +const rgb_color BeShadow = {152,152,152, 255}; +const rgb_color BeDarkShadow = {108,108,108, 255}; +const rgb_color BeLightShadow = {194,194,194, 255}; +const rgb_color BeButtonGrey = {232,232,232, 255}; +const rgb_color BeInactiveGrey = {127,127,127, 255}; +const rgb_color BeListSelectGrey = {178,178,178, 255}; +const rgb_color BeTitleBarYellow = {255,203,0, 255}; + +//Other colors +const rgb_color Black = {0, 0, 0, 255}; +const rgb_color White = {255,255,255, 255}; +const rgb_color Red = {255,0, 0, 255}; +const rgb_color Green = {0, 167,0, 255}; +const rgb_color LightGreen = {90, 240,90, 255}; +const rgb_color Blue = {49, 61, 225, 255}; +const rgb_color LightBlue = {64, 162,255, 255}; +const rgb_color Purple = {144,64, 221, 255}; +const rgb_color LightPurple = {166,74, 255, 255}; +const rgb_color Lavender = {193,122,255, 255}; +const rgb_color Yellow = {255,203,0, 255}; +const rgb_color Orange = {255,163,0, 255}; +const rgb_color Flesh = {255,231,186, 255}; +const rgb_color Tan = {208,182,121, 255}; +const rgb_color Brown = {154,110,45, 255}; +const rgb_color Grey = {200,200,200, 255}; +const rgb_color LightMetallicBlue = {143,166,240, 255}; +const rgb_color MedMetallicBlue = {75, 96, 154, 255}; +const rgb_color DarkMetallicBlue = {78, 89, 126, 255}; + + +#endif diff --git a/include/libfunky/ImageCache.h b/include/libfunky/ImageCache.h new file mode 100644 index 0000000..47c28d1 --- /dev/null +++ b/include/libfunky/ImageCache.h @@ -0,0 +1,52 @@ +#ifndef ImageCache_H +#define ImageCache_H + + /** + * ImageCache. + * @author Andrea Anzani. + */ + +class BBitmap; + +#include +#include +#include "KeyMap.h" + +class ImageCache +{ + +protected: // Constructor/Destructor + + ImageCache(); + + ~ImageCache(); + +public: // Operations + + /** Returns the image corresponding to the which constant */ + static BBitmap * GetImage( BString which ,BString name); + + + static void AddImage(BString name,BBitmap* which); + static void DeleteImage(BString name); + + /** Frees the singleton instance of the cache; + Call this when app quits + */ + static void Release(); + +private: + + static BBitmap * LoadImage( const char *resourceName,const char *); + // Class Data + + static ImageCache * m_instance; + +private: // Instance Data + + + KeyMap m_bitmaps; + +}; + +#endif /* __C_ImageCache_H__ */ diff --git a/include/libfunky/KeyMap.h b/include/libfunky/KeyMap.h new file mode 100644 index 0000000..0406536 --- /dev/null +++ b/include/libfunky/KeyMap.h @@ -0,0 +1,207 @@ +#ifndef __Keymap_h__ +#define __Keymap_h__ + +#include +#include + +using namespace std; + +template +class KeyMap +{ +public: + + bool AddItem( T1 const & key, T2 const & value); + bool RemoveItemFor( T1 const & key); + + T2 ValueFor(T1 key,bool* found = NULL); + T2 ValueAt(int32 position); + + T1 KeyAt(int32 position); + void RemoveItemAt(int32 position); + + uint32 CountItems(); + + void PrintToStream(); + bool MakeEmpty(); + bool IsEmpty(); + +private: + + bool getValue( T1 const & key, T2 *value); //returns value + bool getIndex( T2 const & value, T1 *key ); //returns key + + bool getFirst( T1 *key, T2 *value ); + bool getNext( T1 *key, T2 *value ); + + typename std::map::iterator begin(); + typename std::map::iterator end(); + + std::map m_Map; + typename std::map::iterator m_pPos; +}; + +template +bool KeyMap::AddItem( T1 const & key, T2 const & value) +{ + + std::pair::iterator,bool> result = m_Map.insert( make_pair(key, value) ); + if (!result.second) { + return false; + } + + return true; +} + +template +bool KeyMap::RemoveItemFor( T1 const & key ) +{ + m_Map.erase( key ); + return true; +} + +template +bool KeyMap::IsEmpty() +{ + return m_Map.empty(); +} + + +template +bool KeyMap::MakeEmpty() +{ + m_Map.clear(); + return true; +} + + + +template +bool KeyMap::getIndex( T2 const & value, T1 *key ) +{ + //do something with all elements having a certain value + typename std::map::iterator pos; + for (pos = m_Map.begin(); pos != m_Map.end(); ++pos) { + if (pos->second == value) { + *key = (pos->first); + return true; + } + } + return false; +} + +template +bool KeyMap::getFirst( T1 *key, T2 *value ) +{ + if (m_Map.empty() ) { + return false; + } + //do something with all elements having a certain value + typename std::map::iterator pos; + m_pPos= m_Map.begin(); + *key = m_pPos->first; + *value= m_pPos->second; + return true; +} + +template +bool KeyMap::getNext( T1 *key, T2 *value ) +{ + if ( m_Map.empty() ) { + return false; + } + if ( ++m_pPos == m_Map.end() ) { + return false; + } + *key = m_pPos->first; + *value= m_pPos->second; + return true; +} + +template +bool KeyMap::getValue(T1 const & key, T2 *value) +{ + typename std::map::iterator pos; + pos = m_Map.find(key); + if (m_Map.end() != pos) { + *value = pos->second; + return true; + } + return false; +} + +template +T2 KeyMap::ValueFor(T1 key, bool* found) +{ + T2 pointer; + if (found) + { + *found = getValue(key, &pointer); + return ((*found) ? pointer : NULL); + } + bool f = getValue(key, &pointer); + return (f ? pointer : NULL); +} + +template +T2 KeyMap::ValueAt(int32 position) +{ + typename std::map::iterator i = begin(); + std::advance(i, position); + if(i == end()) + return NULL; + else + return i->second; +} + +template +T1 KeyMap::KeyAt(int32 position) +{ + typename std::map::iterator i = begin(); + std::advance(i, position); + if(i == end()) + return NULL; + else + return i->first; +} + +template +void KeyMap::RemoveItemAt(int32 position) +{ + typename std::map::iterator i = begin(); + std::advance(i, position); + RemoveItemFor(i->first); +} + + +template +uint32 KeyMap::CountItems() +{ + return m_Map.size(); +} + +template +void KeyMap::PrintToStream() +{ + typename std::map::iterator pos; + cout << std::endl << " -- KeyMap::PrintToStream --" << std::endl; + for (pos = m_Map.begin(); pos != m_Map.end(); ++pos) { + cout << pos->first <<" : " << pos->second << std::endl; + } +} + +template +typename std::map::iterator KeyMap::begin() +{ + m_pPos = m_Map.begin(); + return m_pPos; +} + +template +typename std::map::iterator KeyMap::end() +{ + m_pPos = m_Map.end(); + return m_pPos; +} + +#endif // __Keymap_h__ diff --git a/include/libfunky/ObjectList.h b/include/libfunky/ObjectList.h new file mode 100644 index 0000000..bfa1832 --- /dev/null +++ b/include/libfunky/ObjectList.h @@ -0,0 +1,866 @@ +/* +Open Tracker License + +Terms and Conditions + +Copyright (c) 1991-2000, Be Incorporated. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice applies to all licensees +and shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of Be Incorporated shall not be +used in advertising or otherwise to promote the sale, use or other dealings in +this Software without prior written authorization from Be Incorporated. + +Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks +of Be Incorporated in the United States and other countries. Other brand product +names are registered trademarks or trademarks of their respective holders. +All rights reserved. +*/ + +/**************************************************************************** +** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ** +** ** +** DANGER, WILL ROBINSON! ** +** ** +** The interfaces contained here are part of BeOS's ** +** ** +** >> PRIVATE NOT FOR PUBLIC USE << ** +** ** +** implementation. ** +** ** +** These interfaces WILL CHANGE in future releases. ** +** If you use them, your app WILL BREAK at some future time. ** +** ** +** (And yes, this does mean that binaries built from OpenTracker will not ** +** be compatible with some future releases of the OS. When that happens, ** +** we will provide an updated version of this file to keep compatibility.) ** +** ** +** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ** +****************************************************************************/ + +// +// ObjectList is a wrapper around BList that adds type safety, +// optional object ownership, search, insert operations, etc. +// + +#ifndef __OBJECT_LIST__ +#define __OBJECT_LIST__ + +#ifndef _BE_H +#include +#endif + +#include + + +template class BObjectList; + +template +struct UnaryPredicate { + + virtual int operator()(const T *) const + // virtual could be avoided here if FindBinaryInsertionIndex, + // etc. were member template functions + { return 0; } + +private: + static int _unary_predicate_glue(const void *item, void *context); + +friend class BObjectList; +}; + +template +int +UnaryPredicate::_unary_predicate_glue(const void *item, void *context) +{ + return ((UnaryPredicate *)context)->operator()((const T *)item); +} + + +class _PointerList_ : public BList { +public: + _PointerList_(const _PointerList_ &list); + _PointerList_(int32 itemsPerBlock = 20, bool owning = false); + ~_PointerList_(); + + typedef void *(* GenericEachFunction)(void *, void *); + typedef int (* GenericCompareFunction)(const void *, const void *); + typedef int (* GenericCompareFunctionWithState)(const void *, const void *, + void *); + typedef int (* UnaryPredicateGlue)(const void *, void *); + + void *EachElement(GenericEachFunction, void *); + void SortItems(GenericCompareFunction); + void SortItems(GenericCompareFunctionWithState, void *state); + void HSortItems(GenericCompareFunction); + void HSortItems(GenericCompareFunctionWithState, void *state); + + void *BinarySearch(const void *, GenericCompareFunction) const; + void *BinarySearch(const void *, GenericCompareFunctionWithState, void *state) const; + + int32 BinarySearchIndex(const void *, GenericCompareFunction) const; + int32 BinarySearchIndex(const void *, GenericCompareFunctionWithState, void *state) const; + int32 BinarySearchIndexByPredicate(const void *, UnaryPredicateGlue) const; + + bool Owning() const; + bool ReplaceItem(int32, void *); + +protected: + bool owning; + +}; + +template +class BObjectList : private _PointerList_ { +public: + + // iteration and sorting + typedef T *(* EachFunction)(T *, void *); + typedef const T *(* ConstEachFunction)(const T *, void *); + typedef int (* CompareFunction)(const T *, const T *); + typedef int (* CompareFunctionWithState)(const T *, const T *, void *state); + + BObjectList(int32 itemsPerBlock = 20, bool owning = false); + BObjectList(const BObjectList &list); + // clones list; if list is owning, makes copies of all + // the items + + virtual ~BObjectList(); + + BObjectList &operator=(const BObjectList &list); + // clones list; if list is owning, makes copies of all + // the items + + // adding and removing + // ToDo: + // change Add calls to return const item + bool AddItem(T *); + bool AddItem(T *, int32); + bool AddList(BObjectList *); + bool AddList(BObjectList *, int32); + + bool RemoveItem(T *, bool deleteIfOwning = true); + // if owning, deletes the removed item + T *RemoveItemAt(int32); + // returns the removed item + + void MakeEmpty(bool deleteIfOwning = true); + + // item access + T *ItemAt(int32) const; + + bool ReplaceItem(int32 index, T *); + // if list is owning, deletes the item at first + T *SwapWithItem(int32 index, T *newItem); + // same as ReplaceItem, except does not delete old item at , + // returns it instead + + T *FirstItem() const; + T *LastItem() const; + + // misc. getters + int32 IndexOf(const T *) const; + bool HasItem(const T *) const; + bool IsEmpty() const; + int32 CountItems() const; + + T *EachElement(EachFunction, void *); + const T *EachElement(ConstEachFunction, void *) const; + + void SortItems(CompareFunction); + void SortItems(CompareFunctionWithState, void *state); + void HSortItems(CompareFunction); + void HSortItems(CompareFunctionWithState, void *state); + + // linear search, returns first item that matches predicate + const T *FindIf(const UnaryPredicate &) const; + T *FindIf(const UnaryPredicate &); + + // list must be sorted with CompareFunction for these to work + T *BinarySearch(const T &, CompareFunction) const; + T *BinarySearch(const T &, CompareFunctionWithState, void *state) const; + + template + T *BinarySearchByKey(const Key &key, int (*compare)(const Key *, const T *)) + const; + + template + T *BinarySearchByKey(const Key &key, + int (*compare)(const Key *, const T *, void *), void *state) const; + + int32 BinarySearchIndex(const T &item, CompareFunction compare) const; + int32 BinarySearchIndex(const T &item, CompareFunctionWithState compare, + void *state) const; + + template + int32 BinarySearchIndexByKey(const Key &key, + int (*compare)(const Key *, const T *)) const; + + // Binary insertion - list must be sorted with CompareFunction for + // these to work + + // simple insert + bool BinaryInsert(T *, CompareFunction); + bool BinaryInsert(T *, CompareFunctionWithState, void *state); + bool BinaryInsert(T *, const UnaryPredicate &); + + // unique insert, returns false if item already in list + bool BinaryInsertUnique(T *, CompareFunction); + bool BinaryInsertUnique(T *, CompareFunctionWithState, void *state); + bool BinaryInsertUnique(T *, const UnaryPredicate &); + + // insert a copy of the item, returns new inserted item + T *BinaryInsertCopy(const T ©This, CompareFunction); + T *BinaryInsertCopy(const T ©This, CompareFunctionWithState, void *state); + + // insert a copy of the item if not in list already + // returns new inserted item or existing item in case of a conflict + T *BinaryInsertCopyUnique(const T ©This, CompareFunction); + T *BinaryInsertCopyUnique(const T ©This, CompareFunctionWithState, void *state); + + int32 FindBinaryInsertionIndex(const UnaryPredicate &, bool *alreadyInList = 0) const; + // returns either the index into which a new item should be inserted + // or index of an existing item that matches the predicate + + // deprecated API, will go away + BList *AsBList() + { return this; } + const BList *AsBList() const + { return this; } +private: + void SetItem(int32, T *); +}; + +template +Result +WhileEachListItem(BObjectList *list, Result (Item::*func)(Param1), Param1 p1) +{ + Result result = 0; + int32 count = list->CountItems(); + + for (int32 index = 0; index < count; index++) + if ((result = (list->ItemAt(index)->*func)(p1)) != 0) + break; + + return result; +} + +template +Result +WhileEachListItem(BObjectList *list, Result (*func)(Item *, Param1), Param1 p1) +{ + Result result = 0; + int32 count = list->CountItems(); + + for (int32 index = 0; index < count; index++) + if ((result = (*func)(list->ItemAt(index), p1)) != 0) + break; + + return result; +} + +template +Result +WhileEachListItem(BObjectList *list, Result (Item::*func)(Param1, Param2), + Param1 p1, Param2 p2) +{ + Result result = 0; + int32 count = list->CountItems(); + + for (int32 index = 0; index < count; index++) + if ((result = (list->ItemAt(index)->*func)(p1, p2)) != 0) + break; + + return result; +} + +template +Result +WhileEachListItem(BObjectList *list, Result (*func)(Item *, Param1, Param2), + Param1 p1, Param2 p2) +{ + Result result = 0; + int32 count = list->CountItems(); + + for (int32 index = 0; index < count; index++) + if ((result = (*func)(list->ItemAt(index), p1, p2)) != 0) + break; + + return result; +} + +template +Result +WhileEachListItem(BObjectList *list, Result (*func)(Item *, Param1, Param2, + Param3, Param4), Param1 p1, Param2 p2, Param3 p3, Param4 p4) +{ + Result result = 0; + int32 count = list->CountItems(); + + for (int32 index = 0; index < count; index++) + if ((result = (*func)(list->ItemAt(index), p1, p2, p3, p4)) != 0) + break; + + return result; +} + +template +void +EachListItemIgnoreResult(BObjectList *list, Result (Item::*func)()) +{ + int32 count = list->CountItems(); + for (int32 index = 0; index < count; index++) + (list->ItemAt(index)->*func)(); +} + +template +void +EachListItem(BObjectList *list, void (*func)(Item *, Param1), Param1 p1) +{ + int32 count = list->CountItems(); + for (int32 index = 0; index < count; index++) + (func)(list->ItemAt(index), p1); +} + +template +void +EachListItem(BObjectList *list, void (Item::*func)(Param1, Param2), + Param1 p1, Param2 p2) +{ + int32 count = list->CountItems(); + for (int32 index = 0; index < count; index++) + (list->ItemAt(index)->*func)(p1, p2); +} + +template +void +EachListItem(BObjectList *list, void (*func)(Item *,Param1, Param2), + Param1 p1, Param2 p2) +{ + int32 count = list->CountItems(); + for (int32 index = 0; index < count; index++) + (func)(list->ItemAt(index), p1, p2); +} + +template +void +EachListItem(BObjectList *list, void (*func)(Item *,Param1, Param2, + Param3), Param1 p1, Param2 p2, Param3 p3) +{ + int32 count = list->CountItems(); + for (int32 index = 0; index < count; index++) + (func)(list->ItemAt(index), p1, p2, p3); +} + + +template +void +EachListItem(BObjectList *list, void (*func)(Item *,Param1, Param2, + Param3, Param4), Param1 p1, Param2 p2, Param3 p3, Param4 p4) +{ + int32 count = list->CountItems(); + for (int32 index = 0; index < count; index++) + (func)(list->ItemAt(index), p1, p2, p3, p4); +} + +// inline code + +inline bool +_PointerList_::Owning() const +{ + return owning; +} + +template +BObjectList::BObjectList(int32 itemsPerBlock, bool owning) + : _PointerList_(itemsPerBlock, owning) +{ +} + +template +BObjectList::BObjectList(const BObjectList &list) + : _PointerList_(list) +{ + owning = list.owning; + if (owning) { + // make our own copies in an owning list + int32 count = list.CountItems(); + for (int32 index = 0; index < count; index++) { + T *item = list.ItemAt(index); + if (item) + item = new T(*item); + SetItem(index, item); + } + } +} + +template +BObjectList::~BObjectList() +{ + if (Owning()) + // have to nuke elements first + MakeEmpty(); +} + +template +BObjectList & +BObjectList::operator=(const BObjectList &list) +{ + owning = list.owning; + BObjectList &result = (BObjectList &)_PointerList_::operator=(list); + if (owning) { + // make our own copies in an owning list + int32 count = list.CountItems(); + for (int32 index = 0; index < count; index++) { + T *item = list.ItemAt(index); + if (item) + item = new T(*item); + SetItem(index, item); + } + } + return result; +} + +template +bool +BObjectList::AddItem(T *item) +{ + // need to cast to void * to make T work for const pointers + return _PointerList_::AddItem((void *)item); +} + +template +bool +BObjectList::AddItem(T *item, int32 atIndex) +{ + return _PointerList_::AddItem((void *)item, atIndex); +} + +template +bool +BObjectList::AddList(BObjectList *newItems) +{ + return _PointerList_::AddList(newItems); +} + +template +bool +BObjectList::AddList(BObjectList *newItems, int32 atIndex) +{ + return _PointerList_::AddList(newItems, atIndex); +} + + +template +bool +BObjectList::RemoveItem(T *item, bool deleteIfOwning) +{ + bool result = _PointerList_::RemoveItem((void *)item); + + if (result && Owning() && deleteIfOwning) + delete item; + + return result; +} + +template +T * +BObjectList::RemoveItemAt(int32 index) +{ + return (T *)_PointerList_::RemoveItem(index); +} + +template +inline T * +BObjectList::ItemAt(int32 index) const +{ + return (T *)_PointerList_::ItemAt(index); +} + +template +bool +BObjectList::ReplaceItem(int32 index, T *item) +{ + if (owning) + delete ItemAt(index); + return _PointerList_::ReplaceItem(index, (void *)item); +} + +template +T * +BObjectList::SwapWithItem(int32 index, T *newItem) +{ + T *result = ItemAt(index); + _PointerList_::ReplaceItem(index, (void *)newItem); + return result; +} + +template +void +BObjectList::SetItem(int32 index, T *newItem) +{ + _PointerList_::ReplaceItem(index, (void *)newItem); +} + +template +int32 +BObjectList::IndexOf(const T *item) const +{ + return _PointerList_::IndexOf((void *)item); +} + +template +T * +BObjectList::FirstItem() const +{ + return (T *)_PointerList_::FirstItem(); +} + +template +T * +BObjectList::LastItem() const +{ + return (T *)_PointerList_::LastItem(); +} + +template +bool +BObjectList::HasItem(const T *item) const +{ + return _PointerList_::HasItem((void *)item); +} + +template +bool +BObjectList::IsEmpty() const +{ + return _PointerList_::IsEmpty(); +} + +template +int32 +BObjectList::CountItems() const +{ + return _PointerList_::CountItems(); +} + +template +void +BObjectList::MakeEmpty(bool deleteIfOwning) +{ + if (owning && deleteIfOwning) { + int32 count = CountItems(); + for (int32 index = 0; index < count; index++) + delete ItemAt(index); + } + _PointerList_::MakeEmpty(); +} + +template +T * +BObjectList::EachElement(EachFunction func, void *params) +{ + return (T *)_PointerList_::EachElement((GenericEachFunction)func, params); +} + + +template +const T * +BObjectList::EachElement(ConstEachFunction func, void *params) const +{ + return (const T *) + const_cast *>(this)->_PointerList_::EachElement( + (GenericEachFunction)func, params); +} + +template +const T * +BObjectList::FindIf(const UnaryPredicate &predicate) const +{ + int32 count = CountItems(); + for (int32 index = 0; index < count; index++) + if (predicate.operator()(ItemAt(index)) == 0) + return ItemAt(index); + return 0; +} + +template +T * +BObjectList::FindIf(const UnaryPredicate &predicate) +{ + int32 count = CountItems(); + for (int32 index = 0; index < count; index++) + if (predicate.operator()(ItemAt(index)) == 0) + return ItemAt(index); + return 0; +} + + +template +void +BObjectList::SortItems(CompareFunction function) +{ + _PointerList_::SortItems((GenericCompareFunction)function); +} + +template +void +BObjectList::SortItems(CompareFunctionWithState function, void *state) +{ + _PointerList_::SortItems((GenericCompareFunctionWithState)function, state); +} + +template +void +BObjectList::HSortItems(CompareFunction function) +{ + _PointerList_::HSortItems((GenericCompareFunction)function); +} + +template +void +BObjectList::HSortItems(CompareFunctionWithState function, void *state) +{ + _PointerList_::HSortItems((GenericCompareFunctionWithState)function, state); +} + +template +T * +BObjectList::BinarySearch(const T &key, CompareFunction func) const +{ + return (T*)_PointerList_::BinarySearch(&key, + (GenericCompareFunction)func); +} + +template +T * +BObjectList::BinarySearch(const T &key, CompareFunctionWithState func, void *state) const +{ + return (T*)_PointerList_::BinarySearch(&key, + (GenericCompareFunctionWithState)func, state); +} + + +template +template +T * +BObjectList::BinarySearchByKey(const Key &key, + int (*compare)(const Key *, const T *)) const +{ + return (T*)_PointerList_::BinarySearch(&key, + (GenericCompareFunction)compare); +} + + +template +template +T * +BObjectList::BinarySearchByKey(const Key &key, + int (*compare)(const Key *, const T *, void *), void *state) const +{ + return (T*)_PointerList_::BinarySearch(&key, + (GenericCompareFunctionWithState)compare, state); +} + + +template +int32 +BObjectList::BinarySearchIndex(const T &item, CompareFunction compare) const +{ + return _PointerList_::BinarySearchIndex(&item, + (GenericCompareFunction)compare); +} + + +template +int32 +BObjectList::BinarySearchIndex(const T &item, + CompareFunctionWithState compare, void *state) const +{ + return _PointerList_::BinarySearchIndex(&item, + (GenericCompareFunctionWithState)compare, state); +} + + +template +template +int32 +BObjectList::BinarySearchIndexByKey(const Key &key, + int (*compare)(const Key *, const T *)) const +{ + return _PointerList_::BinarySearchIndex(&key, + (GenericCompareFunction)compare); +} + + +template +bool +BObjectList::BinaryInsert(T *item, CompareFunction func) +{ + int32 index = _PointerList_::BinarySearchIndex(item, + (GenericCompareFunction)func); + if (index >= 0) { + // already in list, add after existing + return AddItem(item, index + 1); + } + + return AddItem(item, -index - 1); +} + +template +bool +BObjectList::BinaryInsert(T *item, CompareFunctionWithState func, void *state) +{ + int32 index = _PointerList_::BinarySearchIndex(item, + (GenericCompareFunctionWithState)func, state); + if (index >= 0) { + // already in list, add after existing + return AddItem(item, index + 1); + } + + return AddItem(item, -index - 1); +} + +template +bool +BObjectList::BinaryInsertUnique(T *item, CompareFunction func) +{ + int32 index = _PointerList_::BinarySearchIndex(item, + (GenericCompareFunction)func); + if (index >= 0) + return false; + + return AddItem(item, -index - 1); +} + +template +bool +BObjectList::BinaryInsertUnique(T *item, CompareFunctionWithState func, void *state) +{ + int32 index = _PointerList_::BinarySearchIndex(item, + (GenericCompareFunctionWithState)func, state); + if (index >= 0) + return false; + + return AddItem(item, -index - 1); +} + + +template +T * +BObjectList::BinaryInsertCopy(const T ©This, CompareFunction func) +{ + int32 index = _PointerList_::BinarySearchIndex(©This, + (GenericCompareFunction)func); + + if (index >= 0) + index++; + else + index = -index - 1; + + T *newItem = new T(copyThis); + AddItem(newItem, index); + return newItem; +} + +template +T * +BObjectList::BinaryInsertCopy(const T ©This, CompareFunctionWithState func, void *state) +{ + int32 index = _PointerList_::BinarySearchIndex(©This, + (GenericCompareFunctionWithState)func, state); + + if (index >= 0) + index++; + else + index = -index - 1; + + T *newItem = new T(copyThis); + AddItem(newItem, index); + return newItem; +} + +template +T * +BObjectList::BinaryInsertCopyUnique(const T ©This, CompareFunction func) +{ + int32 index = _PointerList_::BinarySearchIndex(©This, + (GenericCompareFunction)func); + if (index >= 0) + return ItemAt(index); + + index = -index - 1; + T *newItem = new T(copyThis); + AddItem(newItem, index); + return newItem; +} + +template +T * +BObjectList::BinaryInsertCopyUnique(const T ©This, CompareFunctionWithState func, + void *state) +{ + int32 index = _PointerList_::BinarySearchIndex(©This, + (GenericCompareFunctionWithState)func, state); + if (index >= 0) + return ItemAt(index); + + index = -index - 1; + T *newItem = new T(copyThis); + AddItem(newItem, index); + return newItem; +} + +template +int32 +BObjectList::FindBinaryInsertionIndex(const UnaryPredicate &pred, bool *alreadyInList) + const +{ + int32 index = _PointerList_::BinarySearchIndexByPredicate(&pred, + (UnaryPredicateGlue)&UnaryPredicate::_unary_predicate_glue); + + if (alreadyInList) + *alreadyInList = index >= 0; + + if (index < 0) + index = -index - 1; + + return index; +} + +template +bool +BObjectList::BinaryInsert(T *item, const UnaryPredicate &pred) +{ + return AddItem(item, FindBinaryInsertionIndex(pred)); +} + +template +bool +BObjectList::BinaryInsertUnique(T *item, const UnaryPredicate &pred) +{ + bool alreadyInList; + int32 index = FindBinaryInsertionIndex(pred, &alreadyInList); + if (alreadyInList) + return false; + + AddItem(item, index); + return true; +} + +#endif /* __OBJECT_LIST__ */ diff --git a/include/libfunky/PBox.h b/include/libfunky/PBox.h new file mode 100644 index 0000000..b5710db --- /dev/null +++ b/include/libfunky/PBox.h @@ -0,0 +1,59 @@ +#ifndef PBox_H +#define PBox_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include "ObjectList.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +class BBox; +class BButton; + +class PBox : public BBox { + enum { + LISTCHANGED, + SAVE, + REVERT + }; + + public: + + PBox(BRect rect,BMessage fTemplate, BMessage fData,const char* settings_name); + + void AttachedToWindow(); + virtual void MessageReceived(BMessage *msg); + + void GetData(BMessage* data); + + const char* GetSettingsName(){ return fSName.String();} + private: + + float BuildGUI(BMessage viewTemplate, BMessage settings,BView *view); + + BView *fView; + + BView* fPrefView; + + BMessage fTemplate; + BMessage fData; + float fFontHeight; + BString fSName; + +}; + +#endif diff --git a/include/libfunky/Setting.h b/include/libfunky/Setting.h new file mode 100644 index 0000000..2debf94 --- /dev/null +++ b/include/libfunky/Setting.h @@ -0,0 +1,24 @@ +#ifndef Setting_H_ +#define Setting_H_ + +#include +#include + +class Setting : public BMessage { + + public: + + Setting(const char* name); + + void Store(); + void Retrive(); + + BString SettingPath(); + + private: + BString filename; +}; + +#endif + +//.. diff --git a/include/libfunky/SettingsTextView.h b/include/libfunky/SettingsTextView.h new file mode 100644 index 0000000..d16b54b --- /dev/null +++ b/include/libfunky/SettingsTextView.h @@ -0,0 +1,25 @@ +#ifndef SettingsTextView_H_ +#define SettingsTextView_H_ + +#include +#include +#include + + +class SettingsTextView : public BView +{ + public: + SettingsTextView(BRect frame, char *name, BString testo); + void AttachedToWindow(); + void Draw(BRect updateRect); + void SetText(const char*text){fText.SetTo(text);}; + BString Text(){ return fText; } + private: + BString fText; + + + + +}; + +#endif diff --git a/include/libfunky/Utils.h b/include/libfunky/Utils.h new file mode 100644 index 0000000..e8fbac0 --- /dev/null +++ b/include/libfunky/Utils.h @@ -0,0 +1,39 @@ +#ifndef _Utils_H_ +#define _Utils_H_ + +#include +#include +#include +#include + + +BString GetAppRelativePath(); +BString GetAppFilename(); +bool CheckMIME(BString mime,BNode* node); + +BBitmap* LoadIcon(const char* name); +void AddIcon(const char* name,BBitmap*); + + + +status_t ReadAttributeData(BNode* node,const char *name, char **buffer, int32 *size); + +status_t ReadAttributeString(BNode* node,const char *name, char **buffer, int32 *size); +BString ReadAttributeString(BNode* node,const char *name); + +status_t ReadAttributeInt32(BNode* node,const char *name, int32 *dest); +int32 ReadAttributeInt32(BNode* node,const char *name); + +status_t WriteAttributeInt32(BNode* node,const char *name, int32 dest); +status_t WriteAttributeString(BNode* node,const char *name, const char* string); + +status_t WriteAttributeMessage(BNode* node,const char* name,BMessage*); +status_t ReadAttributeMessage(BNode* node,const char* name,BMessage*); + +BString ReadableSize(off_t bytes); +BString ReadableSpeed(float speed); + +void BPDrawString(const char* string, BView* parent, BRect rect,alignment ali,float kTextMargin = 0.0); + + +#endif diff --git a/include/libxml/DOCBparser.h b/include/libxml/DOCBparser.h new file mode 100644 index 0000000..461d4ee --- /dev/null +++ b/include/libxml/DOCBparser.h @@ -0,0 +1,96 @@ +/* + * Summary: old DocBook SGML parser + * Description: interface for a DocBook SGML non-verifying parser + * This code is DEPRECATED, and should not be used anymore. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __DOCB_PARSER_H__ +#define __DOCB_PARSER_H__ +#include + +#ifdef LIBXML_DOCB_ENABLED + +#include +#include + +#ifndef IN_LIBXML +#ifdef __GNUC__ +#warning "The DOCBparser module has been deprecated in libxml2-2.6.0" +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Most of the back-end structures from XML and SGML are shared. + */ +typedef xmlParserCtxt docbParserCtxt; +typedef xmlParserCtxtPtr docbParserCtxtPtr; +typedef xmlSAXHandler docbSAXHandler; +typedef xmlSAXHandlerPtr docbSAXHandlerPtr; +typedef xmlParserInput docbParserInput; +typedef xmlParserInputPtr docbParserInputPtr; +typedef xmlDocPtr docbDocPtr; + +/* + * There is only few public functions. + */ +XMLPUBFUN int XMLCALL + docbEncodeEntities(unsigned char *out, + int *outlen, + const unsigned char *in, + int *inlen, int quoteChar); + +XMLPUBFUN docbDocPtr XMLCALL + docbSAXParseDoc (xmlChar *cur, + const char *encoding, + docbSAXHandlerPtr sax, + void *userData); +XMLPUBFUN docbDocPtr XMLCALL + docbParseDoc (xmlChar *cur, + const char *encoding); +XMLPUBFUN docbDocPtr XMLCALL + docbSAXParseFile (const char *filename, + const char *encoding, + docbSAXHandlerPtr sax, + void *userData); +XMLPUBFUN docbDocPtr XMLCALL + docbParseFile (const char *filename, + const char *encoding); + +/** + * Interfaces for the Push mode. + */ +XMLPUBFUN void XMLCALL + docbFreeParserCtxt (docbParserCtxtPtr ctxt); +XMLPUBFUN docbParserCtxtPtr XMLCALL + docbCreatePushParserCtxt(docbSAXHandlerPtr sax, + void *user_data, + const char *chunk, + int size, + const char *filename, + xmlCharEncoding enc); +XMLPUBFUN int XMLCALL + docbParseChunk (docbParserCtxtPtr ctxt, + const char *chunk, + int size, + int terminate); +XMLPUBFUN docbParserCtxtPtr XMLCALL + docbCreateFileParserCtxt(const char *filename, + const char *encoding); +XMLPUBFUN int XMLCALL + docbParseDocument (docbParserCtxtPtr ctxt); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_DOCB_ENABLED */ + +#endif /* __DOCB_PARSER_H__ */ diff --git a/include/libxml/HTMLparser.h b/include/libxml/HTMLparser.h new file mode 100644 index 0000000..2604d86 --- /dev/null +++ b/include/libxml/HTMLparser.h @@ -0,0 +1,298 @@ +/* + * Summary: interface for an HTML 4.0 non-verifying parser + * Description: this module implements an HTML 4.0 non-verifying parser + * with API compatible with the XML parser ones. It should + * be able to parse "real world" HTML, even if severely + * broken from a specification point of view. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __HTML_PARSER_H__ +#define __HTML_PARSER_H__ +#include +#include + +#ifdef LIBXML_HTML_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Most of the back-end structures from XML and HTML are shared. + */ +typedef xmlParserCtxt htmlParserCtxt; +typedef xmlParserCtxtPtr htmlParserCtxtPtr; +typedef xmlParserNodeInfo htmlParserNodeInfo; +typedef xmlSAXHandler htmlSAXHandler; +typedef xmlSAXHandlerPtr htmlSAXHandlerPtr; +typedef xmlParserInput htmlParserInput; +typedef xmlParserInputPtr htmlParserInputPtr; +typedef xmlDocPtr htmlDocPtr; +typedef xmlNodePtr htmlNodePtr; + +/* + * Internal description of an HTML element, representing HTML 4.01 + * and XHTML 1.0 (which share the same structure). + */ +typedef struct _htmlElemDesc htmlElemDesc; +typedef htmlElemDesc *htmlElemDescPtr; +struct _htmlElemDesc { + const char *name; /* The tag name */ + char startTag; /* Whether the start tag can be implied */ + char endTag; /* Whether the end tag can be implied */ + char saveEndTag; /* Whether the end tag should be saved */ + char empty; /* Is this an empty element ? */ + char depr; /* Is this a deprecated element ? */ + char dtd; /* 1: only in Loose DTD, 2: only Frameset one */ + char isinline; /* is this a block 0 or inline 1 element */ + const char *desc; /* the description */ + +/* NRK Jan.2003 + * New fields encapsulating HTML structure + * + * Bugs: + * This is a very limited representation. It fails to tell us when + * an element *requires* subelements (we only have whether they're + * allowed or not), and it doesn't tell us where CDATA and PCDATA + * are allowed. Some element relationships are not fully represented: + * these are flagged with the word MODIFIER + */ + const char** subelts; /* allowed sub-elements of this element */ + const char* defaultsubelt; /* subelement for suggested auto-repair + if necessary or NULL */ + const char** attrs_opt; /* Optional Attributes */ + const char** attrs_depr; /* Additional deprecated attributes */ + const char** attrs_req; /* Required attributes */ +}; + +/* + * Internal description of an HTML entity. + */ +typedef struct _htmlEntityDesc htmlEntityDesc; +typedef htmlEntityDesc *htmlEntityDescPtr; +struct _htmlEntityDesc { + unsigned int value; /* the UNICODE value for the character */ + const char *name; /* The entity name */ + const char *desc; /* the description */ +}; + +/* + * There is only few public functions. + */ +XMLPUBFUN const htmlElemDesc * XMLCALL + htmlTagLookup (const xmlChar *tag); +XMLPUBFUN const htmlEntityDesc * XMLCALL + htmlEntityLookup(const xmlChar *name); +XMLPUBFUN const htmlEntityDesc * XMLCALL + htmlEntityValueLookup(unsigned int value); + +XMLPUBFUN int XMLCALL + htmlIsAutoClosed(htmlDocPtr doc, + htmlNodePtr elem); +XMLPUBFUN int XMLCALL + htmlAutoCloseTag(htmlDocPtr doc, + const xmlChar *name, + htmlNodePtr elem); +XMLPUBFUN const htmlEntityDesc * XMLCALL + htmlParseEntityRef(htmlParserCtxtPtr ctxt, + const xmlChar **str); +XMLPUBFUN int XMLCALL + htmlParseCharRef(htmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + htmlParseElement(htmlParserCtxtPtr ctxt); + +XMLPUBFUN htmlParserCtxtPtr XMLCALL + htmlCreateMemoryParserCtxt(const char *buffer, + int size); + +XMLPUBFUN int XMLCALL + htmlParseDocument(htmlParserCtxtPtr ctxt); +XMLPUBFUN htmlDocPtr XMLCALL + htmlSAXParseDoc (xmlChar *cur, + const char *encoding, + htmlSAXHandlerPtr sax, + void *userData); +XMLPUBFUN htmlDocPtr XMLCALL + htmlParseDoc (xmlChar *cur, + const char *encoding); +XMLPUBFUN htmlDocPtr XMLCALL + htmlSAXParseFile(const char *filename, + const char *encoding, + htmlSAXHandlerPtr sax, + void *userData); +XMLPUBFUN htmlDocPtr XMLCALL + htmlParseFile (const char *filename, + const char *encoding); +XMLPUBFUN int XMLCALL + UTF8ToHtml (unsigned char *out, + int *outlen, + const unsigned char *in, + int *inlen); +XMLPUBFUN int XMLCALL + htmlEncodeEntities(unsigned char *out, + int *outlen, + const unsigned char *in, + int *inlen, int quoteChar); +XMLPUBFUN int XMLCALL + htmlIsScriptAttribute(const xmlChar *name); +XMLPUBFUN int XMLCALL + htmlHandleOmittedElem(int val); + +#ifdef LIBXML_PUSH_ENABLED +/** + * Interfaces for the Push mode. + */ +XMLPUBFUN htmlParserCtxtPtr XMLCALL + htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax, + void *user_data, + const char *chunk, + int size, + const char *filename, + xmlCharEncoding enc); +XMLPUBFUN int XMLCALL + htmlParseChunk (htmlParserCtxtPtr ctxt, + const char *chunk, + int size, + int terminate); +#endif /* LIBXML_PUSH_ENABLED */ + +XMLPUBFUN void XMLCALL + htmlFreeParserCtxt (htmlParserCtxtPtr ctxt); + +/* + * New set of simpler/more flexible APIs + */ +/** + * xmlParserOption: + * + * This is the set of XML parser options that can be passed down + * to the xmlReadDoc() and similar calls. + */ +typedef enum { + HTML_PARSE_NOERROR = 1<<5, /* suppress error reports */ + HTML_PARSE_NOWARNING= 1<<6, /* suppress warning reports */ + HTML_PARSE_PEDANTIC = 1<<7, /* pedantic error reporting */ + HTML_PARSE_NOBLANKS = 1<<8, /* remove blank nodes */ + HTML_PARSE_NONET = 1<<11 /* Forbid network access */ +} htmlParserOption; + +XMLPUBFUN void XMLCALL + htmlCtxtReset (htmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + htmlCtxtUseOptions (htmlParserCtxtPtr ctxt, + int options); +XMLPUBFUN htmlDocPtr XMLCALL + htmlReadDoc (const xmlChar *cur, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN htmlDocPtr XMLCALL + htmlReadFile (const char *URL, + const char *encoding, + int options); +XMLPUBFUN htmlDocPtr XMLCALL + htmlReadMemory (const char *buffer, + int size, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN htmlDocPtr XMLCALL + htmlReadFd (int fd, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN htmlDocPtr XMLCALL + htmlReadIO (xmlInputReadCallback ioread, + xmlInputCloseCallback ioclose, + void *ioctx, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN htmlDocPtr XMLCALL + htmlCtxtReadDoc (xmlParserCtxtPtr ctxt, + const xmlChar *cur, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN htmlDocPtr XMLCALL + htmlCtxtReadFile (xmlParserCtxtPtr ctxt, + const char *filename, + const char *encoding, + int options); +XMLPUBFUN htmlDocPtr XMLCALL + htmlCtxtReadMemory (xmlParserCtxtPtr ctxt, + const char *buffer, + int size, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN htmlDocPtr XMLCALL + htmlCtxtReadFd (xmlParserCtxtPtr ctxt, + int fd, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN htmlDocPtr XMLCALL + htmlCtxtReadIO (xmlParserCtxtPtr ctxt, + xmlInputReadCallback ioread, + xmlInputCloseCallback ioclose, + void *ioctx, + const char *URL, + const char *encoding, + int options); + +/* NRK/Jan2003: further knowledge of HTML structure + */ +typedef enum { + HTML_NA = 0 , /* something we don't check at all */ + HTML_INVALID = 0x1 , + HTML_DEPRECATED = 0x2 , + HTML_VALID = 0x4 , + HTML_REQUIRED = 0xc /* VALID bit set so ( & HTML_VALID ) is TRUE */ +} htmlStatus ; + +/* Using htmlElemDesc rather than name here, to emphasise the fact + that otherwise there's a lookup overhead +*/ +XMLPUBFUN htmlStatus XMLCALL htmlAttrAllowed(const htmlElemDesc*, const xmlChar*, int) ; +XMLPUBFUN int XMLCALL htmlElementAllowedHere(const htmlElemDesc*, const xmlChar*) ; +XMLPUBFUN htmlStatus XMLCALL htmlElementStatusHere(const htmlElemDesc*, const htmlElemDesc*) ; +XMLPUBFUN htmlStatus XMLCALL htmlNodeStatus(const htmlNodePtr, int) ; +/** + * htmlDefaultSubelement: + * @elt: HTML element + * + * Returns the default subelement for this element + */ +#define htmlDefaultSubelement(elt) elt->defaultsubelt +/** + * htmlElementAllowedHereDesc: + * @parent: HTML parent element + * @elt: HTML element + * + * Checks whether an HTML element description may be a + * direct child of the specified element. + * + * Returns 1 if allowed; 0 otherwise. + */ +#define htmlElementAllowedHereDesc(parent,elt) \ + htmlElementAllowedHere((parent), (elt)->name) +/** + * htmlRequiredAttrs: + * @elt: HTML element + * + * Returns the attributes required for the specified element. + */ +#define htmlRequiredAttrs(elt) (elt)->attrs_req + + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_HTML_ENABLED */ +#endif /* __HTML_PARSER_H__ */ diff --git a/include/libxml/HTMLtree.h b/include/libxml/HTMLtree.h new file mode 100644 index 0000000..50b8544 --- /dev/null +++ b/include/libxml/HTMLtree.h @@ -0,0 +1,142 @@ +/* + * Summary: specific APIs to process HTML tree, especially serialization + * Description: this module implements a few function needed to process + * tree in an HTML specific way. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __HTML_TREE_H__ +#define __HTML_TREE_H__ + +#include +#include +#include +#include + +#ifdef LIBXML_HTML_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * HTML_TEXT_NODE: + * + * Macro. A text node in a HTML document is really implemented + * the same way as a text node in an XML document. + */ +#define HTML_TEXT_NODE XML_TEXT_NODE +/** + * HTML_ENTITY_REF_NODE: + * + * Macro. An entity reference in a HTML document is really implemented + * the same way as an entity reference in an XML document. + */ +#define HTML_ENTITY_REF_NODE XML_ENTITY_REF_NODE +/** + * HTML_COMMENT_NODE: + * + * Macro. A comment in a HTML document is really implemented + * the same way as a comment in an XML document. + */ +#define HTML_COMMENT_NODE XML_COMMENT_NODE +/** + * HTML_PRESERVE_NODE: + * + * Macro. A preserved node in a HTML document is really implemented + * the same way as a CDATA section in an XML document. + */ +#define HTML_PRESERVE_NODE XML_CDATA_SECTION_NODE +/** + * HTML_PI_NODE: + * + * Macro. A processing instruction in a HTML document is really implemented + * the same way as a processing instruction in an XML document. + */ +#define HTML_PI_NODE XML_PI_NODE + +XMLPUBFUN htmlDocPtr XMLCALL + htmlNewDoc (const xmlChar *URI, + const xmlChar *ExternalID); +XMLPUBFUN htmlDocPtr XMLCALL + htmlNewDocNoDtD (const xmlChar *URI, + const xmlChar *ExternalID); +XMLPUBFUN const xmlChar * XMLCALL + htmlGetMetaEncoding (htmlDocPtr doc); +XMLPUBFUN int XMLCALL + htmlSetMetaEncoding (htmlDocPtr doc, + const xmlChar *encoding); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void XMLCALL + htmlDocDumpMemory (xmlDocPtr cur, + xmlChar **mem, + int *size); +XMLPUBFUN int XMLCALL + htmlDocDump (FILE *f, + xmlDocPtr cur); +XMLPUBFUN int XMLCALL + htmlSaveFile (const char *filename, + xmlDocPtr cur); +XMLPUBFUN int XMLCALL + htmlNodeDump (xmlBufferPtr buf, + xmlDocPtr doc, + xmlNodePtr cur); +XMLPUBFUN void XMLCALL + htmlNodeDumpFile (FILE *out, + xmlDocPtr doc, + xmlNodePtr cur); +XMLPUBFUN int XMLCALL + htmlNodeDumpFileFormat (FILE *out, + xmlDocPtr doc, + xmlNodePtr cur, + const char *encoding, + int format); +XMLPUBFUN int XMLCALL + htmlSaveFileEnc (const char *filename, + xmlDocPtr cur, + const char *encoding); +XMLPUBFUN int XMLCALL + htmlSaveFileFormat (const char *filename, + xmlDocPtr cur, + const char *encoding, + int format); + +XMLPUBFUN void XMLCALL + htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, + xmlDocPtr doc, + xmlNodePtr cur, + const char *encoding, + int format); +XMLPUBFUN void XMLCALL + htmlDocContentDumpOutput(xmlOutputBufferPtr buf, + xmlDocPtr cur, + const char *encoding); +XMLPUBFUN void XMLCALL + htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf, + xmlDocPtr cur, + const char *encoding, + int format); +XMLPUBFUN void XMLCALL + htmlNodeDumpOutput (xmlOutputBufferPtr buf, + xmlDocPtr doc, + xmlNodePtr cur, + const char *encoding); + +#endif /* LIBXML_OUTPUT_ENABLED */ + +XMLPUBFUN int XMLCALL + htmlIsBooleanAttr (const xmlChar *name); + + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_HTML_ENABLED */ + +#endif /* __HTML_TREE_H__ */ + diff --git a/include/libxml/Makefile b/include/libxml/Makefile new file mode 100644 index 0000000..3f780d3 --- /dev/null +++ b/include/libxml/Makefile @@ -0,0 +1,556 @@ +# Makefile.in generated by automake 1.9.2 from Makefile.am. +# include/libxml/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 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. + + + +srcdir = . +top_srcdir = ../.. + +pkgdatadir = $(datadir)/libxml2 +pkglibdir = $(libdir)/libxml2 +pkgincludedir = $(includedir)/libxml2 +top_builddir = ../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = /bin/ginstall -c +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 = : +build_triplet = i586-pc-beos +host_triplet = i586-pc-beos +subdir = include/libxml +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/xmlversion.h.in $(xmlinc_HEADERS) +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = xmlversion.h +SOURCES = +DIST_SOURCES = +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 = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(xmlincdir)" +xmlincHEADERS_INSTALL = $(INSTALL_HEADER) +HEADERS = $(xmlinc_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = ${SHELL} /boot/home/Desktop/libxml2-2.6.20/missing --run aclocal-1.9 +AMDEP_FALSE = # +AMDEP_TRUE = +AMTAR = ${SHELL} /boot/home/Desktop/libxml2-2.6.20/missing --run tar +AR = ar +AS = as +AUTOCONF = ${SHELL} /boot/home/Desktop/libxml2-2.6.20/missing --run autoconf +AUTOHEADER = ${SHELL} /boot/home/Desktop/libxml2-2.6.20/missing --run autoheader +AUTOMAKE = ${SHELL} /boot/home/Desktop/libxml2-2.6.20/missing --run automake-1.9 +AWK = gawk +BASE_THREAD_LIBS = +C14N_OBJ = c14n.c +CATALOG_OBJ = catalog.o +CC = gcc +CCDEPMODE = depmode=gcc +CFLAGS = -g -O2 -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls +CPP = gcc -E +CPPFLAGS = +CXX = g++ +CXXCPP = g++ -E +CXXDEPMODE = depmode=gcc +CXXFLAGS = -g -O2 +CYGPATH_W = echo +CYGWIN_EXTRA_LDFLAGS = +CYGWIN_EXTRA_PYTHON_LIBADD = +DEBUG_OBJ = debugXML.o +DEFS = -DHAVE_CONFIG_H +DEPDIR = .deps +DLLTOOL = dlltool +DOCB_OBJ = DOCBparser.o +ECHO = echo +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = grep -E +EXEEXT = +F77 = +FFLAGS = +FTP_OBJ = nanoftp.o +HAVE_ISINF = +HAVE_ISNAN = +HTML_DIR = $(datadir)/doc/$(PACKAGE)-$(VERSION)/html +HTML_OBJ = HTMLparser.o HTMLtree.o +HTTP_OBJ = nanohttp.o +ICONV_LIBS = -liconv +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s +LDFLAGS = +LIBOBJS = +LIBS = -lsocket +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIBXML_MAJOR_VERSION = 2 +LIBXML_MICRO_VERSION = 20 +LIBXML_MINOR_VERSION = 6 +LIBXML_VERSION = 2.6.20 +LIBXML_VERSION_EXTRA = +LIBXML_VERSION_INFO = 8:20:6 +LIBXML_VERSION_NUMBER = 20620 +LN_S = ln -s +LTLIBOBJS = +MAKEINFO = ${SHELL} /boot/home/Desktop/libxml2-2.6.20/missing --run makeinfo +MODULE_EXTENSION = .so +MODULE_PLATFORM_LIBS = -ldl +MV = /bin/mv +M_LIBS = +OBJDUMP = objdump +OBJEXT = o +PACKAGE = libxml2 +PACKAGE_BUGREPORT = +PACKAGE_NAME = +PACKAGE_STRING = +PACKAGE_TARNAME = +PACKAGE_VERSION = +PATH_SEPARATOR = : +PERL = /boot/home/config/bin/perl +PYTHON = /bin/python +PYTHON_INCLUDES = +PYTHON_SITE_PACKAGES = /boot/beos/system/lib/python2.4/site-packages +PYTHON_SUBDIR = +PYTHON_TESTS = +PYTHON_VERSION = 2.4 +RANLIB = ranlib +RDL_LIBS = +READER_TEST = Readertests +RELDATE = Mon Jul 11 2005 +RM = /bin/rm +SET_MAKE = +SHELL = /bin/sh +STATIC_BINARIES = +STRIP = strip +TAR = /bin/tar +TEST_C14N = C14Ntests +TEST_CATALOG = Catatests +TEST_DEBUG = Scripttests +TEST_HTML = HTMLtests +TEST_MODULES = ModuleTests +TEST_PATTERN = Patterntests +TEST_PHTML = HTMLPushtests +TEST_PUSH = XMLPushtests +TEST_REGEXPS = Regexptests Automatatests +TEST_SAX = SAXtests +TEST_SCHEMAS = Schemastests Relaxtests +TEST_THREADS = Threadtests +TEST_VALID = Validtests +TEST_VTIME = VTimingtests +TEST_XINCLUDE = XIncludetests +TEST_XPATH = XPathtests +TEST_XPTR = XPtrtests +THREADS_W32 = +THREAD_CFLAGS = -DHAVE_BEOS_THREADS -D_REENTRANT +THREAD_LIBS = -lpthread +U = +VERSION = 2.6.20 +WIN32_EXTRA_LDFLAGS = +WIN32_EXTRA_LIBADD = +WITH_C14N = 1 +WITH_CATALOG = 1 +WITH_DEBUG = 1 +WITH_DOCB = 1 +WITH_FTP = 1 +WITH_HTML = 1 +WITH_HTTP = 1 +WITH_ICONV = 1 +WITH_ISO8859X = 1 +WITH_LEGACY = 1 +WITH_MEM_DEBUG = 0 +WITH_MODULES = 1 +WITH_OUTPUT = 1 +WITH_PATTERN = 1 +WITH_PUSH = 1 +WITH_PYTHON_FALSE = +WITH_PYTHON_TRUE = # +WITH_READER = 1 +WITH_REGEXPS = 1 +WITH_RUN_DEBUG = 0 +WITH_SAX1 = 1 +WITH_SCHEMAS = 1 +WITH_THREADS = 1 +WITH_TREE = 1 +WITH_TRIO = 0 +WITH_TRIO_SOURCES_FALSE = +WITH_TRIO_SOURCES_TRUE = # +WITH_VALID = 1 +WITH_WRITER = 1 +WITH_XINCLUDE = 1 +WITH_XPATH = 1 +WITH_XPTR = 1 +XINCLUDE_OBJ = xinclude.o +XMLLINT = /usr/bin/xmllint +XML_CFLAGS = +XML_INCLUDEDIR = -I${includedir}/libxml2 +XML_LIBDIR = -L${libdir} +XML_LIBS = -lxml2 -lz -lpthread -liconv -lsocket +XML_LIBTOOLLIBS = libxml2.la +XPATH_OBJ = xpath.o +XPTR_OBJ = xpointer.o +XSLTPROC = /usr/bin/xsltproc +Z_CFLAGS = +Z_LIBS = -lz +ac_ct_AR = ar +ac_ct_AS = +ac_ct_CC = gcc +ac_ct_CXX = g++ +ac_ct_DLLTOOL = +ac_ct_F77 = +ac_ct_OBJDUMP = +ac_ct_RANLIB = ranlib +ac_ct_STRIP = strip +am__fastdepCC_FALSE = +am__fastdepCC_TRUE = # +am__fastdepCXX_FALSE = +am__fastdepCXX_TRUE = # +am__include = include +am__leading_dot = . +am__quote = +am__tar = ${AMTAR} chof - "$$tardir" +am__untar = ${AMTAR} xf - +bindir = ${exec_prefix}/bin +build = i586-pc-beos +build_alias = +build_cpu = i586 +build_os = beos +build_vendor = pc +datadir = ${prefix}/share +exec_prefix = ${prefix} +host = i586-pc-beos +host_alias = +host_cpu = i586 +host_os = beos +host_vendor = pc +includedir = ${prefix}/include +infodir = ${prefix}/info +install_sh = /boot/home/Desktop/libxml2-2.6.20/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localstatedir = ${prefix}/var +mandir = ${prefix}/man +mkdir_p = mkdir -p -- +oldincludedir = /usr/include +prefix = /usr/local +program_transform_name = s,x,x, +pythondir = $(libdir)/python${PYTHON_VERSION}/site-packages +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +sysconfdir = ${prefix}/etc +target_alias = +xmlincdir = $(includedir)/libxml2/libxml +xmlinc_HEADERS = \ + SAX.h \ + entities.h \ + encoding.h \ + parser.h \ + parserInternals.h \ + xmlerror.h \ + HTMLparser.h \ + HTMLtree.h \ + debugXML.h \ + tree.h \ + list.h \ + hash.h \ + xpath.h \ + xpathInternals.h \ + xpointer.h \ + xinclude.h \ + xmlIO.h \ + xmlmemory.h \ + nanohttp.h \ + nanoftp.h \ + uri.h \ + valid.h \ + xlink.h \ + xmlversion.h \ + DOCBparser.h \ + catalog.h \ + threads.h \ + globals.h \ + c14n.h \ + xmlautomata.h \ + xmlregexp.h \ + xmlmodule.h \ + xmlschemas.h \ + schemasInternals.h \ + xmlschemastypes.h \ + xmlstring.h \ + xmlunicode.h \ + xmlreader.h \ + relaxng.h \ + dict.h \ + SAX2.h \ + xmlexports.h \ + xmlwriter.h \ + chvalid.h \ + pattern.h \ + xmlsave.h + +EXTRA_DIST = xmlversion.h.in +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 \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/libxml/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu include/libxml/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(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 +xmlversion.h: $(top_builddir)/config.status $(srcdir)/xmlversion.h.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: +install-xmlincHEADERS: $(xmlinc_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(xmlincdir)" || $(mkdir_p) "$(DESTDIR)$(xmlincdir)" + @list='$(xmlinc_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(xmlincHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(xmlincdir)/$$f'"; \ + $(xmlincHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(xmlincdir)/$$f"; \ + done + +uninstall-xmlincHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(xmlinc_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(xmlincdir)/$$f'"; \ + rm -f "$(DESTDIR)$(xmlincdir)/$$f"; \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$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 $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(xmlincdir)"; 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: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_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-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-xmlincHEADERS + +install-exec-am: + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook + +install-info: install-info-am + +install-man: + +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 mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-xmlincHEADERS + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool ctags distclean distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-exec-hook \ + install-info install-info-am install-man install-strip \ + install-xmlincHEADERS installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am \ + uninstall-xmlincHEADERS + + +install-exec-hook: + $(mkinstalldirs) $(DESTDIR)$(xmlincdir) +# 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: diff --git a/include/libxml/Makefile.am b/include/libxml/Makefile.am new file mode 100644 index 0000000..03f9564 --- /dev/null +++ b/include/libxml/Makefile.am @@ -0,0 +1,56 @@ +## Process this file with automake to produce Makefile.in + +xmlincdir = $(includedir)/libxml2/libxml + +xmlinc_HEADERS = \ + SAX.h \ + entities.h \ + encoding.h \ + parser.h \ + parserInternals.h \ + xmlerror.h \ + HTMLparser.h \ + HTMLtree.h \ + debugXML.h \ + tree.h \ + list.h \ + hash.h \ + xpath.h \ + xpathInternals.h \ + xpointer.h \ + xinclude.h \ + xmlIO.h \ + xmlmemory.h \ + nanohttp.h \ + nanoftp.h \ + uri.h \ + valid.h \ + xlink.h \ + xmlversion.h \ + DOCBparser.h \ + catalog.h \ + threads.h \ + globals.h \ + c14n.h \ + xmlautomata.h \ + xmlregexp.h \ + xmlmodule.h \ + xmlschemas.h \ + schemasInternals.h \ + xmlschemastypes.h \ + xmlstring.h \ + xmlunicode.h \ + xmlreader.h \ + relaxng.h \ + dict.h \ + SAX2.h \ + xmlexports.h \ + xmlwriter.h \ + chvalid.h \ + pattern.h \ + xmlsave.h + +install-exec-hook: + $(mkinstalldirs) $(DESTDIR)$(xmlincdir) + +EXTRA_DIST = xmlversion.h.in diff --git a/include/libxml/Makefile.in b/include/libxml/Makefile.in new file mode 100644 index 0000000..bdcc706 --- /dev/null +++ b/include/libxml/Makefile.in @@ -0,0 +1,556 @@ +# Makefile.in generated by automake 1.9.2 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 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@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +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 = : +build_triplet = @build@ +host_triplet = @host@ +subdir = include/libxml +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/xmlversion.h.in $(xmlinc_HEADERS) +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = xmlversion.h +SOURCES = +DIST_SOURCES = +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 = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(xmlincdir)" +xmlincHEADERS_INSTALL = $(INSTALL_HEADER) +HEADERS = $(xmlinc_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASE_THREAD_LIBS = @BASE_THREAD_LIBS@ +C14N_OBJ = @C14N_OBJ@ +CATALOG_OBJ = @CATALOG_OBJ@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +CYGWIN_EXTRA_LDFLAGS = @CYGWIN_EXTRA_LDFLAGS@ +CYGWIN_EXTRA_PYTHON_LIBADD = @CYGWIN_EXTRA_PYTHON_LIBADD@ +DEBUG_OBJ = @DEBUG_OBJ@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DOCB_OBJ = @DOCB_OBJ@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FTP_OBJ = @FTP_OBJ@ +HAVE_ISINF = @HAVE_ISINF@ +HAVE_ISNAN = @HAVE_ISNAN@ +HTML_DIR = @HTML_DIR@ +HTML_OBJ = @HTML_OBJ@ +HTTP_OBJ = @HTTP_OBJ@ +ICONV_LIBS = @ICONV_LIBS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBXML_MAJOR_VERSION = @LIBXML_MAJOR_VERSION@ +LIBXML_MICRO_VERSION = @LIBXML_MICRO_VERSION@ +LIBXML_MINOR_VERSION = @LIBXML_MINOR_VERSION@ +LIBXML_VERSION = @LIBXML_VERSION@ +LIBXML_VERSION_EXTRA = @LIBXML_VERSION_EXTRA@ +LIBXML_VERSION_INFO = @LIBXML_VERSION_INFO@ +LIBXML_VERSION_NUMBER = @LIBXML_VERSION_NUMBER@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MODULE_EXTENSION = @MODULE_EXTENSION@ +MODULE_PLATFORM_LIBS = @MODULE_PLATFORM_LIBS@ +MV = @MV@ +M_LIBS = @M_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PYTHON = @PYTHON@ +PYTHON_INCLUDES = @PYTHON_INCLUDES@ +PYTHON_SITE_PACKAGES = @PYTHON_SITE_PACKAGES@ +PYTHON_SUBDIR = @PYTHON_SUBDIR@ +PYTHON_TESTS = @PYTHON_TESTS@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +RDL_LIBS = @RDL_LIBS@ +READER_TEST = @READER_TEST@ +RELDATE = @RELDATE@ +RM = @RM@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STATIC_BINARIES = @STATIC_BINARIES@ +STRIP = @STRIP@ +TAR = @TAR@ +TEST_C14N = @TEST_C14N@ +TEST_CATALOG = @TEST_CATALOG@ +TEST_DEBUG = @TEST_DEBUG@ +TEST_HTML = @TEST_HTML@ +TEST_MODULES = @TEST_MODULES@ +TEST_PATTERN = @TEST_PATTERN@ +TEST_PHTML = @TEST_PHTML@ +TEST_PUSH = @TEST_PUSH@ +TEST_REGEXPS = @TEST_REGEXPS@ +TEST_SAX = @TEST_SAX@ +TEST_SCHEMAS = @TEST_SCHEMAS@ +TEST_THREADS = @TEST_THREADS@ +TEST_VALID = @TEST_VALID@ +TEST_VTIME = @TEST_VTIME@ +TEST_XINCLUDE = @TEST_XINCLUDE@ +TEST_XPATH = @TEST_XPATH@ +TEST_XPTR = @TEST_XPTR@ +THREADS_W32 = @THREADS_W32@ +THREAD_CFLAGS = @THREAD_CFLAGS@ +THREAD_LIBS = @THREAD_LIBS@ +U = @U@ +VERSION = @VERSION@ +WIN32_EXTRA_LDFLAGS = @WIN32_EXTRA_LDFLAGS@ +WIN32_EXTRA_LIBADD = @WIN32_EXTRA_LIBADD@ +WITH_C14N = @WITH_C14N@ +WITH_CATALOG = @WITH_CATALOG@ +WITH_DEBUG = @WITH_DEBUG@ +WITH_DOCB = @WITH_DOCB@ +WITH_FTP = @WITH_FTP@ +WITH_HTML = @WITH_HTML@ +WITH_HTTP = @WITH_HTTP@ +WITH_ICONV = @WITH_ICONV@ +WITH_ISO8859X = @WITH_ISO8859X@ +WITH_LEGACY = @WITH_LEGACY@ +WITH_MEM_DEBUG = @WITH_MEM_DEBUG@ +WITH_MODULES = @WITH_MODULES@ +WITH_OUTPUT = @WITH_OUTPUT@ +WITH_PATTERN = @WITH_PATTERN@ +WITH_PUSH = @WITH_PUSH@ +WITH_PYTHON_FALSE = @WITH_PYTHON_FALSE@ +WITH_PYTHON_TRUE = @WITH_PYTHON_TRUE@ +WITH_READER = @WITH_READER@ +WITH_REGEXPS = @WITH_REGEXPS@ +WITH_RUN_DEBUG = @WITH_RUN_DEBUG@ +WITH_SAX1 = @WITH_SAX1@ +WITH_SCHEMAS = @WITH_SCHEMAS@ +WITH_THREADS = @WITH_THREADS@ +WITH_TREE = @WITH_TREE@ +WITH_TRIO = @WITH_TRIO@ +WITH_TRIO_SOURCES_FALSE = @WITH_TRIO_SOURCES_FALSE@ +WITH_TRIO_SOURCES_TRUE = @WITH_TRIO_SOURCES_TRUE@ +WITH_VALID = @WITH_VALID@ +WITH_WRITER = @WITH_WRITER@ +WITH_XINCLUDE = @WITH_XINCLUDE@ +WITH_XPATH = @WITH_XPATH@ +WITH_XPTR = @WITH_XPTR@ +XINCLUDE_OBJ = @XINCLUDE_OBJ@ +XMLLINT = @XMLLINT@ +XML_CFLAGS = @XML_CFLAGS@ +XML_INCLUDEDIR = @XML_INCLUDEDIR@ +XML_LIBDIR = @XML_LIBDIR@ +XML_LIBS = @XML_LIBS@ +XML_LIBTOOLLIBS = @XML_LIBTOOLLIBS@ +XPATH_OBJ = @XPATH_OBJ@ +XPTR_OBJ = @XPTR_OBJ@ +XSLTPROC = @XSLTPROC@ +Z_CFLAGS = @Z_CFLAGS@ +Z_LIBS = @Z_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_AS = @ac_ct_AS@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_OBJDUMP = @ac_ct_OBJDUMP@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +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 = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +xmlincdir = $(includedir)/libxml2/libxml +xmlinc_HEADERS = \ + SAX.h \ + entities.h \ + encoding.h \ + parser.h \ + parserInternals.h \ + xmlerror.h \ + HTMLparser.h \ + HTMLtree.h \ + debugXML.h \ + tree.h \ + list.h \ + hash.h \ + xpath.h \ + xpathInternals.h \ + xpointer.h \ + xinclude.h \ + xmlIO.h \ + xmlmemory.h \ + nanohttp.h \ + nanoftp.h \ + uri.h \ + valid.h \ + xlink.h \ + xmlversion.h \ + DOCBparser.h \ + catalog.h \ + threads.h \ + globals.h \ + c14n.h \ + xmlautomata.h \ + xmlregexp.h \ + xmlmodule.h \ + xmlschemas.h \ + schemasInternals.h \ + xmlschemastypes.h \ + xmlstring.h \ + xmlunicode.h \ + xmlreader.h \ + relaxng.h \ + dict.h \ + SAX2.h \ + xmlexports.h \ + xmlwriter.h \ + chvalid.h \ + pattern.h \ + xmlsave.h + +EXTRA_DIST = xmlversion.h.in +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 \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/libxml/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu include/libxml/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(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 +xmlversion.h: $(top_builddir)/config.status $(srcdir)/xmlversion.h.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: +install-xmlincHEADERS: $(xmlinc_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(xmlincdir)" || $(mkdir_p) "$(DESTDIR)$(xmlincdir)" + @list='$(xmlinc_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(xmlincHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(xmlincdir)/$$f'"; \ + $(xmlincHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(xmlincdir)/$$f"; \ + done + +uninstall-xmlincHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(xmlinc_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(xmlincdir)/$$f'"; \ + rm -f "$(DESTDIR)$(xmlincdir)/$$f"; \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$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 $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(xmlincdir)"; 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: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_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-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-xmlincHEADERS + +install-exec-am: + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook + +install-info: install-info-am + +install-man: + +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 mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-xmlincHEADERS + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool ctags distclean distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-exec-hook \ + install-info install-info-am install-man install-strip \ + install-xmlincHEADERS installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am \ + uninstall-xmlincHEADERS + + +install-exec-hook: + $(mkinstalldirs) $(DESTDIR)$(xmlincdir) +# 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: diff --git a/include/libxml/SAX.h b/include/libxml/SAX.h new file mode 100644 index 0000000..0ca161b --- /dev/null +++ b/include/libxml/SAX.h @@ -0,0 +1,173 @@ +/* + * Summary: Old SAX version 1 handler, deprecated + * Description: DEPRECATED set of SAX version 1 interfaces used to + * build the DOM tree. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + + +#ifndef __XML_SAX_H__ +#define __XML_SAX_H__ + +#include +#include +#include +#include +#include + +#ifdef LIBXML_LEGACY_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif +XMLPUBFUN const xmlChar * XMLCALL + getPublicId (void *ctx); +XMLPUBFUN const xmlChar * XMLCALL + getSystemId (void *ctx); +XMLPUBFUN void XMLCALL + setDocumentLocator (void *ctx, + xmlSAXLocatorPtr loc); + +XMLPUBFUN int XMLCALL + getLineNumber (void *ctx); +XMLPUBFUN int XMLCALL + getColumnNumber (void *ctx); + +XMLPUBFUN int XMLCALL + isStandalone (void *ctx); +XMLPUBFUN int XMLCALL + hasInternalSubset (void *ctx); +XMLPUBFUN int XMLCALL + hasExternalSubset (void *ctx); + +XMLPUBFUN void XMLCALL + internalSubset (void *ctx, + const xmlChar *name, + const xmlChar *ExternalID, + const xmlChar *SystemID); +XMLPUBFUN void XMLCALL + externalSubset (void *ctx, + const xmlChar *name, + const xmlChar *ExternalID, + const xmlChar *SystemID); +XMLPUBFUN xmlEntityPtr XMLCALL + getEntity (void *ctx, + const xmlChar *name); +XMLPUBFUN xmlEntityPtr XMLCALL + getParameterEntity (void *ctx, + const xmlChar *name); +XMLPUBFUN xmlParserInputPtr XMLCALL + resolveEntity (void *ctx, + const xmlChar *publicId, + const xmlChar *systemId); + +XMLPUBFUN void XMLCALL + entityDecl (void *ctx, + const xmlChar *name, + int type, + const xmlChar *publicId, + const xmlChar *systemId, + xmlChar *content); +XMLPUBFUN void XMLCALL + attributeDecl (void *ctx, + const xmlChar *elem, + const xmlChar *fullname, + int type, + int def, + const xmlChar *defaultValue, + xmlEnumerationPtr tree); +XMLPUBFUN void XMLCALL + elementDecl (void *ctx, + const xmlChar *name, + int type, + xmlElementContentPtr content); +XMLPUBFUN void XMLCALL + notationDecl (void *ctx, + const xmlChar *name, + const xmlChar *publicId, + const xmlChar *systemId); +XMLPUBFUN void XMLCALL + unparsedEntityDecl (void *ctx, + const xmlChar *name, + const xmlChar *publicId, + const xmlChar *systemId, + const xmlChar *notationName); + +XMLPUBFUN void XMLCALL + startDocument (void *ctx); +XMLPUBFUN void XMLCALL + endDocument (void *ctx); +XMLPUBFUN void XMLCALL + attribute (void *ctx, + const xmlChar *fullname, + const xmlChar *value); +XMLPUBFUN void XMLCALL + startElement (void *ctx, + const xmlChar *fullname, + const xmlChar **atts); +XMLPUBFUN void XMLCALL + endElement (void *ctx, + const xmlChar *name); +XMLPUBFUN void XMLCALL + reference (void *ctx, + const xmlChar *name); +XMLPUBFUN void XMLCALL + characters (void *ctx, + const xmlChar *ch, + int len); +XMLPUBFUN void XMLCALL + ignorableWhitespace (void *ctx, + const xmlChar *ch, + int len); +XMLPUBFUN void XMLCALL + processingInstruction (void *ctx, + const xmlChar *target, + const xmlChar *data); +XMLPUBFUN void XMLCALL + globalNamespace (void *ctx, + const xmlChar *href, + const xmlChar *prefix); +XMLPUBFUN void XMLCALL + setNamespace (void *ctx, + const xmlChar *name); +XMLPUBFUN xmlNsPtr XMLCALL + getNamespace (void *ctx); +XMLPUBFUN int XMLCALL + checkNamespace (void *ctx, + xmlChar *nameSpace); +XMLPUBFUN void XMLCALL + namespaceDecl (void *ctx, + const xmlChar *href, + const xmlChar *prefix); +XMLPUBFUN void XMLCALL + comment (void *ctx, + const xmlChar *value); +XMLPUBFUN void XMLCALL + cdataBlock (void *ctx, + const xmlChar *value, + int len); + +#ifdef LIBXML_SAX1_ENABLED +XMLPUBFUN void XMLCALL + initxmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr, + int warning); +#ifdef LIBXML_HTML_ENABLED +XMLPUBFUN void XMLCALL + inithtmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr); +#endif +#ifdef LIBXML_DOCB_ENABLED +XMLPUBFUN void XMLCALL + initdocbDefaultSAXHandler (xmlSAXHandlerV1 *hdlr); +#endif +#endif /* LIBXML_SAX1_ENABLED */ + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_LEGACY_ENABLED */ + +#endif /* __XML_SAX_H__ */ diff --git a/include/libxml/SAX2.h b/include/libxml/SAX2.h new file mode 100644 index 0000000..6626564 --- /dev/null +++ b/include/libxml/SAX2.h @@ -0,0 +1,176 @@ +/* + * Summary: SAX2 parser interface used to build the DOM tree + * Description: those are the default SAX2 interfaces used by + * the library when building DOM tree. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + + +#ifndef __XML_SAX2_H__ +#define __XML_SAX2_H__ + +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif +XMLPUBFUN const xmlChar * XMLCALL + xmlSAX2GetPublicId (void *ctx); +XMLPUBFUN const xmlChar * XMLCALL + xmlSAX2GetSystemId (void *ctx); +XMLPUBFUN void XMLCALL + xmlSAX2SetDocumentLocator (void *ctx, + xmlSAXLocatorPtr loc); + +XMLPUBFUN int XMLCALL + xmlSAX2GetLineNumber (void *ctx); +XMLPUBFUN int XMLCALL + xmlSAX2GetColumnNumber (void *ctx); + +XMLPUBFUN int XMLCALL + xmlSAX2IsStandalone (void *ctx); +XMLPUBFUN int XMLCALL + xmlSAX2HasInternalSubset (void *ctx); +XMLPUBFUN int XMLCALL + xmlSAX2HasExternalSubset (void *ctx); + +XMLPUBFUN void XMLCALL + xmlSAX2InternalSubset (void *ctx, + const xmlChar *name, + const xmlChar *ExternalID, + const xmlChar *SystemID); +XMLPUBFUN void XMLCALL + xmlSAX2ExternalSubset (void *ctx, + const xmlChar *name, + const xmlChar *ExternalID, + const xmlChar *SystemID); +XMLPUBFUN xmlEntityPtr XMLCALL + xmlSAX2GetEntity (void *ctx, + const xmlChar *name); +XMLPUBFUN xmlEntityPtr XMLCALL + xmlSAX2GetParameterEntity (void *ctx, + const xmlChar *name); +XMLPUBFUN xmlParserInputPtr XMLCALL + xmlSAX2ResolveEntity (void *ctx, + const xmlChar *publicId, + const xmlChar *systemId); + +XMLPUBFUN void XMLCALL + xmlSAX2EntityDecl (void *ctx, + const xmlChar *name, + int type, + const xmlChar *publicId, + const xmlChar *systemId, + xmlChar *content); +XMLPUBFUN void XMLCALL + xmlSAX2AttributeDecl (void *ctx, + const xmlChar *elem, + const xmlChar *fullname, + int type, + int def, + const xmlChar *defaultValue, + xmlEnumerationPtr tree); +XMLPUBFUN void XMLCALL + xmlSAX2ElementDecl (void *ctx, + const xmlChar *name, + int type, + xmlElementContentPtr content); +XMLPUBFUN void XMLCALL + xmlSAX2NotationDecl (void *ctx, + const xmlChar *name, + const xmlChar *publicId, + const xmlChar *systemId); +XMLPUBFUN void XMLCALL + xmlSAX2UnparsedEntityDecl (void *ctx, + const xmlChar *name, + const xmlChar *publicId, + const xmlChar *systemId, + const xmlChar *notationName); + +XMLPUBFUN void XMLCALL + xmlSAX2StartDocument (void *ctx); +XMLPUBFUN void XMLCALL + xmlSAX2EndDocument (void *ctx); +#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) +XMLPUBFUN void XMLCALL + xmlSAX2StartElement (void *ctx, + const xmlChar *fullname, + const xmlChar **atts); +XMLPUBFUN void XMLCALL + xmlSAX2EndElement (void *ctx, + const xmlChar *name); +#endif /* LIBXML_SAX1_ENABLED or LIBXML_HTML_ENABLED */ +XMLPUBFUN void XMLCALL + xmlSAX2StartElementNs (void *ctx, + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI, + int nb_namespaces, + const xmlChar **namespaces, + int nb_attributes, + int nb_defaulted, + const xmlChar **attributes); +XMLPUBFUN void XMLCALL + xmlSAX2EndElementNs (void *ctx, + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI); +XMLPUBFUN void XMLCALL + xmlSAX2Reference (void *ctx, + const xmlChar *name); +XMLPUBFUN void XMLCALL + xmlSAX2Characters (void *ctx, + const xmlChar *ch, + int len); +XMLPUBFUN void XMLCALL + xmlSAX2IgnorableWhitespace (void *ctx, + const xmlChar *ch, + int len); +XMLPUBFUN void XMLCALL + xmlSAX2ProcessingInstruction (void *ctx, + const xmlChar *target, + const xmlChar *data); +XMLPUBFUN void XMLCALL + xmlSAX2Comment (void *ctx, + const xmlChar *value); +XMLPUBFUN void XMLCALL + xmlSAX2CDataBlock (void *ctx, + const xmlChar *value, + int len); + +#ifdef LIBXML_SAX1_ENABLED +XMLPUBFUN int XMLCALL + xmlSAXDefaultVersion (int version); +#endif /* LIBXML_SAX1_ENABLED */ + +XMLPUBFUN int XMLCALL + xmlSAXVersion (xmlSAXHandler *hdlr, + int version); +XMLPUBFUN void XMLCALL + xmlSAX2InitDefaultSAXHandler (xmlSAXHandler *hdlr, + int warning); +#ifdef LIBXML_HTML_ENABLED +XMLPUBFUN void XMLCALL + xmlSAX2InitHtmlDefaultSAXHandler(xmlSAXHandler *hdlr); +XMLPUBFUN void XMLCALL + htmlDefaultSAXHandlerInit (void); +#endif +#ifdef LIBXML_DOCB_ENABLED +XMLPUBFUN void XMLCALL + xmlSAX2InitDocbDefaultSAXHandler(xmlSAXHandler *hdlr); +XMLPUBFUN void XMLCALL + docbDefaultSAXHandlerInit (void); +#endif +XMLPUBFUN void XMLCALL + xmlDefaultSAXHandlerInit (void); +#ifdef __cplusplus +} +#endif +#endif /* __XML_SAX2_H__ */ diff --git a/include/libxml/c14n.h b/include/libxml/c14n.h new file mode 100644 index 0000000..9f4c6c0 --- /dev/null +++ b/include/libxml/c14n.h @@ -0,0 +1,105 @@ +/* + * Summary: Provide Canonical XML and Exclusive XML Canonicalization + * Description: the c14n modules provides a + * + * "Canonical XML" implementation + * http://www.w3.org/TR/xml-c14n + * + * and an + * + * "Exclusive XML Canonicalization" implementation + * http://www.w3.org/TR/xml-exc-c14n + + * Copy: See Copyright for the status of this software. + * + * Author: Aleksey Sanin + */ +#ifndef __XML_C14N_H__ +#define __XML_C14N_H__ +#ifdef LIBXML_C14N_ENABLED +#ifdef LIBXML_OUTPUT_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include +#include +#include + +/* + * XML Canonicazation + * http://www.w3.org/TR/xml-c14n + * + * Exclusive XML Canonicazation + * http://www.w3.org/TR/xml-exc-c14n + * + * Canonical form of an XML document could be created if and only if + * a) default attributes (if any) are added to all nodes + * b) all character and parsed entity references are resolved + * In order to achive this in libxml2 the document MUST be loaded with + * following global setings: + * + * xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS; + * xmlSubstituteEntitiesDefault(1); + * + * or corresponding parser context setting: + * xmlParserCtxtPtr ctxt; + * + * ... + * ctxt->loadsubset = XML_DETECT_IDS | XML_COMPLETE_ATTRS; + * ctxt->replaceEntities = 1; + * ... + */ + + +XMLPUBFUN int XMLCALL + xmlC14NDocSaveTo (xmlDocPtr doc, + xmlNodeSetPtr nodes, + int exclusive, + xmlChar **inclusive_ns_prefixes, + int with_comments, + xmlOutputBufferPtr buf); + +XMLPUBFUN int XMLCALL + xmlC14NDocDumpMemory (xmlDocPtr doc, + xmlNodeSetPtr nodes, + int exclusive, + xmlChar **inclusive_ns_prefixes, + int with_comments, + xmlChar **doc_txt_ptr); + +XMLPUBFUN int XMLCALL + xmlC14NDocSave (xmlDocPtr doc, + xmlNodeSetPtr nodes, + int exclusive, + xmlChar **inclusive_ns_prefixes, + int with_comments, + const char* filename, + int compression); + + +/** + * This is the core C14N function + */ +typedef int (*xmlC14NIsVisibleCallback) (void* user_data, + xmlNodePtr node, + xmlNodePtr parent); + +XMLPUBFUN int XMLCALL + xmlC14NExecute (xmlDocPtr doc, + xmlC14NIsVisibleCallback is_visible_callback, + void* user_data, + int exclusive, + xmlChar **inclusive_ns_prefixes, + int with_comments, + xmlOutputBufferPtr buf); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* LIBXML_OUTPUT_ENABLED */ +#endif /* LIBXML_C14N_ENABLED */ +#endif /* __XML_C14N_H__ */ + diff --git a/include/libxml/catalog.h b/include/libxml/catalog.h new file mode 100644 index 0000000..b444137 --- /dev/null +++ b/include/libxml/catalog.h @@ -0,0 +1,182 @@ +/** + * Summary: interfaces to the Catalog handling system + * Description: the catalog module implements the support for + * XML Catalogs and SGML catalogs + * + * SGML Open Technical Resolution TR9401:1997. + * http://www.jclark.com/sp/catalog.htm + * + * XML Catalogs Working Draft 06 August 2001 + * http://www.oasis-open.org/committees/entity/spec-2001-08-06.html + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_CATALOG_H__ +#define __XML_CATALOG_H__ + +#include + +#include +#include +#include + +#ifdef LIBXML_CATALOG_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * XML_CATALOGS_NAMESPACE: + * + * The namespace for the XML Catalogs elements. + */ +#define XML_CATALOGS_NAMESPACE \ + (const xmlChar *) "urn:oasis:names:tc:entity:xmlns:xml:catalog" +/** + * XML_CATALOG_PI: + * + * The specific XML Catalog Processing Instuction name. + */ +#define XML_CATALOG_PI \ + (const xmlChar *) "oasis-xml-catalog" + +/* + * The API is voluntarily limited to general cataloging. + */ +typedef enum { + XML_CATA_PREFER_NONE = 0, + XML_CATA_PREFER_PUBLIC = 1, + XML_CATA_PREFER_SYSTEM +} xmlCatalogPrefer; + +typedef enum { + XML_CATA_ALLOW_NONE = 0, + XML_CATA_ALLOW_GLOBAL = 1, + XML_CATA_ALLOW_DOCUMENT = 2, + XML_CATA_ALLOW_ALL = 3 +} xmlCatalogAllow; + +typedef struct _xmlCatalog xmlCatalog; +typedef xmlCatalog *xmlCatalogPtr; + +/* + * Operations on a given catalog. + */ +XMLPUBFUN xmlCatalogPtr XMLCALL + xmlNewCatalog (int sgml); +XMLPUBFUN xmlCatalogPtr XMLCALL + xmlLoadACatalog (const char *filename); +XMLPUBFUN xmlCatalogPtr XMLCALL + xmlLoadSGMLSuperCatalog (const char *filename); +XMLPUBFUN int XMLCALL + xmlConvertSGMLCatalog (xmlCatalogPtr catal); +XMLPUBFUN int XMLCALL + xmlACatalogAdd (xmlCatalogPtr catal, + const xmlChar *type, + const xmlChar *orig, + const xmlChar *replace); +XMLPUBFUN int XMLCALL + xmlACatalogRemove (xmlCatalogPtr catal, + const xmlChar *value); +XMLPUBFUN xmlChar * XMLCALL + xmlACatalogResolve (xmlCatalogPtr catal, + const xmlChar *pubID, + const xmlChar *sysID); +XMLPUBFUN xmlChar * XMLCALL + xmlACatalogResolveSystem(xmlCatalogPtr catal, + const xmlChar *sysID); +XMLPUBFUN xmlChar * XMLCALL + xmlACatalogResolvePublic(xmlCatalogPtr catal, + const xmlChar *pubID); +XMLPUBFUN xmlChar * XMLCALL + xmlACatalogResolveURI (xmlCatalogPtr catal, + const xmlChar *URI); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void XMLCALL + xmlACatalogDump (xmlCatalogPtr catal, + FILE *out); +#endif /* LIBXML_OUTPUT_ENABLED */ +XMLPUBFUN void XMLCALL + xmlFreeCatalog (xmlCatalogPtr catal); +XMLPUBFUN int XMLCALL + xmlCatalogIsEmpty (xmlCatalogPtr catal); + +/* + * Global operations. + */ +XMLPUBFUN void XMLCALL + xmlInitializeCatalog (void); +XMLPUBFUN int XMLCALL + xmlLoadCatalog (const char *filename); +XMLPUBFUN void XMLCALL + xmlLoadCatalogs (const char *paths); +XMLPUBFUN void XMLCALL + xmlCatalogCleanup (void); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void XMLCALL + xmlCatalogDump (FILE *out); +#endif /* LIBXML_OUTPUT_ENABLED */ +XMLPUBFUN xmlChar * XMLCALL + xmlCatalogResolve (const xmlChar *pubID, + const xmlChar *sysID); +XMLPUBFUN xmlChar * XMLCALL + xmlCatalogResolveSystem (const xmlChar *sysID); +XMLPUBFUN xmlChar * XMLCALL + xmlCatalogResolvePublic (const xmlChar *pubID); +XMLPUBFUN xmlChar * XMLCALL + xmlCatalogResolveURI (const xmlChar *URI); +XMLPUBFUN int XMLCALL + xmlCatalogAdd (const xmlChar *type, + const xmlChar *orig, + const xmlChar *replace); +XMLPUBFUN int XMLCALL + xmlCatalogRemove (const xmlChar *value); +XMLPUBFUN xmlDocPtr XMLCALL + xmlParseCatalogFile (const char *filename); +XMLPUBFUN int XMLCALL + xmlCatalogConvert (void); + +/* + * Strictly minimal interfaces for per-document catalogs used + * by the parser. + */ +XMLPUBFUN void XMLCALL + xmlCatalogFreeLocal (void *catalogs); +XMLPUBFUN void * XMLCALL + xmlCatalogAddLocal (void *catalogs, + const xmlChar *URL); +XMLPUBFUN xmlChar * XMLCALL + xmlCatalogLocalResolve (void *catalogs, + const xmlChar *pubID, + const xmlChar *sysID); +XMLPUBFUN xmlChar * XMLCALL + xmlCatalogLocalResolveURI(void *catalogs, + const xmlChar *URI); +/* + * Preference settings. + */ +XMLPUBFUN int XMLCALL + xmlCatalogSetDebug (int level); +XMLPUBFUN xmlCatalogPrefer XMLCALL + xmlCatalogSetDefaultPrefer(xmlCatalogPrefer prefer); +XMLPUBFUN void XMLCALL + xmlCatalogSetDefaults (xmlCatalogAllow allow); +XMLPUBFUN xmlCatalogAllow XMLCALL + xmlCatalogGetDefaults (void); + + +/* DEPRECATED interfaces */ +XMLPUBFUN const xmlChar * XMLCALL + xmlCatalogGetSystem (const xmlChar *sysID); +XMLPUBFUN const xmlChar * XMLCALL + xmlCatalogGetPublic (const xmlChar *pubID); + +#ifdef __cplusplus +} +#endif +#endif /* LIBXML_CATALOG_ENABLED */ +#endif /* __XML_CATALOG_H__ */ diff --git a/include/libxml/chvalid.h b/include/libxml/chvalid.h new file mode 100644 index 0000000..6301a91 --- /dev/null +++ b/include/libxml/chvalid.h @@ -0,0 +1,230 @@ +/* + * Summary: Unicode character range checking + * Description: this module exports interfaces for the character + * range validation APIs + * + * This file is automatically generated from the cvs source + * definition files using the genChRanges.py Python script + * + * Generation date: Tue Nov 18 08:14:21 2003 + * Sources: chvalid.def + * Author: William Brack + */ + +#ifndef __XML_CHVALID_H__ +#define __XML_CHVALID_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Define our typedefs and structures + * + */ +typedef struct _xmlChSRange xmlChSRange; +typedef xmlChSRange *xmlChSRangePtr; +struct _xmlChSRange { + unsigned short low; + unsigned short high; +}; + +typedef struct _xmlChLRange xmlChLRange; +typedef xmlChLRange *xmlChLRangePtr; +struct _xmlChLRange { + unsigned int low; + unsigned int high; +}; + +typedef struct _xmlChRangeGroup xmlChRangeGroup; +typedef xmlChRangeGroup *xmlChRangeGroupPtr; +struct _xmlChRangeGroup { + int nbShortRange; + int nbLongRange; + xmlChSRangePtr shortRange; /* points to an array of ranges */ + xmlChLRangePtr longRange; +}; + +/** + * Range checking routine + */ +XMLPUBFUN int XMLCALL + xmlCharInRange(unsigned int val, const xmlChRangeGroupPtr group); + + +/** + * xmlIsBaseChar_ch: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsBaseChar_ch(c) (((0x41 <= (c)) && ((c) <= 0x5a)) || \ + ((0x61 <= (c)) && ((c) <= 0x7a)) || \ + ((0xc0 <= (c)) && ((c) <= 0xd6)) || \ + ((0xd8 <= (c)) && ((c) <= 0xf6)) || \ + (0xf8 <= (c))) + +/** + * xmlIsBaseCharQ: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsBaseCharQ(c) (((c) < 0x100) ? \ + xmlIsBaseChar_ch((c)) : \ + xmlCharInRange((c), &xmlIsBaseCharGroup)) + +XMLPUBVAR xmlChRangeGroup xmlIsBaseCharGroup; + +/** + * xmlIsBlank_ch: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsBlank_ch(c) (((c) == 0x20) || \ + ((0x9 <= (c)) && ((c) <= 0xa)) || \ + ((c) == 0xd)) + +/** + * xmlIsBlankQ: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsBlankQ(c) (((c) < 0x100) ? \ + xmlIsBlank_ch((c)) : 0) + + +/** + * xmlIsChar_ch: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsChar_ch(c) (((0x9 <= (c)) && ((c) <= 0xa)) || \ + ((c) == 0xd) || \ + (0x20 <= (c))) + +/** + * xmlIsCharQ: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsCharQ(c) (((c) < 0x100) ? \ + xmlIsChar_ch((c)) :\ + (((0x100 <= (c)) && ((c) <= 0xd7ff)) || \ + ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \ + ((0x10000 <= (c)) && ((c) <= 0x10ffff)))) + +XMLPUBVAR xmlChRangeGroup xmlIsCharGroup; + +/** + * xmlIsCombiningQ: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsCombiningQ(c) (((c) < 0x100) ? \ + 0 : \ + xmlCharInRange((c), &xmlIsCombiningGroup)) + +XMLPUBVAR xmlChRangeGroup xmlIsCombiningGroup; + +/** + * xmlIsDigit_ch: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsDigit_ch(c) (((0x30 <= (c)) && ((c) <= 0x39))) + +/** + * xmlIsDigitQ: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsDigitQ(c) (((c) < 0x100) ? \ + xmlIsDigit_ch((c)) : \ + xmlCharInRange((c), &xmlIsDigitGroup)) + +XMLPUBVAR xmlChRangeGroup xmlIsDigitGroup; + +/** + * xmlIsExtender_ch: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsExtender_ch(c) (((c) == 0xb7)) + +/** + * xmlIsExtenderQ: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsExtenderQ(c) (((c) < 0x100) ? \ + xmlIsExtender_ch((c)) : \ + xmlCharInRange((c), &xmlIsExtenderGroup)) + +XMLPUBVAR xmlChRangeGroup xmlIsExtenderGroup; + +/** + * xmlIsIdeographicQ: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsIdeographicQ(c) (((c) < 0x100) ? \ + 0 :\ + (((0x4e00 <= (c)) && ((c) <= 0x9fa5)) || \ + ((c) == 0x3007) || \ + ((0x3021 <= (c)) && ((c) <= 0x3029)))) + +XMLPUBVAR xmlChRangeGroup xmlIsIdeographicGroup; +XMLPUBVAR unsigned char xmlIsPubidChar_tab[256]; + +/** + * xmlIsPubidChar_ch: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsPubidChar_ch(c) (xmlIsPubidChar_tab[(c)]) + +/** + * xmlIsPubidCharQ: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsPubidCharQ(c) (((c) < 0x100) ? \ + xmlIsPubidChar_ch((c)) : 0) + +XMLPUBFUN int XMLCALL + xmlIsBaseChar(unsigned int ch); +XMLPUBFUN int XMLCALL + xmlIsBlank(unsigned int ch); +XMLPUBFUN int XMLCALL + xmlIsChar(unsigned int ch); +XMLPUBFUN int XMLCALL + xmlIsCombining(unsigned int ch); +XMLPUBFUN int XMLCALL + xmlIsDigit(unsigned int ch); +XMLPUBFUN int XMLCALL + xmlIsExtender(unsigned int ch); +XMLPUBFUN int XMLCALL + xmlIsIdeographic(unsigned int ch); +XMLPUBFUN int XMLCALL + xmlIsPubidChar(unsigned int ch); + +#ifdef __cplusplus +} +#endif +#endif /* __XML_CHVALID_H__ */ diff --git a/include/libxml/debugXML.h b/include/libxml/debugXML.h new file mode 100644 index 0000000..5a9d20b --- /dev/null +++ b/include/libxml/debugXML.h @@ -0,0 +1,217 @@ +/* + * Summary: Tree debugging APIs + * Description: Interfaces to a set of routines used for debugging the tree + * produced by the XML parser. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __DEBUG_XML__ +#define __DEBUG_XML__ +#include +#include +#include + +#ifdef LIBXML_DEBUG_ENABLED + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The standard Dump routines. + */ +XMLPUBFUN void XMLCALL + xmlDebugDumpString (FILE *output, + const xmlChar *str); +XMLPUBFUN void XMLCALL + xmlDebugDumpAttr (FILE *output, + xmlAttrPtr attr, + int depth); +XMLPUBFUN void XMLCALL + xmlDebugDumpAttrList (FILE *output, + xmlAttrPtr attr, + int depth); +XMLPUBFUN void XMLCALL + xmlDebugDumpOneNode (FILE *output, + xmlNodePtr node, + int depth); +XMLPUBFUN void XMLCALL + xmlDebugDumpNode (FILE *output, + xmlNodePtr node, + int depth); +XMLPUBFUN void XMLCALL + xmlDebugDumpNodeList (FILE *output, + xmlNodePtr node, + int depth); +XMLPUBFUN void XMLCALL + xmlDebugDumpDocumentHead(FILE *output, + xmlDocPtr doc); +XMLPUBFUN void XMLCALL + xmlDebugDumpDocument (FILE *output, + xmlDocPtr doc); +XMLPUBFUN void XMLCALL + xmlDebugDumpDTD (FILE *output, + xmlDtdPtr dtd); +XMLPUBFUN void XMLCALL + xmlDebugDumpEntities (FILE *output, + xmlDocPtr doc); + +/**************************************************************** + * * + * Checking routines * + * * + ****************************************************************/ + +XMLPUBFUN int XMLCALL + xmlDebugCheckDocument (FILE * output, + xmlDocPtr doc); + +/**************************************************************** + * * + * XML shell helpers * + * * + ****************************************************************/ + +XMLPUBFUN void XMLCALL + xmlLsOneNode (FILE *output, xmlNodePtr node); +XMLPUBFUN int XMLCALL + xmlLsCountNode (xmlNodePtr node); + +XMLPUBFUN const char * XMLCALL + xmlBoolToText (int boolval); + +/**************************************************************** + * * + * The XML shell related structures and functions * + * * + ****************************************************************/ + +#ifdef LIBXML_XPATH_ENABLED +/** + * xmlShellReadlineFunc: + * @prompt: a string prompt + * + * This is a generic signature for the XML shell input function. + * + * Returns a string which will be freed by the Shell. + */ +typedef char * (* xmlShellReadlineFunc)(char *prompt); + +/** + * xmlShellCtxt: + * + * A debugging shell context. + * TODO: add the defined function tables. + */ +typedef struct _xmlShellCtxt xmlShellCtxt; +typedef xmlShellCtxt *xmlShellCtxtPtr; +struct _xmlShellCtxt { + char *filename; + xmlDocPtr doc; + xmlNodePtr node; + xmlXPathContextPtr pctxt; + int loaded; + FILE *output; + xmlShellReadlineFunc input; +}; + +/** + * xmlShellCmd: + * @ctxt: a shell context + * @arg: a string argument + * @node: a first node + * @node2: a second node + * + * This is a generic signature for the XML shell functions. + * + * Returns an int, negative returns indicating errors. + */ +typedef int (* xmlShellCmd) (xmlShellCtxtPtr ctxt, + char *arg, + xmlNodePtr node, + xmlNodePtr node2); + +XMLPUBFUN void XMLCALL + xmlShellPrintXPathError (int errorType, + const char *arg); +XMLPUBFUN void XMLCALL + xmlShellPrintXPathResult(xmlXPathObjectPtr list); +XMLPUBFUN int XMLCALL + xmlShellList (xmlShellCtxtPtr ctxt, + char *arg, + xmlNodePtr node, + xmlNodePtr node2); +XMLPUBFUN int XMLCALL + xmlShellBase (xmlShellCtxtPtr ctxt, + char *arg, + xmlNodePtr node, + xmlNodePtr node2); +XMLPUBFUN int XMLCALL + xmlShellDir (xmlShellCtxtPtr ctxt, + char *arg, + xmlNodePtr node, + xmlNodePtr node2); +XMLPUBFUN int XMLCALL + xmlShellLoad (xmlShellCtxtPtr ctxt, + char *filename, + xmlNodePtr node, + xmlNodePtr node2); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void XMLCALL + xmlShellPrintNode (xmlNodePtr node); +XMLPUBFUN int XMLCALL + xmlShellCat (xmlShellCtxtPtr ctxt, + char *arg, + xmlNodePtr node, + xmlNodePtr node2); +XMLPUBFUN int XMLCALL + xmlShellWrite (xmlShellCtxtPtr ctxt, + char *filename, + xmlNodePtr node, + xmlNodePtr node2); +XMLPUBFUN int XMLCALL + xmlShellSave (xmlShellCtxtPtr ctxt, + char *filename, + xmlNodePtr node, + xmlNodePtr node2); +#endif /* LIBXML_OUTPUT_ENABLED */ +#ifdef LIBXML_VALID_ENABLED +XMLPUBFUN int XMLCALL + xmlShellValidate (xmlShellCtxtPtr ctxt, + char *dtd, + xmlNodePtr node, + xmlNodePtr node2); +#endif /* LIBXML_VALID_ENABLED */ +XMLPUBFUN int XMLCALL + xmlShellDu (xmlShellCtxtPtr ctxt, + char *arg, + xmlNodePtr tree, + xmlNodePtr node2); +XMLPUBFUN int XMLCALL + xmlShellPwd (xmlShellCtxtPtr ctxt, + char *buffer, + xmlNodePtr node, + xmlNodePtr node2); + +/* + * The Shell interface. + */ +XMLPUBFUN void XMLCALL + xmlShell (xmlDocPtr doc, + char *filename, + xmlShellReadlineFunc input, + FILE *output); + +#endif /* LIBXML_XPATH_ENABLED */ + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_DEBUG_ENABLED */ +#endif /* __DEBUG_XML__ */ diff --git a/include/libxml/dict.h b/include/libxml/dict.h new file mode 100644 index 0000000..abb8339 --- /dev/null +++ b/include/libxml/dict.h @@ -0,0 +1,69 @@ +/* + * Summary: string dictionnary + * Description: dictionary of reusable strings, just used to avoid allocation + * and freeing operations. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_DICT_H__ +#define __XML_DICT_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The dictionnary. + */ +typedef struct _xmlDict xmlDict; +typedef xmlDict *xmlDictPtr; + +/* + * Constructor and destructor. + */ +XMLPUBFUN xmlDictPtr XMLCALL + xmlDictCreate (void); +XMLPUBFUN xmlDictPtr XMLCALL + xmlDictCreateSub(xmlDictPtr sub); +XMLPUBFUN int XMLCALL + xmlDictReference(xmlDictPtr dict); +XMLPUBFUN void XMLCALL + xmlDictFree (xmlDictPtr dict); + +/* + * Lookup of entry in the dictionnary. + */ +XMLPUBFUN const xmlChar * XMLCALL + xmlDictLookup (xmlDictPtr dict, + const xmlChar *name, + int len); +XMLPUBFUN const xmlChar * XMLCALL + xmlDictExists (xmlDictPtr dict, + const xmlChar *name, + int len); +XMLPUBFUN const xmlChar * XMLCALL + xmlDictQLookup (xmlDictPtr dict, + const xmlChar *prefix, + const xmlChar *name); +XMLPUBFUN int XMLCALL + xmlDictOwns (xmlDictPtr dict, + const xmlChar *str); +XMLPUBFUN int XMLCALL + xmlDictSize (xmlDictPtr dict); + +/* + * Cleanup function + */ +XMLPUBFUN void XMLCALL + xmlDictCleanup (void); + +#ifdef __cplusplus +} +#endif +#endif /* ! __XML_DICT_H__ */ diff --git a/include/libxml/encoding.h b/include/libxml/encoding.h new file mode 100644 index 0000000..c74b25f --- /dev/null +++ b/include/libxml/encoding.h @@ -0,0 +1,226 @@ +/* + * Summary: interface for the encoding conversion functions + * Description: interface for the encoding conversion functions needed for + * XML basic encoding and iconv() support. + * + * Related specs are + * rfc2044 (UTF-8 and UTF-16) F. Yergeau Alis Technologies + * [ISO-10646] UTF-8 and UTF-16 in Annexes + * [ISO-8859-1] ISO Latin-1 characters codes. + * [UNICODE] The Unicode Consortium, "The Unicode Standard -- + * Worldwide Character Encoding -- Version 1.0", Addison- + * Wesley, Volume 1, 1991, Volume 2, 1992. UTF-8 is + * described in Unicode Technical Report #4. + * [US-ASCII] Coded Character Set--7-bit American Standard Code for + * Information Interchange, ANSI X3.4-1986. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_CHAR_ENCODING_H__ +#define __XML_CHAR_ENCODING_H__ + +#include + +#ifdef LIBXML_ICONV_ENABLED +#include +#endif +#ifdef __cplusplus +extern "C" { +#endif + +/* + * xmlCharEncoding: + * + * Predefined values for some standard encodings. + * Libxml does not do beforehand translation on UTF8 and ISOLatinX. + * It also supports ASCII, ISO-8859-1, and UTF16 (LE and BE) by default. + * + * Anything else would have to be translated to UTF8 before being + * given to the parser itself. The BOM for UTF16 and the encoding + * declaration are looked at and a converter is looked for at that + * point. If not found the parser stops here as asked by the XML REC. A + * converter can be registered by the user using xmlRegisterCharEncodingHandler + * but the current form doesn't allow stateful transcoding (a serious + * problem agreed !). If iconv has been found it will be used + * automatically and allow stateful transcoding, the simplest is then + * to be sure to enable iconv and to provide iconv libs for the encoding + * support needed. + * + * Note that the generic "UTF-16" is not a predefined value. Instead, only + * the specific UTF-16LE and UTF-16BE are present. + */ +typedef enum { + XML_CHAR_ENCODING_ERROR= -1, /* No char encoding detected */ + XML_CHAR_ENCODING_NONE= 0, /* No char encoding detected */ + XML_CHAR_ENCODING_UTF8= 1, /* UTF-8 */ + XML_CHAR_ENCODING_UTF16LE= 2, /* UTF-16 little endian */ + XML_CHAR_ENCODING_UTF16BE= 3, /* UTF-16 big endian */ + XML_CHAR_ENCODING_UCS4LE= 4, /* UCS-4 little endian */ + XML_CHAR_ENCODING_UCS4BE= 5, /* UCS-4 big endian */ + XML_CHAR_ENCODING_EBCDIC= 6, /* EBCDIC uh! */ + XML_CHAR_ENCODING_UCS4_2143=7, /* UCS-4 unusual ordering */ + XML_CHAR_ENCODING_UCS4_3412=8, /* UCS-4 unusual ordering */ + XML_CHAR_ENCODING_UCS2= 9, /* UCS-2 */ + XML_CHAR_ENCODING_8859_1= 10,/* ISO-8859-1 ISO Latin 1 */ + XML_CHAR_ENCODING_8859_2= 11,/* ISO-8859-2 ISO Latin 2 */ + XML_CHAR_ENCODING_8859_3= 12,/* ISO-8859-3 */ + XML_CHAR_ENCODING_8859_4= 13,/* ISO-8859-4 */ + XML_CHAR_ENCODING_8859_5= 14,/* ISO-8859-5 */ + XML_CHAR_ENCODING_8859_6= 15,/* ISO-8859-6 */ + XML_CHAR_ENCODING_8859_7= 16,/* ISO-8859-7 */ + XML_CHAR_ENCODING_8859_8= 17,/* ISO-8859-8 */ + XML_CHAR_ENCODING_8859_9= 18,/* ISO-8859-9 */ + XML_CHAR_ENCODING_2022_JP= 19,/* ISO-2022-JP */ + XML_CHAR_ENCODING_SHIFT_JIS=20,/* Shift_JIS */ + XML_CHAR_ENCODING_EUC_JP= 21,/* EUC-JP */ + XML_CHAR_ENCODING_ASCII= 22 /* pure ASCII */ +} xmlCharEncoding; + +/** + * xmlCharEncodingInputFunc: + * @out: a pointer to an array of bytes to store the UTF-8 result + * @outlen: the length of @out + * @in: a pointer to an array of chars in the original encoding + * @inlen: the length of @in + * + * Take a block of chars in the original encoding and try to convert + * it to an UTF-8 block of chars out. + * + * Returns the number of bytes written, -1 if lack of space, or -2 + * if the transcoding failed. + * The value of @inlen after return is the number of octets consumed + * if the return value is positive, else unpredictiable. + * The value of @outlen after return is the number of octets consumed. + */ +typedef int (* xmlCharEncodingInputFunc)(unsigned char *out, int *outlen, + const unsigned char *in, int *inlen); + + +/** + * xmlCharEncodingOutputFunc: + * @out: a pointer to an array of bytes to store the result + * @outlen: the length of @out + * @in: a pointer to an array of UTF-8 chars + * @inlen: the length of @in + * + * Take a block of UTF-8 chars in and try to convert it to another + * encoding. + * Note: a first call designed to produce heading info is called with + * in = NULL. If stateful this should also initialize the encoder state. + * + * Returns the number of bytes written, -1 if lack of space, or -2 + * if the transcoding failed. + * The value of @inlen after return is the number of octets consumed + * if the return value is positive, else unpredictiable. + * The value of @outlen after return is the number of octets produced. + */ +typedef int (* xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen, + const unsigned char *in, int *inlen); + + +/* + * Block defining the handlers for non UTF-8 encodings. + * If iconv is supported, there are two extra fields. + */ + +typedef struct _xmlCharEncodingHandler xmlCharEncodingHandler; +typedef xmlCharEncodingHandler *xmlCharEncodingHandlerPtr; +struct _xmlCharEncodingHandler { + char *name; + xmlCharEncodingInputFunc input; + xmlCharEncodingOutputFunc output; +#ifdef LIBXML_ICONV_ENABLED + iconv_t iconv_in; + iconv_t iconv_out; +#endif /* LIBXML_ICONV_ENABLED */ +}; + +#ifdef __cplusplus +} +#endif +#include +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Interfaces for encoding handlers. + */ +XMLPUBFUN void XMLCALL + xmlInitCharEncodingHandlers (void); +XMLPUBFUN void XMLCALL + xmlCleanupCharEncodingHandlers (void); +XMLPUBFUN void XMLCALL + xmlRegisterCharEncodingHandler (xmlCharEncodingHandlerPtr handler); +XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL + xmlGetCharEncodingHandler (xmlCharEncoding enc); +XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL + xmlFindCharEncodingHandler (const char *name); +XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL + xmlNewCharEncodingHandler (const char *name, + xmlCharEncodingInputFunc input, + xmlCharEncodingOutputFunc output); + +/* + * Interfaces for encoding names and aliases. + */ +XMLPUBFUN int XMLCALL + xmlAddEncodingAlias (const char *name, + const char *alias); +XMLPUBFUN int XMLCALL + xmlDelEncodingAlias (const char *alias); +XMLPUBFUN const char * XMLCALL + xmlGetEncodingAlias (const char *alias); +XMLPUBFUN void XMLCALL + xmlCleanupEncodingAliases (void); +XMLPUBFUN xmlCharEncoding XMLCALL + xmlParseCharEncoding (const char *name); +XMLPUBFUN const char * XMLCALL + xmlGetCharEncodingName (xmlCharEncoding enc); + +/* + * Interfaces directly used by the parsers. + */ +XMLPUBFUN xmlCharEncoding XMLCALL + xmlDetectCharEncoding (const unsigned char *in, + int len); + +XMLPUBFUN int XMLCALL + xmlCharEncOutFunc (xmlCharEncodingHandler *handler, + xmlBufferPtr out, + xmlBufferPtr in); + +XMLPUBFUN int XMLCALL + xmlCharEncInFunc (xmlCharEncodingHandler *handler, + xmlBufferPtr out, + xmlBufferPtr in); +XMLPUBFUN int XMLCALL + xmlCharEncFirstLine (xmlCharEncodingHandler *handler, + xmlBufferPtr out, + xmlBufferPtr in); +XMLPUBFUN int XMLCALL + xmlCharEncCloseFunc (xmlCharEncodingHandler *handler); + +/* + * Export a few useful functions + */ +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN int XMLCALL + UTF8Toisolat1 (unsigned char *out, + int *outlen, + const unsigned char *in, + int *inlen); +#endif /* LIBXML_OUTPUT_ENABLED */ +XMLPUBFUN int XMLCALL + isolat1ToUTF8 (unsigned char *out, + int *outlen, + const unsigned char *in, + int *inlen); +#ifdef __cplusplus +} +#endif + +#endif /* __XML_CHAR_ENCODING_H__ */ diff --git a/include/libxml/entities.h b/include/libxml/entities.h new file mode 100644 index 0000000..0bb28a0 --- /dev/null +++ b/include/libxml/entities.h @@ -0,0 +1,139 @@ +/* + * Summary: interface for the XML entities handling + * Description: this module provides some of the entity API needed + * for the parser and applications. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_ENTITIES_H__ +#define __XML_ENTITIES_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The different valid entity types. + */ +typedef enum { + XML_INTERNAL_GENERAL_ENTITY = 1, + XML_EXTERNAL_GENERAL_PARSED_ENTITY = 2, + XML_EXTERNAL_GENERAL_UNPARSED_ENTITY = 3, + XML_INTERNAL_PARAMETER_ENTITY = 4, + XML_EXTERNAL_PARAMETER_ENTITY = 5, + XML_INTERNAL_PREDEFINED_ENTITY = 6 +} xmlEntityType; + +/* + * An unit of storage for an entity, contains the string, the value + * and the linkind data needed for the linking in the hash table. + */ + +struct _xmlEntity { + void *_private; /* application data */ + xmlElementType type; /* XML_ENTITY_DECL, must be second ! */ + const xmlChar *name; /* Entity name */ + struct _xmlNode *children; /* First child link */ + struct _xmlNode *last; /* Last child link */ + struct _xmlDtd *parent; /* -> DTD */ + struct _xmlNode *next; /* next sibling link */ + struct _xmlNode *prev; /* previous sibling link */ + struct _xmlDoc *doc; /* the containing document */ + + xmlChar *orig; /* content without ref substitution */ + xmlChar *content; /* content or ndata if unparsed */ + int length; /* the content length */ + xmlEntityType etype; /* The entity type */ + const xmlChar *ExternalID; /* External identifier for PUBLIC */ + const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC Entity */ + + struct _xmlEntity *nexte; /* unused */ + const xmlChar *URI; /* the full URI as computed */ + int owner; /* does the entity own the childrens */ +}; + +/* + * All entities are stored in an hash table. + * There is 2 separate hash tables for global and parameter entities. + */ + +typedef struct _xmlHashTable xmlEntitiesTable; +typedef xmlEntitiesTable *xmlEntitiesTablePtr; + +/* + * External functions: + */ + +#ifdef LIBXML_LEGACY_ENABLED +XMLPUBFUN void XMLCALL + xmlInitializePredefinedEntities (void); +#endif /* LIBXML_LEGACY_ENABLED */ +XMLPUBFUN xmlEntityPtr XMLCALL + xmlAddDocEntity (xmlDocPtr doc, + const xmlChar *name, + int type, + const xmlChar *ExternalID, + const xmlChar *SystemID, + const xmlChar *content); +XMLPUBFUN xmlEntityPtr XMLCALL + xmlAddDtdEntity (xmlDocPtr doc, + const xmlChar *name, + int type, + const xmlChar *ExternalID, + const xmlChar *SystemID, + const xmlChar *content); +XMLPUBFUN xmlEntityPtr XMLCALL + xmlGetPredefinedEntity (const xmlChar *name); +XMLPUBFUN xmlEntityPtr XMLCALL + xmlGetDocEntity (xmlDocPtr doc, + const xmlChar *name); +XMLPUBFUN xmlEntityPtr XMLCALL + xmlGetDtdEntity (xmlDocPtr doc, + const xmlChar *name); +XMLPUBFUN xmlEntityPtr XMLCALL + xmlGetParameterEntity (xmlDocPtr doc, + const xmlChar *name); +#ifdef LIBXML_LEGACY_ENABLED +XMLPUBFUN const xmlChar * XMLCALL + xmlEncodeEntities (xmlDocPtr doc, + const xmlChar *input); +#endif /* LIBXML_LEGACY_ENABLED */ +XMLPUBFUN xmlChar * XMLCALL + xmlEncodeEntitiesReentrant(xmlDocPtr doc, + const xmlChar *input); +XMLPUBFUN xmlChar * XMLCALL + xmlEncodeSpecialChars (xmlDocPtr doc, + const xmlChar *input); +XMLPUBFUN xmlEntitiesTablePtr XMLCALL + xmlCreateEntitiesTable (void); +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN xmlEntitiesTablePtr XMLCALL + xmlCopyEntitiesTable (xmlEntitiesTablePtr table); +#endif /* LIBXML_TREE_ENABLED */ +XMLPUBFUN void XMLCALL + xmlFreeEntitiesTable (xmlEntitiesTablePtr table); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void XMLCALL + xmlDumpEntitiesTable (xmlBufferPtr buf, + xmlEntitiesTablePtr table); +XMLPUBFUN void XMLCALL + xmlDumpEntityDecl (xmlBufferPtr buf, + xmlEntityPtr ent); +#endif /* LIBXML_OUTPUT_ENABLED */ +#ifdef LIBXML_LEGACY_ENABLED +XMLPUBFUN void XMLCALL + xmlCleanupPredefinedEntities(void); +#endif /* LIBXML_LEGACY_ENABLED */ + + +#ifdef __cplusplus +} +#endif + +# endif /* __XML_ENTITIES_H__ */ diff --git a/include/libxml/globals.h b/include/libxml/globals.h new file mode 100644 index 0000000..1173a8f --- /dev/null +++ b/include/libxml/globals.h @@ -0,0 +1,455 @@ +/* + * Summary: interface for all global variables of the library + * Description: all the global variables and thread handling for + * those variables is handled by this module. + * + * The bottom of this file is automatically generated by build_glob.py + * based on the description file global.data + * + * Copy: See Copyright for the status of this software. + * + * Author: Gary Pennington , Daniel Veillard + */ + +#ifndef __XML_GLOBALS_H +#define __XML_GLOBALS_H + +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +XMLPUBFUN void XMLCALL xmlInitGlobals(void); +XMLPUBFUN void XMLCALL xmlCleanupGlobals(void); + +typedef xmlParserInputBufferPtr (*xmlParserInputBufferCreateFilenameFunc) (const char *URI, xmlCharEncoding enc); +typedef xmlOutputBufferPtr (*xmlOutputBufferCreateFilenameFunc) (const char *URI, xmlCharEncodingHandlerPtr encoder, int compression); +XMLPUBFUN xmlParserInputBufferCreateFilenameFunc +XMLCALL xmlParserInputBufferCreateFilenameDefault (xmlParserInputBufferCreateFilenameFunc func); +XMLPUBFUN xmlOutputBufferCreateFilenameFunc +XMLCALL xmlOutputBufferCreateFilenameDefault (xmlOutputBufferCreateFilenameFunc func); + +/* + * Externally global symbols which need to be protected for backwards + * compatibility support. + */ + +#undef docbDefaultSAXHandler +#undef htmlDefaultSAXHandler +#undef oldXMLWDcompatibility +#undef xmlBufferAllocScheme +#undef xmlDefaultBufferSize +#undef xmlDefaultSAXHandler +#undef xmlDefaultSAXLocator +#undef xmlDoValidityCheckingDefaultValue +#undef xmlFree +#undef xmlGenericError +#undef xmlStructuredError +#undef xmlGenericErrorContext +#undef xmlGetWarningsDefaultValue +#undef xmlIndentTreeOutput +#undef xmlTreeIndentString +#undef xmlKeepBlanksDefaultValue +#undef xmlLineNumbersDefaultValue +#undef xmlLoadExtDtdDefaultValue +#undef xmlMalloc +#undef xmlMallocAtomic +#undef xmlMemStrdup +#undef xmlParserDebugEntities +#undef xmlParserVersion +#undef xmlPedanticParserDefaultValue +#undef xmlRealloc +#undef xmlSaveNoEmptyTags +#undef xmlSubstituteEntitiesDefaultValue +#undef xmlRegisterNodeDefaultValue +#undef xmlDeregisterNodeDefaultValue +#undef xmlLastError +#undef xmlParserInputBufferCreateFilenameValue +#undef xmlOutputBufferCreateFilenameValue + +typedef void (*xmlRegisterNodeFunc) (xmlNodePtr node); +typedef void (*xmlDeregisterNodeFunc) (xmlNodePtr node); + +typedef struct _xmlGlobalState xmlGlobalState; +typedef xmlGlobalState *xmlGlobalStatePtr; +struct _xmlGlobalState +{ + const char *xmlParserVersion; + + xmlSAXLocator xmlDefaultSAXLocator; + xmlSAXHandlerV1 xmlDefaultSAXHandler; + xmlSAXHandlerV1 docbDefaultSAXHandler; + xmlSAXHandlerV1 htmlDefaultSAXHandler; + + xmlFreeFunc xmlFree; + xmlMallocFunc xmlMalloc; + xmlStrdupFunc xmlMemStrdup; + xmlReallocFunc xmlRealloc; + + xmlGenericErrorFunc xmlGenericError; + xmlStructuredErrorFunc xmlStructuredError; + void *xmlGenericErrorContext; + + int oldXMLWDcompatibility; + + xmlBufferAllocationScheme xmlBufferAllocScheme; + int xmlDefaultBufferSize; + + int xmlSubstituteEntitiesDefaultValue; + int xmlDoValidityCheckingDefaultValue; + int xmlGetWarningsDefaultValue; + int xmlKeepBlanksDefaultValue; + int xmlLineNumbersDefaultValue; + int xmlLoadExtDtdDefaultValue; + int xmlParserDebugEntities; + int xmlPedanticParserDefaultValue; + + int xmlSaveNoEmptyTags; + int xmlIndentTreeOutput; + const char *xmlTreeIndentString; + + xmlRegisterNodeFunc xmlRegisterNodeDefaultValue; + xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue; + + xmlMallocFunc xmlMallocAtomic; + xmlError xmlLastError; + + xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue; + xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue; +}; + +#ifdef __cplusplus +} +#endif +#include +#ifdef __cplusplus +extern "C" { +#endif + +XMLPUBFUN void XMLCALL xmlInitializeGlobalState(xmlGlobalStatePtr gs); + +XMLPUBFUN void XMLCALL xmlThrDefSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler); + +XMLPUBFUN void XMLCALL xmlThrDefSetStructuredErrorFunc(void *ctx, xmlStructuredErrorFunc handler); + +XMLPUBFUN xmlRegisterNodeFunc XMLCALL xmlRegisterNodeDefault(xmlRegisterNodeFunc func); +XMLPUBFUN xmlRegisterNodeFunc XMLCALL xmlThrDefRegisterNodeDefault(xmlRegisterNodeFunc func); +XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func); +XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func); + +XMLPUBFUN xmlOutputBufferCreateFilenameFunc XMLCALL + xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func); +XMLPUBFUN xmlParserInputBufferCreateFilenameFunc XMLCALL + xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func); + +/** DOC_DISABLE */ +/* + * In general the memory allocation entry points are not kept + * thread specific but this can be overridden by LIBXML_THREAD_ALLOC_ENABLED + * - xmlMalloc + * - xmlMallocAtomic + * - xmlRealloc + * - xmlMemStrdup + * - xmlFree + */ + +#ifdef LIBXML_THREAD_ALLOC_ENABLED +#ifdef LIBXML_THREAD_ENABLED +XMLPUBFUN xmlMallocFunc * XMLCALL __xmlMalloc(void); +#define xmlMalloc \ +(*(__xmlMalloc())) +#else +XMLPUBVAR xmlMallocFunc xmlMalloc; +#endif + +#ifdef LIBXML_THREAD_ENABLED +XMLPUBFUN xmlMallocFunc * XMLCALL __xmlMallocAtomic(void); +#define xmlMallocAtomic \ +(*(__xmlMallocAtomic())) +#else +XMLPUBVAR xmlMallocFunc xmlMallocAtomic; +#endif + +#ifdef LIBXML_THREAD_ENABLED +XMLPUBFUN xmlReallocFunc * XMLCALL __xmlRealloc(void); +#define xmlRealloc \ +(*(__xmlRealloc())) +#else +XMLPUBVAR xmlReallocFunc xmlRealloc; +#endif + +#ifdef LIBXML_THREAD_ENABLED +XMLPUBFUN xmlFreeFunc * XMLCALL __xmlFree(void); +#define xmlFree \ +(*(__xmlFree())) +#else +XMLPUBVAR xmlFreeFunc xmlFree; +#endif + +#ifdef LIBXML_THREAD_ENABLED +XMLPUBFUN xmlStrdupFunc * XMLCALL __xmlMemStrdup(void); +#define xmlMemStrdup \ +(*(__xmlMemStrdup())) +#else +XMLPUBVAR xmlStrdupFunc xmlMemStrdup; +#endif + +#else /* !LIBXML_THREAD_ALLOC_ENABLED */ +XMLPUBVAR xmlMallocFunc xmlMalloc; +XMLPUBVAR xmlMallocFunc xmlMallocAtomic; +XMLPUBVAR xmlReallocFunc xmlRealloc; +XMLPUBVAR xmlFreeFunc xmlFree; +XMLPUBVAR xmlStrdupFunc xmlMemStrdup; +#endif /* LIBXML_THREAD_ALLOC_ENABLED */ + +#ifdef LIBXML_DOCB_ENABLED +XMLPUBFUN xmlSAXHandlerV1 * XMLCALL __docbDefaultSAXHandler(void); +#ifdef LIBXML_THREAD_ENABLED +#define docbDefaultSAXHandler \ +(*(__docbDefaultSAXHandler())) +#else +XMLPUBVAR xmlSAXHandlerV1 docbDefaultSAXHandler; +#endif +#endif + +#ifdef LIBXML_HTML_ENABLED +XMLPUBFUN xmlSAXHandlerV1 * XMLCALL __htmlDefaultSAXHandler(void); +#ifdef LIBXML_THREAD_ENABLED +#define htmlDefaultSAXHandler \ +(*(__htmlDefaultSAXHandler())) +#else +XMLPUBVAR xmlSAXHandlerV1 htmlDefaultSAXHandler; +#endif +#endif + +XMLPUBFUN xmlError * XMLCALL __xmlLastError(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlLastError \ +(*(__xmlLastError())) +#else +XMLPUBVAR xmlError xmlLastError; +#endif + +/* + * Everything starting from the line below is + * Automatically generated by build_glob.py. + * Do not modify the previous line. + */ + + +XMLPUBFUN int * XMLCALL __oldXMLWDcompatibility(void); +#ifdef LIBXML_THREAD_ENABLED +#define oldXMLWDcompatibility \ +(*(__oldXMLWDcompatibility())) +#else +XMLPUBVAR int oldXMLWDcompatibility; +#endif + +XMLPUBFUN xmlBufferAllocationScheme * XMLCALL __xmlBufferAllocScheme(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlBufferAllocScheme \ +(*(__xmlBufferAllocScheme())) +#else +XMLPUBVAR xmlBufferAllocationScheme xmlBufferAllocScheme; +#endif +XMLPUBFUN xmlBufferAllocationScheme XMLCALL xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v); + +XMLPUBFUN int * XMLCALL __xmlDefaultBufferSize(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlDefaultBufferSize \ +(*(__xmlDefaultBufferSize())) +#else +XMLPUBVAR int xmlDefaultBufferSize; +#endif +XMLPUBFUN int XMLCALL xmlThrDefDefaultBufferSize(int v); + +XMLPUBFUN xmlSAXHandlerV1 * XMLCALL __xmlDefaultSAXHandler(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlDefaultSAXHandler \ +(*(__xmlDefaultSAXHandler())) +#else +XMLPUBVAR xmlSAXHandlerV1 xmlDefaultSAXHandler; +#endif + +XMLPUBFUN xmlSAXLocator * XMLCALL __xmlDefaultSAXLocator(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlDefaultSAXLocator \ +(*(__xmlDefaultSAXLocator())) +#else +XMLPUBVAR xmlSAXLocator xmlDefaultSAXLocator; +#endif + +XMLPUBFUN int * XMLCALL __xmlDoValidityCheckingDefaultValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlDoValidityCheckingDefaultValue \ +(*(__xmlDoValidityCheckingDefaultValue())) +#else +XMLPUBVAR int xmlDoValidityCheckingDefaultValue; +#endif +XMLPUBFUN int XMLCALL xmlThrDefDoValidityCheckingDefaultValue(int v); + +XMLPUBFUN xmlGenericErrorFunc * XMLCALL __xmlGenericError(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlGenericError \ +(*(__xmlGenericError())) +#else +XMLPUBVAR xmlGenericErrorFunc xmlGenericError; +#endif + +XMLPUBFUN xmlStructuredErrorFunc * XMLCALL __xmlStructuredError(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlStructuredError \ +(*(__xmlStructuredError())) +#else +XMLPUBVAR xmlStructuredErrorFunc xmlStructuredError; +#endif + +XMLPUBFUN void * * XMLCALL __xmlGenericErrorContext(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlGenericErrorContext \ +(*(__xmlGenericErrorContext())) +#else +XMLPUBVAR void * xmlGenericErrorContext; +#endif + +XMLPUBFUN int * XMLCALL __xmlGetWarningsDefaultValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlGetWarningsDefaultValue \ +(*(__xmlGetWarningsDefaultValue())) +#else +XMLPUBVAR int xmlGetWarningsDefaultValue; +#endif +XMLPUBFUN int XMLCALL xmlThrDefGetWarningsDefaultValue(int v); + +XMLPUBFUN int * XMLCALL __xmlIndentTreeOutput(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlIndentTreeOutput \ +(*(__xmlIndentTreeOutput())) +#else +XMLPUBVAR int xmlIndentTreeOutput; +#endif +XMLPUBFUN int XMLCALL xmlThrDefIndentTreeOutput(int v); + +XMLPUBFUN const char * * XMLCALL __xmlTreeIndentString(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlTreeIndentString \ +(*(__xmlTreeIndentString())) +#else +XMLPUBVAR const char * xmlTreeIndentString; +#endif +XMLPUBFUN const char * XMLCALL xmlThrDefTreeIndentString(const char * v); + +XMLPUBFUN int * XMLCALL __xmlKeepBlanksDefaultValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlKeepBlanksDefaultValue \ +(*(__xmlKeepBlanksDefaultValue())) +#else +XMLPUBVAR int xmlKeepBlanksDefaultValue; +#endif +XMLPUBFUN int XMLCALL xmlThrDefKeepBlanksDefaultValue(int v); + +XMLPUBFUN int * XMLCALL __xmlLineNumbersDefaultValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlLineNumbersDefaultValue \ +(*(__xmlLineNumbersDefaultValue())) +#else +XMLPUBVAR int xmlLineNumbersDefaultValue; +#endif +XMLPUBFUN int XMLCALL xmlThrDefLineNumbersDefaultValue(int v); + +XMLPUBFUN int * XMLCALL __xmlLoadExtDtdDefaultValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlLoadExtDtdDefaultValue \ +(*(__xmlLoadExtDtdDefaultValue())) +#else +XMLPUBVAR int xmlLoadExtDtdDefaultValue; +#endif +XMLPUBFUN int XMLCALL xmlThrDefLoadExtDtdDefaultValue(int v); + +XMLPUBFUN int * XMLCALL __xmlParserDebugEntities(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlParserDebugEntities \ +(*(__xmlParserDebugEntities())) +#else +XMLPUBVAR int xmlParserDebugEntities; +#endif +XMLPUBFUN int XMLCALL xmlThrDefParserDebugEntities(int v); + +XMLPUBFUN const char * * XMLCALL __xmlParserVersion(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlParserVersion \ +(*(__xmlParserVersion())) +#else +XMLPUBVAR const char * xmlParserVersion; +#endif + +XMLPUBFUN int * XMLCALL __xmlPedanticParserDefaultValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlPedanticParserDefaultValue \ +(*(__xmlPedanticParserDefaultValue())) +#else +XMLPUBVAR int xmlPedanticParserDefaultValue; +#endif +XMLPUBFUN int XMLCALL xmlThrDefPedanticParserDefaultValue(int v); + +XMLPUBFUN int * XMLCALL __xmlSaveNoEmptyTags(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlSaveNoEmptyTags \ +(*(__xmlSaveNoEmptyTags())) +#else +XMLPUBVAR int xmlSaveNoEmptyTags; +#endif +XMLPUBFUN int XMLCALL xmlThrDefSaveNoEmptyTags(int v); + +XMLPUBFUN int * XMLCALL __xmlSubstituteEntitiesDefaultValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlSubstituteEntitiesDefaultValue \ +(*(__xmlSubstituteEntitiesDefaultValue())) +#else +XMLPUBVAR int xmlSubstituteEntitiesDefaultValue; +#endif +XMLPUBFUN int XMLCALL xmlThrDefSubstituteEntitiesDefaultValue(int v); + +XMLPUBFUN xmlRegisterNodeFunc * XMLCALL __xmlRegisterNodeDefaultValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlRegisterNodeDefaultValue \ +(*(__xmlRegisterNodeDefaultValue())) +#else +XMLPUBVAR xmlRegisterNodeFunc xmlRegisterNodeDefaultValue; +#endif + +XMLPUBFUN xmlDeregisterNodeFunc * XMLCALL __xmlDeregisterNodeDefaultValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlDeregisterNodeDefaultValue \ +(*(__xmlDeregisterNodeDefaultValue())) +#else +XMLPUBVAR xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue; +#endif + +XMLPUBFUN xmlParserInputBufferCreateFilenameFunc * XMLCALL __xmlParserInputBufferCreateFilenameValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlParserInputBufferCreateFilenameValue \ +(*(__xmlParserInputBufferCreateFilenameValue())) +#else +XMLPUBVAR xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue; +#endif + +XMLPUBFUN xmlOutputBufferCreateFilenameFunc * XMLCALL __xmlOutputBufferCreateFilenameValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlOutputBufferCreateFilenameValue \ +(*(__xmlOutputBufferCreateFilenameValue())) +#else +XMLPUBVAR xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue; +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __XML_GLOBALS_H */ diff --git a/include/libxml/hash.h b/include/libxml/hash.h new file mode 100644 index 0000000..7fe4be7 --- /dev/null +++ b/include/libxml/hash.h @@ -0,0 +1,233 @@ +/* + * Summary: Chained hash tables + * Description: This module implements the hash table support used in + * various places in the library. + * + * Copy: See Copyright for the status of this software. + * + * Author: Bjorn Reese + */ + +#ifndef __XML_HASH_H__ +#define __XML_HASH_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The hash table. + */ +typedef struct _xmlHashTable xmlHashTable; +typedef xmlHashTable *xmlHashTablePtr; + +#ifdef __cplusplus +} +#endif + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Recent version of gcc produce a warning when a function pointer is assigned + * to an object pointer, or vice versa. The following macro is a dirty hack + * to allow suppression of the warning. If your architecture has function + * pointers which are a different size than a void pointer, there may be some + * serious trouble within the library. + */ +/** + * XML_CAST_FPTR: + * @fptr: pointer to a function + * + * Macro to do a casting from an object pointer to a + * function pointer without encountering a warning from + * gcc + * + * #define XML_CAST_FPTR(fptr) (*(void **)(&fptr)) + * This macro violated ISO C aliasing rules (gcc4 on s390 broke) + * so it is disabled now + */ + +#define XML_CAST_FPTR(fptr) fptr + + +/* + * function types: + */ +/** + * xmlHashDeallocator: + * @payload: the data in the hash + * @name: the name associated + * + * Callback to free data from a hash. + */ +typedef void (*xmlHashDeallocator)(void *payload, xmlChar *name); +/** + * xmlHashCopier: + * @payload: the data in the hash + * @name: the name associated + * + * Callback to copy data from a hash. + * + * Returns a copy of the data or NULL in case of error. + */ +typedef void *(*xmlHashCopier)(void *payload, xmlChar *name); +/** + * xmlHashScanner: + * @payload: the data in the hash + * @data: extra scannner data + * @name: the name associated + * + * Callback when scanning data in a hash with the simple scanner. + */ +typedef void (*xmlHashScanner)(void *payload, void *data, xmlChar *name); +/** + * xmlHashScannerFull: + * @payload: the data in the hash + * @data: extra scannner data + * @name: the name associated + * @name2: the second name associated + * @name3: the third name associated + * + * Callback when scanning data in a hash with the full scanner. + */ +typedef void (*xmlHashScannerFull)(void *payload, void *data, + const xmlChar *name, const xmlChar *name2, + const xmlChar *name3); + +/* + * Constructor and destructor. + */ +XMLPUBFUN xmlHashTablePtr XMLCALL + xmlHashCreate (int size); +XMLPUBFUN xmlHashTablePtr XMLCALL + xmlHashCreateDict(int size, + xmlDictPtr dict); +XMLPUBFUN void XMLCALL + xmlHashFree (xmlHashTablePtr table, + xmlHashDeallocator f); + +/* + * Add a new entry to the hash table. + */ +XMLPUBFUN int XMLCALL + xmlHashAddEntry (xmlHashTablePtr table, + const xmlChar *name, + void *userdata); +XMLPUBFUN int XMLCALL + xmlHashUpdateEntry(xmlHashTablePtr table, + const xmlChar *name, + void *userdata, + xmlHashDeallocator f); +XMLPUBFUN int XMLCALL + xmlHashAddEntry2(xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *name2, + void *userdata); +XMLPUBFUN int XMLCALL + xmlHashUpdateEntry2(xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *name2, + void *userdata, + xmlHashDeallocator f); +XMLPUBFUN int XMLCALL + xmlHashAddEntry3(xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *name2, + const xmlChar *name3, + void *userdata); +XMLPUBFUN int XMLCALL + xmlHashUpdateEntry3(xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *name2, + const xmlChar *name3, + void *userdata, + xmlHashDeallocator f); + +/* + * Remove an entry from the hash table. + */ +XMLPUBFUN int XMLCALL + xmlHashRemoveEntry(xmlHashTablePtr table, const xmlChar *name, + xmlHashDeallocator f); +XMLPUBFUN int XMLCALL + xmlHashRemoveEntry2(xmlHashTablePtr table, const xmlChar *name, + const xmlChar *name2, xmlHashDeallocator f); +XMLPUBFUN int XMLCALL + xmlHashRemoveEntry3(xmlHashTablePtr table, const xmlChar *name, + const xmlChar *name2, const xmlChar *name3, + xmlHashDeallocator f); + +/* + * Retrieve the userdata. + */ +XMLPUBFUN void * XMLCALL + xmlHashLookup (xmlHashTablePtr table, + const xmlChar *name); +XMLPUBFUN void * XMLCALL + xmlHashLookup2 (xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *name2); +XMLPUBFUN void * XMLCALL + xmlHashLookup3 (xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *name2, + const xmlChar *name3); +XMLPUBFUN void * XMLCALL + xmlHashQLookup (xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *prefix); +XMLPUBFUN void * XMLCALL + xmlHashQLookup2 (xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *prefix, + const xmlChar *name2, + const xmlChar *prefix2); +XMLPUBFUN void * XMLCALL + xmlHashQLookup3 (xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *prefix, + const xmlChar *name2, + const xmlChar *prefix2, + const xmlChar *name3, + const xmlChar *prefix3); + +/* + * Helpers. + */ +XMLPUBFUN xmlHashTablePtr XMLCALL + xmlHashCopy (xmlHashTablePtr table, + xmlHashCopier f); +XMLPUBFUN int XMLCALL + xmlHashSize (xmlHashTablePtr table); +XMLPUBFUN void XMLCALL + xmlHashScan (xmlHashTablePtr table, + xmlHashScanner f, + void *data); +XMLPUBFUN void XMLCALL + xmlHashScan3 (xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *name2, + const xmlChar *name3, + xmlHashScanner f, + void *data); +XMLPUBFUN void XMLCALL + xmlHashScanFull (xmlHashTablePtr table, + xmlHashScannerFull f, + void *data); +XMLPUBFUN void XMLCALL + xmlHashScanFull3(xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *name2, + const xmlChar *name3, + xmlHashScannerFull f, + void *data); +#ifdef __cplusplus +} +#endif +#endif /* ! __XML_HASH_H__ */ diff --git a/include/libxml/list.h b/include/libxml/list.h new file mode 100644 index 0000000..1d83482 --- /dev/null +++ b/include/libxml/list.h @@ -0,0 +1,137 @@ +/* + * Summary: lists interfaces + * Description: this module implement the list support used in + * various place in the library. + * + * Copy: See Copyright for the status of this software. + * + * Author: Gary Pennington + */ + +#ifndef __XML_LINK_INCLUDE__ +#define __XML_LINK_INCLUDE__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct _xmlLink xmlLink; +typedef xmlLink *xmlLinkPtr; + +typedef struct _xmlList xmlList; +typedef xmlList *xmlListPtr; + +/** + * xmlListDeallocator: + * @lk: the data to deallocate + * + * Callback function used to free data from a list. + */ +typedef void (*xmlListDeallocator) (xmlLinkPtr lk); +/** + * xmlListDataCompare: + * @data0: the first data + * @data1: the second data + * + * Callback function used to compare 2 data. + * + * Returns 0 is equality, -1 or 1 otherwise depending on the ordering. + */ +typedef int (*xmlListDataCompare) (const void *data0, const void *data1); +/** + * xmlListWalker: + * @data: the data found in the list + * @user: extra user provided data to the walker + * + * Callback function used when walking a list with xmlListWalk(). + * + * Returns 0 to stop walking the list, 1 otherwise. + */ +typedef int (*xmlListWalker) (const void *data, const void *user); + +/* Creation/Deletion */ +XMLPUBFUN xmlListPtr XMLCALL + xmlListCreate (xmlListDeallocator deallocator, + xmlListDataCompare compare); +XMLPUBFUN void XMLCALL + xmlListDelete (xmlListPtr l); + +/* Basic Operators */ +XMLPUBFUN void * XMLCALL + xmlListSearch (xmlListPtr l, + void *data); +XMLPUBFUN void * XMLCALL + xmlListReverseSearch (xmlListPtr l, + void *data); +XMLPUBFUN int XMLCALL + xmlListInsert (xmlListPtr l, + void *data) ; +XMLPUBFUN int XMLCALL + xmlListAppend (xmlListPtr l, + void *data) ; +XMLPUBFUN int XMLCALL + xmlListRemoveFirst (xmlListPtr l, + void *data); +XMLPUBFUN int XMLCALL + xmlListRemoveLast (xmlListPtr l, + void *data); +XMLPUBFUN int XMLCALL + xmlListRemoveAll (xmlListPtr l, + void *data); +XMLPUBFUN void XMLCALL + xmlListClear (xmlListPtr l); +XMLPUBFUN int XMLCALL + xmlListEmpty (xmlListPtr l); +XMLPUBFUN xmlLinkPtr XMLCALL + xmlListFront (xmlListPtr l); +XMLPUBFUN xmlLinkPtr XMLCALL + xmlListEnd (xmlListPtr l); +XMLPUBFUN int XMLCALL + xmlListSize (xmlListPtr l); + +XMLPUBFUN void XMLCALL + xmlListPopFront (xmlListPtr l); +XMLPUBFUN void XMLCALL + xmlListPopBack (xmlListPtr l); +XMLPUBFUN int XMLCALL + xmlListPushFront (xmlListPtr l, + void *data); +XMLPUBFUN int XMLCALL + xmlListPushBack (xmlListPtr l, + void *data); + +/* Advanced Operators */ +XMLPUBFUN void XMLCALL + xmlListReverse (xmlListPtr l); +XMLPUBFUN void XMLCALL + xmlListSort (xmlListPtr l); +XMLPUBFUN void XMLCALL + xmlListWalk (xmlListPtr l, + xmlListWalker walker, + const void *user); +XMLPUBFUN void XMLCALL + xmlListReverseWalk (xmlListPtr l, + xmlListWalker walker, + const void *user); +XMLPUBFUN void XMLCALL + xmlListMerge (xmlListPtr l1, + xmlListPtr l2); +XMLPUBFUN xmlListPtr XMLCALL + xmlListDup (const xmlListPtr old); +XMLPUBFUN int XMLCALL + xmlListCopy (xmlListPtr cur, + const xmlListPtr old); +/* Link operators */ +XMLPUBFUN void * XMLCALL + xmlLinkGetData (xmlLinkPtr lk); + +/* xmlListUnique() */ +/* xmlListSwap */ + +#ifdef __cplusplus +} +#endif + +#endif /* __XML_LINK_INCLUDE__ */ diff --git a/include/libxml/nanoftp.h b/include/libxml/nanoftp.h new file mode 100644 index 0000000..e3c28a0 --- /dev/null +++ b/include/libxml/nanoftp.h @@ -0,0 +1,143 @@ +/* + * Summary: minimal FTP implementation + * Description: minimal FTP implementation allowing to fetch resources + * like external subset. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __NANO_FTP_H__ +#define __NANO_FTP_H__ + +#include + +#ifdef LIBXML_FTP_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * ftpListCallback: + * @userData: user provided data for the callback + * @filename: the file name (including "->" when links are shown) + * @attrib: the attribute string + * @owner: the owner string + * @group: the group string + * @size: the file size + * @links: the link count + * @year: the year + * @month: the month + * @day: the day + * @hour: the hour + * @minute: the minute + * + * A callback for the xmlNanoFTPList command. + * Note that only one of year and day:minute are specified. + */ +typedef void (*ftpListCallback) (void *userData, + const char *filename, const char *attrib, + const char *owner, const char *group, + unsigned long size, int links, int year, + const char *month, int day, int hour, + int minute); +/** + * ftpDataCallback: + * @userData: the user provided context + * @data: the data received + * @len: its size in bytes + * + * A callback for the xmlNanoFTPGet command. + */ +typedef void (*ftpDataCallback) (void *userData, + const char *data, + int len); + +/* + * Init + */ +XMLPUBFUN void XMLCALL + xmlNanoFTPInit (void); +XMLPUBFUN void XMLCALL + xmlNanoFTPCleanup (void); + +/* + * Creating/freeing contexts. + */ +XMLPUBFUN void * XMLCALL + xmlNanoFTPNewCtxt (const char *URL); +XMLPUBFUN void XMLCALL + xmlNanoFTPFreeCtxt (void * ctx); +XMLPUBFUN void * XMLCALL + xmlNanoFTPConnectTo (const char *server, + int port); +/* + * Opening/closing session connections. + */ +XMLPUBFUN void * XMLCALL + xmlNanoFTPOpen (const char *URL); +XMLPUBFUN int XMLCALL + xmlNanoFTPConnect (void *ctx); +XMLPUBFUN int XMLCALL + xmlNanoFTPClose (void *ctx); +XMLPUBFUN int XMLCALL + xmlNanoFTPQuit (void *ctx); +XMLPUBFUN void XMLCALL + xmlNanoFTPScanProxy (const char *URL); +XMLPUBFUN void XMLCALL + xmlNanoFTPProxy (const char *host, + int port, + const char *user, + const char *passwd, + int type); +XMLPUBFUN int XMLCALL + xmlNanoFTPUpdateURL (void *ctx, + const char *URL); + +/* + * Rather internal commands. + */ +XMLPUBFUN int XMLCALL + xmlNanoFTPGetResponse (void *ctx); +XMLPUBFUN int XMLCALL + xmlNanoFTPCheckResponse (void *ctx); + +/* + * CD/DIR/GET handlers. + */ +XMLPUBFUN int XMLCALL + xmlNanoFTPCwd (void *ctx, + const char *directory); +XMLPUBFUN int XMLCALL + xmlNanoFTPDele (void *ctx, + const char *file); + +XMLPUBFUN int XMLCALL + xmlNanoFTPGetConnection (void *ctx); +XMLPUBFUN int XMLCALL + xmlNanoFTPCloseConnection(void *ctx); +XMLPUBFUN int XMLCALL + xmlNanoFTPList (void *ctx, + ftpListCallback callback, + void *userData, + const char *filename); +XMLPUBFUN int XMLCALL + xmlNanoFTPGetSocket (void *ctx, + const char *filename); +XMLPUBFUN int XMLCALL + xmlNanoFTPGet (void *ctx, + ftpDataCallback callback, + void *userData, + const char *filename); +XMLPUBFUN int XMLCALL + xmlNanoFTPRead (void *ctx, + void *dest, + int len); + +#ifdef __cplusplus +} +#endif +#endif /* LIBXML_FTP_ENABLED */ +#endif /* __NANO_FTP_H__ */ diff --git a/include/libxml/nanohttp.h b/include/libxml/nanohttp.h new file mode 100644 index 0000000..1d8ac24 --- /dev/null +++ b/include/libxml/nanohttp.h @@ -0,0 +1,81 @@ +/* + * Summary: minimal HTTP implementation + * Description: minimal HTTP implementation allowing to fetch resources + * like external subset. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __NANO_HTTP_H__ +#define __NANO_HTTP_H__ + +#include + +#ifdef LIBXML_HTTP_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif +XMLPUBFUN void XMLCALL + xmlNanoHTTPInit (void); +XMLPUBFUN void XMLCALL + xmlNanoHTTPCleanup (void); +XMLPUBFUN void XMLCALL + xmlNanoHTTPScanProxy (const char *URL); +XMLPUBFUN int XMLCALL + xmlNanoHTTPFetch (const char *URL, + const char *filename, + char **contentType); +XMLPUBFUN void * XMLCALL + xmlNanoHTTPMethod (const char *URL, + const char *method, + const char *input, + char **contentType, + const char *headers, + int ilen); +XMLPUBFUN void * XMLCALL + xmlNanoHTTPMethodRedir (const char *URL, + const char *method, + const char *input, + char **contentType, + char **redir, + const char *headers, + int ilen); +XMLPUBFUN void * XMLCALL + xmlNanoHTTPOpen (const char *URL, + char **contentType); +XMLPUBFUN void * XMLCALL + xmlNanoHTTPOpenRedir (const char *URL, + char **contentType, + char **redir); +XMLPUBFUN int XMLCALL + xmlNanoHTTPReturnCode (void *ctx); +XMLPUBFUN const char * XMLCALL + xmlNanoHTTPAuthHeader (void *ctx); +XMLPUBFUN const char * XMLCALL + xmlNanoHTTPRedir (void *ctx); +XMLPUBFUN int XMLCALL + xmlNanoHTTPContentLength( void * ctx ); +XMLPUBFUN const char * XMLCALL + xmlNanoHTTPEncoding (void *ctx); +XMLPUBFUN const char * XMLCALL + xmlNanoHTTPMimeType (void *ctx); +XMLPUBFUN int XMLCALL + xmlNanoHTTPRead (void *ctx, + void *dest, + int len); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN int XMLCALL + xmlNanoHTTPSave (void *ctxt, + const char *filename); +#endif /* LIBXML_OUTPUT_ENABLED */ +XMLPUBFUN void XMLCALL + xmlNanoHTTPClose (void *ctx); +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_HTTP_ENABLED */ +#endif /* __NANO_HTTP_H__ */ diff --git a/include/libxml/parser.h b/include/libxml/parser.h new file mode 100644 index 0000000..7203ca3 --- /dev/null +++ b/include/libxml/parser.h @@ -0,0 +1,1169 @@ +/* + * Summary: the core parser module + * Description: Interfaces, constants and types related to the XML parser + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_PARSER_H__ +#define __XML_PARSER_H__ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * XML_DEFAULT_VERSION: + * + * The default version of XML used: 1.0 + */ +#define XML_DEFAULT_VERSION "1.0" + +/** + * xmlParserInput: + * + * An xmlParserInput is an input flow for the XML processor. + * Each entity parsed is associated an xmlParserInput (except the + * few predefined ones). This is the case both for internal entities + * - in which case the flow is already completely in memory - or + * external entities - in which case we use the buf structure for + * progressive reading and I18N conversions to the internal UTF-8 format. + */ + +/** + * xmlParserInputDeallocate: + * @str: the string to deallocate + * + * Callback for freeing some parser input allocations. + */ +typedef void (* xmlParserInputDeallocate)(xmlChar *str); + +struct _xmlParserInput { + /* Input buffer */ + xmlParserInputBufferPtr buf; /* UTF-8 encoded buffer */ + + const char *filename; /* The file analyzed, if any */ + const char *directory; /* the directory/base of the file */ + const xmlChar *base; /* Base of the array to parse */ + const xmlChar *cur; /* Current char being parsed */ + const xmlChar *end; /* end of the array to parse */ + int length; /* length if known */ + int line; /* Current line */ + int col; /* Current column */ + /* + * NOTE: consumed is only tested for equality in the parser code, + * so even if there is an overflow this should not give troubles + * for parsing very large instances. + */ + unsigned long consumed; /* How many xmlChars already consumed */ + xmlParserInputDeallocate free; /* function to deallocate the base */ + const xmlChar *encoding; /* the encoding string for entity */ + const xmlChar *version; /* the version string for entity */ + int standalone; /* Was that entity marked standalone */ + int id; /* an unique identifier for the entity */ +}; + +/** + * xmlParserNodeInfo: + * + * The parser can be asked to collect Node informations, i.e. at what + * place in the file they were detected. + * NOTE: This is off by default and not very well tested. + */ +typedef struct _xmlParserNodeInfo xmlParserNodeInfo; +typedef xmlParserNodeInfo *xmlParserNodeInfoPtr; + +struct _xmlParserNodeInfo { + const struct _xmlNode* node; + /* Position & line # that text that created the node begins & ends on */ + unsigned long begin_pos; + unsigned long begin_line; + unsigned long end_pos; + unsigned long end_line; +}; + +typedef struct _xmlParserNodeInfoSeq xmlParserNodeInfoSeq; +typedef xmlParserNodeInfoSeq *xmlParserNodeInfoSeqPtr; +struct _xmlParserNodeInfoSeq { + unsigned long maximum; + unsigned long length; + xmlParserNodeInfo* buffer; +}; + +/** + * xmlParserInputState: + * + * The parser is now working also as a state based parser. + * The recursive one use the state info for entities processing. + */ +typedef enum { + XML_PARSER_EOF = -1, /* nothing is to be parsed */ + XML_PARSER_START = 0, /* nothing has been parsed */ + XML_PARSER_MISC, /* Misc* before int subset */ + XML_PARSER_PI, /* Within a processing instruction */ + XML_PARSER_DTD, /* within some DTD content */ + XML_PARSER_PROLOG, /* Misc* after internal subset */ + XML_PARSER_COMMENT, /* within a comment */ + XML_PARSER_START_TAG, /* within a start tag */ + XML_PARSER_CONTENT, /* within the content */ + XML_PARSER_CDATA_SECTION, /* within a CDATA section */ + XML_PARSER_END_TAG, /* within a closing tag */ + XML_PARSER_ENTITY_DECL, /* within an entity declaration */ + XML_PARSER_ENTITY_VALUE, /* within an entity value in a decl */ + XML_PARSER_ATTRIBUTE_VALUE, /* within an attribute value */ + XML_PARSER_SYSTEM_LITERAL, /* within a SYSTEM value */ + XML_PARSER_EPILOG, /* the Misc* after the last end tag */ + XML_PARSER_IGNORE, /* within an IGNORED section */ + XML_PARSER_PUBLIC_LITERAL /* within a PUBLIC value */ +} xmlParserInputState; + +/** + * XML_DETECT_IDS: + * + * Bit in the loadsubset context field to tell to do ID/REFs lookups. + * Use it to initialize xmlLoadExtDtdDefaultValue. + */ +#define XML_DETECT_IDS 2 + +/** + * XML_COMPLETE_ATTRS: + * + * Bit in the loadsubset context field to tell to do complete the + * elements attributes lists with the ones defaulted from the DTDs. + * Use it to initialize xmlLoadExtDtdDefaultValue. + */ +#define XML_COMPLETE_ATTRS 4 + +/** + * XML_SKIP_IDS: + * + * Bit in the loadsubset context field to tell to not do ID/REFs registration. + * Used to initialize xmlLoadExtDtdDefaultValue in some special cases. + */ +#define XML_SKIP_IDS 8 + +/** + * xmlParserMode: + * + * A parser can operate in various modes + */ +typedef enum { + XML_PARSE_UNKNOWN = 0, + XML_PARSE_DOM = 1, + XML_PARSE_SAX = 2, + XML_PARSE_PUSH_DOM = 3, + XML_PARSE_PUSH_SAX = 4, + XML_PARSE_READER = 5 +} xmlParserMode; + +/** + * xmlParserCtxt: + * + * The parser context. + * NOTE This doesn't completely define the parser state, the (current ?) + * design of the parser uses recursive function calls since this allow + * and easy mapping from the production rules of the specification + * to the actual code. The drawback is that the actual function call + * also reflect the parser state. However most of the parsing routines + * takes as the only argument the parser context pointer, so migrating + * to a state based parser for progressive parsing shouldn't be too hard. + */ +struct _xmlParserCtxt { + struct _xmlSAXHandler *sax; /* The SAX handler */ + void *userData; /* For SAX interface only, used by DOM build */ + xmlDocPtr myDoc; /* the document being built */ + int wellFormed; /* is the document well formed */ + int replaceEntities; /* shall we replace entities ? */ + const xmlChar *version; /* the XML version string */ + const xmlChar *encoding; /* the declared encoding, if any */ + int standalone; /* standalone document */ + int html; /* an HTML(1)/Docbook(2) document */ + + /* Input stream stack */ + xmlParserInputPtr input; /* Current input stream */ + int inputNr; /* Number of current input streams */ + int inputMax; /* Max number of input streams */ + xmlParserInputPtr *inputTab; /* stack of inputs */ + + /* Node analysis stack only used for DOM building */ + xmlNodePtr node; /* Current parsed Node */ + int nodeNr; /* Depth of the parsing stack */ + int nodeMax; /* Max depth of the parsing stack */ + xmlNodePtr *nodeTab; /* array of nodes */ + + int record_info; /* Whether node info should be kept */ + xmlParserNodeInfoSeq node_seq; /* info about each node parsed */ + + int errNo; /* error code */ + + int hasExternalSubset; /* reference and external subset */ + int hasPErefs; /* the internal subset has PE refs */ + int external; /* are we parsing an external entity */ + + int valid; /* is the document valid */ + int validate; /* shall we try to validate ? */ + xmlValidCtxt vctxt; /* The validity context */ + + xmlParserInputState instate; /* current type of input */ + int token; /* next char look-ahead */ + + char *directory; /* the data directory */ + + /* Node name stack */ + const xmlChar *name; /* Current parsed Node */ + int nameNr; /* Depth of the parsing stack */ + int nameMax; /* Max depth of the parsing stack */ + const xmlChar * *nameTab; /* array of nodes */ + + long nbChars; /* number of xmlChar processed */ + long checkIndex; /* used by progressive parsing lookup */ + int keepBlanks; /* ugly but ... */ + int disableSAX; /* SAX callbacks are disabled */ + int inSubset; /* Parsing is in int 1/ext 2 subset */ + const xmlChar * intSubName; /* name of subset */ + xmlChar * extSubURI; /* URI of external subset */ + xmlChar * extSubSystem; /* SYSTEM ID of external subset */ + + /* xml:space values */ + int * space; /* Should the parser preserve spaces */ + int spaceNr; /* Depth of the parsing stack */ + int spaceMax; /* Max depth of the parsing stack */ + int * spaceTab; /* array of space infos */ + + int depth; /* to prevent entity substitution loops */ + xmlParserInputPtr entity; /* used to check entities boundaries */ + int charset; /* encoding of the in-memory content + actually an xmlCharEncoding */ + int nodelen; /* Those two fields are there to */ + int nodemem; /* Speed up large node parsing */ + int pedantic; /* signal pedantic warnings */ + void *_private; /* For user data, libxml won't touch it */ + + int loadsubset; /* should the external subset be loaded */ + int linenumbers; /* set line number in element content */ + void *catalogs; /* document's own catalog */ + int recovery; /* run in recovery mode */ + int progressive; /* is this a progressive parsing */ + xmlDictPtr dict; /* dictionnary for the parser */ + const xmlChar * *atts; /* array for the attributes callbacks */ + int maxatts; /* the size of the array */ + int docdict; /* use strings from dict to build tree */ + + /* + * pre-interned strings + */ + const xmlChar *str_xml; + const xmlChar *str_xmlns; + const xmlChar *str_xml_ns; + + /* + * Everything below is used only by the new SAX mode + */ + int sax2; /* operating in the new SAX mode */ + int nsNr; /* the number of inherited namespaces */ + int nsMax; /* the size of the arrays */ + const xmlChar * *nsTab; /* the array of prefix/namespace name */ + int *attallocs; /* which attribute were allocated */ + void * *pushTab; /* array of data for push */ + xmlHashTablePtr attsDefault; /* defaulted attributes if any */ + xmlHashTablePtr attsSpecial; /* non-CDATA attributes if any */ + int nsWellFormed; /* is the document XML Nanespace okay */ + int options; /* Extra options */ + + /* + * Those fields are needed only for treaming parsing so far + */ + int dictNames; /* Use dictionary names for the tree */ + int freeElemsNr; /* number of freed element nodes */ + xmlNodePtr freeElems; /* List of freed element nodes */ + int freeAttrsNr; /* number of freed attributes nodes */ + xmlAttrPtr freeAttrs; /* List of freed attributes nodes */ + + /* + * the complete error informations for the last error. + */ + xmlError lastError; + xmlParserMode parseMode; /* the parser mode */ +}; + +/** + * xmlSAXLocator: + * + * A SAX Locator. + */ +struct _xmlSAXLocator { + const xmlChar *(*getPublicId)(void *ctx); + const xmlChar *(*getSystemId)(void *ctx); + int (*getLineNumber)(void *ctx); + int (*getColumnNumber)(void *ctx); +}; + +/** + * xmlSAXHandler: + * + * A SAX handler is bunch of callbacks called by the parser when processing + * of the input generate data or structure informations. + */ + +/** + * resolveEntitySAXFunc: + * @ctx: the user data (XML parser context) + * @publicId: The public ID of the entity + * @systemId: The system ID of the entity + * + * Callback: + * The entity loader, to control the loading of external entities, + * the application can either: + * - override this resolveEntity() callback in the SAX block + * - or better use the xmlSetExternalEntityLoader() function to + * set up it's own entity resolution routine + * + * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour. + */ +typedef xmlParserInputPtr (*resolveEntitySAXFunc) (void *ctx, + const xmlChar *publicId, + const xmlChar *systemId); +/** + * internalSubsetSAXFunc: + * @ctx: the user data (XML parser context) + * @name: the root element name + * @ExternalID: the external ID + * @SystemID: the SYSTEM ID (e.g. filename or URL) + * + * Callback on internal subset declaration. + */ +typedef void (*internalSubsetSAXFunc) (void *ctx, + const xmlChar *name, + const xmlChar *ExternalID, + const xmlChar *SystemID); +/** + * externalSubsetSAXFunc: + * @ctx: the user data (XML parser context) + * @name: the root element name + * @ExternalID: the external ID + * @SystemID: the SYSTEM ID (e.g. filename or URL) + * + * Callback on external subset declaration. + */ +typedef void (*externalSubsetSAXFunc) (void *ctx, + const xmlChar *name, + const xmlChar *ExternalID, + const xmlChar *SystemID); +/** + * getEntitySAXFunc: + * @ctx: the user data (XML parser context) + * @name: The entity name + * + * Get an entity by name. + * + * Returns the xmlEntityPtr if found. + */ +typedef xmlEntityPtr (*getEntitySAXFunc) (void *ctx, + const xmlChar *name); +/** + * getParameterEntitySAXFunc: + * @ctx: the user data (XML parser context) + * @name: The entity name + * + * Get a parameter entity by name. + * + * Returns the xmlEntityPtr if found. + */ +typedef xmlEntityPtr (*getParameterEntitySAXFunc) (void *ctx, + const xmlChar *name); +/** + * entityDeclSAXFunc: + * @ctx: the user data (XML parser context) + * @name: the entity name + * @type: the entity type + * @publicId: The public ID of the entity + * @systemId: The system ID of the entity + * @content: the entity value (without processing). + * + * An entity definition has been parsed. + */ +typedef void (*entityDeclSAXFunc) (void *ctx, + const xmlChar *name, + int type, + const xmlChar *publicId, + const xmlChar *systemId, + xmlChar *content); +/** + * notationDeclSAXFunc: + * @ctx: the user data (XML parser context) + * @name: The name of the notation + * @publicId: The public ID of the entity + * @systemId: The system ID of the entity + * + * What to do when a notation declaration has been parsed. + */ +typedef void (*notationDeclSAXFunc)(void *ctx, + const xmlChar *name, + const xmlChar *publicId, + const xmlChar *systemId); +/** + * attributeDeclSAXFunc: + * @ctx: the user data (XML parser context) + * @elem: the name of the element + * @fullname: the attribute name + * @type: the attribute type + * @def: the type of default value + * @defaultValue: the attribute default value + * @tree: the tree of enumerated value set + * + * An attribute definition has been parsed. + */ +typedef void (*attributeDeclSAXFunc)(void *ctx, + const xmlChar *elem, + const xmlChar *fullname, + int type, + int def, + const xmlChar *defaultValue, + xmlEnumerationPtr tree); +/** + * elementDeclSAXFunc: + * @ctx: the user data (XML parser context) + * @name: the element name + * @type: the element type + * @content: the element value tree + * + * An element definition has been parsed. + */ +typedef void (*elementDeclSAXFunc)(void *ctx, + const xmlChar *name, + int type, + xmlElementContentPtr content); +/** + * unparsedEntityDeclSAXFunc: + * @ctx: the user data (XML parser context) + * @name: The name of the entity + * @publicId: The public ID of the entity + * @systemId: The system ID of the entity + * @notationName: the name of the notation + * + * What to do when an unparsed entity declaration is parsed. + */ +typedef void (*unparsedEntityDeclSAXFunc)(void *ctx, + const xmlChar *name, + const xmlChar *publicId, + const xmlChar *systemId, + const xmlChar *notationName); +/** + * setDocumentLocatorSAXFunc: + * @ctx: the user data (XML parser context) + * @loc: A SAX Locator + * + * Receive the document locator at startup, actually xmlDefaultSAXLocator. + * Everything is available on the context, so this is useless in our case. + */ +typedef void (*setDocumentLocatorSAXFunc) (void *ctx, + xmlSAXLocatorPtr loc); +/** + * startDocumentSAXFunc: + * @ctx: the user data (XML parser context) + * + * Called when the document start being processed. + */ +typedef void (*startDocumentSAXFunc) (void *ctx); +/** + * endDocumentSAXFunc: + * @ctx: the user data (XML parser context) + * + * Called when the document end has been detected. + */ +typedef void (*endDocumentSAXFunc) (void *ctx); +/** + * startElementSAXFunc: + * @ctx: the user data (XML parser context) + * @name: The element name, including namespace prefix + * @atts: An array of name/value attributes pairs, NULL terminated + * + * Called when an opening tag has been processed. + */ +typedef void (*startElementSAXFunc) (void *ctx, + const xmlChar *name, + const xmlChar **atts); +/** + * endElementSAXFunc: + * @ctx: the user data (XML parser context) + * @name: The element name + * + * Called when the end of an element has been detected. + */ +typedef void (*endElementSAXFunc) (void *ctx, + const xmlChar *name); +/** + * attributeSAXFunc: + * @ctx: the user data (XML parser context) + * @name: The attribute name, including namespace prefix + * @value: The attribute value + * + * Handle an attribute that has been read by the parser. + * The default handling is to convert the attribute into an + * DOM subtree and past it in a new xmlAttr element added to + * the element. + */ +typedef void (*attributeSAXFunc) (void *ctx, + const xmlChar *name, + const xmlChar *value); +/** + * referenceSAXFunc: + * @ctx: the user data (XML parser context) + * @name: The entity name + * + * Called when an entity reference is detected. + */ +typedef void (*referenceSAXFunc) (void *ctx, + const xmlChar *name); +/** + * charactersSAXFunc: + * @ctx: the user data (XML parser context) + * @ch: a xmlChar string + * @len: the number of xmlChar + * + * Receiving some chars from the parser. + */ +typedef void (*charactersSAXFunc) (void *ctx, + const xmlChar *ch, + int len); +/** + * ignorableWhitespaceSAXFunc: + * @ctx: the user data (XML parser context) + * @ch: a xmlChar string + * @len: the number of xmlChar + * + * Receiving some ignorable whitespaces from the parser. + * UNUSED: by default the DOM building will use characters. + */ +typedef void (*ignorableWhitespaceSAXFunc) (void *ctx, + const xmlChar *ch, + int len); +/** + * processingInstructionSAXFunc: + * @ctx: the user data (XML parser context) + * @target: the target name + * @data: the PI data's + * + * A processing instruction has been parsed. + */ +typedef void (*processingInstructionSAXFunc) (void *ctx, + const xmlChar *target, + const xmlChar *data); +/** + * commentSAXFunc: + * @ctx: the user data (XML parser context) + * @value: the comment content + * + * A comment has been parsed. + */ +typedef void (*commentSAXFunc) (void *ctx, + const xmlChar *value); +/** + * cdataBlockSAXFunc: + * @ctx: the user data (XML parser context) + * @value: The pcdata content + * @len: the block length + * + * Called when a pcdata block has been parsed. + */ +typedef void (*cdataBlockSAXFunc) ( + void *ctx, + const xmlChar *value, + int len); +/** + * warningSAXFunc: + * @ctx: an XML parser context + * @msg: the message to display/transmit + * @...: extra parameters for the message display + * + * Display and format a warning messages, callback. + */ +typedef void (*warningSAXFunc) (void *ctx, + const char *msg, ...); +/** + * errorSAXFunc: + * @ctx: an XML parser context + * @msg: the message to display/transmit + * @...: extra parameters for the message display + * + * Display and format an error messages, callback. + */ +typedef void (*errorSAXFunc) (void *ctx, + const char *msg, ...); +/** + * fatalErrorSAXFunc: + * @ctx: an XML parser context + * @msg: the message to display/transmit + * @...: extra parameters for the message display + * + * Display and format fatal error messages, callback. + * Note: so far fatalError() SAX callbacks are not used, error() + * get all the callbacks for errors. + */ +typedef void (*fatalErrorSAXFunc) (void *ctx, + const char *msg, ...); +/** + * isStandaloneSAXFunc: + * @ctx: the user data (XML parser context) + * + * Is this document tagged standalone? + * + * Returns 1 if true + */ +typedef int (*isStandaloneSAXFunc) (void *ctx); +/** + * hasInternalSubsetSAXFunc: + * @ctx: the user data (XML parser context) + * + * Does this document has an internal subset. + * + * Returns 1 if true + */ +typedef int (*hasInternalSubsetSAXFunc) (void *ctx); + +/** + * hasExternalSubsetSAXFunc: + * @ctx: the user data (XML parser context) + * + * Does this document has an external subset? + * + * Returns 1 if true + */ +typedef int (*hasExternalSubsetSAXFunc) (void *ctx); + +/************************************************************************ + * * + * The SAX version 2 API extensions * + * * + ************************************************************************/ +/** + * XML_SAX2_MAGIC: + * + * Special constant found in SAX2 blocks initialized fields + */ +#define XML_SAX2_MAGIC 0xDEEDBEAF + +/** + * startElementNsSAX2Func: + * @ctx: the user data (XML parser context) + * @localname: the local name of the element + * @prefix: the element namespace prefix if available + * @URI: the element namespace name if available + * @nb_namespaces: number of namespace definitions on that node + * @namespaces: pointer to the array of prefix/URI pairs namespace definitions + * @nb_attributes: the number of attributes on that node + * @nb_defaulted: the number of defaulted attributes. The defaulted + * ones are at the end of the array + * @attributes: pointer to the array of (localname/prefix/URI/value/end) + * attribute values. + * + * SAX2 callback when an element start has been detected by the parser. + * It provides the namespace informations for the element, as well as + * the new namespace declarations on the element. + */ + +typedef void (*startElementNsSAX2Func) (void *ctx, + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI, + int nb_namespaces, + const xmlChar **namespaces, + int nb_attributes, + int nb_defaulted, + const xmlChar **attributes); + +/** + * endElementNsSAX2Func: + * @ctx: the user data (XML parser context) + * @localname: the local name of the element + * @prefix: the element namespace prefix if available + * @URI: the element namespace name if available + * + * SAX2 callback when an element end has been detected by the parser. + * It provides the namespace informations for the element. + */ + +typedef void (*endElementNsSAX2Func) (void *ctx, + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI); + + +struct _xmlSAXHandler { + internalSubsetSAXFunc internalSubset; + isStandaloneSAXFunc isStandalone; + hasInternalSubsetSAXFunc hasInternalSubset; + hasExternalSubsetSAXFunc hasExternalSubset; + resolveEntitySAXFunc resolveEntity; + getEntitySAXFunc getEntity; + entityDeclSAXFunc entityDecl; + notationDeclSAXFunc notationDecl; + attributeDeclSAXFunc attributeDecl; + elementDeclSAXFunc elementDecl; + unparsedEntityDeclSAXFunc unparsedEntityDecl; + setDocumentLocatorSAXFunc setDocumentLocator; + startDocumentSAXFunc startDocument; + endDocumentSAXFunc endDocument; + startElementSAXFunc startElement; + endElementSAXFunc endElement; + referenceSAXFunc reference; + charactersSAXFunc characters; + ignorableWhitespaceSAXFunc ignorableWhitespace; + processingInstructionSAXFunc processingInstruction; + commentSAXFunc comment; + warningSAXFunc warning; + errorSAXFunc error; + fatalErrorSAXFunc fatalError; /* unused error() get all the errors */ + getParameterEntitySAXFunc getParameterEntity; + cdataBlockSAXFunc cdataBlock; + externalSubsetSAXFunc externalSubset; + unsigned int initialized; + /* The following fields are extensions available only on version 2 */ + void *_private; + startElementNsSAX2Func startElementNs; + endElementNsSAX2Func endElementNs; + xmlStructuredErrorFunc serror; +}; + +/* + * SAX Version 1 + */ +typedef struct _xmlSAXHandlerV1 xmlSAXHandlerV1; +typedef xmlSAXHandlerV1 *xmlSAXHandlerV1Ptr; +struct _xmlSAXHandlerV1 { + internalSubsetSAXFunc internalSubset; + isStandaloneSAXFunc isStandalone; + hasInternalSubsetSAXFunc hasInternalSubset; + hasExternalSubsetSAXFunc hasExternalSubset; + resolveEntitySAXFunc resolveEntity; + getEntitySAXFunc getEntity; + entityDeclSAXFunc entityDecl; + notationDeclSAXFunc notationDecl; + attributeDeclSAXFunc attributeDecl; + elementDeclSAXFunc elementDecl; + unparsedEntityDeclSAXFunc unparsedEntityDecl; + setDocumentLocatorSAXFunc setDocumentLocator; + startDocumentSAXFunc startDocument; + endDocumentSAXFunc endDocument; + startElementSAXFunc startElement; + endElementSAXFunc endElement; + referenceSAXFunc reference; + charactersSAXFunc characters; + ignorableWhitespaceSAXFunc ignorableWhitespace; + processingInstructionSAXFunc processingInstruction; + commentSAXFunc comment; + warningSAXFunc warning; + errorSAXFunc error; + fatalErrorSAXFunc fatalError; /* unused error() get all the errors */ + getParameterEntitySAXFunc getParameterEntity; + cdataBlockSAXFunc cdataBlock; + externalSubsetSAXFunc externalSubset; + unsigned int initialized; +}; + + +/** + * xmlExternalEntityLoader: + * @URL: The System ID of the resource requested + * @ID: The Public ID of the resource requested + * @context: the XML parser context + * + * External entity loaders types. + * + * Returns the entity input parser. + */ +typedef xmlParserInputPtr (*xmlExternalEntityLoader) (const char *URL, + const char *ID, + xmlParserCtxtPtr context); + +#ifdef __cplusplus +} +#endif + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +/* + * Init/Cleanup + */ +XMLPUBFUN void XMLCALL + xmlInitParser (void); +XMLPUBFUN void XMLCALL + xmlCleanupParser (void); + +/* + * Input functions + */ +XMLPUBFUN int XMLCALL + xmlParserInputRead (xmlParserInputPtr in, + int len); +XMLPUBFUN int XMLCALL + xmlParserInputGrow (xmlParserInputPtr in, + int len); + +/* + * Basic parsing Interfaces + */ +#ifdef LIBXML_SAX1_ENABLED +XMLPUBFUN xmlDocPtr XMLCALL + xmlParseDoc (const xmlChar *cur); +XMLPUBFUN xmlDocPtr XMLCALL + xmlParseFile (const char *filename); +XMLPUBFUN xmlDocPtr XMLCALL + xmlParseMemory (const char *buffer, + int size); +#endif /* LIBXML_SAX1_ENABLED */ +XMLPUBFUN int XMLCALL + xmlSubstituteEntitiesDefault(int val); +XMLPUBFUN int XMLCALL + xmlKeepBlanksDefault (int val); +XMLPUBFUN void XMLCALL + xmlStopParser (xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlPedanticParserDefault(int val); +XMLPUBFUN int XMLCALL + xmlLineNumbersDefault (int val); + +#ifdef LIBXML_SAX1_ENABLED +/* + * Recovery mode + */ +XMLPUBFUN xmlDocPtr XMLCALL + xmlRecoverDoc (xmlChar *cur); +XMLPUBFUN xmlDocPtr XMLCALL + xmlRecoverMemory (const char *buffer, + int size); +XMLPUBFUN xmlDocPtr XMLCALL + xmlRecoverFile (const char *filename); +#endif /* LIBXML_SAX1_ENABLED */ + +/* + * Less common routines and SAX interfaces + */ +XMLPUBFUN int XMLCALL + xmlParseDocument (xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlParseExtParsedEnt (xmlParserCtxtPtr ctxt); +#ifdef LIBXML_SAX1_ENABLED +XMLPUBFUN int XMLCALL + xmlSAXUserParseFile (xmlSAXHandlerPtr sax, + void *user_data, + const char *filename); +XMLPUBFUN int XMLCALL + xmlSAXUserParseMemory (xmlSAXHandlerPtr sax, + void *user_data, + const char *buffer, + int size); +XMLPUBFUN xmlDocPtr XMLCALL + xmlSAXParseDoc (xmlSAXHandlerPtr sax, + const xmlChar *cur, + int recovery); +XMLPUBFUN xmlDocPtr XMLCALL + xmlSAXParseMemory (xmlSAXHandlerPtr sax, + const char *buffer, + int size, + int recovery); +XMLPUBFUN xmlDocPtr XMLCALL + xmlSAXParseMemoryWithData (xmlSAXHandlerPtr sax, + const char *buffer, + int size, + int recovery, + void *data); +XMLPUBFUN xmlDocPtr XMLCALL + xmlSAXParseFile (xmlSAXHandlerPtr sax, + const char *filename, + int recovery); +XMLPUBFUN xmlDocPtr XMLCALL + xmlSAXParseFileWithData (xmlSAXHandlerPtr sax, + const char *filename, + int recovery, + void *data); +XMLPUBFUN xmlDocPtr XMLCALL + xmlSAXParseEntity (xmlSAXHandlerPtr sax, + const char *filename); +XMLPUBFUN xmlDocPtr XMLCALL + xmlParseEntity (const char *filename); +#endif /* LIBXML_SAX1_ENABLED */ + +#ifdef LIBXML_VALID_ENABLED +XMLPUBFUN xmlDtdPtr XMLCALL + xmlSAXParseDTD (xmlSAXHandlerPtr sax, + const xmlChar *ExternalID, + const xmlChar *SystemID); +XMLPUBFUN xmlDtdPtr XMLCALL + xmlParseDTD (const xmlChar *ExternalID, + const xmlChar *SystemID); +XMLPUBFUN xmlDtdPtr XMLCALL + xmlIOParseDTD (xmlSAXHandlerPtr sax, + xmlParserInputBufferPtr input, + xmlCharEncoding enc); +#endif /* LIBXML_VALID_ENABLE */ +#ifdef LIBXML_SAX1_ENABLED +XMLPUBFUN int XMLCALL + xmlParseBalancedChunkMemory(xmlDocPtr doc, + xmlSAXHandlerPtr sax, + void *user_data, + int depth, + const xmlChar *string, + xmlNodePtr *lst); +#endif /* LIBXML_SAX1_ENABLED */ +XMLPUBFUN xmlParserErrors XMLCALL + xmlParseInNodeContext (xmlNodePtr node, + const char *data, + int datalen, + int options, + xmlNodePtr *lst); +#ifdef LIBXML_SAX1_ENABLED +XMLPUBFUN int XMLCALL + xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, + xmlSAXHandlerPtr sax, + void *user_data, + int depth, + const xmlChar *string, + xmlNodePtr *lst, + int recover); +XMLPUBFUN int XMLCALL + xmlParseExternalEntity (xmlDocPtr doc, + xmlSAXHandlerPtr sax, + void *user_data, + int depth, + const xmlChar *URL, + const xmlChar *ID, + xmlNodePtr *lst); +#endif /* LIBXML_SAX1_ENABLED */ +XMLPUBFUN int XMLCALL + xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, + const xmlChar *URL, + const xmlChar *ID, + xmlNodePtr *lst); + +/* + * Parser contexts handling. + */ +XMLPUBFUN xmlParserCtxtPtr XMLCALL + xmlNewParserCtxt (void); +XMLPUBFUN int XMLCALL + xmlInitParserCtxt (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlClearParserCtxt (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlFreeParserCtxt (xmlParserCtxtPtr ctxt); +#ifdef LIBXML_SAX1_ENABLED +XMLPUBFUN void XMLCALL + xmlSetupParserForBuffer (xmlParserCtxtPtr ctxt, + const xmlChar* buffer, + const char *filename); +#endif /* LIBXML_SAX1_ENABLED */ +XMLPUBFUN xmlParserCtxtPtr XMLCALL + xmlCreateDocParserCtxt (const xmlChar *cur); + +#ifdef LIBXML_LEGACY_ENABLED +/* + * Reading/setting optional parsing features. + */ +XMLPUBFUN int XMLCALL + xmlGetFeaturesList (int *len, + const char **result); +XMLPUBFUN int XMLCALL + xmlGetFeature (xmlParserCtxtPtr ctxt, + const char *name, + void *result); +XMLPUBFUN int XMLCALL + xmlSetFeature (xmlParserCtxtPtr ctxt, + const char *name, + void *value); +#endif /* LIBXML_LEGACY_ENABLED */ + +#ifdef LIBXML_PUSH_ENABLED +/* + * Interfaces for the Push mode. + */ +XMLPUBFUN xmlParserCtxtPtr XMLCALL + xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax, + void *user_data, + const char *chunk, + int size, + const char *filename); +XMLPUBFUN int XMLCALL + xmlParseChunk (xmlParserCtxtPtr ctxt, + const char *chunk, + int size, + int terminate); +#endif /* LIBXML_PUSH_ENABLED */ + +/* + * Special I/O mode. + */ + +XMLPUBFUN xmlParserCtxtPtr XMLCALL + xmlCreateIOParserCtxt (xmlSAXHandlerPtr sax, + void *user_data, + xmlInputReadCallback ioread, + xmlInputCloseCallback ioclose, + void *ioctx, + xmlCharEncoding enc); + +XMLPUBFUN xmlParserInputPtr XMLCALL + xmlNewIOInputStream (xmlParserCtxtPtr ctxt, + xmlParserInputBufferPtr input, + xmlCharEncoding enc); + +/* + * Node infos. + */ +XMLPUBFUN const xmlParserNodeInfo* XMLCALL + xmlParserFindNodeInfo (const xmlParserCtxtPtr ctxt, + const xmlNodePtr node); +XMLPUBFUN void XMLCALL + xmlInitNodeInfoSeq (xmlParserNodeInfoSeqPtr seq); +XMLPUBFUN void XMLCALL + xmlClearNodeInfoSeq (xmlParserNodeInfoSeqPtr seq); +XMLPUBFUN unsigned long XMLCALL + xmlParserFindNodeInfoIndex(const xmlParserNodeInfoSeqPtr seq, + const xmlNodePtr node); +XMLPUBFUN void XMLCALL + xmlParserAddNodeInfo (xmlParserCtxtPtr ctxt, + const xmlParserNodeInfoPtr info); + +/* + * External entities handling actually implemented in xmlIO. + */ + +XMLPUBFUN void XMLCALL + xmlSetExternalEntityLoader(xmlExternalEntityLoader f); +XMLPUBFUN xmlExternalEntityLoader XMLCALL + xmlGetExternalEntityLoader(void); +XMLPUBFUN xmlParserInputPtr XMLCALL + xmlLoadExternalEntity (const char *URL, + const char *ID, + xmlParserCtxtPtr ctxt); + +/* + * Index lookup, actually implemented in the encoding module + */ +XMLPUBFUN long XMLCALL + xmlByteConsumed (xmlParserCtxtPtr ctxt); + +/* + * New set of simpler/more flexible APIs + */ +/** + * xmlParserOption: + * + * This is the set of XML parser options that can be passed down + * to the xmlReadDoc() and similar calls. + */ +typedef enum { + XML_PARSE_RECOVER = 1<<0, /* recover on errors */ + XML_PARSE_NOENT = 1<<1, /* substitute entities */ + XML_PARSE_DTDLOAD = 1<<2, /* load the external subset */ + XML_PARSE_DTDATTR = 1<<3, /* default DTD attributes */ + XML_PARSE_DTDVALID = 1<<4, /* validate with the DTD */ + XML_PARSE_NOERROR = 1<<5, /* suppress error reports */ + XML_PARSE_NOWARNING = 1<<6, /* suppress warning reports */ + XML_PARSE_PEDANTIC = 1<<7, /* pedantic error reporting */ + XML_PARSE_NOBLANKS = 1<<8, /* remove blank nodes */ + XML_PARSE_SAX1 = 1<<9, /* use the SAX1 interface internally */ + XML_PARSE_XINCLUDE = 1<<10,/* Implement XInclude substitition */ + XML_PARSE_NONET = 1<<11,/* Forbid network access */ + XML_PARSE_NODICT = 1<<12,/* Do not reuse the context dictionnary */ + XML_PARSE_NSCLEAN = 1<<13,/* remove redundant namespaces declarations */ + XML_PARSE_NOCDATA = 1<<14,/* merge CDATA as text nodes */ + XML_PARSE_NOXINCNODE= 1<<15 /* do not generate XINCLUDE START/END nodes */ +} xmlParserOption; + +XMLPUBFUN void XMLCALL + xmlCtxtReset (xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlCtxtResetPush (xmlParserCtxtPtr ctxt, + const char *chunk, + int size, + const char *filename, + const char *encoding); +XMLPUBFUN int XMLCALL + xmlCtxtUseOptions (xmlParserCtxtPtr ctxt, + int options); +XMLPUBFUN xmlDocPtr XMLCALL + xmlReadDoc (const xmlChar *cur, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlDocPtr XMLCALL + xmlReadFile (const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlDocPtr XMLCALL + xmlReadMemory (const char *buffer, + int size, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlDocPtr XMLCALL + xmlReadFd (int fd, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlDocPtr XMLCALL + xmlReadIO (xmlInputReadCallback ioread, + xmlInputCloseCallback ioclose, + void *ioctx, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlDocPtr XMLCALL + xmlCtxtReadDoc (xmlParserCtxtPtr ctxt, + const xmlChar *cur, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlDocPtr XMLCALL + xmlCtxtReadFile (xmlParserCtxtPtr ctxt, + const char *filename, + const char *encoding, + int options); +XMLPUBFUN xmlDocPtr XMLCALL + xmlCtxtReadMemory (xmlParserCtxtPtr ctxt, + const char *buffer, + int size, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlDocPtr XMLCALL + xmlCtxtReadFd (xmlParserCtxtPtr ctxt, + int fd, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlDocPtr XMLCALL + xmlCtxtReadIO (xmlParserCtxtPtr ctxt, + xmlInputReadCallback ioread, + xmlInputCloseCallback ioclose, + void *ioctx, + const char *URL, + const char *encoding, + int options); + +#ifdef __cplusplus +} +#endif +#endif /* __XML_PARSER_H__ */ + diff --git a/include/libxml/parserInternals.h b/include/libxml/parserInternals.h new file mode 100644 index 0000000..7ac0ce6 --- /dev/null +++ b/include/libxml/parserInternals.h @@ -0,0 +1,602 @@ +/* + * Summary: internals routines exported by the parser. + * Description: this module exports a number of internal parsing routines + * they are not really all intended for applications but + * can prove useful doing low level processing. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_PARSER_INTERNALS_H__ +#define __XML_PARSER_INTERNALS_H__ + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlParserMaxDepth: + * + * arbitrary depth limit for the XML documents that we allow to + * process. This is not a limitation of the parser but a safety + * boundary feature. + */ +XMLPUBVAR unsigned int xmlParserMaxDepth; + + /** + * XML_MAX_NAMELEN: + * + * Identifiers can be longer, but this will be more costly + * at runtime. + */ +#define XML_MAX_NAMELEN 100 + +/** + * INPUT_CHUNK: + * + * The parser tries to always have that amount of input ready. + * One of the point is providing context when reporting errors. + */ +#define INPUT_CHUNK 250 + +/************************************************************************ + * * + * UNICODE version of the macros. * + * * + ************************************************************************/ +/** + * IS_BYTE_CHAR: + * @c: an byte value (int) + * + * Macro to check the following production in the XML spec: + * + * [2] Char ::= #x9 | #xA | #xD | [#x20...] + * any byte character in the accepted range + */ +#define IS_BYTE_CHAR(c) xmlIsChar_ch(c) + +/** + * IS_CHAR: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] + * | [#x10000-#x10FFFF] + * any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. + */ +#define IS_CHAR(c) xmlIsCharQ(c) + +/** + * IS_CHAR_CH: + * @c: an xmlChar (usually an unsigned char) + * + * Behaves like IS_CHAR on single-byte value + */ +#define IS_CHAR_CH(c) xmlIsChar_ch(c) + +/** + * IS_BLANK: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * [3] S ::= (#x20 | #x9 | #xD | #xA)+ + */ +#define IS_BLANK(c) xmlIsBlankQ(c) + +/** + * IS_BLANK_CH: + * @c: an xmlChar value (normally unsigned char) + * + * Behaviour same as IS_BLANK + */ +#define IS_BLANK_CH(c) xmlIsBlank_ch(c) + +/** + * IS_BASECHAR: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * [85] BaseChar ::= ... long list see REC ... + */ +#define IS_BASECHAR(c) xmlIsBaseCharQ(c) + +/** + * IS_DIGIT: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * [88] Digit ::= ... long list see REC ... + */ +#define IS_DIGIT(c) xmlIsDigitQ(c) + +/** + * IS_DIGIT_CH: + * @c: an xmlChar value (usually an unsigned char) + * + * Behaves like IS_DIGIT but with a single byte argument + */ +#define IS_DIGIT_CH(c) xmlIsDigit_ch(c) + +/** + * IS_COMBINING: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * [87] CombiningChar ::= ... long list see REC ... + */ +#define IS_COMBINING(c) xmlIsCombiningQ(c) + +/** + * IS_COMBINING_CH: + * @c: an xmlChar (usually an unsigned char) + * + * Always false (all combining chars > 0xff) + */ +#define IS_COMBINING_CH(c) 0 + +/** + * IS_EXTENDER: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * + * [89] Extender ::= #x00B7 | #x02D0 | #x02D1 | #x0387 | #x0640 | + * #x0E46 | #x0EC6 | #x3005 | [#x3031-#x3035] | + * [#x309D-#x309E] | [#x30FC-#x30FE] + */ +#define IS_EXTENDER(c) xmlIsExtenderQ(c) + +/** + * IS_EXTENDER_CH: + * @c: an xmlChar value (usually an unsigned char) + * + * Behaves like IS_EXTENDER but with a single-byte argument + */ +#define IS_EXTENDER_CH(c) xmlIsExtender_ch(c) + +/** + * IS_IDEOGRAPHIC: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * + * [86] Ideographic ::= [#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029] + */ +#define IS_IDEOGRAPHIC(c) xmlIsIdeographicQ(c) + +/** + * IS_LETTER: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * + * [84] Letter ::= BaseChar | Ideographic + */ +#define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c)) + +/** + * IS_LETTER_CH: + * @c: an xmlChar value (normally unsigned char) + * + * Macro behaves like IS_LETTER, but only check base chars + * + */ +#define IS_LETTER_CH(c) xmlIsBaseChar_ch(c) + +/** + * IS_ASCII_LETTER: + * @c: an xmlChar value + * + * Macro to check [a-zA-Z] + * + */ +#define IS_ASCII_LETTER(c) (((0x41 <= (c)) && ((c) <= 0x5a)) || \ + ((0x61 <= (c)) && ((c) <= 0x7a))) + +/** + * IS_ASCII_DIGIT: + * @c: an xmlChar value + * + * Macro to check [0-9] + * + */ +#define IS_ASCII_DIGIT(c) ((0x30 <= (c)) && ((c) <= 0x39)) + +/** + * IS_PUBIDCHAR: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * + * [13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%] + */ +#define IS_PUBIDCHAR(c) xmlIsPubidCharQ(c) + +/** + * IS_PUBIDCHAR_CH: + * @c: an xmlChar value (normally unsigned char) + * + * Same as IS_PUBIDCHAR but for single-byte value + */ +#define IS_PUBIDCHAR_CH(c) xmlIsPubidChar_ch(c) + +/** + * SKIP_EOL: + * @p: and UTF8 string pointer + * + * Skips the end of line chars. + */ +#define SKIP_EOL(p) \ + if (*(p) == 0x13) { p++ ; if (*(p) == 0x10) p++; } \ + if (*(p) == 0x10) { p++ ; if (*(p) == 0x13) p++; } + +/** + * MOVETO_ENDTAG: + * @p: and UTF8 string pointer + * + * Skips to the next '>' char. + */ +#define MOVETO_ENDTAG(p) \ + while ((*p) && (*(p) != '>')) (p)++ + +/** + * MOVETO_STARTTAG: + * @p: and UTF8 string pointer + * + * Skips to the next '<' char. + */ +#define MOVETO_STARTTAG(p) \ + while ((*p) && (*(p) != '<')) (p)++ + +/** + * Global variables used for predefined strings. + */ +XMLPUBVAR const xmlChar xmlStringText[]; +XMLPUBVAR const xmlChar xmlStringTextNoenc[]; +XMLPUBVAR const xmlChar xmlStringComment[]; + +/* + * Function to finish the work of the macros where needed. + */ +XMLPUBFUN int XMLCALL xmlIsLetter (int c); + +/** + * Parser context. + */ +XMLPUBFUN xmlParserCtxtPtr XMLCALL + xmlCreateFileParserCtxt (const char *filename); +XMLPUBFUN xmlParserCtxtPtr XMLCALL + xmlCreateURLParserCtxt (const char *filename, + int options); +XMLPUBFUN xmlParserCtxtPtr XMLCALL + xmlCreateMemoryParserCtxt(const char *buffer, + int size); +XMLPUBFUN xmlParserCtxtPtr XMLCALL + xmlCreateEntityParserCtxt(const xmlChar *URL, + const xmlChar *ID, + const xmlChar *base); +XMLPUBFUN int XMLCALL + xmlSwitchEncoding (xmlParserCtxtPtr ctxt, + xmlCharEncoding enc); +XMLPUBFUN int XMLCALL + xmlSwitchToEncoding (xmlParserCtxtPtr ctxt, + xmlCharEncodingHandlerPtr handler); +XMLPUBFUN int XMLCALL + xmlSwitchInputEncoding (xmlParserCtxtPtr ctxt, + xmlParserInputPtr input, + xmlCharEncodingHandlerPtr handler); + +#ifdef IN_LIBXML +/* internal error reporting */ +XMLPUBFUN void XMLCALL + __xmlErrEncoding (xmlParserCtxtPtr ctxt, + xmlParserErrors xmlerr, + const char *msg, + const xmlChar * str1, + const xmlChar * str2); +#endif + +/** + * Input Streams. + */ +XMLPUBFUN xmlParserInputPtr XMLCALL + xmlNewStringInputStream (xmlParserCtxtPtr ctxt, + const xmlChar *buffer); +XMLPUBFUN xmlParserInputPtr XMLCALL + xmlNewEntityInputStream (xmlParserCtxtPtr ctxt, + xmlEntityPtr entity); +XMLPUBFUN void XMLCALL + xmlPushInput (xmlParserCtxtPtr ctxt, + xmlParserInputPtr input); +XMLPUBFUN xmlChar XMLCALL + xmlPopInput (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlFreeInputStream (xmlParserInputPtr input); +XMLPUBFUN xmlParserInputPtr XMLCALL + xmlNewInputFromFile (xmlParserCtxtPtr ctxt, + const char *filename); +XMLPUBFUN xmlParserInputPtr XMLCALL + xmlNewInputStream (xmlParserCtxtPtr ctxt); + +/** + * Namespaces. + */ +XMLPUBFUN xmlChar * XMLCALL + xmlSplitQName (xmlParserCtxtPtr ctxt, + const xmlChar *name, + xmlChar **prefix); + +/** + * Generic production rules. + */ +XMLPUBFUN const xmlChar * XMLCALL + xmlParseName (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlParseNmtoken (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlParseEntityValue (xmlParserCtxtPtr ctxt, + xmlChar **orig); +XMLPUBFUN xmlChar * XMLCALL + xmlParseAttValue (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlParseSystemLiteral (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlParsePubidLiteral (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseCharData (xmlParserCtxtPtr ctxt, + int cdata); +XMLPUBFUN xmlChar * XMLCALL + xmlParseExternalID (xmlParserCtxtPtr ctxt, + xmlChar **publicID, + int strict); +XMLPUBFUN void XMLCALL + xmlParseComment (xmlParserCtxtPtr ctxt); +XMLPUBFUN const xmlChar * XMLCALL + xmlParsePITarget (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParsePI (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseNotationDecl (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseEntityDecl (xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlParseDefaultDecl (xmlParserCtxtPtr ctxt, + xmlChar **value); +XMLPUBFUN xmlEnumerationPtr XMLCALL + xmlParseNotationType (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlEnumerationPtr XMLCALL + xmlParseEnumerationType (xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlParseEnumeratedType (xmlParserCtxtPtr ctxt, + xmlEnumerationPtr *tree); +XMLPUBFUN int XMLCALL + xmlParseAttributeType (xmlParserCtxtPtr ctxt, + xmlEnumerationPtr *tree); +XMLPUBFUN void XMLCALL + xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlElementContentPtr XMLCALL + xmlParseElementMixedContentDecl + (xmlParserCtxtPtr ctxt, + int inputchk); +XMLPUBFUN xmlElementContentPtr XMLCALL + xmlParseElementChildrenContentDecl + (xmlParserCtxtPtr ctxt, + int inputchk); +XMLPUBFUN int XMLCALL + xmlParseElementContentDecl(xmlParserCtxtPtr ctxt, + const xmlChar *name, + xmlElementContentPtr *result); +XMLPUBFUN int XMLCALL + xmlParseElementDecl (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseMarkupDecl (xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlParseCharRef (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlEntityPtr XMLCALL + xmlParseEntityRef (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseReference (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParsePEReference (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseDocTypeDecl (xmlParserCtxtPtr ctxt); +#ifdef LIBXML_SAX1_ENABLED +XMLPUBFUN const xmlChar * XMLCALL + xmlParseAttribute (xmlParserCtxtPtr ctxt, + xmlChar **value); +XMLPUBFUN const xmlChar * XMLCALL + xmlParseStartTag (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseEndTag (xmlParserCtxtPtr ctxt); +#endif /* LIBXML_SAX1_ENABLED */ +XMLPUBFUN void XMLCALL + xmlParseCDSect (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseContent (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseElement (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlParseVersionNum (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlParseVersionInfo (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlParseEncName (xmlParserCtxtPtr ctxt); +XMLPUBFUN const xmlChar * XMLCALL + xmlParseEncodingDecl (xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlParseSDDecl (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseXMLDecl (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseTextDecl (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseMisc (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseExternalSubset (xmlParserCtxtPtr ctxt, + const xmlChar *ExternalID, + const xmlChar *SystemID); +/** + * XML_SUBSTITUTE_NONE: + * + * If no entities need to be substituted. + */ +#define XML_SUBSTITUTE_NONE 0 +/** + * XML_SUBSTITUTE_REF: + * + * Whether general entities need to be substituted. + */ +#define XML_SUBSTITUTE_REF 1 +/** + * XML_SUBSTITUTE_PEREF: + * + * Whether parameter entities need to be substituted. + */ +#define XML_SUBSTITUTE_PEREF 2 +/** + * XML_SUBSTITUTE_BOTH: + * + * Both general and parameter entities need to be substituted. + */ +#define XML_SUBSTITUTE_BOTH 3 + +XMLPUBFUN xmlChar * XMLCALL + xmlStringDecodeEntities (xmlParserCtxtPtr ctxt, + const xmlChar *str, + int what, + xmlChar end, + xmlChar end2, + xmlChar end3); +XMLPUBFUN xmlChar * XMLCALL + xmlStringLenDecodeEntities (xmlParserCtxtPtr ctxt, + const xmlChar *str, + int len, + int what, + xmlChar end, + xmlChar end2, + xmlChar end3); + +/* + * Generated by MACROS on top of parser.c c.f. PUSH_AND_POP. + */ +XMLPUBFUN int XMLCALL nodePush (xmlParserCtxtPtr ctxt, + xmlNodePtr value); +XMLPUBFUN xmlNodePtr XMLCALL nodePop (xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL inputPush (xmlParserCtxtPtr ctxt, + xmlParserInputPtr value); +XMLPUBFUN xmlParserInputPtr XMLCALL inputPop (xmlParserCtxtPtr ctxt); +XMLPUBFUN const xmlChar * XMLCALL namePop (xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL namePush (xmlParserCtxtPtr ctxt, + const xmlChar *value); + +/* + * other commodities shared between parser.c and parserInternals. + */ +XMLPUBFUN int XMLCALL xmlSkipBlankChars (xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL xmlStringCurrentChar (xmlParserCtxtPtr ctxt, + const xmlChar *cur, + int *len); +XMLPUBFUN void XMLCALL xmlParserHandlePEReference(xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL xmlCheckLanguageID (const xmlChar *lang); + +/* + * Really core function shared with HTML parser. + */ +XMLPUBFUN int XMLCALL xmlCurrentChar (xmlParserCtxtPtr ctxt, + int *len); +XMLPUBFUN int XMLCALL xmlCopyCharMultiByte (xmlChar *out, + int val); +XMLPUBFUN int XMLCALL xmlCopyChar (int len, + xmlChar *out, + int val); +XMLPUBFUN void XMLCALL xmlNextChar (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL xmlParserInputShrink (xmlParserInputPtr in); + +#ifdef LIBXML_HTML_ENABLED +/* + * Actually comes from the HTML parser but launched from the init stuff. + */ +XMLPUBFUN void XMLCALL htmlInitAutoClose (void); +XMLPUBFUN htmlParserCtxtPtr XMLCALL htmlCreateFileParserCtxt(const char *filename, + const char *encoding); +#endif + +/* + * Specific function to keep track of entities references + * and used by the XSLT debugger. + */ +#ifdef LIBXML_LEGACY_ENABLED +/** + * xmlEntityReferenceFunc: + * @ent: the entity + * @firstNode: the fist node in the chunk + * @lastNode: the last nod in the chunk + * + * Callback function used when one needs to be able to track back the + * provenance of a chunk of nodes inherited from an entity replacement. + */ +typedef void (*xmlEntityReferenceFunc) (xmlEntityPtr ent, + xmlNodePtr firstNode, + xmlNodePtr lastNode); + +XMLPUBFUN void XMLCALL xmlSetEntityReferenceFunc (xmlEntityReferenceFunc func); + +XMLPUBFUN xmlChar * XMLCALL + xmlParseQuotedString (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseNamespace (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlNamespaceParseNSDef (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlScanName (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlNamespaceParseNCName (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL xmlParserHandleReference(xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlNamespaceParseQName (xmlParserCtxtPtr ctxt, + xmlChar **prefix); +/** + * Entities + */ +XMLPUBFUN xmlChar * XMLCALL + xmlDecodeEntities (xmlParserCtxtPtr ctxt, + int len, + int what, + xmlChar end, + xmlChar end2, + xmlChar end3); +XMLPUBFUN void XMLCALL + xmlHandleEntity (xmlParserCtxtPtr ctxt, + xmlEntityPtr entity); + +#endif /* LIBXML_LEGACY_ENABLED */ + +#ifdef IN_LIBXML +/* + * internal only + */ +XMLPUBFUN void XMLCALL + xmlErrMemory (xmlParserCtxtPtr ctxt, + const char *extra); +#endif + +#ifdef __cplusplus +} +#endif +#endif /* __XML_PARSER_INTERNALS_H__ */ diff --git a/include/libxml/pattern.h b/include/libxml/pattern.h new file mode 100644 index 0000000..e3ee76d --- /dev/null +++ b/include/libxml/pattern.h @@ -0,0 +1,91 @@ +/* + * Summary: pattern expression handling + * Description: allows to compile and test pattern expressions for nodes + * either in a tree or based on a parser state. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_PATTERN_H__ +#define __XML_PATTERN_H__ + +#include +#include +#include + +#ifdef LIBXML_PATTERN_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlPattern: + * + * A compiled (XPath based) pattern to select nodes + */ +typedef struct _xmlPattern xmlPattern; +typedef xmlPattern *xmlPatternPtr; + +/** + * xmlPatternFlags: + * + * This is the set of options affecting the behaviour of pattern + * matching with this module + * + */ +typedef enum { + XML_PATTERN_DEFAULT = 0, /* simple pattern match */ + XML_PATTERN_XPATH = 1<<0, /* standard XPath pattern */ + XML_PATTERN_XSSEL = 1<<1, /* XPath subset for schema selector */ + XML_PATTERN_XSFIELD = 1<<2 /* XPath subset for schema field */ +} xmlPatternFlags; + +XMLPUBFUN void XMLCALL + xmlFreePattern (xmlPatternPtr comp); + +XMLPUBFUN void XMLCALL + xmlFreePatternList (xmlPatternPtr comp); + +XMLPUBFUN xmlPatternPtr XMLCALL + xmlPatterncompile (const xmlChar *pattern, + xmlDict *dict, + xmlPatternFlags flags, + const xmlChar **namespaces); +XMLPUBFUN int XMLCALL + xmlPatternMatch (xmlPatternPtr comp, + xmlNodePtr node); + +/* streaming interfaces */ +typedef struct _xmlStreamCtxt xmlStreamCtxt; +typedef xmlStreamCtxt *xmlStreamCtxtPtr; + +XMLPUBFUN int XMLCALL + xmlPatternStreamable (xmlPatternPtr comp); +XMLPUBFUN int XMLCALL + xmlPatternMaxDepth (xmlPatternPtr comp); +XMLPUBFUN int XMLCALL + xmlPatternFromRoot (xmlPatternPtr comp); +XMLPUBFUN xmlStreamCtxtPtr XMLCALL + xmlPatternGetStreamCtxt (xmlPatternPtr comp); +XMLPUBFUN void XMLCALL + xmlFreeStreamCtxt (xmlStreamCtxtPtr stream); +XMLPUBFUN int XMLCALL + xmlStreamPush (xmlStreamCtxtPtr stream, + const xmlChar *name, + const xmlChar *ns); +XMLPUBFUN int XMLCALL + xmlStreamPushAttr (xmlStreamCtxtPtr stream, + const xmlChar *name, + const xmlChar *ns); +XMLPUBFUN int XMLCALL + xmlStreamPop (xmlStreamCtxtPtr stream); +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_PATTERN_ENABLED */ + +#endif /* __XML_PATTERN_H__ */ diff --git a/include/libxml/relaxng.h b/include/libxml/relaxng.h new file mode 100644 index 0000000..ca3c13b --- /dev/null +++ b/include/libxml/relaxng.h @@ -0,0 +1,188 @@ +/* + * Summary: implementation of the Relax-NG validation + * Description: implementation of the Relax-NG validation + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_RELAX_NG__ +#define __XML_RELAX_NG__ + +#include +#include +#include + +#ifdef LIBXML_SCHEMAS_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct _xmlRelaxNG xmlRelaxNG; +typedef xmlRelaxNG *xmlRelaxNGPtr; + + +/** + * A schemas validation context + */ +typedef void (*xmlRelaxNGValidityErrorFunc) (void *ctx, const char *msg, ...); +typedef void (*xmlRelaxNGValidityWarningFunc) (void *ctx, const char *msg, ...); + +typedef struct _xmlRelaxNGParserCtxt xmlRelaxNGParserCtxt; +typedef xmlRelaxNGParserCtxt *xmlRelaxNGParserCtxtPtr; + +typedef struct _xmlRelaxNGValidCtxt xmlRelaxNGValidCtxt; +typedef xmlRelaxNGValidCtxt *xmlRelaxNGValidCtxtPtr; + +/* + * xmlRelaxNGValidErr: + * + * List of possible Relax NG validation errors + */ +typedef enum { + XML_RELAXNG_OK = 0, + XML_RELAXNG_ERR_MEMORY, + XML_RELAXNG_ERR_TYPE, + XML_RELAXNG_ERR_TYPEVAL, + XML_RELAXNG_ERR_DUPID, + XML_RELAXNG_ERR_TYPECMP, + XML_RELAXNG_ERR_NOSTATE, + XML_RELAXNG_ERR_NODEFINE, + XML_RELAXNG_ERR_LISTEXTRA, + XML_RELAXNG_ERR_LISTEMPTY, + XML_RELAXNG_ERR_INTERNODATA, + XML_RELAXNG_ERR_INTERSEQ, + XML_RELAXNG_ERR_INTEREXTRA, + XML_RELAXNG_ERR_ELEMNAME, + XML_RELAXNG_ERR_ATTRNAME, + XML_RELAXNG_ERR_ELEMNONS, + XML_RELAXNG_ERR_ATTRNONS, + XML_RELAXNG_ERR_ELEMWRONGNS, + XML_RELAXNG_ERR_ATTRWRONGNS, + XML_RELAXNG_ERR_ELEMEXTRANS, + XML_RELAXNG_ERR_ATTREXTRANS, + XML_RELAXNG_ERR_ELEMNOTEMPTY, + XML_RELAXNG_ERR_NOELEM, + XML_RELAXNG_ERR_NOTELEM, + XML_RELAXNG_ERR_ATTRVALID, + XML_RELAXNG_ERR_CONTENTVALID, + XML_RELAXNG_ERR_EXTRACONTENT, + XML_RELAXNG_ERR_INVALIDATTR, + XML_RELAXNG_ERR_DATAELEM, + XML_RELAXNG_ERR_VALELEM, + XML_RELAXNG_ERR_LISTELEM, + XML_RELAXNG_ERR_DATATYPE, + XML_RELAXNG_ERR_VALUE, + XML_RELAXNG_ERR_LIST, + XML_RELAXNG_ERR_NOGRAMMAR, + XML_RELAXNG_ERR_EXTRADATA, + XML_RELAXNG_ERR_LACKDATA, + XML_RELAXNG_ERR_INTERNAL, + XML_RELAXNG_ERR_ELEMWRONG, + XML_RELAXNG_ERR_TEXTWRONG +} xmlRelaxNGValidErr; + +/* + * xmlRelaxNGParserFlags: + * + * List of possible Relax NG Parser flags + */ +typedef enum { + XML_RELAXNGP_NONE = 0, + XML_RELAXNGP_FREE_DOC = 1, + XML_RELAXNGP_CRNG = 2 +} xmlRelaxNGParserFlag; + +XMLPUBFUN int XMLCALL + xmlRelaxNGInitTypes (void); +XMLPUBFUN void XMLCALL + xmlRelaxNGCleanupTypes (void); + +/* + * Interfaces for parsing. + */ +XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL + xmlRelaxNGNewParserCtxt (const char *URL); +XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL + xmlRelaxNGNewMemParserCtxt (const char *buffer, + int size); +XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL + xmlRelaxNGNewDocParserCtxt (xmlDocPtr doc); + +XMLPUBFUN int XMLCALL + xmlRelaxParserSetFlag (xmlRelaxNGParserCtxtPtr ctxt, + int flag); + +XMLPUBFUN void XMLCALL + xmlRelaxNGFreeParserCtxt (xmlRelaxNGParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlRelaxNGSetParserErrors(xmlRelaxNGParserCtxtPtr ctxt, + xmlRelaxNGValidityErrorFunc err, + xmlRelaxNGValidityWarningFunc warn, + void *ctx); +XMLPUBFUN int XMLCALL + xmlRelaxNGGetParserErrors(xmlRelaxNGParserCtxtPtr ctxt, + xmlRelaxNGValidityErrorFunc *err, + xmlRelaxNGValidityWarningFunc *warn, + void **ctx); +XMLPUBFUN xmlRelaxNGPtr XMLCALL + xmlRelaxNGParse (xmlRelaxNGParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlRelaxNGFree (xmlRelaxNGPtr schema); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void XMLCALL + xmlRelaxNGDump (FILE *output, + xmlRelaxNGPtr schema); +XMLPUBFUN void XMLCALL + xmlRelaxNGDumpTree (FILE * output, + xmlRelaxNGPtr schema); +#endif /* LIBXML_OUTPUT_ENABLED */ +/* + * Interfaces for validating + */ +XMLPUBFUN void XMLCALL + xmlRelaxNGSetValidErrors(xmlRelaxNGValidCtxtPtr ctxt, + xmlRelaxNGValidityErrorFunc err, + xmlRelaxNGValidityWarningFunc warn, + void *ctx); +XMLPUBFUN int XMLCALL + xmlRelaxNGGetValidErrors(xmlRelaxNGValidCtxtPtr ctxt, + xmlRelaxNGValidityErrorFunc *err, + xmlRelaxNGValidityWarningFunc *warn, + void **ctx); +XMLPUBFUN xmlRelaxNGValidCtxtPtr XMLCALL + xmlRelaxNGNewValidCtxt (xmlRelaxNGPtr schema); +XMLPUBFUN void XMLCALL + xmlRelaxNGFreeValidCtxt (xmlRelaxNGValidCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlRelaxNGValidateDoc (xmlRelaxNGValidCtxtPtr ctxt, + xmlDocPtr doc); +/* + * Interfaces for progressive validation when possible + */ +XMLPUBFUN int XMLCALL + xmlRelaxNGValidatePushElement (xmlRelaxNGValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr elem); +XMLPUBFUN int XMLCALL + xmlRelaxNGValidatePushCData (xmlRelaxNGValidCtxtPtr ctxt, + const xmlChar *data, + int len); +XMLPUBFUN int XMLCALL + xmlRelaxNGValidatePopElement (xmlRelaxNGValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr elem); +XMLPUBFUN int XMLCALL + xmlRelaxNGValidateFullElement (xmlRelaxNGValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr elem); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_SCHEMAS_ENABLED */ + +#endif /* __XML_RELAX_NG__ */ diff --git a/include/libxml/schemasInternals.h b/include/libxml/schemasInternals.h new file mode 100644 index 0000000..eb1f426 --- /dev/null +++ b/include/libxml/schemasInternals.h @@ -0,0 +1,905 @@ +/* + * Summary: internal interfaces for XML Schemas + * Description: internal interfaces for the XML Schemas handling + * and schema validity checking + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + + +#ifndef __XML_SCHEMA_INTERNALS_H__ +#define __XML_SCHEMA_INTERNALS_H__ + +#include + +#ifdef LIBXML_SCHEMAS_ENABLED + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + XML_SCHEMAS_UNKNOWN = 0, + XML_SCHEMAS_STRING, + XML_SCHEMAS_NORMSTRING, + XML_SCHEMAS_DECIMAL, + XML_SCHEMAS_TIME, + XML_SCHEMAS_GDAY, + XML_SCHEMAS_GMONTH, + XML_SCHEMAS_GMONTHDAY, + XML_SCHEMAS_GYEAR, + XML_SCHEMAS_GYEARMONTH, + XML_SCHEMAS_DATE, + XML_SCHEMAS_DATETIME, + XML_SCHEMAS_DURATION, + XML_SCHEMAS_FLOAT, + XML_SCHEMAS_DOUBLE, + XML_SCHEMAS_BOOLEAN, + XML_SCHEMAS_TOKEN, + XML_SCHEMAS_LANGUAGE, + XML_SCHEMAS_NMTOKEN, + XML_SCHEMAS_NMTOKENS, + XML_SCHEMAS_NAME, + XML_SCHEMAS_QNAME, + XML_SCHEMAS_NCNAME, + XML_SCHEMAS_ID, + XML_SCHEMAS_IDREF, + XML_SCHEMAS_IDREFS, + XML_SCHEMAS_ENTITY, + XML_SCHEMAS_ENTITIES, + XML_SCHEMAS_NOTATION, + XML_SCHEMAS_ANYURI, + XML_SCHEMAS_INTEGER, + XML_SCHEMAS_NPINTEGER, + XML_SCHEMAS_NINTEGER, + XML_SCHEMAS_NNINTEGER, + XML_SCHEMAS_PINTEGER, + XML_SCHEMAS_INT, + XML_SCHEMAS_UINT, + XML_SCHEMAS_LONG, + XML_SCHEMAS_ULONG, + XML_SCHEMAS_SHORT, + XML_SCHEMAS_USHORT, + XML_SCHEMAS_BYTE, + XML_SCHEMAS_UBYTE, + XML_SCHEMAS_HEXBINARY, + XML_SCHEMAS_BASE64BINARY, + XML_SCHEMAS_ANYTYPE, + XML_SCHEMAS_ANYSIMPLETYPE +} xmlSchemaValType; + +/* + * XML Schemas defines multiple type of types. + */ +typedef enum { + XML_SCHEMA_TYPE_BASIC = 1, /* A built-in datatype */ + XML_SCHEMA_TYPE_ANY, + XML_SCHEMA_TYPE_FACET, + XML_SCHEMA_TYPE_SIMPLE, + XML_SCHEMA_TYPE_COMPLEX, + XML_SCHEMA_TYPE_SEQUENCE = 6, + XML_SCHEMA_TYPE_CHOICE, + XML_SCHEMA_TYPE_ALL, + XML_SCHEMA_TYPE_SIMPLE_CONTENT, + XML_SCHEMA_TYPE_COMPLEX_CONTENT, + XML_SCHEMA_TYPE_UR, + XML_SCHEMA_TYPE_RESTRICTION, + XML_SCHEMA_TYPE_EXTENSION, + XML_SCHEMA_TYPE_ELEMENT, + XML_SCHEMA_TYPE_ATTRIBUTE, + XML_SCHEMA_TYPE_ATTRIBUTEGROUP, + XML_SCHEMA_TYPE_GROUP, + XML_SCHEMA_TYPE_NOTATION, + XML_SCHEMA_TYPE_LIST, + XML_SCHEMA_TYPE_UNION, + XML_SCHEMA_TYPE_ANY_ATTRIBUTE, + XML_SCHEMA_TYPE_IDC_UNIQUE, + XML_SCHEMA_TYPE_IDC_KEY, + XML_SCHEMA_TYPE_IDC_KEYREF, + XML_SCHEMA_TYPE_PARTICLE = 25, + XML_SCHEMA_FACET_MININCLUSIVE = 1000, + XML_SCHEMA_FACET_MINEXCLUSIVE, + XML_SCHEMA_FACET_MAXINCLUSIVE, + XML_SCHEMA_FACET_MAXEXCLUSIVE, + XML_SCHEMA_FACET_TOTALDIGITS, + XML_SCHEMA_FACET_FRACTIONDIGITS, + XML_SCHEMA_FACET_PATTERN, + XML_SCHEMA_FACET_ENUMERATION, + XML_SCHEMA_FACET_WHITESPACE, + XML_SCHEMA_FACET_LENGTH, + XML_SCHEMA_FACET_MAXLENGTH, + XML_SCHEMA_FACET_MINLENGTH, + XML_SCHEMA_EXTRA_QNAMEREF = 2000 +} xmlSchemaTypeType; + +typedef enum { + XML_SCHEMA_CONTENT_UNKNOWN = 0, + XML_SCHEMA_CONTENT_EMPTY = 1, + XML_SCHEMA_CONTENT_ELEMENTS, + XML_SCHEMA_CONTENT_MIXED, + XML_SCHEMA_CONTENT_SIMPLE, + XML_SCHEMA_CONTENT_MIXED_OR_ELEMENTS, /* obsolete, not used */ + XML_SCHEMA_CONTENT_BASIC, + XML_SCHEMA_CONTENT_ANY +} xmlSchemaContentType; + +typedef struct _xmlSchemaVal xmlSchemaVal; +typedef xmlSchemaVal *xmlSchemaValPtr; + +typedef struct _xmlSchemaType xmlSchemaType; +typedef xmlSchemaType *xmlSchemaTypePtr; + +typedef struct _xmlSchemaFacet xmlSchemaFacet; +typedef xmlSchemaFacet *xmlSchemaFacetPtr; + +/** + * Annotation + */ +typedef struct _xmlSchemaAnnot xmlSchemaAnnot; +typedef xmlSchemaAnnot *xmlSchemaAnnotPtr; +struct _xmlSchemaAnnot { + struct _xmlSchemaAnnot *next; + xmlNodePtr content; /* the annotation */ +}; + +/** + * XML_SCHEMAS_ANYATTR_SKIP: + * + * Skip unknown attribute from validation + * Obsolete, not used anymore. + */ +#define XML_SCHEMAS_ANYATTR_SKIP 1 +/** + * XML_SCHEMAS_ANYATTR_LAX: + * + * Ignore validation non definition on attributes + * Obsolete, not used anymore. + */ +#define XML_SCHEMAS_ANYATTR_LAX 2 +/** + * XML_SCHEMAS_ANYATTR_STRICT: + * + * Apply strict validation rules on attributes + * Obsolete, not used anymore. + */ +#define XML_SCHEMAS_ANYATTR_STRICT 3 +/** + * XML_SCHEMAS_ANY_SKIP: + * + * Skip unknown attribute from validation + */ +#define XML_SCHEMAS_ANY_SKIP 1 +/** + * XML_SCHEMAS_ANY_LAX: + * + * Used by wildcards. + * Validate if type found, don't worry if not found + */ +#define XML_SCHEMAS_ANY_LAX 2 +/** + * XML_SCHEMAS_ANY_STRICT: + * + * Used by wildcards. + * Apply strict validation rules + */ +#define XML_SCHEMAS_ANY_STRICT 3 +/** + * XML_SCHEMAS_ATTR_USE_PROHIBITED: + * + * Used by wildcards. + * The attribute is prohibited. + */ +#define XML_SCHEMAS_ATTR_USE_PROHIBITED 0 +/** + * XML_SCHEMAS_ATTR_USE_REQUIRED: + * + * The attribute is required. + */ +#define XML_SCHEMAS_ATTR_USE_REQUIRED 1 +/** + * XML_SCHEMAS_ATTR_USE_OPTIONAL: + * + * The attribute is optional. + */ +#define XML_SCHEMAS_ATTR_USE_OPTIONAL 2 +/** + * XML_SCHEMAS_ATTR_GLOBAL: + * + * allow elements in no namespace + */ +#define XML_SCHEMAS_ATTR_GLOBAL 1 << 0 +/** + * XML_SCHEMAS_ATTR_NSDEFAULT: + * + * allow elements in no namespace + */ +#define XML_SCHEMAS_ATTR_NSDEFAULT 1 << 7 +/** + * XML_SCHEMAS_ATTR_INTERNAL_RESOLVED: + * + * this is set when the "type" and "ref" references + * have been resolved. + */ +#define XML_SCHEMAS_ATTR_INTERNAL_RESOLVED 1 << 8 +/** + * XML_SCHEMAS_ATTR_FIXED: + * + * the attribute has a fixed value + */ +#define XML_SCHEMAS_ATTR_FIXED 1 << 9 + +/** + * xmlSchemaAttribute: + * An attribute definition. + */ + +typedef struct _xmlSchemaAttribute xmlSchemaAttribute; +typedef xmlSchemaAttribute *xmlSchemaAttributePtr; +struct _xmlSchemaAttribute { + xmlSchemaTypeType type; /* The kind of type */ + struct _xmlSchemaAttribute *next;/* the next attribute if in a group ... */ + const xmlChar *name; /* name of the declaration or empty if particle */ + const xmlChar *id; + const xmlChar *ref; /* the local name of the attribute decl. if a particle */ + const xmlChar *refNs; /* the ns URI of the attribute decl. if a particle */ + const xmlChar *typeName; /* the local name of the type definition */ + const xmlChar *typeNs; /* the ns URI of the type definition */ + xmlSchemaAnnotPtr annot; + + xmlSchemaTypePtr base; /* obsolete, not used */ + int occurs; + const xmlChar *defValue; + xmlSchemaTypePtr subtypes; /* the type definition */ + xmlNodePtr node; + const xmlChar *targetNamespace; + int flags; + const xmlChar *refPrefix; + xmlSchemaValPtr defVal; + xmlSchemaAttributePtr refDecl; +}; + +/** + * xmlSchemaAttributeLink: + * Used to build a list of attribute uses on complexType definitions. + */ +typedef struct _xmlSchemaAttributeLink xmlSchemaAttributeLink; +typedef xmlSchemaAttributeLink *xmlSchemaAttributeLinkPtr; +struct _xmlSchemaAttributeLink { + struct _xmlSchemaAttributeLink *next;/* the next attribute link ... */ + struct _xmlSchemaAttribute *attr;/* the linked attribute */ +}; + +/** + * XML_SCHEMAS_WILDCARD_COMPLETE: + * + * If the wildcard is complete. + */ +#define XML_SCHEMAS_WILDCARD_COMPLETE 1 << 0 + +/** + * xmlSchemaCharValueLink: + * Used to build a list of namespaces on wildcards. + */ +typedef struct _xmlSchemaWildcardNs xmlSchemaWildcardNs; +typedef xmlSchemaWildcardNs *xmlSchemaWildcardNsPtr; +struct _xmlSchemaWildcardNs { + struct _xmlSchemaWildcardNs *next;/* the next constraint link ... */ + const xmlChar *value;/* the value */ +}; + +/** + * xmlSchemaWildcard. + * A wildcard. + */ +typedef struct _xmlSchemaWildcard xmlSchemaWildcard; +typedef xmlSchemaWildcard *xmlSchemaWildcardPtr; +struct _xmlSchemaWildcard { + xmlSchemaTypeType type; /* The kind of type */ + const xmlChar *id; + xmlSchemaAnnotPtr annot; + xmlNodePtr node; + int minOccurs; + int maxOccurs; + int processContents; + int any; /* Indicates if the ns constraint is of ##any */ + xmlSchemaWildcardNsPtr nsSet; /* The list of allowed namespaces */ + xmlSchemaWildcardNsPtr negNsSet; /* The negated namespace */ + int flags; +}; + +/** + * XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED: + * + * The attribute wildcard has been already builded. + */ +#define XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED 1 << 0 +/** + * XML_SCHEMAS_ATTRGROUP_GLOBAL: + * + * The attribute wildcard has been already builded. + */ +#define XML_SCHEMAS_ATTRGROUP_GLOBAL 1 << 1 +/** + * XML_SCHEMAS_ATTRGROUP_MARKED: + * + * Marks the attr group as marked; used for circular checks. + */ +#define XML_SCHEMAS_ATTRGROUP_MARKED 1 << 2 + +/** + * An attribute group definition. + * + * xmlSchemaAttribute and xmlSchemaAttributeGroup start of structures + * must be kept similar + */ +typedef struct _xmlSchemaAttributeGroup xmlSchemaAttributeGroup; +typedef xmlSchemaAttributeGroup *xmlSchemaAttributeGroupPtr; +struct _xmlSchemaAttributeGroup { + xmlSchemaTypeType type; /* The kind of type */ + struct _xmlSchemaAttribute *next;/* the next attribute if in a group ... */ + const xmlChar *name; + const xmlChar *id; + const xmlChar *ref; + const xmlChar *refNs; + xmlSchemaAnnotPtr annot; + + xmlSchemaAttributePtr attributes; + xmlNodePtr node; + int flags; + xmlSchemaWildcardPtr attributeWildcard; + const xmlChar *refPrefix; + xmlSchemaAttributeGroupPtr refItem; /* The referenced attribute group */ + const xmlChar *targetNamespace; +}; + +/** + * xmlSchemaTypeLink: + * Used to build a list of types (e.g. member types of + * simpleType with variety "union"). + */ +typedef struct _xmlSchemaTypeLink xmlSchemaTypeLink; +typedef xmlSchemaTypeLink *xmlSchemaTypeLinkPtr; +struct _xmlSchemaTypeLink { + struct _xmlSchemaTypeLink *next;/* the next type link ... */ + xmlSchemaTypePtr type;/* the linked type*/ +}; + +/** + * xmlSchemaFacetLink: + * Used to build a list of facets. + */ +typedef struct _xmlSchemaFacetLink xmlSchemaFacetLink; +typedef xmlSchemaFacetLink *xmlSchemaFacetLinkPtr; +struct _xmlSchemaFacetLink { + struct _xmlSchemaFacetLink *next;/* the next facet link ... */ + xmlSchemaFacetPtr facet;/* the linked facet */ +}; + +/** + * XML_SCHEMAS_TYPE_MIXED: + * + * the element content type is mixed + */ +#define XML_SCHEMAS_TYPE_MIXED 1 << 0 +/** + * XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION: + * + * the simple or complex type has a derivation method of "extension". + */ +#define XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION 1 << 1 +/** + * XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION: + * + * the simple or complex type has a derivation method of "restriction". + */ +#define XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION 1 << 2 +/** + * XML_SCHEMAS_TYPE_GLOBAL: + * + * the type is global + */ +#define XML_SCHEMAS_TYPE_GLOBAL 1 << 3 +/** + * XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD: + * + * the complexType owns an attribute wildcard, i.e. + * it can be freed by the complexType + */ +#define XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD 1 << 4 /* Obsolete. */ +/** + * XML_SCHEMAS_TYPE_VARIETY_ABSENT: + * + * the simpleType has a variety of "absent". + */ +#define XML_SCHEMAS_TYPE_VARIETY_ABSENT 1 << 5 +/** + * XML_SCHEMAS_TYPE_VARIETY_LIST: + * + * the simpleType has a variety of "list". + */ +#define XML_SCHEMAS_TYPE_VARIETY_LIST 1 << 6 +/** + * XML_SCHEMAS_TYPE_VARIETY_UNION: + * + * the simpleType has a variety of "union". + */ +#define XML_SCHEMAS_TYPE_VARIETY_UNION 1 << 7 +/** + * XML_SCHEMAS_TYPE_VARIETY_ATOMIC: + * + * the simpleType has a variety of "union". + */ +#define XML_SCHEMAS_TYPE_VARIETY_ATOMIC 1 << 8 +/** + * XML_SCHEMAS_TYPE_FINAL_EXTENSION: + * + * the complexType has a final of "extension". + */ +#define XML_SCHEMAS_TYPE_FINAL_EXTENSION 1 << 9 +/** + * XML_SCHEMAS_TYPE_FINAL_RESTRICTION: + * + * the simpleType/complexType has a final of "restriction". + */ +#define XML_SCHEMAS_TYPE_FINAL_RESTRICTION 1 << 10 +/** + * XML_SCHEMAS_TYPE_FINAL_LIST: + * + * the simpleType has a final of "list". + */ +#define XML_SCHEMAS_TYPE_FINAL_LIST 1 << 11 +/** + * XML_SCHEMAS_TYPE_FINAL_UNION: + * + * the simpleType has a final of "union". + */ +#define XML_SCHEMAS_TYPE_FINAL_UNION 1 << 12 +/** + * XML_SCHEMAS_TYPE_FINAL_DEFAULT: + * + * the simpleType has a final of "default". + */ +#define XML_SCHEMAS_TYPE_FINAL_DEFAULT 1 << 13 +/** + * XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE: + * + * Marks the item as a builtin primitive. + */ +#define XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE 1 << 14 +/** + * XML_SCHEMAS_TYPE_MARKED: + * + * Marks the item as marked; used for circular checks. + */ +#define XML_SCHEMAS_TYPE_MARKED 1 << 16 +/** + * XML_SCHEMAS_TYPE_BLOCK_DEFAULT: + * + * the complexType did not specify 'block' so use the default of the + * item. + */ +#define XML_SCHEMAS_TYPE_BLOCK_DEFAULT 1 << 17 +/** + * XML_SCHEMAS_TYPE_BLOCK_EXTENSION: + * + * the complexType has a 'block' of "extension". + */ +#define XML_SCHEMAS_TYPE_BLOCK_EXTENSION 1 << 18 +/** + * XML_SCHEMAS_TYPE_BLOCK_RESTRICTION: + * + * the complexType has a 'block' of "restriction". + */ +#define XML_SCHEMAS_TYPE_BLOCK_RESTRICTION 1 << 19 +/** + * XML_SCHEMAS_TYPE_ABSTRACT: + * + * the simple/complexType is abstract. + */ +#define XML_SCHEMAS_TYPE_ABSTRACT 1 << 20 +/** + * XML_SCHEMAS_TYPE_FACETSNEEDVALUE: + * + * indicates if the facets need a computed value + */ +#define XML_SCHEMAS_TYPE_FACETSNEEDVALUE 1 << 21 +/** + * XML_SCHEMAS_TYPE_INTERNAL_RESOLVED: + * + * indicates that the type was typefixed + */ +#define XML_SCHEMAS_TYPE_INTERNAL_RESOLVED 1 << 22 +/** + * XML_SCHEMAS_TYPE_INTERNAL_INVALID: + * + * indicates that the type is invalid + */ +#define XML_SCHEMAS_TYPE_INTERNAL_INVALID 1 << 23 +/** + * XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE: + * + * a whitespace-facet value of "preserve" + */ +#define XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE 1 << 24 +/** + * XML_SCHEMAS_TYPE_WHITESPACE_REPLACE: + * + * a whitespace-facet value of "replace" + */ +#define XML_SCHEMAS_TYPE_WHITESPACE_REPLACE 1 << 25 +/** + * XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE: + * + * a whitespace-facet value of "collapse" + */ +#define XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE 1 << 26 +/** + * XML_SCHEMAS_TYPE_HAS_FACETS: + * + * has facets + */ +#define XML_SCHEMAS_TYPE_HAS_FACETS 1 << 27 +/** + * XML_SCHEMAS_TYPE_NORMVALUENEEDED: + * + * indicates if the facets (pattern) need a normalized value + */ +#define XML_SCHEMAS_TYPE_NORMVALUENEEDED 1 << 28 + +/** + * _xmlSchemaType: + * + * Schemas type definition. + */ +struct _xmlSchemaType { + xmlSchemaTypeType type; /* The kind of type */ + struct _xmlSchemaType *next;/* the next type if in a sequence ... */ + const xmlChar *name; + const xmlChar *id; + const xmlChar *ref; + const xmlChar *refNs; + xmlSchemaAnnotPtr annot; + xmlSchemaTypePtr subtypes; + xmlSchemaAttributePtr attributes; + xmlNodePtr node; + int minOccurs; + int maxOccurs; + + int flags; + xmlSchemaContentType contentType; + const xmlChar *base; + const xmlChar *baseNs; + xmlSchemaTypePtr baseType; + xmlSchemaFacetPtr facets; + struct _xmlSchemaType *redef;/* possible redefinitions for the type */ + int recurse; + xmlSchemaAttributeLinkPtr attributeUses; + xmlSchemaWildcardPtr attributeWildcard; + int builtInType; + xmlSchemaTypeLinkPtr memberTypes; + xmlSchemaFacetLinkPtr facetSet; + const xmlChar *refPrefix; + xmlSchemaTypePtr contentTypeDef; + xmlRegexpPtr contModel; + const xmlChar *targetNamespace; +}; + +/* + * xmlSchemaElement: + * An element definition. + * + * xmlSchemaType, xmlSchemaFacet and xmlSchemaElement start of + * structures must be kept similar + */ +/** + * XML_SCHEMAS_ELEM_NILLABLE: + * + * the element is nillable + */ +#define XML_SCHEMAS_ELEM_NILLABLE 1 << 0 +/** + * XML_SCHEMAS_ELEM_GLOBAL: + * + * the element is global + */ +#define XML_SCHEMAS_ELEM_GLOBAL 1 << 1 +/** + * XML_SCHEMAS_ELEM_DEFAULT: + * + * the element has a default value + */ +#define XML_SCHEMAS_ELEM_DEFAULT 1 << 2 +/** + * XML_SCHEMAS_ELEM_FIXED: + * + * the element has a fixed value + */ +#define XML_SCHEMAS_ELEM_FIXED 1 << 3 +/** + * XML_SCHEMAS_ELEM_ABSTRACT: + * + * the element is abstract + */ +#define XML_SCHEMAS_ELEM_ABSTRACT 1 << 4 +/** + * XML_SCHEMAS_ELEM_TOPLEVEL: + * + * the element is top level + * obsolete: use XML_SCHEMAS_ELEM_GLOBAL instead + */ +#define XML_SCHEMAS_ELEM_TOPLEVEL 1 << 5 +/** + * XML_SCHEMAS_ELEM_REF: + * + * the element is a reference to a type + */ +#define XML_SCHEMAS_ELEM_REF 1 << 6 +/** + * XML_SCHEMAS_ELEM_NSDEFAULT: + * + * allow elements in no namespace + * Obsolete, not used anymore. + */ +#define XML_SCHEMAS_ELEM_NSDEFAULT 1 << 7 +/** + * XML_SCHEMAS_ELEM_INTERNAL_RESOLVED: + * + * this is set when "type", "ref", "substitutionGroup" + * references have been resolved. + */ +#define XML_SCHEMAS_ELEM_INTERNAL_RESOLVED 1 << 8 + /** + * XML_SCHEMAS_ELEM_CIRCULAR: + * + * a helper flag for the search of circular references. + */ +#define XML_SCHEMAS_ELEM_CIRCULAR 1 << 9 +/** + * XML_SCHEMAS_ELEM_BLOCK_ABSENT: + * + * the "block" attribute is absent + */ +#define XML_SCHEMAS_ELEM_BLOCK_ABSENT 1 << 10 +/** + * XML_SCHEMAS_ELEM_BLOCK_EXTENSION: + * + * disallowed substitutions are absent + */ +#define XML_SCHEMAS_ELEM_BLOCK_EXTENSION 1 << 11 +/** + * XML_SCHEMAS_ELEM_BLOCK_RESTRICTION: + * + * disallowed substitutions: "restriction" + */ +#define XML_SCHEMAS_ELEM_BLOCK_RESTRICTION 1 << 12 +/** + * XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION: + * + * disallowed substitutions: "substituion" + */ +#define XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION 1 << 13 +/** + * XML_SCHEMAS_ELEM_FINAL_ABSENT: + * + * substitution group exclusions are absent + */ +#define XML_SCHEMAS_ELEM_FINAL_ABSENT 1 << 14 +/** + * XML_SCHEMAS_ELEM_FINAL_EXTENSION: + * + * substitution group exclusions: "extension" + */ +#define XML_SCHEMAS_ELEM_FINAL_EXTENSION 1 << 15 +/** + * XML_SCHEMAS_ELEM_FINAL_RESTRICTION: + * + * substitution group exclusions: "restriction" + */ +#define XML_SCHEMAS_ELEM_FINAL_RESTRICTION 1 << 16 +/** + * XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD: + * + * the declaration is a substitution group head + */ +#define XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD 1 << 17 +/** + * XML_SCHEMAS_ELEM_INTERNAL_CHECKED: + * + * this is set when the elem decl has been checked against + * all constraints + */ +#define XML_SCHEMAS_ELEM_INTERNAL_CHECKED 1 << 18 + +typedef struct _xmlSchemaElement xmlSchemaElement; +typedef xmlSchemaElement *xmlSchemaElementPtr; +struct _xmlSchemaElement { + xmlSchemaTypeType type; /* The kind of type */ + struct _xmlSchemaType *next;/* the next type if in a sequence ... */ + const xmlChar *name; + const xmlChar *id; + const xmlChar *ref; /* the local name of the element declaration if a particle */ + const xmlChar *refNs; /* the ns URI of the element declaration if a particle */ + xmlSchemaAnnotPtr annot; + xmlSchemaTypePtr subtypes; /* the type definition */ + xmlSchemaAttributePtr attributes; + xmlNodePtr node; + int minOccurs; + int maxOccurs; + + int flags; + const xmlChar *targetNamespace; + const xmlChar *namedType; + const xmlChar *namedTypeNs; + const xmlChar *substGroup; + const xmlChar *substGroupNs; + const xmlChar *scope; + const xmlChar *value; + struct _xmlSchemaElement *refDecl; /* This will now be used for the substitution group affiliation */ + xmlRegexpPtr contModel; + xmlSchemaContentType contentType; + const xmlChar *refPrefix; + xmlSchemaValPtr defVal; + void *idcs; +}; + +/* + * XML_SCHEMAS_FACET_UNKNOWN: + * + * unknown facet handling + */ +#define XML_SCHEMAS_FACET_UNKNOWN 0 +/* + * XML_SCHEMAS_FACET_PRESERVE: + * + * preserve the type of the facet + */ +#define XML_SCHEMAS_FACET_PRESERVE 1 +/* + * XML_SCHEMAS_FACET_REPLACE: + * + * replace the type of the facet + */ +#define XML_SCHEMAS_FACET_REPLACE 2 +/* + * XML_SCHEMAS_FACET_COLLAPSE: + * + * collapse the types of the facet + */ +#define XML_SCHEMAS_FACET_COLLAPSE 3 +/** + * A facet definition. + */ +struct _xmlSchemaFacet { + xmlSchemaTypeType type; /* The kind of type */ + struct _xmlSchemaFacet *next;/* the next type if in a sequence ... */ + const xmlChar *value; + const xmlChar *id; + xmlSchemaAnnotPtr annot; + xmlNodePtr node; + int fixed; + int whitespace; + xmlSchemaValPtr val; + xmlRegexpPtr regexp; +}; + +/** + * A notation definition. + */ +typedef struct _xmlSchemaNotation xmlSchemaNotation; +typedef xmlSchemaNotation *xmlSchemaNotationPtr; +struct _xmlSchemaNotation { + xmlSchemaTypeType type; /* The kind of type */ + const xmlChar *name; + xmlSchemaAnnotPtr annot; + const xmlChar *identifier; + const xmlChar *targetNamespace; +}; + +/** + * XML_SCHEMAS_QUALIF_ELEM: + * + * the schema requires qualified elements + */ +#define XML_SCHEMAS_QUALIF_ELEM 1 << 0 +/** + * XML_SCHEMAS_QUALIF_ATTR: + * + * the schema requires qualified attributes + */ +#define XML_SCHEMAS_QUALIF_ATTR 1 << 1 +/** + * XML_SCHEMAS_FINAL_DEFAULT_EXTENSION: + * + * the schema has "extension" in the set of finalDefault. + */ +#define XML_SCHEMAS_FINAL_DEFAULT_EXTENSION 1 << 2 +/** + * XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION: + * + * the schema has "restriction" in the set of finalDefault. + */ +#define XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION 1 << 3 +/** + * XML_SCHEMAS_FINAL_DEFAULT_LIST: + * + * the cshema has "list" in the set of finalDefault. + */ +#define XML_SCHEMAS_FINAL_DEFAULT_LIST 1 << 4 +/** + * XML_SCHEMAS_FINAL_DEFAULT_UNION: + * + * the schema has "union" in the set of finalDefault. + */ +#define XML_SCHEMAS_FINAL_DEFAULT_UNION 1 << 5 +/** + * XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION: + * + * the schema has "extension" in the set of blockDefault. + */ +#define XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION 1 << 6 +/** + * XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION: + * + * the schema has "restriction" in the set of blockDefault. + */ +#define XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION 1 << 7 +/** + * XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION: + * + * the schema has "substitution" in the set of blockDefault. + */ +#define XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION 1 << 8 +/** + * XML_SCHEMAS_INCLUDING_CONVERT_NS: + * + * the schema is currently including an other schema with + * no target namespace. + */ +#define XML_SCHEMAS_INCLUDING_CONVERT_NS 1 << 9 +/** + * _xmlSchema: + * + * A Schemas definition + */ +struct _xmlSchema { + const xmlChar *name; /* schema name */ + const xmlChar *targetNamespace; /* the target namespace */ + const xmlChar *version; + const xmlChar *id; + xmlDocPtr doc; + xmlSchemaAnnotPtr annot; + int flags; + + xmlHashTablePtr typeDecl; + xmlHashTablePtr attrDecl; + xmlHashTablePtr attrgrpDecl; + xmlHashTablePtr elemDecl; + xmlHashTablePtr notaDecl; + + xmlHashTablePtr schemasImports; + + void *_private; /* unused by the library for users or bindings */ + xmlHashTablePtr groupDecl; + xmlDictPtr dict; + void *includes; /* the includes, this is opaque for now */ + int preserve; /* whether to free the document */ + int counter; /* used to give ononymous components unique names */ + xmlHashTablePtr idcDef; + void *volatiles; /* Misc. helper items (e.g. reference items) */ +}; + +XMLPUBFUN void XMLCALL xmlSchemaFreeType (xmlSchemaTypePtr type); +XMLPUBFUN void XMLCALL xmlSchemaFreeWildcard(xmlSchemaWildcardPtr wildcard); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_SCHEMAS_ENABLED */ +#endif /* __XML_SCHEMA_INTERNALS_H__ */ diff --git a/include/libxml/threads.h b/include/libxml/threads.h new file mode 100644 index 0000000..fb6b704 --- /dev/null +++ b/include/libxml/threads.h @@ -0,0 +1,81 @@ +/** + * Summary: interfaces for thread handling + * Description: set of generic threading related routines + * should work with pthreads, Windows native or TLS threads + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_THREADS_H__ +#define __XML_THREADS_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * xmlMutex are a simple mutual exception locks. + */ +typedef struct _xmlMutex xmlMutex; +typedef xmlMutex *xmlMutexPtr; + +/* + * xmlRMutex are reentrant mutual exception locks. + */ +typedef struct _xmlRMutex xmlRMutex; +typedef xmlRMutex *xmlRMutexPtr; + +#ifdef __cplusplus +} +#endif +#include +#ifdef __cplusplus +extern "C" { +#endif + +XMLPUBFUN xmlMutexPtr XMLCALL + xmlNewMutex (void); +XMLPUBFUN void XMLCALL + xmlMutexLock (xmlMutexPtr tok); +XMLPUBFUN void XMLCALL + xmlMutexUnlock (xmlMutexPtr tok); +XMLPUBFUN void XMLCALL + xmlFreeMutex (xmlMutexPtr tok); + +XMLPUBFUN xmlRMutexPtr XMLCALL + xmlNewRMutex (void); +XMLPUBFUN void XMLCALL + xmlRMutexLock (xmlRMutexPtr tok); +XMLPUBFUN void XMLCALL + xmlRMutexUnlock (xmlRMutexPtr tok); +XMLPUBFUN void XMLCALL + xmlFreeRMutex (xmlRMutexPtr tok); + +/* + * Library wide APIs. + */ +XMLPUBFUN void XMLCALL + xmlInitThreads (void); +XMLPUBFUN void XMLCALL + xmlLockLibrary (void); +XMLPUBFUN void XMLCALL + xmlUnlockLibrary(void); +XMLPUBFUN int XMLCALL + xmlGetThreadId (void); +XMLPUBFUN int XMLCALL + xmlIsMainThread (void); +XMLPUBFUN void XMLCALL + xmlCleanupThreads(void); +XMLPUBFUN xmlGlobalStatePtr XMLCALL + xmlGetGlobalState(void); + +#ifdef __cplusplus +} +#endif + + +#endif /* __XML_THREADS_H__ */ diff --git a/include/libxml/tree.h b/include/libxml/tree.h new file mode 100644 index 0000000..d995e5c --- /dev/null +++ b/include/libxml/tree.h @@ -0,0 +1,1154 @@ +/* + * Summary: interfaces for tree manipulation + * Description: this module describes the structures found in an tree resulting + * from an XML or HTML parsing, as well as the API provided for + * various processing on that tree + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_TREE_H__ +#define __XML_TREE_H__ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Some of the basic types pointer to structures: + */ +/* xmlIO.h */ +typedef struct _xmlParserInputBuffer xmlParserInputBuffer; +typedef xmlParserInputBuffer *xmlParserInputBufferPtr; + +typedef struct _xmlOutputBuffer xmlOutputBuffer; +typedef xmlOutputBuffer *xmlOutputBufferPtr; + +/* parser.h */ +typedef struct _xmlParserInput xmlParserInput; +typedef xmlParserInput *xmlParserInputPtr; + +typedef struct _xmlParserCtxt xmlParserCtxt; +typedef xmlParserCtxt *xmlParserCtxtPtr; + +typedef struct _xmlSAXLocator xmlSAXLocator; +typedef xmlSAXLocator *xmlSAXLocatorPtr; + +typedef struct _xmlSAXHandler xmlSAXHandler; +typedef xmlSAXHandler *xmlSAXHandlerPtr; + +/* entities.h */ +typedef struct _xmlEntity xmlEntity; +typedef xmlEntity *xmlEntityPtr; + +/** + * BASE_BUFFER_SIZE: + * + * default buffer size 4000. + */ +#define BASE_BUFFER_SIZE 4096 + +/** + * XML_XML_NAMESPACE: + * + * This is the namespace for the special xml: prefix predefined in the + * XML Namespace specification. + */ +#define XML_XML_NAMESPACE \ + (const xmlChar *) "http://www.w3.org/XML/1998/namespace" + +/** + * XML_XML_ID: + * + * This is the name for the special xml:id attribute + */ +#define XML_XML_ID (const xmlChar *) "xml:id" + +/* + * The different element types carried by an XML tree. + * + * NOTE: This is synchronized with DOM Level1 values + * See http://www.w3.org/TR/REC-DOM-Level-1/ + * + * Actually this had diverged a bit, and now XML_DOCUMENT_TYPE_NODE should + * be deprecated to use an XML_DTD_NODE. + */ +typedef enum { + XML_ELEMENT_NODE= 1, + XML_ATTRIBUTE_NODE= 2, + XML_TEXT_NODE= 3, + XML_CDATA_SECTION_NODE= 4, + XML_ENTITY_REF_NODE= 5, + XML_ENTITY_NODE= 6, + XML_PI_NODE= 7, + XML_COMMENT_NODE= 8, + XML_DOCUMENT_NODE= 9, + XML_DOCUMENT_TYPE_NODE= 10, + XML_DOCUMENT_FRAG_NODE= 11, + XML_NOTATION_NODE= 12, + XML_HTML_DOCUMENT_NODE= 13, + XML_DTD_NODE= 14, + XML_ELEMENT_DECL= 15, + XML_ATTRIBUTE_DECL= 16, + XML_ENTITY_DECL= 17, + XML_NAMESPACE_DECL= 18, + XML_XINCLUDE_START= 19, + XML_XINCLUDE_END= 20 +#ifdef LIBXML_DOCB_ENABLED + ,XML_DOCB_DOCUMENT_NODE= 21 +#endif +} xmlElementType; + + +/** + * xmlNotation: + * + * A DTD Notation definition. + */ + +typedef struct _xmlNotation xmlNotation; +typedef xmlNotation *xmlNotationPtr; +struct _xmlNotation { + const xmlChar *name; /* Notation name */ + const xmlChar *PublicID; /* Public identifier, if any */ + const xmlChar *SystemID; /* System identifier, if any */ +}; + +/** + * xmlAttributeType: + * + * A DTD Attribute type definition. + */ + +typedef enum { + XML_ATTRIBUTE_CDATA = 1, + XML_ATTRIBUTE_ID, + XML_ATTRIBUTE_IDREF , + XML_ATTRIBUTE_IDREFS, + XML_ATTRIBUTE_ENTITY, + XML_ATTRIBUTE_ENTITIES, + XML_ATTRIBUTE_NMTOKEN, + XML_ATTRIBUTE_NMTOKENS, + XML_ATTRIBUTE_ENUMERATION, + XML_ATTRIBUTE_NOTATION +} xmlAttributeType; + +/** + * xmlAttributeDefault: + * + * A DTD Attribute default definition. + */ + +typedef enum { + XML_ATTRIBUTE_NONE = 1, + XML_ATTRIBUTE_REQUIRED, + XML_ATTRIBUTE_IMPLIED, + XML_ATTRIBUTE_FIXED +} xmlAttributeDefault; + +/** + * xmlEnumeration: + * + * List structure used when there is an enumeration in DTDs. + */ + +typedef struct _xmlEnumeration xmlEnumeration; +typedef xmlEnumeration *xmlEnumerationPtr; +struct _xmlEnumeration { + struct _xmlEnumeration *next; /* next one */ + const xmlChar *name; /* Enumeration name */ +}; + +/** + * xmlAttribute: + * + * An Attribute declaration in a DTD. + */ + +typedef struct _xmlAttribute xmlAttribute; +typedef xmlAttribute *xmlAttributePtr; +struct _xmlAttribute { + void *_private; /* application data */ + xmlElementType type; /* XML_ATTRIBUTE_DECL, must be second ! */ + const xmlChar *name; /* Attribute name */ + struct _xmlNode *children; /* NULL */ + struct _xmlNode *last; /* NULL */ + struct _xmlDtd *parent; /* -> DTD */ + struct _xmlNode *next; /* next sibling link */ + struct _xmlNode *prev; /* previous sibling link */ + struct _xmlDoc *doc; /* the containing document */ + + struct _xmlAttribute *nexth; /* next in hash table */ + xmlAttributeType atype; /* The attribute type */ + xmlAttributeDefault def; /* the default */ + const xmlChar *defaultValue; /* or the default value */ + xmlEnumerationPtr tree; /* or the enumeration tree if any */ + const xmlChar *prefix; /* the namespace prefix if any */ + const xmlChar *elem; /* Element holding the attribute */ +}; + +/** + * xmlElementContentType: + * + * Possible definitions of element content types. + */ +typedef enum { + XML_ELEMENT_CONTENT_PCDATA = 1, + XML_ELEMENT_CONTENT_ELEMENT, + XML_ELEMENT_CONTENT_SEQ, + XML_ELEMENT_CONTENT_OR +} xmlElementContentType; + +/** + * xmlElementContentOccur: + * + * Possible definitions of element content occurrences. + */ +typedef enum { + XML_ELEMENT_CONTENT_ONCE = 1, + XML_ELEMENT_CONTENT_OPT, + XML_ELEMENT_CONTENT_MULT, + XML_ELEMENT_CONTENT_PLUS +} xmlElementContentOccur; + +/** + * xmlElementContent: + * + * An XML Element content as stored after parsing an element definition + * in a DTD. + */ + +typedef struct _xmlElementContent xmlElementContent; +typedef xmlElementContent *xmlElementContentPtr; +struct _xmlElementContent { + xmlElementContentType type; /* PCDATA, ELEMENT, SEQ or OR */ + xmlElementContentOccur ocur; /* ONCE, OPT, MULT or PLUS */ + const xmlChar *name; /* Element name */ + struct _xmlElementContent *c1; /* first child */ + struct _xmlElementContent *c2; /* second child */ + struct _xmlElementContent *parent; /* parent */ + const xmlChar *prefix; /* Namespace prefix */ +}; + +/** + * xmlElementTypeVal: + * + * The different possibilities for an element content type. + */ + +typedef enum { + XML_ELEMENT_TYPE_UNDEFINED = 0, + XML_ELEMENT_TYPE_EMPTY = 1, + XML_ELEMENT_TYPE_ANY, + XML_ELEMENT_TYPE_MIXED, + XML_ELEMENT_TYPE_ELEMENT +} xmlElementTypeVal; + +#ifdef __cplusplus +} +#endif +#include +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlElement: + * + * An XML Element declaration from a DTD. + */ + +typedef struct _xmlElement xmlElement; +typedef xmlElement *xmlElementPtr; +struct _xmlElement { + void *_private; /* application data */ + xmlElementType type; /* XML_ELEMENT_DECL, must be second ! */ + const xmlChar *name; /* Element name */ + struct _xmlNode *children; /* NULL */ + struct _xmlNode *last; /* NULL */ + struct _xmlDtd *parent; /* -> DTD */ + struct _xmlNode *next; /* next sibling link */ + struct _xmlNode *prev; /* previous sibling link */ + struct _xmlDoc *doc; /* the containing document */ + + xmlElementTypeVal etype; /* The type */ + xmlElementContentPtr content; /* the allowed element content */ + xmlAttributePtr attributes; /* List of the declared attributes */ + const xmlChar *prefix; /* the namespace prefix if any */ +#ifdef LIBXML_REGEXP_ENABLED + xmlRegexpPtr contModel; /* the validating regexp */ +#else + void *contModel; +#endif +}; + + +/** + * XML_LOCAL_NAMESPACE: + * + * A namespace declaration node. + */ +#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL +typedef xmlElementType xmlNsType; + +/** + * xmlNs: + * + * An XML namespace. + * Note that prefix == NULL is valid, it defines the default namespace + * within the subtree (until overridden). + * + * xmlNsType is unified with xmlElementType. + */ + +typedef struct _xmlNs xmlNs; +typedef xmlNs *xmlNsPtr; +struct _xmlNs { + struct _xmlNs *next; /* next Ns link for this node */ + xmlNsType type; /* global or local */ + const xmlChar *href; /* URL for the namespace */ + const xmlChar *prefix; /* prefix for the namespace */ + void *_private; /* application data */ +}; + +/** + * xmlDtd: + * + * An XML DTD, as defined by parent link */ + struct _xmlNode *next; /* next sibling link */ + struct _xmlNode *prev; /* previous sibling link */ + struct _xmlDoc *doc; /* the containing document */ + + /* End of common part */ + void *notations; /* Hash table for notations if any */ + void *elements; /* Hash table for elements if any */ + void *attributes; /* Hash table for attributes if any */ + void *entities; /* Hash table for entities if any */ + const xmlChar *ExternalID; /* External identifier for PUBLIC DTD */ + const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC DTD */ + void *pentities; /* Hash table for param entities if any */ +}; + +/** + * xmlAttr: + * + * An attribute on an XML node. + */ +typedef struct _xmlAttr xmlAttr; +typedef xmlAttr *xmlAttrPtr; +struct _xmlAttr { + void *_private; /* application data */ + xmlElementType type; /* XML_ATTRIBUTE_NODE, must be second ! */ + const xmlChar *name; /* the name of the property */ + struct _xmlNode *children; /* the value of the property */ + struct _xmlNode *last; /* NULL */ + struct _xmlNode *parent; /* child->parent link */ + struct _xmlAttr *next; /* next sibling link */ + struct _xmlAttr *prev; /* previous sibling link */ + struct _xmlDoc *doc; /* the containing document */ + xmlNs *ns; /* pointer to the associated namespace */ + xmlAttributeType atype; /* the attribute type if validating */ + void *psvi; /* for type/PSVI informations */ +}; + +/** + * xmlID: + * + * An XML ID instance. + */ + +typedef struct _xmlID xmlID; +typedef xmlID *xmlIDPtr; +struct _xmlID { + struct _xmlID *next; /* next ID */ + const xmlChar *value; /* The ID name */ + xmlAttrPtr attr; /* The attribute holding it */ + const xmlChar *name; /* The attribute if attr is not available */ + int lineno; /* The line number if attr is not available */ + struct _xmlDoc *doc; /* The document holding the ID */ +}; + +/** + * xmlRef: + * + * An XML IDREF instance. + */ + +typedef struct _xmlRef xmlRef; +typedef xmlRef *xmlRefPtr; +struct _xmlRef { + struct _xmlRef *next; /* next Ref */ + const xmlChar *value; /* The Ref name */ + xmlAttrPtr attr; /* The attribute holding it */ + const xmlChar *name; /* The attribute if attr is not available */ + int lineno; /* The line number if attr is not available */ +}; + +/** + * xmlBufferAllocationScheme: + * + * A buffer allocation scheme can be defined to either match exactly the + * need or double it's allocated size each time it is found too small. + */ + +typedef enum { + XML_BUFFER_ALLOC_DOUBLEIT, + XML_BUFFER_ALLOC_EXACT, + XML_BUFFER_ALLOC_IMMUTABLE +} xmlBufferAllocationScheme; + +/** + * xmlBuffer: + * + * A buffer structure. + */ +typedef struct _xmlBuffer xmlBuffer; +typedef xmlBuffer *xmlBufferPtr; +struct _xmlBuffer { + xmlChar *content; /* The buffer content UTF8 */ + unsigned int use; /* The buffer size used */ + unsigned int size; /* The buffer size */ + xmlBufferAllocationScheme alloc; /* The realloc method */ +}; + +/** + * xmlNode: + * + * A node in an XML tree. + */ +typedef struct _xmlNode xmlNode; +typedef xmlNode *xmlNodePtr; +struct _xmlNode { + void *_private; /* application data */ + xmlElementType type; /* type number, must be second ! */ + const xmlChar *name; /* the name of the node, or the entity */ + struct _xmlNode *children; /* parent->childs link */ + struct _xmlNode *last; /* last child link */ + struct _xmlNode *parent; /* child->parent link */ + struct _xmlNode *next; /* next sibling link */ + struct _xmlNode *prev; /* previous sibling link */ + struct _xmlDoc *doc; /* the containing document */ + + /* End of common part */ + xmlNs *ns; /* pointer to the associated namespace */ + xmlChar *content; /* the content */ + struct _xmlAttr *properties;/* properties list */ + xmlNs *nsDef; /* namespace definitions on this node */ + void *psvi; /* for type/PSVI informations */ + unsigned short line; /* line number */ + unsigned short extra; /* extra data for XPath/XSLT */ +}; + +/** + * XML_GET_CONTENT: + * + * Macro to extract the content pointer of a node. + */ +#define XML_GET_CONTENT(n) \ + ((n)->type == XML_ELEMENT_NODE ? NULL : (n)->content) + +/** + * XML_GET_LINE: + * + * Macro to extract the line number of an element node. + */ +#define XML_GET_LINE(n) \ + (xmlGetLineNo(n)) + + +/** + * xmlDoc: + * + * An XML document. + */ +typedef struct _xmlDoc xmlDoc; +typedef xmlDoc *xmlDocPtr; +struct _xmlDoc { + void *_private; /* application data */ + xmlElementType type; /* XML_DOCUMENT_NODE, must be second ! */ + char *name; /* name/filename/URI of the document */ + struct _xmlNode *children; /* the document tree */ + struct _xmlNode *last; /* last child link */ + struct _xmlNode *parent; /* child->parent link */ + struct _xmlNode *next; /* next sibling link */ + struct _xmlNode *prev; /* previous sibling link */ + struct _xmlDoc *doc; /* autoreference to itself */ + + /* End of common part */ + int compression;/* level of zlib compression */ + int standalone; /* standalone document (no external refs) */ + struct _xmlDtd *intSubset; /* the document internal subset */ + struct _xmlDtd *extSubset; /* the document external subset */ + struct _xmlNs *oldNs; /* Global namespace, the old way */ + const xmlChar *version; /* the XML version string */ + const xmlChar *encoding; /* external initial encoding, if any */ + void *ids; /* Hash table for ID attributes if any */ + void *refs; /* Hash table for IDREFs attributes if any */ + const xmlChar *URL; /* The URI for that document */ + int charset; /* encoding of the in-memory content + actually an xmlCharEncoding */ + struct _xmlDict *dict; /* dict used to allocate names or NULL */ + void *psvi; /* for type/PSVI informations */ +}; + +typedef struct _xmlDOMWrapCtxt xmlDOMWrapCtxt; +typedef xmlDOMWrapCtxt *xmlDOMWrapCtxtPtr; +struct _xmlDOMWrapCtxt { + void * _private; +}; + +/** + * xmlChildrenNode: + * + * Macro for compatibility naming layer with libxml1. Maps + * to "children." + */ +#ifndef xmlChildrenNode +#define xmlChildrenNode children +#endif + +/** + * xmlRootNode: + * + * Macro for compatibility naming layer with libxml1. Maps + * to "children". + */ +#ifndef xmlRootNode +#define xmlRootNode children +#endif + +/* + * Variables. + */ + +/* + * Some helper functions + */ +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) +XMLPUBFUN int XMLCALL + xmlValidateNCName (const xmlChar *value, + int space); +#endif + +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) +XMLPUBFUN int XMLCALL + xmlValidateQName (const xmlChar *value, + int space); +XMLPUBFUN int XMLCALL + xmlValidateName (const xmlChar *value, + int space); +XMLPUBFUN int XMLCALL + xmlValidateNMToken (const xmlChar *value, + int space); +#endif + +XMLPUBFUN xmlChar * XMLCALL + xmlBuildQName (const xmlChar *ncname, + const xmlChar *prefix, + xmlChar *memory, + int len); +XMLPUBFUN xmlChar * XMLCALL + xmlSplitQName2 (const xmlChar *name, + xmlChar **prefix); +XMLPUBFUN const xmlChar * XMLCALL + xmlSplitQName3 (const xmlChar *name, + int *len); + +/* + * Handling Buffers. + */ + +XMLPUBFUN void XMLCALL + xmlSetBufferAllocationScheme(xmlBufferAllocationScheme scheme); +XMLPUBFUN xmlBufferAllocationScheme XMLCALL + xmlGetBufferAllocationScheme(void); + +XMLPUBFUN xmlBufferPtr XMLCALL + xmlBufferCreate (void); +XMLPUBFUN xmlBufferPtr XMLCALL + xmlBufferCreateSize (size_t size); +XMLPUBFUN xmlBufferPtr XMLCALL + xmlBufferCreateStatic (void *mem, + size_t size); +XMLPUBFUN int XMLCALL + xmlBufferResize (xmlBufferPtr buf, + unsigned int size); +XMLPUBFUN void XMLCALL + xmlBufferFree (xmlBufferPtr buf); +XMLPUBFUN int XMLCALL + xmlBufferDump (FILE *file, + xmlBufferPtr buf); +XMLPUBFUN int XMLCALL + xmlBufferAdd (xmlBufferPtr buf, + const xmlChar *str, + int len); +XMLPUBFUN int XMLCALL + xmlBufferAddHead (xmlBufferPtr buf, + const xmlChar *str, + int len); +XMLPUBFUN int XMLCALL + xmlBufferCat (xmlBufferPtr buf, + const xmlChar *str); +XMLPUBFUN int XMLCALL + xmlBufferCCat (xmlBufferPtr buf, + const char *str); +XMLPUBFUN int XMLCALL + xmlBufferShrink (xmlBufferPtr buf, + unsigned int len); +XMLPUBFUN int XMLCALL + xmlBufferGrow (xmlBufferPtr buf, + unsigned int len); +XMLPUBFUN void XMLCALL + xmlBufferEmpty (xmlBufferPtr buf); +XMLPUBFUN const xmlChar* XMLCALL + xmlBufferContent (const xmlBufferPtr buf); +XMLPUBFUN void XMLCALL + xmlBufferSetAllocationScheme(xmlBufferPtr buf, + xmlBufferAllocationScheme scheme); +XMLPUBFUN int XMLCALL + xmlBufferLength (const xmlBufferPtr buf); + +/* + * Creating/freeing new structures. + */ +XMLPUBFUN xmlDtdPtr XMLCALL + xmlCreateIntSubset (xmlDocPtr doc, + const xmlChar *name, + const xmlChar *ExternalID, + const xmlChar *SystemID); +XMLPUBFUN xmlDtdPtr XMLCALL + xmlNewDtd (xmlDocPtr doc, + const xmlChar *name, + const xmlChar *ExternalID, + const xmlChar *SystemID); +XMLPUBFUN xmlDtdPtr XMLCALL + xmlGetIntSubset (xmlDocPtr doc); +XMLPUBFUN void XMLCALL + xmlFreeDtd (xmlDtdPtr cur); +#ifdef LIBXML_LEGACY_ENABLED +XMLPUBFUN xmlNsPtr XMLCALL + xmlNewGlobalNs (xmlDocPtr doc, + const xmlChar *href, + const xmlChar *prefix); +#endif /* LIBXML_LEGACY_ENABLED */ +XMLPUBFUN xmlNsPtr XMLCALL + xmlNewNs (xmlNodePtr node, + const xmlChar *href, + const xmlChar *prefix); +XMLPUBFUN void XMLCALL + xmlFreeNs (xmlNsPtr cur); +XMLPUBFUN void XMLCALL + xmlFreeNsList (xmlNsPtr cur); +XMLPUBFUN xmlDocPtr XMLCALL + xmlNewDoc (const xmlChar *version); +XMLPUBFUN void XMLCALL + xmlFreeDoc (xmlDocPtr cur); +XMLPUBFUN xmlAttrPtr XMLCALL + xmlNewDocProp (xmlDocPtr doc, + const xmlChar *name, + const xmlChar *value); +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \ + defined(LIBXML_SCHEMAS_ENABLED) +XMLPUBFUN xmlAttrPtr XMLCALL + xmlNewProp (xmlNodePtr node, + const xmlChar *name, + const xmlChar *value); +#endif +XMLPUBFUN xmlAttrPtr XMLCALL + xmlNewNsProp (xmlNodePtr node, + xmlNsPtr ns, + const xmlChar *name, + const xmlChar *value); +XMLPUBFUN xmlAttrPtr XMLCALL + xmlNewNsPropEatName (xmlNodePtr node, + xmlNsPtr ns, + xmlChar *name, + const xmlChar *value); +XMLPUBFUN void XMLCALL + xmlFreePropList (xmlAttrPtr cur); +XMLPUBFUN void XMLCALL + xmlFreeProp (xmlAttrPtr cur); +XMLPUBFUN xmlAttrPtr XMLCALL + xmlCopyProp (xmlNodePtr target, + xmlAttrPtr cur); +XMLPUBFUN xmlAttrPtr XMLCALL + xmlCopyPropList (xmlNodePtr target, + xmlAttrPtr cur); +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN xmlDtdPtr XMLCALL + xmlCopyDtd (xmlDtdPtr dtd); +#endif /* LIBXML_TREE_ENABLED */ +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) +XMLPUBFUN xmlDocPtr XMLCALL + xmlCopyDoc (xmlDocPtr doc, + int recursive); +#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */ +/* + * Creating new nodes. + */ +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewDocNode (xmlDocPtr doc, + xmlNsPtr ns, + const xmlChar *name, + const xmlChar *content); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewDocNodeEatName (xmlDocPtr doc, + xmlNsPtr ns, + xmlChar *name, + const xmlChar *content); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewNode (xmlNsPtr ns, + const xmlChar *name); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewNodeEatName (xmlNsPtr ns, + xmlChar *name); +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewChild (xmlNodePtr parent, + xmlNsPtr ns, + const xmlChar *name, + const xmlChar *content); +#endif +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewDocText (xmlDocPtr doc, + const xmlChar *content); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewText (const xmlChar *content); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewDocPI (xmlDocPtr doc, + const xmlChar *name, + const xmlChar *content); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewPI (const xmlChar *name, + const xmlChar *content); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewDocTextLen (xmlDocPtr doc, + const xmlChar *content, + int len); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewTextLen (const xmlChar *content, + int len); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewDocComment (xmlDocPtr doc, + const xmlChar *content); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewComment (const xmlChar *content); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewCDataBlock (xmlDocPtr doc, + const xmlChar *content, + int len); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewCharRef (xmlDocPtr doc, + const xmlChar *name); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewReference (xmlDocPtr doc, + const xmlChar *name); +XMLPUBFUN xmlNodePtr XMLCALL + xmlCopyNode (const xmlNodePtr node, + int recursive); +XMLPUBFUN xmlNodePtr XMLCALL + xmlDocCopyNode (const xmlNodePtr node, + xmlDocPtr doc, + int recursive); +XMLPUBFUN xmlNodePtr XMLCALL + xmlDocCopyNodeList (xmlDocPtr doc, + const xmlNodePtr node); +XMLPUBFUN xmlNodePtr XMLCALL + xmlCopyNodeList (const xmlNodePtr node); +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewTextChild (xmlNodePtr parent, + xmlNsPtr ns, + const xmlChar *name, + const xmlChar *content); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewDocRawNode (xmlDocPtr doc, + xmlNsPtr ns, + const xmlChar *name, + const xmlChar *content); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewDocFragment (xmlDocPtr doc); +#endif /* LIBXML_TREE_ENABLED */ + +/* + * Navigating. + */ +XMLPUBFUN long XMLCALL + xmlGetLineNo (xmlNodePtr node); +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) +XMLPUBFUN xmlChar * XMLCALL + xmlGetNodePath (xmlNodePtr node); +#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) */ +XMLPUBFUN xmlNodePtr XMLCALL + xmlDocGetRootElement (xmlDocPtr doc); +XMLPUBFUN xmlNodePtr XMLCALL + xmlGetLastChild (xmlNodePtr parent); +XMLPUBFUN int XMLCALL + xmlNodeIsText (xmlNodePtr node); +XMLPUBFUN int XMLCALL + xmlIsBlankNode (xmlNodePtr node); + +/* + * Changing the structure. + */ +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) +XMLPUBFUN xmlNodePtr XMLCALL + xmlDocSetRootElement (xmlDocPtr doc, + xmlNodePtr root); +#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */ +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN void XMLCALL + xmlNodeSetName (xmlNodePtr cur, + const xmlChar *name); +#endif /* LIBXML_TREE_ENABLED */ +XMLPUBFUN xmlNodePtr XMLCALL + xmlAddChild (xmlNodePtr parent, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL + xmlAddChildList (xmlNodePtr parent, + xmlNodePtr cur); +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) +XMLPUBFUN xmlNodePtr XMLCALL + xmlReplaceNode (xmlNodePtr old, + xmlNodePtr cur); +#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */ +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \ + defined(LIBXML_SCHEMAS_ENABLED) +XMLPUBFUN xmlNodePtr XMLCALL + xmlAddPrevSibling (xmlNodePtr cur, + xmlNodePtr elem); +#endif /* LIBXML_TREE_ENABLED || LIBXML_HTML_ENABLED || LIBXML_SCHEMAS_ENABLED */ +XMLPUBFUN xmlNodePtr XMLCALL + xmlAddSibling (xmlNodePtr cur, + xmlNodePtr elem); +XMLPUBFUN xmlNodePtr XMLCALL + xmlAddNextSibling (xmlNodePtr cur, + xmlNodePtr elem); +XMLPUBFUN void XMLCALL + xmlUnlinkNode (xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL + xmlTextMerge (xmlNodePtr first, + xmlNodePtr second); +XMLPUBFUN int XMLCALL + xmlTextConcat (xmlNodePtr node, + const xmlChar *content, + int len); +XMLPUBFUN void XMLCALL + xmlFreeNodeList (xmlNodePtr cur); +XMLPUBFUN void XMLCALL + xmlFreeNode (xmlNodePtr cur); +XMLPUBFUN void XMLCALL + xmlSetTreeDoc (xmlNodePtr tree, + xmlDocPtr doc); +XMLPUBFUN void XMLCALL + xmlSetListDoc (xmlNodePtr list, + xmlDocPtr doc); +/* + * Namespaces. + */ +XMLPUBFUN xmlNsPtr XMLCALL + xmlSearchNs (xmlDocPtr doc, + xmlNodePtr node, + const xmlChar *nameSpace); +XMLPUBFUN xmlNsPtr XMLCALL + xmlSearchNsByHref (xmlDocPtr doc, + xmlNodePtr node, + const xmlChar *href); +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) +XMLPUBFUN xmlNsPtr * XMLCALL + xmlGetNsList (xmlDocPtr doc, + xmlNodePtr node); +#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) */ + +XMLPUBFUN void XMLCALL + xmlSetNs (xmlNodePtr node, + xmlNsPtr ns); +XMLPUBFUN xmlNsPtr XMLCALL + xmlCopyNamespace (xmlNsPtr cur); +XMLPUBFUN xmlNsPtr XMLCALL + xmlCopyNamespaceList (xmlNsPtr cur); + +/* + * Changing the content. + */ +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) +XMLPUBFUN xmlAttrPtr XMLCALL + xmlSetProp (xmlNodePtr node, + const xmlChar *name, + const xmlChar *value); +XMLPUBFUN xmlAttrPtr XMLCALL + xmlSetNsProp (xmlNodePtr node, + xmlNsPtr ns, + const xmlChar *name, + const xmlChar *value); +#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) */ +XMLPUBFUN xmlChar * XMLCALL + xmlGetNoNsProp (xmlNodePtr node, + const xmlChar *name); +XMLPUBFUN xmlChar * XMLCALL + xmlGetProp (xmlNodePtr node, + const xmlChar *name); +XMLPUBFUN xmlAttrPtr XMLCALL + xmlHasProp (xmlNodePtr node, + const xmlChar *name); +XMLPUBFUN xmlAttrPtr XMLCALL + xmlHasNsProp (xmlNodePtr node, + const xmlChar *name, + const xmlChar *nameSpace); +XMLPUBFUN xmlChar * XMLCALL + xmlGetNsProp (xmlNodePtr node, + const xmlChar *name, + const xmlChar *nameSpace); +XMLPUBFUN xmlNodePtr XMLCALL + xmlStringGetNodeList (xmlDocPtr doc, + const xmlChar *value); +XMLPUBFUN xmlNodePtr XMLCALL + xmlStringLenGetNodeList (xmlDocPtr doc, + const xmlChar *value, + int len); +XMLPUBFUN xmlChar * XMLCALL + xmlNodeListGetString (xmlDocPtr doc, + xmlNodePtr list, + int inLine); +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN xmlChar * XMLCALL + xmlNodeListGetRawString (xmlDocPtr doc, + xmlNodePtr list, + int inLine); +#endif /* LIBXML_TREE_ENABLED */ +XMLPUBFUN void XMLCALL + xmlNodeSetContent (xmlNodePtr cur, + const xmlChar *content); +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN void XMLCALL + xmlNodeSetContentLen (xmlNodePtr cur, + const xmlChar *content, + int len); +#endif /* LIBXML_TREE_ENABLED */ +XMLPUBFUN void XMLCALL + xmlNodeAddContent (xmlNodePtr cur, + const xmlChar *content); +XMLPUBFUN void XMLCALL + xmlNodeAddContentLen (xmlNodePtr cur, + const xmlChar *content, + int len); +XMLPUBFUN xmlChar * XMLCALL + xmlNodeGetContent (xmlNodePtr cur); +XMLPUBFUN int XMLCALL + xmlNodeBufGetContent (xmlBufferPtr buffer, + xmlNodePtr cur); +XMLPUBFUN xmlChar * XMLCALL + xmlNodeGetLang (xmlNodePtr cur); +XMLPUBFUN int XMLCALL + xmlNodeGetSpacePreserve (xmlNodePtr cur); +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN void XMLCALL + xmlNodeSetLang (xmlNodePtr cur, + const xmlChar *lang); +XMLPUBFUN void XMLCALL + xmlNodeSetSpacePreserve (xmlNodePtr cur, + int val); +#endif /* LIBXML_TREE_ENABLED */ +XMLPUBFUN xmlChar * XMLCALL + xmlNodeGetBase (xmlDocPtr doc, + xmlNodePtr cur); +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) +XMLPUBFUN void XMLCALL + xmlNodeSetBase (xmlNodePtr cur, + const xmlChar *uri); +#endif + +/* + * Removing content. + */ +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN int XMLCALL + xmlRemoveProp (xmlAttrPtr cur); +#endif /* LIBXML_TREE_ENABLED */ +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) +XMLPUBFUN int XMLCALL + xmlUnsetNsProp (xmlNodePtr node, + xmlNsPtr ns, + const xmlChar *name); +XMLPUBFUN int XMLCALL + xmlUnsetProp (xmlNodePtr node, + const xmlChar *name); +#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */ + +/* + * Internal, don't use. + */ +XMLPUBFUN void XMLCALL + xmlBufferWriteCHAR (xmlBufferPtr buf, + const xmlChar *string); +XMLPUBFUN void XMLCALL + xmlBufferWriteChar (xmlBufferPtr buf, + const char *string); +XMLPUBFUN void XMLCALL + xmlBufferWriteQuotedString(xmlBufferPtr buf, + const xmlChar *string); + +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void xmlAttrSerializeTxtContent(xmlBufferPtr buf, + xmlDocPtr doc, + xmlAttrPtr attr, + const xmlChar *string); +#endif /* LIBXML_OUTPUT_ENABLED */ + +#ifdef LIBXML_TREE_ENABLED +/* + * Namespace handling. + */ +XMLPUBFUN int XMLCALL + xmlReconciliateNs (xmlDocPtr doc, + xmlNodePtr tree); +#endif + +#ifdef LIBXML_OUTPUT_ENABLED +/* + * Saving. + */ +XMLPUBFUN void XMLCALL + xmlDocDumpFormatMemory (xmlDocPtr cur, + xmlChar **mem, + int *size, + int format); +XMLPUBFUN void XMLCALL + xmlDocDumpMemory (xmlDocPtr cur, + xmlChar **mem, + int *size); +XMLPUBFUN void XMLCALL + xmlDocDumpMemoryEnc (xmlDocPtr out_doc, + xmlChar **doc_txt_ptr, + int * doc_txt_len, + const char *txt_encoding); +XMLPUBFUN void XMLCALL + xmlDocDumpFormatMemoryEnc(xmlDocPtr out_doc, + xmlChar **doc_txt_ptr, + int * doc_txt_len, + const char *txt_encoding, + int format); +XMLPUBFUN int XMLCALL + xmlDocFormatDump (FILE *f, + xmlDocPtr cur, + int format); +XMLPUBFUN int XMLCALL + xmlDocDump (FILE *f, + xmlDocPtr cur); +XMLPUBFUN void XMLCALL + xmlElemDump (FILE *f, + xmlDocPtr doc, + xmlNodePtr cur); +XMLPUBFUN int XMLCALL + xmlSaveFile (const char *filename, + xmlDocPtr cur); +XMLPUBFUN int XMLCALL + xmlSaveFormatFile (const char *filename, + xmlDocPtr cur, + int format); +XMLPUBFUN int XMLCALL + xmlNodeDump (xmlBufferPtr buf, + xmlDocPtr doc, + xmlNodePtr cur, + int level, + int format); + +XMLPUBFUN int XMLCALL + xmlSaveFileTo (xmlOutputBufferPtr buf, + xmlDocPtr cur, + const char *encoding); +XMLPUBFUN int XMLCALL + xmlSaveFormatFileTo (xmlOutputBufferPtr buf, + xmlDocPtr cur, + const char *encoding, + int format); +XMLPUBFUN void XMLCALL + xmlNodeDumpOutput (xmlOutputBufferPtr buf, + xmlDocPtr doc, + xmlNodePtr cur, + int level, + int format, + const char *encoding); + +XMLPUBFUN int XMLCALL + xmlSaveFormatFileEnc (const char *filename, + xmlDocPtr cur, + const char *encoding, + int format); + +XMLPUBFUN int XMLCALL + xmlSaveFileEnc (const char *filename, + xmlDocPtr cur, + const char *encoding); + +#endif /* LIBXML_OUTPUT_ENABLED */ +/* + * XHTML + */ +XMLPUBFUN int XMLCALL + xmlIsXHTML (const xmlChar *systemID, + const xmlChar *publicID); + +/* + * Compression. + */ +XMLPUBFUN int XMLCALL + xmlGetDocCompressMode (xmlDocPtr doc); +XMLPUBFUN void XMLCALL + xmlSetDocCompressMode (xmlDocPtr doc, + int mode); +XMLPUBFUN int XMLCALL + xmlGetCompressMode (void); +XMLPUBFUN void XMLCALL + xmlSetCompressMode (int mode); + +/* +* DOM-wrapper helper functions. +*/ +XMLPUBFUN xmlDOMWrapCtxtPtr XMLCALL + xmlDOMWrapNewCtxt (void); +XMLPUBFUN void XMLCALL + xmlDOMWrapFreeCtxt (xmlDOMWrapCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlDOMWrapReconcileNamespaces(xmlDOMWrapCtxtPtr ctxt, + xmlNodePtr elem, + int options); +XMLPUBFUN int XMLCALL + xmlDOMWrapAdoptNode (xmlDOMWrapCtxtPtr ctxt, + xmlDocPtr sourceDoc, + xmlNodePtr node, + xmlDocPtr destDoc, + xmlNodePtr destParent, + int options); +XMLPUBFUN int XMLCALL + xmlDOMWrapRemoveNode (xmlDOMWrapCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr node, + int options); + +#ifdef __cplusplus +} +#endif +#ifndef __XML_PARSER_H__ +#include +#endif + +#endif /* __XML_TREE_H__ */ + diff --git a/include/libxml/uri.h b/include/libxml/uri.h new file mode 100644 index 0000000..90ed06e --- /dev/null +++ b/include/libxml/uri.h @@ -0,0 +1,84 @@ +/** + * Summary: library of generic URI related routines + * Description: library of generic URI related routines + * Implements RFC 2396 + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_URI_H__ +#define __XML_URI_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlURI: + * + * A parsed URI reference. This is a struct containing the various fields + * as described in RFC 2396 but separated for further processing. + */ +typedef struct _xmlURI xmlURI; +typedef xmlURI *xmlURIPtr; +struct _xmlURI { + char *scheme; /* the URI scheme */ + char *opaque; /* opaque part */ + char *authority; /* the authority part */ + char *server; /* the server part */ + char *user; /* the user part */ + int port; /* the port number */ + char *path; /* the path string */ + char *query; /* the query string */ + char *fragment; /* the fragment identifier */ + int cleanup; /* parsing potentially unclean URI */ +}; + +/* + * This function is in tree.h: + * xmlChar * xmlNodeGetBase (xmlDocPtr doc, + * xmlNodePtr cur); + */ +XMLPUBFUN xmlURIPtr XMLCALL + xmlCreateURI (void); +XMLPUBFUN xmlChar * XMLCALL + xmlBuildURI (const xmlChar *URI, + const xmlChar *base); +XMLPUBFUN xmlChar * XMLCALL + xmlBuildRelativeURI (const xmlChar *URI, + const xmlChar *base); +XMLPUBFUN xmlURIPtr XMLCALL + xmlParseURI (const char *str); +XMLPUBFUN int XMLCALL + xmlParseURIReference (xmlURIPtr uri, + const char *str); +XMLPUBFUN xmlChar * XMLCALL + xmlSaveUri (xmlURIPtr uri); +XMLPUBFUN void XMLCALL + xmlPrintURI (FILE *stream, + xmlURIPtr uri); +XMLPUBFUN xmlChar * XMLCALL + xmlURIEscapeStr (const xmlChar *str, + const xmlChar *list); +XMLPUBFUN char * XMLCALL + xmlURIUnescapeString (const char *str, + int len, + char *target); +XMLPUBFUN int XMLCALL + xmlNormalizeURIPath (char *path); +XMLPUBFUN xmlChar * XMLCALL + xmlURIEscape (const xmlChar *str); +XMLPUBFUN void XMLCALL + xmlFreeURI (xmlURIPtr uri); +XMLPUBFUN xmlChar* XMLCALL + xmlCanonicPath (const xmlChar *path); + +#ifdef __cplusplus +} +#endif +#endif /* __XML_URI_H__ */ diff --git a/include/libxml/valid.h b/include/libxml/valid.h new file mode 100644 index 0000000..86e3fce --- /dev/null +++ b/include/libxml/valid.h @@ -0,0 +1,458 @@ +/* + * Summary: The DTD validation + * Description: API for the DTD handling and the validity checking + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + + +#ifndef __XML_VALID_H__ +#define __XML_VALID_H__ + +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Validation state added for non-determinist content model. + */ +typedef struct _xmlValidState xmlValidState; +typedef xmlValidState *xmlValidStatePtr; + +/** + * xmlValidityErrorFunc: + * @ctx: usually an xmlValidCtxtPtr to a validity error context, + * but comes from ctxt->userData (which normally contains such + * a pointer); ctxt->userData can be changed by the user. + * @msg: the string to format *printf like vararg + * @...: remaining arguments to the format + * + * Callback called when a validity error is found. This is a message + * oriented function similar to an *printf function. + */ +typedef void (*xmlValidityErrorFunc) (void *ctx, + const char *msg, + ...); + +/** + * xmlValidityWarningFunc: + * @ctx: usually an xmlValidCtxtPtr to a validity error context, + * but comes from ctxt->userData (which normally contains such + * a pointer); ctxt->userData can be changed by the user. + * @msg: the string to format *printf like vararg + * @...: remaining arguments to the format + * + * Callback called when a validity warning is found. This is a message + * oriented function similar to an *printf function. + */ +typedef void (*xmlValidityWarningFunc) (void *ctx, + const char *msg, + ...); + +#ifdef IN_LIBXML +/** + * XML_CTXT_FINISH_DTD_0: + * + * Special value for finishDtd field when embedded in an xmlParserCtxt + */ +#define XML_CTXT_FINISH_DTD_0 0xabcd1234 +/** + * XML_CTXT_FINISH_DTD_1: + * + * Special value for finishDtd field when embedded in an xmlParserCtxt + */ +#define XML_CTXT_FINISH_DTD_1 0xabcd1235 +#endif + +/* + * xmlValidCtxt: + * An xmlValidCtxt is used for error reporting when validating. + */ +typedef struct _xmlValidCtxt xmlValidCtxt; +typedef xmlValidCtxt *xmlValidCtxtPtr; +struct _xmlValidCtxt { + void *userData; /* user specific data block */ + xmlValidityErrorFunc error; /* the callback in case of errors */ + xmlValidityWarningFunc warning; /* the callback in case of warning */ + + /* Node analysis stack used when validating within entities */ + xmlNodePtr node; /* Current parsed Node */ + int nodeNr; /* Depth of the parsing stack */ + int nodeMax; /* Max depth of the parsing stack */ + xmlNodePtr *nodeTab; /* array of nodes */ + + unsigned int finishDtd; /* finished validating the Dtd ? */ + xmlDocPtr doc; /* the document */ + int valid; /* temporary validity check result */ + + /* state state used for non-determinist content validation */ + xmlValidState *vstate; /* current state */ + int vstateNr; /* Depth of the validation stack */ + int vstateMax; /* Max depth of the validation stack */ + xmlValidState *vstateTab; /* array of validation states */ + +#ifdef LIBXML_REGEXP_ENABLED + xmlAutomataPtr am; /* the automata */ + xmlAutomataStatePtr state; /* used to build the automata */ +#else + void *am; + void *state; +#endif +}; + +/* + * ALL notation declarations are stored in a table. + * There is one table per DTD. + */ + +typedef struct _xmlHashTable xmlNotationTable; +typedef xmlNotationTable *xmlNotationTablePtr; + +/* + * ALL element declarations are stored in a table. + * There is one table per DTD. + */ + +typedef struct _xmlHashTable xmlElementTable; +typedef xmlElementTable *xmlElementTablePtr; + +/* + * ALL attribute declarations are stored in a table. + * There is one table per DTD. + */ + +typedef struct _xmlHashTable xmlAttributeTable; +typedef xmlAttributeTable *xmlAttributeTablePtr; + +/* + * ALL IDs attributes are stored in a table. + * There is one table per document. + */ + +typedef struct _xmlHashTable xmlIDTable; +typedef xmlIDTable *xmlIDTablePtr; + +/* + * ALL Refs attributes are stored in a table. + * There is one table per document. + */ + +typedef struct _xmlHashTable xmlRefTable; +typedef xmlRefTable *xmlRefTablePtr; + +/* Notation */ +XMLPUBFUN xmlNotationPtr XMLCALL + xmlAddNotationDecl (xmlValidCtxtPtr ctxt, + xmlDtdPtr dtd, + const xmlChar *name, + const xmlChar *PublicID, + const xmlChar *SystemID); +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN xmlNotationTablePtr XMLCALL + xmlCopyNotationTable (xmlNotationTablePtr table); +#endif /* LIBXML_TREE_ENABLED */ +XMLPUBFUN void XMLCALL + xmlFreeNotationTable (xmlNotationTablePtr table); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void XMLCALL + xmlDumpNotationDecl (xmlBufferPtr buf, + xmlNotationPtr nota); +XMLPUBFUN void XMLCALL + xmlDumpNotationTable (xmlBufferPtr buf, + xmlNotationTablePtr table); +#endif /* LIBXML_OUTPUT_ENABLED */ + +/* Element Content */ +/* the non Doc version are being deprecated */ +XMLPUBFUN xmlElementContentPtr XMLCALL + xmlNewElementContent (const xmlChar *name, + xmlElementContentType type); +XMLPUBFUN xmlElementContentPtr XMLCALL + xmlCopyElementContent (xmlElementContentPtr content); +XMLPUBFUN void XMLCALL + xmlFreeElementContent (xmlElementContentPtr cur); +/* the new versions with doc argument */ +XMLPUBFUN xmlElementContentPtr XMLCALL + xmlNewDocElementContent (xmlDocPtr doc, + const xmlChar *name, + xmlElementContentType type); +XMLPUBFUN xmlElementContentPtr XMLCALL + xmlCopyDocElementContent(xmlDocPtr doc, + xmlElementContentPtr content); +XMLPUBFUN void XMLCALL + xmlFreeDocElementContent(xmlDocPtr doc, + xmlElementContentPtr cur); +XMLPUBFUN void XMLCALL + xmlSnprintfElementContent(char *buf, + int size, + xmlElementContentPtr content, + int englob); +#ifdef LIBXML_OUTPUT_ENABLED +/* DEPRECATED */ +XMLPUBFUN void XMLCALL + xmlSprintfElementContent(char *buf, + xmlElementContentPtr content, + int englob); +#endif /* LIBXML_OUTPUT_ENABLED */ +/* DEPRECATED */ + +/* Element */ +XMLPUBFUN xmlElementPtr XMLCALL + xmlAddElementDecl (xmlValidCtxtPtr ctxt, + xmlDtdPtr dtd, + const xmlChar *name, + xmlElementTypeVal type, + xmlElementContentPtr content); +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN xmlElementTablePtr XMLCALL + xmlCopyElementTable (xmlElementTablePtr table); +#endif /* LIBXML_TREE_ENABLED */ +XMLPUBFUN void XMLCALL + xmlFreeElementTable (xmlElementTablePtr table); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void XMLCALL + xmlDumpElementTable (xmlBufferPtr buf, + xmlElementTablePtr table); +XMLPUBFUN void XMLCALL + xmlDumpElementDecl (xmlBufferPtr buf, + xmlElementPtr elem); +#endif /* LIBXML_OUTPUT_ENABLED */ + +/* Enumeration */ +XMLPUBFUN xmlEnumerationPtr XMLCALL + xmlCreateEnumeration (const xmlChar *name); +XMLPUBFUN void XMLCALL + xmlFreeEnumeration (xmlEnumerationPtr cur); +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN xmlEnumerationPtr XMLCALL + xmlCopyEnumeration (xmlEnumerationPtr cur); +#endif /* LIBXML_TREE_ENABLED */ + +/* Attribute */ +XMLPUBFUN xmlAttributePtr XMLCALL + xmlAddAttributeDecl (xmlValidCtxtPtr ctxt, + xmlDtdPtr dtd, + const xmlChar *elem, + const xmlChar *name, + const xmlChar *ns, + xmlAttributeType type, + xmlAttributeDefault def, + const xmlChar *defaultValue, + xmlEnumerationPtr tree); +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN xmlAttributeTablePtr XMLCALL + xmlCopyAttributeTable (xmlAttributeTablePtr table); +#endif /* LIBXML_TREE_ENABLED */ +XMLPUBFUN void XMLCALL + xmlFreeAttributeTable (xmlAttributeTablePtr table); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void XMLCALL + xmlDumpAttributeTable (xmlBufferPtr buf, + xmlAttributeTablePtr table); +XMLPUBFUN void XMLCALL + xmlDumpAttributeDecl (xmlBufferPtr buf, + xmlAttributePtr attr); +#endif /* LIBXML_OUTPUT_ENABLED */ + +/* IDs */ +XMLPUBFUN xmlIDPtr XMLCALL + xmlAddID (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + const xmlChar *value, + xmlAttrPtr attr); +XMLPUBFUN void XMLCALL + xmlFreeIDTable (xmlIDTablePtr table); +XMLPUBFUN xmlAttrPtr XMLCALL + xmlGetID (xmlDocPtr doc, + const xmlChar *ID); +XMLPUBFUN int XMLCALL + xmlIsID (xmlDocPtr doc, + xmlNodePtr elem, + xmlAttrPtr attr); +XMLPUBFUN int XMLCALL + xmlRemoveID (xmlDocPtr doc, + xmlAttrPtr attr); + +/* IDREFs */ +XMLPUBFUN xmlRefPtr XMLCALL + xmlAddRef (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + const xmlChar *value, + xmlAttrPtr attr); +XMLPUBFUN void XMLCALL + xmlFreeRefTable (xmlRefTablePtr table); +XMLPUBFUN int XMLCALL + xmlIsRef (xmlDocPtr doc, + xmlNodePtr elem, + xmlAttrPtr attr); +XMLPUBFUN int XMLCALL + xmlRemoveRef (xmlDocPtr doc, + xmlAttrPtr attr); +XMLPUBFUN xmlListPtr XMLCALL + xmlGetRefs (xmlDocPtr doc, + const xmlChar *ID); + +/** + * The public function calls related to validity checking. + */ +#ifdef LIBXML_VALID_ENABLED +/* Allocate/Release Validation Contexts */ +XMLPUBFUN xmlValidCtxtPtr XMLCALL + xmlNewValidCtxt(void); +XMLPUBFUN void XMLCALL + xmlFreeValidCtxt(xmlValidCtxtPtr); + +XMLPUBFUN int XMLCALL + xmlValidateRoot (xmlValidCtxtPtr ctxt, + xmlDocPtr doc); +XMLPUBFUN int XMLCALL + xmlValidateElementDecl (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlElementPtr elem); +XMLPUBFUN xmlChar * XMLCALL + xmlValidNormalizeAttributeValue(xmlDocPtr doc, + xmlNodePtr elem, + const xmlChar *name, + const xmlChar *value); +XMLPUBFUN xmlChar * XMLCALL + xmlValidCtxtNormalizeAttributeValue(xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr elem, + const xmlChar *name, + const xmlChar *value); +XMLPUBFUN int XMLCALL + xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlAttributePtr attr); +XMLPUBFUN int XMLCALL + xmlValidateAttributeValue(xmlAttributeType type, + const xmlChar *value); +XMLPUBFUN int XMLCALL + xmlValidateNotationDecl (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNotationPtr nota); +XMLPUBFUN int XMLCALL + xmlValidateDtd (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlDtdPtr dtd); +XMLPUBFUN int XMLCALL + xmlValidateDtdFinal (xmlValidCtxtPtr ctxt, + xmlDocPtr doc); +XMLPUBFUN int XMLCALL + xmlValidateDocument (xmlValidCtxtPtr ctxt, + xmlDocPtr doc); +XMLPUBFUN int XMLCALL + xmlValidateElement (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr elem); +XMLPUBFUN int XMLCALL + xmlValidateOneElement (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr elem); +XMLPUBFUN int XMLCALL + xmlValidateOneAttribute (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr elem, + xmlAttrPtr attr, + const xmlChar *value); +XMLPUBFUN int XMLCALL + xmlValidateOneNamespace (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr elem, + const xmlChar *prefix, + xmlNsPtr ns, + const xmlChar *value); +XMLPUBFUN int XMLCALL + xmlValidateDocumentFinal(xmlValidCtxtPtr ctxt, + xmlDocPtr doc); +#endif /* LIBXML_VALID_ENABLED */ + +#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) +XMLPUBFUN int XMLCALL + xmlValidateNotationUse (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + const xmlChar *notationName); +#endif /* LIBXML_VALID_ENABLED or LIBXML_SCHEMAS_ENABLED */ + +XMLPUBFUN int XMLCALL + xmlIsMixedElement (xmlDocPtr doc, + const xmlChar *name); +XMLPUBFUN xmlAttributePtr XMLCALL + xmlGetDtdAttrDesc (xmlDtdPtr dtd, + const xmlChar *elem, + const xmlChar *name); +XMLPUBFUN xmlAttributePtr XMLCALL + xmlGetDtdQAttrDesc (xmlDtdPtr dtd, + const xmlChar *elem, + const xmlChar *name, + const xmlChar *prefix); +XMLPUBFUN xmlNotationPtr XMLCALL + xmlGetDtdNotationDesc (xmlDtdPtr dtd, + const xmlChar *name); +XMLPUBFUN xmlElementPtr XMLCALL + xmlGetDtdQElementDesc (xmlDtdPtr dtd, + const xmlChar *name, + const xmlChar *prefix); +XMLPUBFUN xmlElementPtr XMLCALL + xmlGetDtdElementDesc (xmlDtdPtr dtd, + const xmlChar *name); + +#ifdef LIBXML_VALID_ENABLED + +XMLPUBFUN int XMLCALL + xmlValidGetPotentialChildren(xmlElementContent *ctree, + const xmlChar **list, + int *len, + int max); + +XMLPUBFUN int XMLCALL + xmlValidGetValidElements(xmlNode *prev, + xmlNode *next, + const xmlChar **names, + int max); +XMLPUBFUN int XMLCALL + xmlValidateNameValue (const xmlChar *value); +XMLPUBFUN int XMLCALL + xmlValidateNamesValue (const xmlChar *value); +XMLPUBFUN int XMLCALL + xmlValidateNmtokenValue (const xmlChar *value); +XMLPUBFUN int XMLCALL + xmlValidateNmtokensValue(const xmlChar *value); + +#ifdef LIBXML_REGEXP_ENABLED +/* + * Validation based on the regexp support + */ +XMLPUBFUN int XMLCALL + xmlValidBuildContentModel(xmlValidCtxtPtr ctxt, + xmlElementPtr elem); + +XMLPUBFUN int XMLCALL + xmlValidatePushElement (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr elem, + const xmlChar *qname); +XMLPUBFUN int XMLCALL + xmlValidatePushCData (xmlValidCtxtPtr ctxt, + const xmlChar *data, + int len); +XMLPUBFUN int XMLCALL + xmlValidatePopElement (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr elem, + const xmlChar *qname); +#endif /* LIBXML_REGEXP_ENABLED */ +#endif /* LIBXML_VALID_ENABLED */ +#ifdef __cplusplus +} +#endif +#endif /* __XML_VALID_H__ */ diff --git a/include/libxml/xinclude.h b/include/libxml/xinclude.h new file mode 100644 index 0000000..4bb0aab --- /dev/null +++ b/include/libxml/xinclude.h @@ -0,0 +1,121 @@ +/* + * Summary: implementation of XInclude + * Description: API to handle XInclude processing, + * implements the + * World Wide Web Consortium Last Call Working Draft 10 November 2003 + * http://www.w3.org/TR/2003/WD-xinclude-20031110 + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XINCLUDE_H__ +#define __XML_XINCLUDE_H__ + +#include +#include + +#ifdef LIBXML_XINCLUDE_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * XINCLUDE_NS: + * + * Macro defining the Xinclude namespace: http://www.w3.org/2003/XInclude + */ +#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude" +/** + * XINCLUDE_OLD_NS: + * + * Macro defining the draft Xinclude namespace: http://www.w3.org/2001/XInclude + */ +#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude" +/** + * XINCLUDE_NODE: + * + * Macro defining "include" + */ +#define XINCLUDE_NODE (const xmlChar *) "include" +/** + * XINCLUDE_FALLBACK: + * + * Macro defining "fallback" + */ +#define XINCLUDE_FALLBACK (const xmlChar *) "fallback" +/** + * XINCLUDE_HREF: + * + * Macro defining "href" + */ +#define XINCLUDE_HREF (const xmlChar *) "href" +/** + * XINCLUDE_PARSE: + * + * Macro defining "parse" + */ +#define XINCLUDE_PARSE (const xmlChar *) "parse" +/** + * XINCLUDE_PARSE_XML: + * + * Macro defining "xml" + */ +#define XINCLUDE_PARSE_XML (const xmlChar *) "xml" +/** + * XINCLUDE_PARSE_TEXT: + * + * Macro defining "text" + */ +#define XINCLUDE_PARSE_TEXT (const xmlChar *) "text" +/** + * XINCLUDE_PARSE_ENCODING: + * + * Macro defining "encoding" + */ +#define XINCLUDE_PARSE_ENCODING (const xmlChar *) "encoding" +/** + * XINCLUDE_PARSE_XPOINTER: + * + * Macro defining "xpointer" + */ +#define XINCLUDE_PARSE_XPOINTER (const xmlChar *) "xpointer" + +typedef struct _xmlXIncludeCtxt xmlXIncludeCtxt; +typedef xmlXIncludeCtxt *xmlXIncludeCtxtPtr; + +/* + * standalone processing + */ +XMLPUBFUN int XMLCALL + xmlXIncludeProcess (xmlDocPtr doc); +XMLPUBFUN int XMLCALL + xmlXIncludeProcessFlags (xmlDocPtr doc, + int flags); +XMLPUBFUN int XMLCALL + xmlXIncludeProcessTree (xmlNodePtr tree); +XMLPUBFUN int XMLCALL + xmlXIncludeProcessTreeFlags(xmlNodePtr tree, + int flags); +/* + * contextual processing + */ +XMLPUBFUN xmlXIncludeCtxtPtr XMLCALL + xmlXIncludeNewContext (xmlDocPtr doc); +XMLPUBFUN int XMLCALL + xmlXIncludeSetFlags (xmlXIncludeCtxtPtr ctxt, + int flags); +XMLPUBFUN void XMLCALL + xmlXIncludeFreeContext (xmlXIncludeCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlXIncludeProcessNode (xmlXIncludeCtxtPtr ctxt, + xmlNodePtr tree); +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_XINCLUDE_ENABLED */ + +#endif /* __XML_XINCLUDE_H__ */ diff --git a/include/libxml/xlink.h b/include/libxml/xlink.h new file mode 100644 index 0000000..083c7ed --- /dev/null +++ b/include/libxml/xlink.h @@ -0,0 +1,189 @@ +/* + * Summary: unfinished XLink detection module + * Description: unfinished XLink detection module + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XLINK_H__ +#define __XML_XLINK_H__ + +#include +#include + +#ifdef LIBXML_XPTR_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Various defines for the various Link properties. + * + * NOTE: the link detection layer will try to resolve QName expansion + * of namespaces. If "foo" is the prefix for "http://foo.com/" + * then the link detection layer will expand role="foo:myrole" + * to "http://foo.com/:myrole". + * NOTE: the link detection layer will expand URI-Refences found on + * href attributes by using the base mechanism if found. + */ +typedef xmlChar *xlinkHRef; +typedef xmlChar *xlinkRole; +typedef xmlChar *xlinkTitle; + +typedef enum { + XLINK_TYPE_NONE = 0, + XLINK_TYPE_SIMPLE, + XLINK_TYPE_EXTENDED, + XLINK_TYPE_EXTENDED_SET +} xlinkType; + +typedef enum { + XLINK_SHOW_NONE = 0, + XLINK_SHOW_NEW, + XLINK_SHOW_EMBED, + XLINK_SHOW_REPLACE +} xlinkShow; + +typedef enum { + XLINK_ACTUATE_NONE = 0, + XLINK_ACTUATE_AUTO, + XLINK_ACTUATE_ONREQUEST +} xlinkActuate; + +/** + * xlinkNodeDetectFunc: + * @ctx: user data pointer + * @node: the node to check + * + * This is the prototype for the link detection routine. + * It calls the default link detection callbacks upon link detection. + */ +typedef void (*xlinkNodeDetectFunc) (void *ctx, xmlNodePtr node); + +/* + * The link detection module interact with the upper layers using + * a set of callback registered at parsing time. + */ + +/** + * xlinkSimpleLinkFunk: + * @ctx: user data pointer + * @node: the node carrying the link + * @href: the target of the link + * @role: the role string + * @title: the link title + * + * This is the prototype for a simple link detection callback. + */ +typedef void +(*xlinkSimpleLinkFunk) (void *ctx, + xmlNodePtr node, + const xlinkHRef href, + const xlinkRole role, + const xlinkTitle title); + +/** + * xlinkExtendedLinkFunk: + * @ctx: user data pointer + * @node: the node carrying the link + * @nbLocators: the number of locators detected on the link + * @hrefs: pointer to the array of locator hrefs + * @roles: pointer to the array of locator roles + * @nbArcs: the number of arcs detected on the link + * @from: pointer to the array of source roles found on the arcs + * @to: pointer to the array of target roles found on the arcs + * @show: array of values for the show attributes found on the arcs + * @actuate: array of values for the actuate attributes found on the arcs + * @nbTitles: the number of titles detected on the link + * @title: array of titles detected on the link + * @langs: array of xml:lang values for the titles + * + * This is the prototype for a extended link detection callback. + */ +typedef void +(*xlinkExtendedLinkFunk)(void *ctx, + xmlNodePtr node, + int nbLocators, + const xlinkHRef *hrefs, + const xlinkRole *roles, + int nbArcs, + const xlinkRole *from, + const xlinkRole *to, + xlinkShow *show, + xlinkActuate *actuate, + int nbTitles, + const xlinkTitle *titles, + const xmlChar **langs); + +/** + * xlinkExtendedLinkSetFunk: + * @ctx: user data pointer + * @node: the node carrying the link + * @nbLocators: the number of locators detected on the link + * @hrefs: pointer to the array of locator hrefs + * @roles: pointer to the array of locator roles + * @nbTitles: the number of titles detected on the link + * @title: array of titles detected on the link + * @langs: array of xml:lang values for the titles + * + * This is the prototype for a extended link set detection callback. + */ +typedef void +(*xlinkExtendedLinkSetFunk) (void *ctx, + xmlNodePtr node, + int nbLocators, + const xlinkHRef *hrefs, + const xlinkRole *roles, + int nbTitles, + const xlinkTitle *titles, + const xmlChar **langs); + +/** + * This is the structure containing a set of Links detection callbacks. + * + * There is no default xlink callbacks, if one want to get link + * recognition activated, those call backs must be provided before parsing. + */ +typedef struct _xlinkHandler xlinkHandler; +typedef xlinkHandler *xlinkHandlerPtr; +struct _xlinkHandler { + xlinkSimpleLinkFunk simple; + xlinkExtendedLinkFunk extended; + xlinkExtendedLinkSetFunk set; +}; + +/* + * The default detection routine, can be overridden, they call the default + * detection callbacks. + */ + +XMLPUBFUN xlinkNodeDetectFunc XMLCALL + xlinkGetDefaultDetect (void); +XMLPUBFUN void XMLCALL + xlinkSetDefaultDetect (xlinkNodeDetectFunc func); + +/* + * Routines to set/get the default handlers. + */ +XMLPUBFUN xlinkHandlerPtr XMLCALL + xlinkGetDefaultHandler (void); +XMLPUBFUN void XMLCALL + xlinkSetDefaultHandler (xlinkHandlerPtr handler); + +/* + * Link detection module itself. + */ +XMLPUBFUN xlinkType XMLCALL + xlinkIsLink (xmlDocPtr doc, + xmlNodePtr node); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_XPTR_ENABLED */ + +#endif /* __XML_XLINK_H__ */ diff --git a/include/libxml/xmlIO.h b/include/libxml/xmlIO.h new file mode 100644 index 0000000..0f7b8a8 --- /dev/null +++ b/include/libxml/xmlIO.h @@ -0,0 +1,356 @@ +/* + * Summary: interface for the I/O interfaces used by the parser + * Description: interface for the I/O interfaces used by the parser + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_IO_H__ +#define __XML_IO_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Those are the functions and datatypes for the parser input + * I/O structures. + */ + +/** + * xmlInputMatchCallback: + * @filename: the filename or URI + * + * Callback used in the I/O Input API to detect if the current handler + * can provide input fonctionnalities for this resource. + * + * Returns 1 if yes and 0 if another Input module should be used + */ +typedef int (*xmlInputMatchCallback) (char const *filename); +/** + * xmlInputOpenCallback: + * @filename: the filename or URI + * + * Callback used in the I/O Input API to open the resource + * + * Returns an Input context or NULL in case or error + */ +typedef void * (*xmlInputOpenCallback) (char const *filename); +/** + * xmlInputReadCallback: + * @context: an Input context + * @buffer: the buffer to store data read + * @len: the length of the buffer in bytes + * + * Callback used in the I/O Input API to read the resource + * + * Returns the number of bytes read or -1 in case of error + */ +typedef int (*xmlInputReadCallback) (void * context, char * buffer, int len); +/** + * xmlInputCloseCallback: + * @context: an Input context + * + * Callback used in the I/O Input API to close the resource + * + * Returns 0 or -1 in case of error + */ +typedef int (*xmlInputCloseCallback) (void * context); + +#ifdef LIBXML_OUTPUT_ENABLED +/* + * Those are the functions and datatypes for the library output + * I/O structures. + */ + +/** + * xmlOutputMatchCallback: + * @filename: the filename or URI + * + * Callback used in the I/O Output API to detect if the current handler + * can provide output fonctionnalities for this resource. + * + * Returns 1 if yes and 0 if another Output module should be used + */ +typedef int (*xmlOutputMatchCallback) (char const *filename); +/** + * xmlOutputOpenCallback: + * @filename: the filename or URI + * + * Callback used in the I/O Output API to open the resource + * + * Returns an Output context or NULL in case or error + */ +typedef void * (*xmlOutputOpenCallback) (char const *filename); +/** + * xmlOutputWriteCallback: + * @context: an Output context + * @buffer: the buffer of data to write + * @len: the length of the buffer in bytes + * + * Callback used in the I/O Output API to write to the resource + * + * Returns the number of bytes written or -1 in case of error + */ +typedef int (*xmlOutputWriteCallback) (void * context, const char * buffer, + int len); +/** + * xmlOutputCloseCallback: + * @context: an Output context + * + * Callback used in the I/O Output API to close the resource + * + * Returns 0 or -1 in case of error + */ +typedef int (*xmlOutputCloseCallback) (void * context); +#endif /* LIBXML_OUTPUT_ENABLED */ + +#ifdef __cplusplus +} +#endif + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif +struct _xmlParserInputBuffer { + void* context; + xmlInputReadCallback readcallback; + xmlInputCloseCallback closecallback; + + xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */ + + xmlBufferPtr buffer; /* Local buffer encoded in UTF-8 */ + xmlBufferPtr raw; /* if encoder != NULL buffer for raw input */ + int compressed; /* -1=unknown, 0=not compressed, 1=compressed */ + int error; + unsigned long rawconsumed;/* amount consumed from raw */ +}; + + +#ifdef LIBXML_OUTPUT_ENABLED +struct _xmlOutputBuffer { + void* context; + xmlOutputWriteCallback writecallback; + xmlOutputCloseCallback closecallback; + + xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */ + + xmlBufferPtr buffer; /* Local buffer encoded in UTF-8 or ISOLatin */ + xmlBufferPtr conv; /* if encoder != NULL buffer for output */ + int written; /* total number of byte written */ + int error; +}; +#endif /* LIBXML_OUTPUT_ENABLED */ + +/* + * Interfaces for input + */ +XMLPUBFUN void XMLCALL + xmlCleanupInputCallbacks (void); + +XMLPUBFUN int XMLCALL + xmlPopInputCallbacks (void); + +XMLPUBFUN void XMLCALL + xmlRegisterDefaultInputCallbacks (void); +XMLPUBFUN xmlParserInputBufferPtr XMLCALL + xmlAllocParserInputBuffer (xmlCharEncoding enc); + +XMLPUBFUN xmlParserInputBufferPtr XMLCALL + xmlParserInputBufferCreateFilename (const char *URI, + xmlCharEncoding enc); +XMLPUBFUN xmlParserInputBufferPtr XMLCALL + xmlParserInputBufferCreateFile (FILE *file, + xmlCharEncoding enc); +XMLPUBFUN xmlParserInputBufferPtr XMLCALL + xmlParserInputBufferCreateFd (int fd, + xmlCharEncoding enc); +XMLPUBFUN xmlParserInputBufferPtr XMLCALL + xmlParserInputBufferCreateMem (const char *mem, int size, + xmlCharEncoding enc); +XMLPUBFUN xmlParserInputBufferPtr XMLCALL + xmlParserInputBufferCreateStatic (const char *mem, int size, + xmlCharEncoding enc); +XMLPUBFUN xmlParserInputBufferPtr XMLCALL + xmlParserInputBufferCreateIO (xmlInputReadCallback ioread, + xmlInputCloseCallback ioclose, + void *ioctx, + xmlCharEncoding enc); +XMLPUBFUN int XMLCALL + xmlParserInputBufferRead (xmlParserInputBufferPtr in, + int len); +XMLPUBFUN int XMLCALL + xmlParserInputBufferGrow (xmlParserInputBufferPtr in, + int len); +XMLPUBFUN int XMLCALL + xmlParserInputBufferPush (xmlParserInputBufferPtr in, + int len, + const char *buf); +XMLPUBFUN void XMLCALL + xmlFreeParserInputBuffer (xmlParserInputBufferPtr in); +XMLPUBFUN char * XMLCALL + xmlParserGetDirectory (const char *filename); + +XMLPUBFUN int XMLCALL + xmlRegisterInputCallbacks (xmlInputMatchCallback matchFunc, + xmlInputOpenCallback openFunc, + xmlInputReadCallback readFunc, + xmlInputCloseCallback closeFunc); + +xmlParserInputBufferPtr + __xmlParserInputBufferCreateFilename(const char *URI, + xmlCharEncoding enc); + +#ifdef LIBXML_OUTPUT_ENABLED +/* + * Interfaces for output + */ +XMLPUBFUN void XMLCALL + xmlCleanupOutputCallbacks (void); +XMLPUBFUN void XMLCALL + xmlRegisterDefaultOutputCallbacks(void); +XMLPUBFUN xmlOutputBufferPtr XMLCALL + xmlAllocOutputBuffer (xmlCharEncodingHandlerPtr encoder); + +XMLPUBFUN xmlOutputBufferPtr XMLCALL + xmlOutputBufferCreateFilename (const char *URI, + xmlCharEncodingHandlerPtr encoder, + int compression); + +XMLPUBFUN xmlOutputBufferPtr XMLCALL + xmlOutputBufferCreateFile (FILE *file, + xmlCharEncodingHandlerPtr encoder); + +XMLPUBFUN xmlOutputBufferPtr XMLCALL + xmlOutputBufferCreateFd (int fd, + xmlCharEncodingHandlerPtr encoder); + +XMLPUBFUN xmlOutputBufferPtr XMLCALL + xmlOutputBufferCreateIO (xmlOutputWriteCallback iowrite, + xmlOutputCloseCallback ioclose, + void *ioctx, + xmlCharEncodingHandlerPtr encoder); + +XMLPUBFUN int XMLCALL + xmlOutputBufferWrite (xmlOutputBufferPtr out, + int len, + const char *buf); +XMLPUBFUN int XMLCALL + xmlOutputBufferWriteString (xmlOutputBufferPtr out, + const char *str); +XMLPUBFUN int XMLCALL + xmlOutputBufferWriteEscape (xmlOutputBufferPtr out, + const xmlChar *str, + xmlCharEncodingOutputFunc escaping); + +XMLPUBFUN int XMLCALL + xmlOutputBufferFlush (xmlOutputBufferPtr out); +XMLPUBFUN int XMLCALL + xmlOutputBufferClose (xmlOutputBufferPtr out); + +XMLPUBFUN int XMLCALL + xmlRegisterOutputCallbacks (xmlOutputMatchCallback matchFunc, + xmlOutputOpenCallback openFunc, + xmlOutputWriteCallback writeFunc, + xmlOutputCloseCallback closeFunc); + +xmlOutputBufferPtr + __xmlOutputBufferCreateFilename(const char *URI, + xmlCharEncodingHandlerPtr encoder, + int compression); + +#ifdef LIBXML_HTTP_ENABLED +/* This function only exists if HTTP support built into the library */ +XMLPUBFUN void XMLCALL + xmlRegisterHTTPPostCallbacks (void ); +#endif /* LIBXML_HTTP_ENABLED */ + +#endif /* LIBXML_OUTPUT_ENABLED */ + +XMLPUBFUN xmlParserInputPtr XMLCALL + xmlCheckHTTPInput (xmlParserCtxtPtr ctxt, + xmlParserInputPtr ret); + +/* + * A predefined entity loader disabling network accesses + */ +XMLPUBFUN xmlParserInputPtr XMLCALL + xmlNoNetExternalEntityLoader (const char *URL, + const char *ID, + xmlParserCtxtPtr ctxt); + +/* + * xmlNormalizeWindowsPath is obsolete, don't use it. + * Check xmlCanonicPath in uri.h for a better alternative. + */ +XMLPUBFUN xmlChar * XMLCALL + xmlNormalizeWindowsPath (const xmlChar *path); + +XMLPUBFUN int XMLCALL + xmlCheckFilename (const char *path); +/** + * Default 'file://' protocol callbacks + */ +XMLPUBFUN int XMLCALL + xmlFileMatch (const char *filename); +XMLPUBFUN void * XMLCALL + xmlFileOpen (const char *filename); +XMLPUBFUN int XMLCALL + xmlFileRead (void * context, + char * buffer, + int len); +XMLPUBFUN int XMLCALL + xmlFileClose (void * context); + +/** + * Default 'http://' protocol callbacks + */ +#ifdef LIBXML_HTTP_ENABLED +XMLPUBFUN int XMLCALL + xmlIOHTTPMatch (const char *filename); +XMLPUBFUN void * XMLCALL + xmlIOHTTPOpen (const char *filename); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void * XMLCALL + xmlIOHTTPOpenW (const char * post_uri, + int compression ); +#endif /* LIBXML_OUTPUT_ENABLED */ +XMLPUBFUN int XMLCALL + xmlIOHTTPRead (void * context, + char * buffer, + int len); +XMLPUBFUN int XMLCALL + xmlIOHTTPClose (void * context); +#endif /* LIBXML_HTTP_ENABLED */ + +/** + * Default 'ftp://' protocol callbacks + */ +#ifdef LIBXML_FTP_ENABLED +XMLPUBFUN int XMLCALL + xmlIOFTPMatch (const char *filename); +XMLPUBFUN void * XMLCALL + xmlIOFTPOpen (const char *filename); +XMLPUBFUN int XMLCALL + xmlIOFTPRead (void * context, + char * buffer, + int len); +XMLPUBFUN int XMLCALL + xmlIOFTPClose (void * context); +#endif /* LIBXML_FTP_ENABLED */ + +#ifdef __cplusplus +} +#endif + +#endif /* __XML_IO_H__ */ diff --git a/include/libxml/xmlautomata.h b/include/libxml/xmlautomata.h new file mode 100644 index 0000000..d29ddcf --- /dev/null +++ b/include/libxml/xmlautomata.h @@ -0,0 +1,138 @@ +/* + * Summary: API to build regexp automata + * Description: the API to build regexp automata + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_AUTOMATA_H__ +#define __XML_AUTOMATA_H__ + +#include +#include + +#ifdef LIBXML_REGEXP_ENABLED +#ifdef LIBXML_AUTOMATA_ENABLED +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlAutomataPtr: + * + * A libxml automata description, It can be compiled into a regexp + */ +typedef struct _xmlAutomata xmlAutomata; +typedef xmlAutomata *xmlAutomataPtr; + +/** + * xmlAutomataStatePtr: + * + * A state int the automata description, + */ +typedef struct _xmlAutomataState xmlAutomataState; +typedef xmlAutomataState *xmlAutomataStatePtr; + +/* + * Building API + */ +XMLPUBFUN xmlAutomataPtr XMLCALL + xmlNewAutomata (void); +XMLPUBFUN void XMLCALL + xmlFreeAutomata (xmlAutomataPtr am); + +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataGetInitState (xmlAutomataPtr am); +XMLPUBFUN int XMLCALL + xmlAutomataSetFinalState (xmlAutomataPtr am, + xmlAutomataStatePtr state); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewState (xmlAutomataPtr am); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewTransition (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to, + const xmlChar *token, + void *data); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewTransition2 (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to, + const xmlChar *token, + const xmlChar *token2, + void *data); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewCountTrans (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to, + const xmlChar *token, + int min, + int max, + void *data); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewCountTrans2 (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to, + const xmlChar *token, + const xmlChar *token2, + int min, + int max, + void *data); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewOnceTrans (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to, + const xmlChar *token, + int min, + int max, + void *data); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewOnceTrans2 (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to, + const xmlChar *token, + const xmlChar *token2, + int min, + int max, + void *data); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewAllTrans (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to, + int lax); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewEpsilon (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewCountedTrans (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to, + int counter); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewCounterTrans (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to, + int counter); +XMLPUBFUN int XMLCALL + xmlAutomataNewCounter (xmlAutomataPtr am, + int min, + int max); + +XMLPUBFUN xmlRegexpPtr XMLCALL + xmlAutomataCompile (xmlAutomataPtr am); +XMLPUBFUN int XMLCALL + xmlAutomataIsDeterminist (xmlAutomataPtr am); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_AUTOMATA_ENABLED */ +#endif /* LIBXML_REGEXP_ENABLED */ + +#endif /* __XML_AUTOMATA_H__ */ diff --git a/include/libxml/xmlerror.h b/include/libxml/xmlerror.h new file mode 100644 index 0000000..04da1a6 --- /dev/null +++ b/include/libxml/xmlerror.h @@ -0,0 +1,918 @@ +/* + * Summary: error handling + * Description: the API used to report errors + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#include + +#ifndef __XML_ERROR_H__ +#define __XML_ERROR_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlErrorLevel: + * + * Indicates the level of an error + */ +typedef enum { + XML_ERR_NONE = 0, + XML_ERR_WARNING = 1, /* A simple warning */ + XML_ERR_ERROR = 2, /* A recoverable error */ + XML_ERR_FATAL = 3 /* A fatal error */ +} xmlErrorLevel; + +/** + * xmlErrorDomain: + * + * Indicates where an error may have come from + */ +typedef enum { + XML_FROM_NONE = 0, + XML_FROM_PARSER, /* The XML parser */ + XML_FROM_TREE, /* The tree module */ + XML_FROM_NAMESPACE, /* The XML Namespace module */ + XML_FROM_DTD, /* The XML DTD validation with parser context*/ + XML_FROM_HTML, /* The HTML parser */ + XML_FROM_MEMORY, /* The memory allocator */ + XML_FROM_OUTPUT, /* The serialization code */ + XML_FROM_IO, /* The Input/Output stack */ + XML_FROM_FTP, /* The FTP module */ + XML_FROM_HTTP, /* The HTTP module */ + XML_FROM_XINCLUDE, /* The XInclude processing */ + XML_FROM_XPATH, /* The XPath module */ + XML_FROM_XPOINTER, /* The XPointer module */ + XML_FROM_REGEXP, /* The regular expressions module */ + XML_FROM_DATATYPE, /* The W3C XML Schemas Datatype module */ + XML_FROM_SCHEMASP, /* The W3C XML Schemas parser module */ + XML_FROM_SCHEMASV, /* The W3C XML Schemas validation module */ + XML_FROM_RELAXNGP, /* The Relax-NG parser module */ + XML_FROM_RELAXNGV, /* The Relax-NG validator module */ + XML_FROM_CATALOG, /* The Catalog module */ + XML_FROM_C14N, /* The Canonicalization module */ + XML_FROM_XSLT, /* The XSLT engine from libxslt */ + XML_FROM_VALID, /* The XML DTD validation with valid context */ + XML_FROM_CHECK, /* The error checking module */ + XML_FROM_WRITER, /* The xmlwriter module */ + XML_FROM_MODULE /* The dynamically loaded module module*/ +} xmlErrorDomain; + +/** + * xmlError: + * + * An XML Error instance. + */ + +typedef struct _xmlError xmlError; +typedef xmlError *xmlErrorPtr; +struct _xmlError { + int domain; /* What part of the library raised this error */ + int code; /* The error code, e.g. an xmlParserError */ + char *message;/* human-readable informative error message */ + xmlErrorLevel level;/* how consequent is the error */ + char *file; /* the filename */ + int line; /* the line number if available */ + char *str1; /* extra string information */ + char *str2; /* extra string information */ + char *str3; /* extra string information */ + int int1; /* extra number information */ + int int2; /* column number of the error or 0 if N/A (todo: rename this field when we would break ABI) */ + void *ctxt; /* the parser context if available */ + void *node; /* the node in the tree */ +}; + +/** + * xmlParserError: + * + * This is an error that the XML (or HTML) parser can generate + */ +typedef enum { + XML_ERR_OK = 0, + XML_ERR_INTERNAL_ERROR, /* 1 */ + XML_ERR_NO_MEMORY, /* 2 */ + XML_ERR_DOCUMENT_START, /* 3 */ + XML_ERR_DOCUMENT_EMPTY, /* 4 */ + XML_ERR_DOCUMENT_END, /* 5 */ + XML_ERR_INVALID_HEX_CHARREF, /* 6 */ + XML_ERR_INVALID_DEC_CHARREF, /* 7 */ + XML_ERR_INVALID_CHARREF, /* 8 */ + XML_ERR_INVALID_CHAR, /* 9 */ + XML_ERR_CHARREF_AT_EOF, /* 10 */ + XML_ERR_CHARREF_IN_PROLOG, /* 11 */ + XML_ERR_CHARREF_IN_EPILOG, /* 12 */ + XML_ERR_CHARREF_IN_DTD, /* 13 */ + XML_ERR_ENTITYREF_AT_EOF, /* 14 */ + XML_ERR_ENTITYREF_IN_PROLOG, /* 15 */ + XML_ERR_ENTITYREF_IN_EPILOG, /* 16 */ + XML_ERR_ENTITYREF_IN_DTD, /* 17 */ + XML_ERR_PEREF_AT_EOF, /* 18 */ + XML_ERR_PEREF_IN_PROLOG, /* 19 */ + XML_ERR_PEREF_IN_EPILOG, /* 20 */ + XML_ERR_PEREF_IN_INT_SUBSET, /* 21 */ + XML_ERR_ENTITYREF_NO_NAME, /* 22 */ + XML_ERR_ENTITYREF_SEMICOL_MISSING, /* 23 */ + XML_ERR_PEREF_NO_NAME, /* 24 */ + XML_ERR_PEREF_SEMICOL_MISSING, /* 25 */ + XML_ERR_UNDECLARED_ENTITY, /* 26 */ + XML_WAR_UNDECLARED_ENTITY, /* 27 */ + XML_ERR_UNPARSED_ENTITY, /* 28 */ + XML_ERR_ENTITY_IS_EXTERNAL, /* 29 */ + XML_ERR_ENTITY_IS_PARAMETER, /* 30 */ + XML_ERR_UNKNOWN_ENCODING, /* 31 */ + XML_ERR_UNSUPPORTED_ENCODING, /* 32 */ + XML_ERR_STRING_NOT_STARTED, /* 33 */ + XML_ERR_STRING_NOT_CLOSED, /* 34 */ + XML_ERR_NS_DECL_ERROR, /* 35 */ + XML_ERR_ENTITY_NOT_STARTED, /* 36 */ + XML_ERR_ENTITY_NOT_FINISHED, /* 37 */ + XML_ERR_LT_IN_ATTRIBUTE, /* 38 */ + XML_ERR_ATTRIBUTE_NOT_STARTED, /* 39 */ + XML_ERR_ATTRIBUTE_NOT_FINISHED, /* 40 */ + XML_ERR_ATTRIBUTE_WITHOUT_VALUE, /* 41 */ + XML_ERR_ATTRIBUTE_REDEFINED, /* 42 */ + XML_ERR_LITERAL_NOT_STARTED, /* 43 */ + XML_ERR_LITERAL_NOT_FINISHED, /* 44 */ + XML_ERR_COMMENT_NOT_FINISHED, /* 45 */ + XML_ERR_PI_NOT_STARTED, /* 46 */ + XML_ERR_PI_NOT_FINISHED, /* 47 */ + XML_ERR_NOTATION_NOT_STARTED, /* 48 */ + XML_ERR_NOTATION_NOT_FINISHED, /* 49 */ + XML_ERR_ATTLIST_NOT_STARTED, /* 50 */ + XML_ERR_ATTLIST_NOT_FINISHED, /* 51 */ + XML_ERR_MIXED_NOT_STARTED, /* 52 */ + XML_ERR_MIXED_NOT_FINISHED, /* 53 */ + XML_ERR_ELEMCONTENT_NOT_STARTED, /* 54 */ + XML_ERR_ELEMCONTENT_NOT_FINISHED, /* 55 */ + XML_ERR_XMLDECL_NOT_STARTED, /* 56 */ + XML_ERR_XMLDECL_NOT_FINISHED, /* 57 */ + XML_ERR_CONDSEC_NOT_STARTED, /* 58 */ + XML_ERR_CONDSEC_NOT_FINISHED, /* 59 */ + XML_ERR_EXT_SUBSET_NOT_FINISHED, /* 60 */ + XML_ERR_DOCTYPE_NOT_FINISHED, /* 61 */ + XML_ERR_MISPLACED_CDATA_END, /* 62 */ + XML_ERR_CDATA_NOT_FINISHED, /* 63 */ + XML_ERR_RESERVED_XML_NAME, /* 64 */ + XML_ERR_SPACE_REQUIRED, /* 65 */ + XML_ERR_SEPARATOR_REQUIRED, /* 66 */ + XML_ERR_NMTOKEN_REQUIRED, /* 67 */ + XML_ERR_NAME_REQUIRED, /* 68 */ + XML_ERR_PCDATA_REQUIRED, /* 69 */ + XML_ERR_URI_REQUIRED, /* 70 */ + XML_ERR_PUBID_REQUIRED, /* 71 */ + XML_ERR_LT_REQUIRED, /* 72 */ + XML_ERR_GT_REQUIRED, /* 73 */ + XML_ERR_LTSLASH_REQUIRED, /* 74 */ + XML_ERR_EQUAL_REQUIRED, /* 75 */ + XML_ERR_TAG_NAME_MISMATCH, /* 76 */ + XML_ERR_TAG_NOT_FINISHED, /* 77 */ + XML_ERR_STANDALONE_VALUE, /* 78 */ + XML_ERR_ENCODING_NAME, /* 79 */ + XML_ERR_HYPHEN_IN_COMMENT, /* 80 */ + XML_ERR_INVALID_ENCODING, /* 81 */ + XML_ERR_EXT_ENTITY_STANDALONE, /* 82 */ + XML_ERR_CONDSEC_INVALID, /* 83 */ + XML_ERR_VALUE_REQUIRED, /* 84 */ + XML_ERR_NOT_WELL_BALANCED, /* 85 */ + XML_ERR_EXTRA_CONTENT, /* 86 */ + XML_ERR_ENTITY_CHAR_ERROR, /* 87 */ + XML_ERR_ENTITY_PE_INTERNAL, /* 88 */ + XML_ERR_ENTITY_LOOP, /* 89 */ + XML_ERR_ENTITY_BOUNDARY, /* 90 */ + XML_ERR_INVALID_URI, /* 91 */ + XML_ERR_URI_FRAGMENT, /* 92 */ + XML_WAR_CATALOG_PI, /* 93 */ + XML_ERR_NO_DTD, /* 94 */ + XML_ERR_CONDSEC_INVALID_KEYWORD, /* 95 */ + XML_ERR_VERSION_MISSING, /* 96 */ + XML_WAR_UNKNOWN_VERSION, /* 97 */ + XML_WAR_LANG_VALUE, /* 98 */ + XML_WAR_NS_URI, /* 99 */ + XML_WAR_NS_URI_RELATIVE, /* 100 */ + XML_ERR_MISSING_ENCODING, /* 101 */ + XML_WAR_SPACE_VALUE, /* 102 */ + XML_ERR_NOT_STANDALONE, /* 103 */ + XML_ERR_ENTITY_PROCESSING, /* 104 */ + XML_ERR_NOTATION_PROCESSING, /* 105 */ + XML_WAR_NS_COLUMN, /* 106 */ + XML_WAR_ENTITY_REDEFINED, /* 107 */ + XML_NS_ERR_XML_NAMESPACE = 200, + XML_NS_ERR_UNDEFINED_NAMESPACE, /* 201 */ + XML_NS_ERR_QNAME, /* 202 */ + XML_NS_ERR_ATTRIBUTE_REDEFINED, /* 203 */ + XML_NS_ERR_EMPTY, /* 204 */ + XML_DTD_ATTRIBUTE_DEFAULT = 500, + XML_DTD_ATTRIBUTE_REDEFINED, /* 501 */ + XML_DTD_ATTRIBUTE_VALUE, /* 502 */ + XML_DTD_CONTENT_ERROR, /* 503 */ + XML_DTD_CONTENT_MODEL, /* 504 */ + XML_DTD_CONTENT_NOT_DETERMINIST, /* 505 */ + XML_DTD_DIFFERENT_PREFIX, /* 506 */ + XML_DTD_ELEM_DEFAULT_NAMESPACE, /* 507 */ + XML_DTD_ELEM_NAMESPACE, /* 508 */ + XML_DTD_ELEM_REDEFINED, /* 509 */ + XML_DTD_EMPTY_NOTATION, /* 510 */ + XML_DTD_ENTITY_TYPE, /* 511 */ + XML_DTD_ID_FIXED, /* 512 */ + XML_DTD_ID_REDEFINED, /* 513 */ + XML_DTD_ID_SUBSET, /* 514 */ + XML_DTD_INVALID_CHILD, /* 515 */ + XML_DTD_INVALID_DEFAULT, /* 516 */ + XML_DTD_LOAD_ERROR, /* 517 */ + XML_DTD_MISSING_ATTRIBUTE, /* 518 */ + XML_DTD_MIXED_CORRUPT, /* 519 */ + XML_DTD_MULTIPLE_ID, /* 520 */ + XML_DTD_NO_DOC, /* 521 */ + XML_DTD_NO_DTD, /* 522 */ + XML_DTD_NO_ELEM_NAME, /* 523 */ + XML_DTD_NO_PREFIX, /* 524 */ + XML_DTD_NO_ROOT, /* 525 */ + XML_DTD_NOTATION_REDEFINED, /* 526 */ + XML_DTD_NOTATION_VALUE, /* 527 */ + XML_DTD_NOT_EMPTY, /* 528 */ + XML_DTD_NOT_PCDATA, /* 529 */ + XML_DTD_NOT_STANDALONE, /* 530 */ + XML_DTD_ROOT_NAME, /* 531 */ + XML_DTD_STANDALONE_WHITE_SPACE, /* 532 */ + XML_DTD_UNKNOWN_ATTRIBUTE, /* 533 */ + XML_DTD_UNKNOWN_ELEM, /* 534 */ + XML_DTD_UNKNOWN_ENTITY, /* 535 */ + XML_DTD_UNKNOWN_ID, /* 536 */ + XML_DTD_UNKNOWN_NOTATION, /* 537 */ + XML_DTD_STANDALONE_DEFAULTED, /* 538 */ + XML_DTD_XMLID_VALUE, /* 539 */ + XML_DTD_XMLID_TYPE, /* 540 */ + XML_HTML_STRUCURE_ERROR = 800, + XML_HTML_UNKNOWN_TAG, /* 801 */ + XML_RNGP_ANYNAME_ATTR_ANCESTOR = 1000, + XML_RNGP_ATTR_CONFLICT, /* 1001 */ + XML_RNGP_ATTRIBUTE_CHILDREN, /* 1002 */ + XML_RNGP_ATTRIBUTE_CONTENT, /* 1003 */ + XML_RNGP_ATTRIBUTE_EMPTY, /* 1004 */ + XML_RNGP_ATTRIBUTE_NOOP, /* 1005 */ + XML_RNGP_CHOICE_CONTENT, /* 1006 */ + XML_RNGP_CHOICE_EMPTY, /* 1007 */ + XML_RNGP_CREATE_FAILURE, /* 1008 */ + XML_RNGP_DATA_CONTENT, /* 1009 */ + XML_RNGP_DEF_CHOICE_AND_INTERLEAVE, /* 1010 */ + XML_RNGP_DEFINE_CREATE_FAILED, /* 1011 */ + XML_RNGP_DEFINE_EMPTY, /* 1012 */ + XML_RNGP_DEFINE_MISSING, /* 1013 */ + XML_RNGP_DEFINE_NAME_MISSING, /* 1014 */ + XML_RNGP_ELEM_CONTENT_EMPTY, /* 1015 */ + XML_RNGP_ELEM_CONTENT_ERROR, /* 1016 */ + XML_RNGP_ELEMENT_EMPTY, /* 1017 */ + XML_RNGP_ELEMENT_CONTENT, /* 1018 */ + XML_RNGP_ELEMENT_NAME, /* 1019 */ + XML_RNGP_ELEMENT_NO_CONTENT, /* 1020 */ + XML_RNGP_ELEM_TEXT_CONFLICT, /* 1021 */ + XML_RNGP_EMPTY, /* 1022 */ + XML_RNGP_EMPTY_CONSTRUCT, /* 1023 */ + XML_RNGP_EMPTY_CONTENT, /* 1024 */ + XML_RNGP_EMPTY_NOT_EMPTY, /* 1025 */ + XML_RNGP_ERROR_TYPE_LIB, /* 1026 */ + XML_RNGP_EXCEPT_EMPTY, /* 1027 */ + XML_RNGP_EXCEPT_MISSING, /* 1028 */ + XML_RNGP_EXCEPT_MULTIPLE, /* 1029 */ + XML_RNGP_EXCEPT_NO_CONTENT, /* 1030 */ + XML_RNGP_EXTERNALREF_EMTPY, /* 1031 */ + XML_RNGP_EXTERNAL_REF_FAILURE, /* 1032 */ + XML_RNGP_EXTERNALREF_RECURSE, /* 1033 */ + XML_RNGP_FORBIDDEN_ATTRIBUTE, /* 1034 */ + XML_RNGP_FOREIGN_ELEMENT, /* 1035 */ + XML_RNGP_GRAMMAR_CONTENT, /* 1036 */ + XML_RNGP_GRAMMAR_EMPTY, /* 1037 */ + XML_RNGP_GRAMMAR_MISSING, /* 1038 */ + XML_RNGP_GRAMMAR_NO_START, /* 1039 */ + XML_RNGP_GROUP_ATTR_CONFLICT, /* 1040 */ + XML_RNGP_HREF_ERROR, /* 1041 */ + XML_RNGP_INCLUDE_EMPTY, /* 1042 */ + XML_RNGP_INCLUDE_FAILURE, /* 1043 */ + XML_RNGP_INCLUDE_RECURSE, /* 1044 */ + XML_RNGP_INTERLEAVE_ADD, /* 1045 */ + XML_RNGP_INTERLEAVE_CREATE_FAILED, /* 1046 */ + XML_RNGP_INTERLEAVE_EMPTY, /* 1047 */ + XML_RNGP_INTERLEAVE_NO_CONTENT, /* 1048 */ + XML_RNGP_INVALID_DEFINE_NAME, /* 1049 */ + XML_RNGP_INVALID_URI, /* 1050 */ + XML_RNGP_INVALID_VALUE, /* 1051 */ + XML_RNGP_MISSING_HREF, /* 1052 */ + XML_RNGP_NAME_MISSING, /* 1053 */ + XML_RNGP_NEED_COMBINE, /* 1054 */ + XML_RNGP_NOTALLOWED_NOT_EMPTY, /* 1055 */ + XML_RNGP_NSNAME_ATTR_ANCESTOR, /* 1056 */ + XML_RNGP_NSNAME_NO_NS, /* 1057 */ + XML_RNGP_PARAM_FORBIDDEN, /* 1058 */ + XML_RNGP_PARAM_NAME_MISSING, /* 1059 */ + XML_RNGP_PARENTREF_CREATE_FAILED, /* 1060 */ + XML_RNGP_PARENTREF_NAME_INVALID, /* 1061 */ + XML_RNGP_PARENTREF_NO_NAME, /* 1062 */ + XML_RNGP_PARENTREF_NO_PARENT, /* 1063 */ + XML_RNGP_PARENTREF_NOT_EMPTY, /* 1064 */ + XML_RNGP_PARSE_ERROR, /* 1065 */ + XML_RNGP_PAT_ANYNAME_EXCEPT_ANYNAME, /* 1066 */ + XML_RNGP_PAT_ATTR_ATTR, /* 1067 */ + XML_RNGP_PAT_ATTR_ELEM, /* 1068 */ + XML_RNGP_PAT_DATA_EXCEPT_ATTR, /* 1069 */ + XML_RNGP_PAT_DATA_EXCEPT_ELEM, /* 1070 */ + XML_RNGP_PAT_DATA_EXCEPT_EMPTY, /* 1071 */ + XML_RNGP_PAT_DATA_EXCEPT_GROUP, /* 1072 */ + XML_RNGP_PAT_DATA_EXCEPT_INTERLEAVE, /* 1073 */ + XML_RNGP_PAT_DATA_EXCEPT_LIST, /* 1074 */ + XML_RNGP_PAT_DATA_EXCEPT_ONEMORE, /* 1075 */ + XML_RNGP_PAT_DATA_EXCEPT_REF, /* 1076 */ + XML_RNGP_PAT_DATA_EXCEPT_TEXT, /* 1077 */ + XML_RNGP_PAT_LIST_ATTR, /* 1078 */ + XML_RNGP_PAT_LIST_ELEM, /* 1079 */ + XML_RNGP_PAT_LIST_INTERLEAVE, /* 1080 */ + XML_RNGP_PAT_LIST_LIST, /* 1081 */ + XML_RNGP_PAT_LIST_REF, /* 1082 */ + XML_RNGP_PAT_LIST_TEXT, /* 1083 */ + XML_RNGP_PAT_NSNAME_EXCEPT_ANYNAME, /* 1084 */ + XML_RNGP_PAT_NSNAME_EXCEPT_NSNAME, /* 1085 */ + XML_RNGP_PAT_ONEMORE_GROUP_ATTR, /* 1086 */ + XML_RNGP_PAT_ONEMORE_INTERLEAVE_ATTR, /* 1087 */ + XML_RNGP_PAT_START_ATTR, /* 1088 */ + XML_RNGP_PAT_START_DATA, /* 1089 */ + XML_RNGP_PAT_START_EMPTY, /* 1090 */ + XML_RNGP_PAT_START_GROUP, /* 1091 */ + XML_RNGP_PAT_START_INTERLEAVE, /* 1092 */ + XML_RNGP_PAT_START_LIST, /* 1093 */ + XML_RNGP_PAT_START_ONEMORE, /* 1094 */ + XML_RNGP_PAT_START_TEXT, /* 1095 */ + XML_RNGP_PAT_START_VALUE, /* 1096 */ + XML_RNGP_PREFIX_UNDEFINED, /* 1097 */ + XML_RNGP_REF_CREATE_FAILED, /* 1098 */ + XML_RNGP_REF_CYCLE, /* 1099 */ + XML_RNGP_REF_NAME_INVALID, /* 1100 */ + XML_RNGP_REF_NO_DEF, /* 1101 */ + XML_RNGP_REF_NO_NAME, /* 1102 */ + XML_RNGP_REF_NOT_EMPTY, /* 1103 */ + XML_RNGP_START_CHOICE_AND_INTERLEAVE, /* 1104 */ + XML_RNGP_START_CONTENT, /* 1105 */ + XML_RNGP_START_EMPTY, /* 1106 */ + XML_RNGP_START_MISSING, /* 1107 */ + XML_RNGP_TEXT_EXPECTED, /* 1108 */ + XML_RNGP_TEXT_HAS_CHILD, /* 1109 */ + XML_RNGP_TYPE_MISSING, /* 1110 */ + XML_RNGP_TYPE_NOT_FOUND, /* 1111 */ + XML_RNGP_TYPE_VALUE, /* 1112 */ + XML_RNGP_UNKNOWN_ATTRIBUTE, /* 1113 */ + XML_RNGP_UNKNOWN_COMBINE, /* 1114 */ + XML_RNGP_UNKNOWN_CONSTRUCT, /* 1115 */ + XML_RNGP_UNKNOWN_TYPE_LIB, /* 1116 */ + XML_RNGP_URI_FRAGMENT, /* 1117 */ + XML_RNGP_URI_NOT_ABSOLUTE, /* 1118 */ + XML_RNGP_VALUE_EMPTY, /* 1119 */ + XML_RNGP_VALUE_NO_CONTENT, /* 1120 */ + XML_RNGP_XMLNS_NAME, /* 1121 */ + XML_RNGP_XML_NS, /* 1122 */ + XML_XPATH_EXPRESSION_OK = 1200, + XML_XPATH_NUMBER_ERROR, /* 1201 */ + XML_XPATH_UNFINISHED_LITERAL_ERROR, /* 1202 */ + XML_XPATH_START_LITERAL_ERROR, /* 1203 */ + XML_XPATH_VARIABLE_REF_ERROR, /* 1204 */ + XML_XPATH_UNDEF_VARIABLE_ERROR, /* 1205 */ + XML_XPATH_INVALID_PREDICATE_ERROR, /* 1206 */ + XML_XPATH_EXPR_ERROR, /* 1207 */ + XML_XPATH_UNCLOSED_ERROR, /* 1208 */ + XML_XPATH_UNKNOWN_FUNC_ERROR, /* 1209 */ + XML_XPATH_INVALID_OPERAND, /* 1210 */ + XML_XPATH_INVALID_TYPE, /* 1211 */ + XML_XPATH_INVALID_ARITY, /* 1212 */ + XML_XPATH_INVALID_CTXT_SIZE, /* 1213 */ + XML_XPATH_INVALID_CTXT_POSITION, /* 1214 */ + XML_XPATH_MEMORY_ERROR, /* 1215 */ + XML_XPTR_SYNTAX_ERROR, /* 1216 */ + XML_XPTR_RESOURCE_ERROR, /* 1217 */ + XML_XPTR_SUB_RESOURCE_ERROR, /* 1218 */ + XML_XPATH_UNDEF_PREFIX_ERROR, /* 1219 */ + XML_XPATH_ENCODING_ERROR, /* 1220 */ + XML_XPATH_INVALID_CHAR_ERROR, /* 1221 */ + XML_TREE_INVALID_HEX = 1300, + XML_TREE_INVALID_DEC, /* 1301 */ + XML_TREE_UNTERMINATED_ENTITY, /* 1302 */ + XML_SAVE_NOT_UTF8 = 1400, + XML_SAVE_CHAR_INVALID, /* 1401 */ + XML_SAVE_NO_DOCTYPE, /* 1402 */ + XML_SAVE_UNKNOWN_ENCODING, /* 1403 */ + XML_REGEXP_COMPILE_ERROR = 1450, + XML_IO_UNKNOWN = 1500, + XML_IO_EACCES, /* 1501 */ + XML_IO_EAGAIN, /* 1502 */ + XML_IO_EBADF, /* 1503 */ + XML_IO_EBADMSG, /* 1504 */ + XML_IO_EBUSY, /* 1505 */ + XML_IO_ECANCELED, /* 1506 */ + XML_IO_ECHILD, /* 1507 */ + XML_IO_EDEADLK, /* 1508 */ + XML_IO_EDOM, /* 1509 */ + XML_IO_EEXIST, /* 1510 */ + XML_IO_EFAULT, /* 1511 */ + XML_IO_EFBIG, /* 1512 */ + XML_IO_EINPROGRESS, /* 1513 */ + XML_IO_EINTR, /* 1514 */ + XML_IO_EINVAL, /* 1515 */ + XML_IO_EIO, /* 1516 */ + XML_IO_EISDIR, /* 1517 */ + XML_IO_EMFILE, /* 1518 */ + XML_IO_EMLINK, /* 1519 */ + XML_IO_EMSGSIZE, /* 1520 */ + XML_IO_ENAMETOOLONG, /* 1521 */ + XML_IO_ENFILE, /* 1522 */ + XML_IO_ENODEV, /* 1523 */ + XML_IO_ENOENT, /* 1524 */ + XML_IO_ENOEXEC, /* 1525 */ + XML_IO_ENOLCK, /* 1526 */ + XML_IO_ENOMEM, /* 1527 */ + XML_IO_ENOSPC, /* 1528 */ + XML_IO_ENOSYS, /* 1529 */ + XML_IO_ENOTDIR, /* 1530 */ + XML_IO_ENOTEMPTY, /* 1531 */ + XML_IO_ENOTSUP, /* 1532 */ + XML_IO_ENOTTY, /* 1533 */ + XML_IO_ENXIO, /* 1534 */ + XML_IO_EPERM, /* 1535 */ + XML_IO_EPIPE, /* 1536 */ + XML_IO_ERANGE, /* 1537 */ + XML_IO_EROFS, /* 1538 */ + XML_IO_ESPIPE, /* 1539 */ + XML_IO_ESRCH, /* 1540 */ + XML_IO_ETIMEDOUT, /* 1541 */ + XML_IO_EXDEV, /* 1542 */ + XML_IO_NETWORK_ATTEMPT, /* 1543 */ + XML_IO_ENCODER, /* 1544 */ + XML_IO_FLUSH, /* 1545 */ + XML_IO_WRITE, /* 1546 */ + XML_IO_NO_INPUT, /* 1547 */ + XML_IO_BUFFER_FULL, /* 1548 */ + XML_IO_LOAD_ERROR, /* 1549 */ + XML_IO_ENOTSOCK, /* 1550 */ + XML_IO_EISCONN, /* 1551 */ + XML_IO_ECONNREFUSED, /* 1552 */ + XML_IO_ENETUNREACH, /* 1553 */ + XML_IO_EADDRINUSE, /* 1554 */ + XML_IO_EALREADY, /* 1555 */ + XML_IO_EAFNOSUPPORT, /* 1556 */ + XML_XINCLUDE_RECURSION=1600, + XML_XINCLUDE_PARSE_VALUE, /* 1601 */ + XML_XINCLUDE_ENTITY_DEF_MISMATCH, /* 1602 */ + XML_XINCLUDE_NO_HREF, /* 1603 */ + XML_XINCLUDE_NO_FALLBACK, /* 1604 */ + XML_XINCLUDE_HREF_URI, /* 1605 */ + XML_XINCLUDE_TEXT_FRAGMENT, /* 1606 */ + XML_XINCLUDE_TEXT_DOCUMENT, /* 1607 */ + XML_XINCLUDE_INVALID_CHAR, /* 1608 */ + XML_XINCLUDE_BUILD_FAILED, /* 1609 */ + XML_XINCLUDE_UNKNOWN_ENCODING, /* 1610 */ + XML_XINCLUDE_MULTIPLE_ROOT, /* 1611 */ + XML_XINCLUDE_XPTR_FAILED, /* 1612 */ + XML_XINCLUDE_XPTR_RESULT, /* 1613 */ + XML_XINCLUDE_INCLUDE_IN_INCLUDE, /* 1614 */ + XML_XINCLUDE_FALLBACKS_IN_INCLUDE, /* 1615 */ + XML_XINCLUDE_FALLBACK_NOT_IN_INCLUDE, /* 1616 */ + XML_XINCLUDE_DEPRECATED_NS, /* 1617 */ + XML_XINCLUDE_FRAGMENT_ID, /* 1618 */ + XML_CATALOG_MISSING_ATTR = 1650, + XML_CATALOG_ENTRY_BROKEN, /* 1651 */ + XML_CATALOG_PREFER_VALUE, /* 1652 */ + XML_CATALOG_NOT_CATALOG, /* 1653 */ + XML_CATALOG_RECURSION, /* 1654 */ + XML_SCHEMAP_PREFIX_UNDEFINED = 1700, + XML_SCHEMAP_ATTRFORMDEFAULT_VALUE, /* 1701 */ + XML_SCHEMAP_ATTRGRP_NONAME_NOREF, /* 1702 */ + XML_SCHEMAP_ATTR_NONAME_NOREF, /* 1703 */ + XML_SCHEMAP_COMPLEXTYPE_NONAME_NOREF, /* 1704 */ + XML_SCHEMAP_ELEMFORMDEFAULT_VALUE, /* 1705 */ + XML_SCHEMAP_ELEM_NONAME_NOREF, /* 1706 */ + XML_SCHEMAP_EXTENSION_NO_BASE, /* 1707 */ + XML_SCHEMAP_FACET_NO_VALUE, /* 1708 */ + XML_SCHEMAP_FAILED_BUILD_IMPORT, /* 1709 */ + XML_SCHEMAP_GROUP_NONAME_NOREF, /* 1710 */ + XML_SCHEMAP_IMPORT_NAMESPACE_NOT_URI, /* 1711 */ + XML_SCHEMAP_IMPORT_REDEFINE_NSNAME, /* 1712 */ + XML_SCHEMAP_IMPORT_SCHEMA_NOT_URI, /* 1713 */ + XML_SCHEMAP_INVALID_BOOLEAN, /* 1714 */ + XML_SCHEMAP_INVALID_ENUM, /* 1715 */ + XML_SCHEMAP_INVALID_FACET, /* 1716 */ + XML_SCHEMAP_INVALID_FACET_VALUE, /* 1717 */ + XML_SCHEMAP_INVALID_MAXOCCURS, /* 1718 */ + XML_SCHEMAP_INVALID_MINOCCURS, /* 1719 */ + XML_SCHEMAP_INVALID_REF_AND_SUBTYPE, /* 1720 */ + XML_SCHEMAP_INVALID_WHITE_SPACE, /* 1721 */ + XML_SCHEMAP_NOATTR_NOREF, /* 1722 */ + XML_SCHEMAP_NOTATION_NO_NAME, /* 1723 */ + XML_SCHEMAP_NOTYPE_NOREF, /* 1724 */ + XML_SCHEMAP_REF_AND_SUBTYPE, /* 1725 */ + XML_SCHEMAP_RESTRICTION_NONAME_NOREF, /* 1726 */ + XML_SCHEMAP_SIMPLETYPE_NONAME, /* 1727 */ + XML_SCHEMAP_TYPE_AND_SUBTYPE, /* 1728 */ + XML_SCHEMAP_UNKNOWN_ALL_CHILD, /* 1729 */ + XML_SCHEMAP_UNKNOWN_ANYATTRIBUTE_CHILD, /* 1730 */ + XML_SCHEMAP_UNKNOWN_ATTR_CHILD, /* 1731 */ + XML_SCHEMAP_UNKNOWN_ATTRGRP_CHILD, /* 1732 */ + XML_SCHEMAP_UNKNOWN_ATTRIBUTE_GROUP, /* 1733 */ + XML_SCHEMAP_UNKNOWN_BASE_TYPE, /* 1734 */ + XML_SCHEMAP_UNKNOWN_CHOICE_CHILD, /* 1735 */ + XML_SCHEMAP_UNKNOWN_COMPLEXCONTENT_CHILD, /* 1736 */ + XML_SCHEMAP_UNKNOWN_COMPLEXTYPE_CHILD, /* 1737 */ + XML_SCHEMAP_UNKNOWN_ELEM_CHILD, /* 1738 */ + XML_SCHEMAP_UNKNOWN_EXTENSION_CHILD, /* 1739 */ + XML_SCHEMAP_UNKNOWN_FACET_CHILD, /* 1740 */ + XML_SCHEMAP_UNKNOWN_FACET_TYPE, /* 1741 */ + XML_SCHEMAP_UNKNOWN_GROUP_CHILD, /* 1742 */ + XML_SCHEMAP_UNKNOWN_IMPORT_CHILD, /* 1743 */ + XML_SCHEMAP_UNKNOWN_LIST_CHILD, /* 1744 */ + XML_SCHEMAP_UNKNOWN_NOTATION_CHILD, /* 1745 */ + XML_SCHEMAP_UNKNOWN_PROCESSCONTENT_CHILD, /* 1746 */ + XML_SCHEMAP_UNKNOWN_REF, /* 1747 */ + XML_SCHEMAP_UNKNOWN_RESTRICTION_CHILD, /* 1748 */ + XML_SCHEMAP_UNKNOWN_SCHEMAS_CHILD, /* 1749 */ + XML_SCHEMAP_UNKNOWN_SEQUENCE_CHILD, /* 1750 */ + XML_SCHEMAP_UNKNOWN_SIMPLECONTENT_CHILD, /* 1751 */ + XML_SCHEMAP_UNKNOWN_SIMPLETYPE_CHILD, /* 1752 */ + XML_SCHEMAP_UNKNOWN_TYPE, /* 1753 */ + XML_SCHEMAP_UNKNOWN_UNION_CHILD, /* 1754 */ + XML_SCHEMAP_ELEM_DEFAULT_FIXED, /* 1755 */ + XML_SCHEMAP_REGEXP_INVALID, /* 1756 */ + XML_SCHEMAP_FAILED_LOAD, /* 1757 */ + XML_SCHEMAP_NOTHING_TO_PARSE, /* 1758 */ + XML_SCHEMAP_NOROOT, /* 1759 */ + XML_SCHEMAP_REDEFINED_GROUP, /* 1760 */ + XML_SCHEMAP_REDEFINED_TYPE, /* 1761 */ + XML_SCHEMAP_REDEFINED_ELEMENT, /* 1762 */ + XML_SCHEMAP_REDEFINED_ATTRGROUP, /* 1763 */ + XML_SCHEMAP_REDEFINED_ATTR, /* 1764 */ + XML_SCHEMAP_REDEFINED_NOTATION, /* 1765 */ + XML_SCHEMAP_FAILED_PARSE, /* 1766 */ + XML_SCHEMAP_UNKNOWN_PREFIX, /* 1767 */ + XML_SCHEMAP_DEF_AND_PREFIX, /* 1768 */ + XML_SCHEMAP_UNKNOWN_INCLUDE_CHILD, /* 1769 */ + XML_SCHEMAP_INCLUDE_SCHEMA_NOT_URI, /* 1770 */ + XML_SCHEMAP_INCLUDE_SCHEMA_NO_URI, /* 1771 */ + XML_SCHEMAP_NOT_SCHEMA, /* 1772 */ + XML_SCHEMAP_UNKNOWN_MEMBER_TYPE, /* 1773 */ + XML_SCHEMAP_INVALID_ATTR_USE, /* 1774 */ + XML_SCHEMAP_RECURSIVE, /* 1775 */ + XML_SCHEMAP_SUPERNUMEROUS_LIST_ITEM_TYPE, /* 1776 */ + XML_SCHEMAP_INVALID_ATTR_COMBINATION, /* 1777 */ + XML_SCHEMAP_INVALID_ATTR_INLINE_COMBINATION, /* 1778 */ + XML_SCHEMAP_MISSING_SIMPLETYPE_CHILD, /* 1779 */ + XML_SCHEMAP_INVALID_ATTR_NAME, /* 1780 */ + XML_SCHEMAP_REF_AND_CONTENT, /* 1781 */ + XML_SCHEMAP_CT_PROPS_CORRECT_1, /* 1782 */ + XML_SCHEMAP_CT_PROPS_CORRECT_2, /* 1783 */ + XML_SCHEMAP_CT_PROPS_CORRECT_3, /* 1784 */ + XML_SCHEMAP_CT_PROPS_CORRECT_4, /* 1785 */ + XML_SCHEMAP_CT_PROPS_CORRECT_5, /* 1786 */ + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_1, /* 1787 */ + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_1, /* 1788 */ + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_2, /* 1789 */ + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_2, /* 1790 */ + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_3, /* 1791 */ + XML_SCHEMAP_WILDCARD_INVALID_NS_MEMBER, /* 1792 */ + XML_SCHEMAP_INTERSECTION_NOT_EXPRESSIBLE, /* 1793 */ + XML_SCHEMAP_UNION_NOT_EXPRESSIBLE, /* 1794 */ + XML_SCHEMAP_SRC_IMPORT_3_1, /* 1795 */ + XML_SCHEMAP_SRC_IMPORT_3_2, /* 1796 */ + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_1, /* 1797 */ + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_2, /* 1798 */ + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_3, /* 1799 */ + XML_SCHEMAP_COS_CT_EXTENDS_1_3, /* 1800 */ + XML_SCHEMAV_NOROOT = 1801, + XML_SCHEMAV_UNDECLAREDELEM, /* 1802 */ + XML_SCHEMAV_NOTTOPLEVEL, /* 1803 */ + XML_SCHEMAV_MISSING, /* 1804 */ + XML_SCHEMAV_WRONGELEM, /* 1805 */ + XML_SCHEMAV_NOTYPE, /* 1806 */ + XML_SCHEMAV_NOROLLBACK, /* 1807 */ + XML_SCHEMAV_ISABSTRACT, /* 1808 */ + XML_SCHEMAV_NOTEMPTY, /* 1809 */ + XML_SCHEMAV_ELEMCONT, /* 1810 */ + XML_SCHEMAV_HAVEDEFAULT, /* 1811 */ + XML_SCHEMAV_NOTNILLABLE, /* 1812 */ + XML_SCHEMAV_EXTRACONTENT, /* 1813 */ + XML_SCHEMAV_INVALIDATTR, /* 1814 */ + XML_SCHEMAV_INVALIDELEM, /* 1815 */ + XML_SCHEMAV_NOTDETERMINIST, /* 1816 */ + XML_SCHEMAV_CONSTRUCT, /* 1817 */ + XML_SCHEMAV_INTERNAL, /* 1818 */ + XML_SCHEMAV_NOTSIMPLE, /* 1819 */ + XML_SCHEMAV_ATTRUNKNOWN, /* 1820 */ + XML_SCHEMAV_ATTRINVALID, /* 1821 */ + XML_SCHEMAV_VALUE, /* 1822 */ + XML_SCHEMAV_FACET, /* 1823 */ + XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1, /* 1824 */ + XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2, /* 1825 */ + XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_3, /* 1826 */ + XML_SCHEMAV_CVC_TYPE_3_1_1, /* 1827 */ + XML_SCHEMAV_CVC_TYPE_3_1_2, /* 1828 */ + XML_SCHEMAV_CVC_FACET_VALID, /* 1829 */ + XML_SCHEMAV_CVC_LENGTH_VALID, /* 1830 */ + XML_SCHEMAV_CVC_MINLENGTH_VALID, /* 1831 */ + XML_SCHEMAV_CVC_MAXLENGTH_VALID, /* 1832 */ + XML_SCHEMAV_CVC_MININCLUSIVE_VALID, /* 1833 */ + XML_SCHEMAV_CVC_MAXINCLUSIVE_VALID, /* 1834 */ + XML_SCHEMAV_CVC_MINEXCLUSIVE_VALID, /* 1835 */ + XML_SCHEMAV_CVC_MAXEXCLUSIVE_VALID, /* 1836 */ + XML_SCHEMAV_CVC_TOTALDIGITS_VALID, /* 1837 */ + XML_SCHEMAV_CVC_FRACTIONDIGITS_VALID, /* 1838 */ + XML_SCHEMAV_CVC_PATTERN_VALID, /* 1839 */ + XML_SCHEMAV_CVC_ENUMERATION_VALID, /* 1840 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_2_1, /* 1841 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_2_2, /* 1842 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_2_3, /* 1843 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_2_4, /* 1844 */ + XML_SCHEMAV_CVC_ELT_1, /* 1845 */ + XML_SCHEMAV_CVC_ELT_2, /* 1846 */ + XML_SCHEMAV_CVC_ELT_3_1, /* 1847 */ + XML_SCHEMAV_CVC_ELT_3_2_1, /* 1848 */ + XML_SCHEMAV_CVC_ELT_3_2_2, /* 1849 */ + XML_SCHEMAV_CVC_ELT_4_1, /* 1850 */ + XML_SCHEMAV_CVC_ELT_4_2, /* 1851 */ + XML_SCHEMAV_CVC_ELT_4_3, /* 1852 */ + XML_SCHEMAV_CVC_ELT_5_1_1, /* 1853 */ + XML_SCHEMAV_CVC_ELT_5_1_2, /* 1854 */ + XML_SCHEMAV_CVC_ELT_5_2_1, /* 1855 */ + XML_SCHEMAV_CVC_ELT_5_2_2_1, /* 1856 */ + XML_SCHEMAV_CVC_ELT_5_2_2_2_1, /* 1857 */ + XML_SCHEMAV_CVC_ELT_5_2_2_2_2, /* 1858 */ + XML_SCHEMAV_CVC_ELT_6, /* 1859 */ + XML_SCHEMAV_CVC_ELT_7, /* 1860 */ + XML_SCHEMAV_CVC_ATTRIBUTE_1, /* 1861 */ + XML_SCHEMAV_CVC_ATTRIBUTE_2, /* 1862 */ + XML_SCHEMAV_CVC_ATTRIBUTE_3, /* 1863 */ + XML_SCHEMAV_CVC_ATTRIBUTE_4, /* 1864 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_3_1, /* 1865 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_1, /* 1866 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_2, /* 1867 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_4, /* 1868 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_5_1, /* 1869 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_5_2, /* 1870 */ + XML_SCHEMAV_ELEMENT_CONTENT, /* 1871 */ + XML_SCHEMAV_DOCUMENT_ELEMENT_MISSING, /* 1872 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_1, /* 1873 */ + XML_SCHEMAV_CVC_AU, /* 1874 */ + XML_SCHEMAV_CVC_TYPE_1, /* 1875 */ + XML_SCHEMAV_CVC_TYPE_2, /* 1876 */ + XML_SCHEMAV_CVC_IDC, /* 1877 */ + XML_SCHEMAV_CVC_WILDCARD, /* 1878 */ + XML_XPTR_UNKNOWN_SCHEME = 1900, + XML_XPTR_CHILDSEQ_START, /* 1901 */ + XML_XPTR_EVAL_FAILED, /* 1902 */ + XML_XPTR_EXTRA_OBJECTS, /* 1903 */ + XML_C14N_CREATE_CTXT = 1950, + XML_C14N_REQUIRES_UTF8, /* 1951 */ + XML_C14N_CREATE_STACK, /* 1952 */ + XML_C14N_INVALID_NODE, /* 1953 */ + XML_C14N_UNKNOW_NODE, /* 1954 */ + XML_C14N_RELATIVE_NAMESPACE, /* 1955 */ + XML_FTP_PASV_ANSWER = 2000, + XML_FTP_EPSV_ANSWER, /* 2001 */ + XML_FTP_ACCNT, /* 2002 */ + XML_FTP_URL_SYNTAX, /* 2003 */ + XML_HTTP_URL_SYNTAX = 2020, + XML_HTTP_USE_IP, /* 2021 */ + XML_HTTP_UNKNOWN_HOST, /* 2022 */ + XML_SCHEMAP_SRC_SIMPLE_TYPE_1 = 3000, + XML_SCHEMAP_SRC_SIMPLE_TYPE_2, /* 3001 */ + XML_SCHEMAP_SRC_SIMPLE_TYPE_3, /* 3002 */ + XML_SCHEMAP_SRC_SIMPLE_TYPE_4, /* 3003 */ + XML_SCHEMAP_SRC_RESOLVE, /* 3004 */ + XML_SCHEMAP_SRC_RESTRICTION_BASE_OR_SIMPLETYPE, /* 3005 */ + XML_SCHEMAP_SRC_LIST_ITEMTYPE_OR_SIMPLETYPE, /* 3006 */ + XML_SCHEMAP_SRC_UNION_MEMBERTYPES_OR_SIMPLETYPES, /* 3007 */ + XML_SCHEMAP_ST_PROPS_CORRECT_1, /* 3008 */ + XML_SCHEMAP_ST_PROPS_CORRECT_2, /* 3009 */ + XML_SCHEMAP_ST_PROPS_CORRECT_3, /* 3010 */ + XML_SCHEMAP_COS_ST_RESTRICTS_1_1, /* 3011 */ + XML_SCHEMAP_COS_ST_RESTRICTS_1_2, /* 3012 */ + XML_SCHEMAP_COS_ST_RESTRICTS_1_3_1, /* 3013 */ + XML_SCHEMAP_COS_ST_RESTRICTS_1_3_2, /* 3014 */ + XML_SCHEMAP_COS_ST_RESTRICTS_2_1, /* 3015 */ + XML_SCHEMAP_COS_ST_RESTRICTS_2_3_1_1, /* 3016 */ + XML_SCHEMAP_COS_ST_RESTRICTS_2_3_1_2, /* 3017 */ + XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_1, /* 3018 */ + XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_2, /* 3019 */ + XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_3, /* 3020 */ + XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_4, /* 3021 */ + XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_5, /* 3022 */ + XML_SCHEMAP_COS_ST_RESTRICTS_3_1, /* 3023 */ + XML_SCHEMAP_COS_ST_RESTRICTS_3_3_1, /* 3024 */ + XML_SCHEMAP_COS_ST_RESTRICTS_3_3_1_2, /* 3025 */ + XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_2, /* 3026 */ + XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_1, /* 3027 */ + XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_3, /* 3028 */ + XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_4, /* 3029 */ + XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_5, /* 3030 */ + XML_SCHEMAP_COS_ST_DERIVED_OK_2_1, /* 3031 */ + XML_SCHEMAP_COS_ST_DERIVED_OK_2_2, /* 3032 */ + XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, /* 3033 */ + XML_SCHEMAP_S4S_ELEM_MISSING, /* 3034 */ + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, /* 3035 */ + XML_SCHEMAP_S4S_ATTR_MISSING, /* 3036 */ + XML_SCHEMAP_S4S_ATTR_INVALID_VALUE, /* 3037 */ + XML_SCHEMAP_SRC_ELEMENT_1, /* 3038 */ + XML_SCHEMAP_SRC_ELEMENT_2_1, /* 3039 */ + XML_SCHEMAP_SRC_ELEMENT_2_2, /* 3040 */ + XML_SCHEMAP_SRC_ELEMENT_3, /* 3041 */ + XML_SCHEMAP_P_PROPS_CORRECT_1, /* 3042 */ + XML_SCHEMAP_P_PROPS_CORRECT_2_1, /* 3043 */ + XML_SCHEMAP_P_PROPS_CORRECT_2_2, /* 3044 */ + XML_SCHEMAP_E_PROPS_CORRECT_2, /* 3045 */ + XML_SCHEMAP_E_PROPS_CORRECT_3, /* 3046 */ + XML_SCHEMAP_E_PROPS_CORRECT_4, /* 3047 */ + XML_SCHEMAP_E_PROPS_CORRECT_5, /* 3048 */ + XML_SCHEMAP_E_PROPS_CORRECT_6, /* 3049 */ + XML_SCHEMAP_SRC_INCLUDE, /* 3050 */ + XML_SCHEMAP_SRC_ATTRIBUTE_1, /* 3051 */ + XML_SCHEMAP_SRC_ATTRIBUTE_2, /* 3052 */ + XML_SCHEMAP_SRC_ATTRIBUTE_3_1, /* 3053 */ + XML_SCHEMAP_SRC_ATTRIBUTE_3_2, /* 3054 */ + XML_SCHEMAP_SRC_ATTRIBUTE_4, /* 3055 */ + XML_SCHEMAP_NO_XMLNS, /* 3056 */ + XML_SCHEMAP_NO_XSI, /* 3057 */ + XML_SCHEMAP_COS_VALID_DEFAULT_1, /* 3058 */ + XML_SCHEMAP_COS_VALID_DEFAULT_2_1, /* 3059 */ + XML_SCHEMAP_COS_VALID_DEFAULT_2_2_1, /* 3060 */ + XML_SCHEMAP_COS_VALID_DEFAULT_2_2_2, /* 3061 */ + XML_SCHEMAP_CVC_SIMPLE_TYPE, /* 3062 */ + XML_SCHEMAP_COS_CT_EXTENDS_1_1, /* 3063 */ + XML_SCHEMAP_SRC_IMPORT_1_1, /* 3064 */ + XML_SCHEMAP_SRC_IMPORT_1_2, /* 3065 */ + XML_SCHEMAP_SRC_IMPORT_2, /* 3066 */ + XML_SCHEMAP_SRC_IMPORT_2_1, /* 3067 */ + XML_SCHEMAP_SRC_IMPORT_2_2, /* 3068 */ + XML_SCHEMAP_INTERNAL, /* 3069 non-W3C */ + XML_SCHEMAP_NOT_DETERMINISTIC, /* 3070 non-W3C */ + XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_1, /* 3071 */ + XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_2, /* 3072 */ + XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_3, /* 3073 */ + XML_SCHEMAP_MG_PROPS_CORRECT_1, /* 3074 */ + XML_SCHEMAP_MG_PROPS_CORRECT_2, /* 3075 */ + XML_SCHEMAP_SRC_CT_1, /* 3076 */ + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_3, /* 3077 */ + XML_SCHEMAP_AU_PROPS_CORRECT_2, /* 3078 */ + XML_SCHEMAP_A_PROPS_CORRECT_2, /* 3079 */ + XML_SCHEMAP_C_PROPS_CORRECT, /* 3080 */ + XML_MODULE_OPEN = 4900, /* 4900 */ + XML_MODULE_CLOSE, /* 4901 */ + XML_CHECK_FOUND_ELEMENT = 5000, + XML_CHECK_FOUND_ATTRIBUTE, /* 5001 */ + XML_CHECK_FOUND_TEXT, /* 5002 */ + XML_CHECK_FOUND_CDATA, /* 5003 */ + XML_CHECK_FOUND_ENTITYREF, /* 5004 */ + XML_CHECK_FOUND_ENTITY, /* 5005 */ + XML_CHECK_FOUND_PI, /* 5006 */ + XML_CHECK_FOUND_COMMENT, /* 5007 */ + XML_CHECK_FOUND_DOCTYPE, /* 5008 */ + XML_CHECK_FOUND_FRAGMENT, /* 5009 */ + XML_CHECK_FOUND_NOTATION, /* 5010 */ + XML_CHECK_UNKNOWN_NODE, /* 5011 */ + XML_CHECK_ENTITY_TYPE, /* 5012 */ + XML_CHECK_NO_PARENT, /* 5013 */ + XML_CHECK_NO_DOC, /* 5014 */ + XML_CHECK_NO_NAME, /* 5015 */ + XML_CHECK_NO_ELEM, /* 5016 */ + XML_CHECK_WRONG_DOC, /* 5017 */ + XML_CHECK_NO_PREV, /* 5018 */ + XML_CHECK_WRONG_PREV, /* 5019 */ + XML_CHECK_NO_NEXT, /* 5020 */ + XML_CHECK_WRONG_NEXT, /* 5021 */ + XML_CHECK_NOT_DTD, /* 5022 */ + XML_CHECK_NOT_ATTR, /* 5023 */ + XML_CHECK_NOT_ATTR_DECL, /* 5024 */ + XML_CHECK_NOT_ELEM_DECL, /* 5025 */ + XML_CHECK_NOT_ENTITY_DECL, /* 5026 */ + XML_CHECK_NOT_NS_DECL, /* 5027 */ + XML_CHECK_NO_HREF, /* 5028 */ + XML_CHECK_WRONG_PARENT,/* 5029 */ + XML_CHECK_NS_SCOPE, /* 5030 */ + XML_CHECK_NS_ANCESTOR, /* 5031 */ + XML_CHECK_NOT_UTF8, /* 5032 */ + XML_CHECK_NO_DICT, /* 5033 */ + XML_CHECK_NOT_NCNAME, /* 5034 */ + XML_CHECK_OUTSIDE_DICT, /* 5035 */ + XML_CHECK_WRONG_NAME, /* 5036 */ + XML_CHECK_NAME_NOT_NULL /* 5037 */ +#if 0 + XML_CHECK_, /* 5033 */ + XML_CHECK_X /* 503 */ +#endif +} xmlParserErrors; + +/** + * xmlGenericErrorFunc: + * @ctx: a parsing context + * @msg: the message + * @...: the extra arguments of the varags to format the message + * + * Signature of the function to use when there is an error and + * no parsing or validity context available . + */ +typedef void (*xmlGenericErrorFunc) (void *ctx, + const char *msg, + ...); +/** + * xmlStructuredErrorFunc: + * @userData: user provided data for the error callback + * @error: the error being raised. + * + * Signature of the function to use when there is an error and + * the module handles the new error reporting mechanism. + */ +typedef void (*xmlStructuredErrorFunc) (void *userData, xmlErrorPtr error); + +/* + * Use the following function to reset the two global variables + * xmlGenericError and xmlGenericErrorContext. + */ +XMLPUBFUN void XMLCALL + xmlSetGenericErrorFunc (void *ctx, + xmlGenericErrorFunc handler); +XMLPUBFUN void XMLCALL + initGenericErrorDefaultFunc (xmlGenericErrorFunc *handler); + +XMLPUBFUN void XMLCALL + xmlSetStructuredErrorFunc (void *ctx, + xmlStructuredErrorFunc handler); +/* + * Default message routines used by SAX and Valid context for error + * and warning reporting. + */ +XMLPUBFUN void XMLCALL + xmlParserError (void *ctx, + const char *msg, + ...); +XMLPUBFUN void XMLCALL + xmlParserWarning (void *ctx, + const char *msg, + ...); +XMLPUBFUN void XMLCALL + xmlParserValidityError (void *ctx, + const char *msg, + ...); +XMLPUBFUN void XMLCALL + xmlParserValidityWarning (void *ctx, + const char *msg, + ...); +XMLPUBFUN void XMLCALL + xmlParserPrintFileInfo (xmlParserInputPtr input); +XMLPUBFUN void XMLCALL + xmlParserPrintFileContext (xmlParserInputPtr input); + +/* + * Extended error information routines + */ +XMLPUBFUN xmlErrorPtr XMLCALL + xmlGetLastError (void); +XMLPUBFUN void XMLCALL + xmlResetLastError (void); +XMLPUBFUN xmlErrorPtr XMLCALL + xmlCtxtGetLastError (void *ctx); +XMLPUBFUN void XMLCALL + xmlCtxtResetLastError (void *ctx); +XMLPUBFUN void XMLCALL + xmlResetError (xmlErrorPtr err); +XMLPUBFUN int XMLCALL + xmlCopyError (xmlErrorPtr from, + xmlErrorPtr to); + +#ifdef IN_LIBXML +/* + * Internal callback reporting routine + */ +XMLPUBFUN void XMLCALL + __xmlRaiseError (xmlStructuredErrorFunc schannel, + xmlGenericErrorFunc channel, + void *data, + void *ctx, + void *node, + int domain, + int code, + xmlErrorLevel level, + const char *file, + int line, + const char *str1, + const char *str2, + const char *str3, + int int1, + int col, + const char *msg, + ...); +XMLPUBFUN void XMLCALL + __xmlSimpleError (int domain, + int code, + xmlNodePtr node, + const char *msg, + const char *extra); +#endif +#ifdef __cplusplus +} +#endif +#endif /* __XML_ERROR_H__ */ diff --git a/include/libxml/xmlexports.h b/include/libxml/xmlexports.h new file mode 100644 index 0000000..ee03cad --- /dev/null +++ b/include/libxml/xmlexports.h @@ -0,0 +1,138 @@ +/* + * Summary: macros for marking symbols as exportable/importable. + * Description: macros for marking symbols as exportable/importable. + * + * Copy: See Copyright for the status of this software. + * + * Author: Igor Zlatovic + */ + +#ifndef __XML_EXPORTS_H__ +#define __XML_EXPORTS_H__ + +/** + * XMLPUBFUN, XMLPUBVAR, XMLCALL + * + * Macros which declare an exportable function, an exportable variable and + * the calling convention used for functions. + * + * Please use an extra block for every platform/compiler combination when + * modifying this, rather than overlong #ifdef lines. This helps + * readability as well as the fact that different compilers on the same + * platform might need different definitions. + */ + +/** + * XMLPUBFUN: + * + * Macros which declare an exportable function + */ +#define XMLPUBFUN +/** + * XMLPUBVAR: + * + * Macros which declare an exportable variable + */ +#define XMLPUBVAR extern +/** + * XMLCALL: + * + * Macros which declare the called convention for exported functions + */ +#define XMLCALL + +/** DOC_DISABLE */ + +/* Windows platform with MS compiler */ +#if defined(_WIN32) && defined(_MSC_VER) + #undef XMLPUBFUN + #undef XMLPUBVAR + #undef XMLCALL + #if defined(IN_LIBXML) && !defined(LIBXML_STATIC) + #define XMLPUBFUN __declspec(dllexport) + #define XMLPUBVAR __declspec(dllexport) + #else + #define XMLPUBFUN + #if !defined(LIBXML_STATIC) + #define XMLPUBVAR __declspec(dllimport) extern + #else + #define XMLPUBVAR extern + #endif + #endif + #define XMLCALL __cdecl + #if !defined _REENTRANT + #define _REENTRANT + #endif +#endif + +/* Windows platform with Borland compiler */ +#if defined(_WIN32) && defined(__BORLANDC__) + #undef XMLPUBFUN + #undef XMLPUBVAR + #undef XMLCALL + #if defined(IN_LIBXML) && !defined(LIBXML_STATIC) + #define XMLPUBFUN __declspec(dllexport) + #define XMLPUBVAR __declspec(dllexport) extern + #else + #define XMLPUBFUN + #if !defined(LIBXML_STATIC) + #define XMLPUBVAR __declspec(dllimport) extern + #else + #define XMLPUBVAR extern + #endif + #endif + #define XMLCALL __cdecl + #if !defined _REENTRANT + #define _REENTRANT + #endif +#endif + +/* Windows platform with GNU compiler (Mingw) */ +#if defined(_WIN32) && defined(__MINGW32__) + #undef XMLPUBFUN + #undef XMLPUBVAR + #undef XMLCALL + #if defined(IN_LIBXML) && !defined(LIBXML_STATIC) + #define XMLPUBFUN __declspec(dllexport) + #define XMLPUBVAR __declspec(dllexport) + #else + #define XMLPUBFUN + #if !defined(LIBXML_STATIC) + #define XMLPUBVAR __declspec(dllimport) extern + #else + #define XMLPUBVAR extern + #endif + #endif + #define XMLCALL __cdecl + #if !defined _REENTRANT + #define _REENTRANT + #endif +#endif + +/* Cygwin platform, GNU compiler */ +#if defined(_WIN32) && defined(__CYGWIN__) + #undef XMLPUBFUN + #undef XMLPUBVAR + #undef XMLCALL + #if defined(IN_LIBXML) && !defined(LIBXML_STATIC) + #define XMLPUBFUN __declspec(dllexport) + #define XMLPUBVAR __declspec(dllexport) + #else + #define XMLPUBFUN + #if !defined(LIBXML_STATIC) + #define XMLPUBVAR __declspec(dllimport) extern + #else + #define XMLPUBVAR + #endif + #endif + #define XMLCALL __cdecl +#endif + +/* Compatibility */ +#if !defined(LIBXML_DLL_IMPORT) +#define LIBXML_DLL_IMPORT XMLPUBVAR +#endif + +#endif /* __XML_EXPORTS_H__ */ + + diff --git a/include/libxml/xmlmemory.h b/include/libxml/xmlmemory.h new file mode 100644 index 0000000..235721c --- /dev/null +++ b/include/libxml/xmlmemory.h @@ -0,0 +1,222 @@ +/* + * Summary: interface for the memory allocator + * Description: provides interfaces for the memory allocator, + * including debugging capabilities. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + + +#ifndef __DEBUG_MEMORY_ALLOC__ +#define __DEBUG_MEMORY_ALLOC__ + +#include +#include + +/** + * DEBUG_MEMORY: + * + * DEBUG_MEMORY replaces the allocator with a collect and debug + * shell to the libc allocator. + * DEBUG_MEMORY should only be activated when debugging + * libxml i.e. if libxml has been configured with --with-debug-mem too. + */ +/* #define DEBUG_MEMORY_FREED */ +/* #define DEBUG_MEMORY_LOCATION */ + +#ifdef DEBUG +#ifndef DEBUG_MEMORY +#define DEBUG_MEMORY +#endif +#endif + +/** + * DEBUG_MEMORY_LOCATION: + * + * DEBUG_MEMORY_LOCATION should be activated only when debugging + * libxml i.e. if libxml has been configured with --with-debug-mem too. + */ +#ifdef DEBUG_MEMORY_LOCATION +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The XML memory wrapper support 4 basic overloadable functions. + */ +/** + * xmlFreeFunc: + * @mem: an already allocated block of memory + * + * Signature for a free() implementation. + */ +typedef void (XMLCALL *xmlFreeFunc)(void *mem); +/** + * xmlMallocFunc: + * @size: the size requested in bytes + * + * Signature for a malloc() implementation. + * + * Returns a pointer to the newly allocated block or NULL in case of error. + */ +typedef void *(XMLCALL *xmlMallocFunc)(size_t size); + +/** + * xmlReallocFunc: + * @mem: an already allocated block of memory + * @size: the new size requested in bytes + * + * Signature for a realloc() implementation. + * + * Returns a pointer to the newly reallocated block or NULL in case of error. + */ +typedef void *(XMLCALL *xmlReallocFunc)(void *mem, size_t size); + +/** + * xmlStrdupFunc: + * @str: a zero terminated string + * + * Signature for an strdup() implementation. + * + * Returns the copy of the string or NULL in case of error. + */ +typedef char *(XMLCALL *xmlStrdupFunc)(const char *str); + +/* + * The 4 interfaces used for all memory handling within libxml. +LIBXML_DLL_IMPORT extern xmlFreeFunc xmlFree; +LIBXML_DLL_IMPORT extern xmlMallocFunc xmlMalloc; +LIBXML_DLL_IMPORT extern xmlMallocFunc xmlMallocAtomic; +LIBXML_DLL_IMPORT extern xmlReallocFunc xmlRealloc; +LIBXML_DLL_IMPORT extern xmlStrdupFunc xmlMemStrdup; + */ + +/* + * The way to overload the existing functions. + * The xmlGc function have an extra entry for atomic block + * allocations useful for garbage collected memory allocators + */ +XMLPUBFUN int XMLCALL + xmlMemSetup (xmlFreeFunc freeFunc, + xmlMallocFunc mallocFunc, + xmlReallocFunc reallocFunc, + xmlStrdupFunc strdupFunc); +XMLPUBFUN int XMLCALL + xmlMemGet (xmlFreeFunc *freeFunc, + xmlMallocFunc *mallocFunc, + xmlReallocFunc *reallocFunc, + xmlStrdupFunc *strdupFunc); +XMLPUBFUN int XMLCALL + xmlGcMemSetup (xmlFreeFunc freeFunc, + xmlMallocFunc mallocFunc, + xmlMallocFunc mallocAtomicFunc, + xmlReallocFunc reallocFunc, + xmlStrdupFunc strdupFunc); +XMLPUBFUN int XMLCALL + xmlGcMemGet (xmlFreeFunc *freeFunc, + xmlMallocFunc *mallocFunc, + xmlMallocFunc *mallocAtomicFunc, + xmlReallocFunc *reallocFunc, + xmlStrdupFunc *strdupFunc); + +/* + * Initialization of the memory layer. + */ +XMLPUBFUN int XMLCALL + xmlInitMemory (void); + +/* + * Cleanup of the memory layer. + */ +XMLPUBFUN void XMLCALL + xmlCleanupMemory (void); +/* + * These are specific to the XML debug memory wrapper. + */ +XMLPUBFUN int XMLCALL + xmlMemUsed (void); +XMLPUBFUN int XMLCALL + xmlMemBlocks (void); +XMLPUBFUN void XMLCALL + xmlMemDisplay (FILE *fp); +XMLPUBFUN void XMLCALL + xmlMemShow (FILE *fp, int nr); +XMLPUBFUN void XMLCALL + xmlMemoryDump (void); +XMLPUBFUN void * XMLCALL + xmlMemMalloc (size_t size); +XMLPUBFUN void * XMLCALL + xmlMemRealloc (void *ptr,size_t size); +XMLPUBFUN void XMLCALL + xmlMemFree (void *ptr); +XMLPUBFUN char * XMLCALL + xmlMemoryStrdup (const char *str); +XMLPUBFUN void * XMLCALL + xmlMallocLoc (size_t size, const char *file, int line); +XMLPUBFUN void * XMLCALL + xmlReallocLoc (void *ptr, size_t size, const char *file, int line); +XMLPUBFUN void * XMLCALL + xmlMallocAtomicLoc (size_t size, const char *file, int line); +XMLPUBFUN char * XMLCALL + xmlMemStrdupLoc (const char *str, const char *file, int line); + + +#ifdef DEBUG_MEMORY_LOCATION +/** + * xmlMalloc: + * @size: number of bytes to allocate + * + * Wrapper for the malloc() function used in the XML library. + * + * Returns the pointer to the allocated area or NULL in case of error. + */ +#define xmlMalloc(size) xmlMallocLoc((size), __FILE__, __LINE__) +/** + * xmlMallocAtomic: + * @size: number of bytes to allocate + * + * Wrapper for the malloc() function used in the XML library for allocation + * of block not containing pointers to other areas. + * + * Returns the pointer to the allocated area or NULL in case of error. + */ +#define xmlMallocAtomic(size) xmlMallocAtomicLoc((size), __FILE__, __LINE__) +/** + * xmlRealloc: + * @ptr: pointer to the existing allocated area + * @size: number of bytes to allocate + * + * Wrapper for the realloc() function used in the XML library. + * + * Returns the pointer to the allocated area or NULL in case of error. + */ +#define xmlRealloc(ptr, size) xmlReallocLoc((ptr), (size), __FILE__, __LINE__) +/** + * xmlMemStrdup: + * @str: pointer to the existing string + * + * Wrapper for the strdup() function, xmlStrdup() is usually preferred. + * + * Returns the pointer to the allocated area or NULL in case of error. + */ +#define xmlMemStrdup(str) xmlMemStrdupLoc((str), __FILE__, __LINE__) + +#endif /* DEBUG_MEMORY_LOCATION */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#ifndef __XML_GLOBALS_H +#ifndef __XML_THREADS_H__ +#include +#include +#endif +#endif + +#endif /* __DEBUG_MEMORY_ALLOC__ */ + diff --git a/include/libxml/xmlmodule.h b/include/libxml/xmlmodule.h new file mode 100644 index 0000000..8f4a560 --- /dev/null +++ b/include/libxml/xmlmodule.h @@ -0,0 +1,57 @@ +/* + * Summary: dynamic module loading + * Description: basic API for dynamic module loading, used by + * libexslt added in 2.6.17 + * + * Copy: See Copyright for the status of this software. + * + * Author: Joel W. Reed + */ + +#ifndef __XML_MODULE_H__ +#define __XML_MODULE_H__ + +#include + +#ifdef LIBXML_MODULES_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlModulePtr: + * + * A handle to a dynamically loaded module + */ +typedef struct _xmlModule xmlModule; +typedef xmlModule *xmlModulePtr; + +/** + * xmlModuleOption: + * + * enumeration of options that can be passed down to xmlModuleOpen() + */ +typedef enum { + XML_MODULE_LAZY = 1, /* lazy binding */ + XML_MODULE_LOCAL= 2 /* local binding */ +} xmlModuleOption; + +XMLPUBFUN xmlModulePtr XMLCALL xmlModuleOpen (const char *filename, + int options); + +XMLPUBFUN int XMLCALL xmlModuleSymbol (xmlModulePtr module, + const char* name, + void **result); + +XMLPUBFUN int XMLCALL xmlModuleClose (xmlModulePtr module); + +XMLPUBFUN int XMLCALL xmlModuleFree (xmlModulePtr module); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_MODULES_ENABLED */ + +#endif /*__XML_MODULE_H__ */ diff --git a/include/libxml/xmlreader.h b/include/libxml/xmlreader.h new file mode 100644 index 0000000..f016546 --- /dev/null +++ b/include/libxml/xmlreader.h @@ -0,0 +1,399 @@ +/* + * Summary: the XMLReader implementation + * Description: API of the XML streaming API based on C# interfaces. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XMLREADER_H__ +#define __XML_XMLREADER_H__ + +#include +#include +#include +#ifdef LIBXML_SCHEMAS_ENABLED +#include +#include +#endif + +#ifdef LIBXML_READER_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlTextReaderMode: + * + * Internal state values for the reader. + */ +typedef enum { + XML_TEXTREADER_MODE_INITIAL = 0, + XML_TEXTREADER_MODE_INTERACTIVE = 1, + XML_TEXTREADER_MODE_ERROR = 2, + XML_TEXTREADER_MODE_EOF =3, + XML_TEXTREADER_MODE_CLOSED = 4, + XML_TEXTREADER_MODE_READING = 5 +} xmlTextReaderMode; + +/** + * xmlParserProperties: + * + * Some common options to use with xmlTextReaderSetParserProp, but it + * is better to use xmlParserOption and the xmlReaderNewxxx and + * xmlReaderForxxx APIs now. + */ +typedef enum { + XML_PARSER_LOADDTD = 1, + XML_PARSER_DEFAULTATTRS = 2, + XML_PARSER_VALIDATE = 3, + XML_PARSER_SUBST_ENTITIES = 4 +} xmlParserProperties; + +/** + * xmlParserSeverities: + * + * How severe an error callback is when the per-reader error callback API + * is used. + */ +typedef enum { + XML_PARSER_SEVERITY_VALIDITY_WARNING = 1, + XML_PARSER_SEVERITY_VALIDITY_ERROR = 2, + XML_PARSER_SEVERITY_WARNING = 3, + XML_PARSER_SEVERITY_ERROR = 4 +} xmlParserSeverities; + +/** + * xmlReaderTypes: + * + * Predefined constants for the different types of nodes. + */ +typedef enum { + XML_READER_TYPE_NONE = 0, + XML_READER_TYPE_ELEMENT = 1, + XML_READER_TYPE_ATTRIBUTE = 2, + XML_READER_TYPE_TEXT = 3, + XML_READER_TYPE_CDATA = 4, + XML_READER_TYPE_ENTITY_REFERENCE = 5, + XML_READER_TYPE_ENTITY = 6, + XML_READER_TYPE_PROCESSING_INSTRUCTION = 7, + XML_READER_TYPE_COMMENT = 8, + XML_READER_TYPE_DOCUMENT = 9, + XML_READER_TYPE_DOCUMENT_TYPE = 10, + XML_READER_TYPE_DOCUMENT_FRAGMENT = 11, + XML_READER_TYPE_NOTATION = 12, + XML_READER_TYPE_WHITESPACE = 13, + XML_READER_TYPE_SIGNIFICANT_WHITESPACE = 14, + XML_READER_TYPE_END_ELEMENT = 15, + XML_READER_TYPE_END_ENTITY = 16, + XML_READER_TYPE_XML_DECLARATION = 17 +} xmlReaderTypes; + +/** + * xmlTextReader: + * + * Structure for an xmlReader context. + */ +typedef struct _xmlTextReader xmlTextReader; + +/** + * xmlTextReaderPtr: + * + * Pointer to an xmlReader context. + */ +typedef xmlTextReader *xmlTextReaderPtr; + +/* + * Constructors & Destructor + */ +XMLPUBFUN xmlTextReaderPtr XMLCALL + xmlNewTextReader (xmlParserInputBufferPtr input, + const char *URI); +XMLPUBFUN xmlTextReaderPtr XMLCALL + xmlNewTextReaderFilename(const char *URI); +XMLPUBFUN void XMLCALL + xmlFreeTextReader (xmlTextReaderPtr reader); + +/* + * Iterators + */ +XMLPUBFUN int XMLCALL + xmlTextReaderRead (xmlTextReaderPtr reader); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderReadInnerXml (xmlTextReaderPtr reader); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderReadOuterXml (xmlTextReaderPtr reader); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderReadString (xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderReadAttributeValue (xmlTextReaderPtr reader); + +/* + * Attributes of the node + */ +XMLPUBFUN int XMLCALL + xmlTextReaderAttributeCount(xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderDepth (xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderHasAttributes(xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderHasValue(xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderIsDefault (xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderIsEmptyElement(xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderNodeType (xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderQuoteChar (xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderReadState (xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderIsNamespaceDecl(xmlTextReaderPtr reader); + +XMLPUBFUN const xmlChar * XMLCALL + xmlTextReaderConstBaseUri (xmlTextReaderPtr reader); +XMLPUBFUN const xmlChar * XMLCALL + xmlTextReaderConstLocalName (xmlTextReaderPtr reader); +XMLPUBFUN const xmlChar * XMLCALL + xmlTextReaderConstName (xmlTextReaderPtr reader); +XMLPUBFUN const xmlChar * XMLCALL + xmlTextReaderConstNamespaceUri(xmlTextReaderPtr reader); +XMLPUBFUN const xmlChar * XMLCALL + xmlTextReaderConstPrefix (xmlTextReaderPtr reader); +XMLPUBFUN const xmlChar * XMLCALL + xmlTextReaderConstXmlLang (xmlTextReaderPtr reader); +XMLPUBFUN const xmlChar * XMLCALL + xmlTextReaderConstString (xmlTextReaderPtr reader, + const xmlChar *str); +XMLPUBFUN const xmlChar * XMLCALL + xmlTextReaderConstValue (xmlTextReaderPtr reader); + +/* + * use the Const version of the routine for + * better performance and simpler code + */ +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderBaseUri (xmlTextReaderPtr reader); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderLocalName (xmlTextReaderPtr reader); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderName (xmlTextReaderPtr reader); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderNamespaceUri(xmlTextReaderPtr reader); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderPrefix (xmlTextReaderPtr reader); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderXmlLang (xmlTextReaderPtr reader); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderValue (xmlTextReaderPtr reader); + +/* + * Methods of the XmlTextReader + */ +XMLPUBFUN int XMLCALL + xmlTextReaderClose (xmlTextReaderPtr reader); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderGetAttributeNo (xmlTextReaderPtr reader, + int no); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderGetAttribute (xmlTextReaderPtr reader, + const xmlChar *name); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderGetAttributeNs (xmlTextReaderPtr reader, + const xmlChar *localName, + const xmlChar *namespaceURI); +XMLPUBFUN xmlParserInputBufferPtr XMLCALL + xmlTextReaderGetRemainder (xmlTextReaderPtr reader); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderLookupNamespace(xmlTextReaderPtr reader, + const xmlChar *prefix); +XMLPUBFUN int XMLCALL + xmlTextReaderMoveToAttributeNo(xmlTextReaderPtr reader, + int no); +XMLPUBFUN int XMLCALL + xmlTextReaderMoveToAttribute(xmlTextReaderPtr reader, + const xmlChar *name); +XMLPUBFUN int XMLCALL + xmlTextReaderMoveToAttributeNs(xmlTextReaderPtr reader, + const xmlChar *localName, + const xmlChar *namespaceURI); +XMLPUBFUN int XMLCALL + xmlTextReaderMoveToFirstAttribute(xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderMoveToNextAttribute(xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderMoveToElement (xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderNormalization (xmlTextReaderPtr reader); +XMLPUBFUN const xmlChar * XMLCALL + xmlTextReaderConstEncoding (xmlTextReaderPtr reader); + +/* + * Extensions + */ +XMLPUBFUN int XMLCALL + xmlTextReaderSetParserProp (xmlTextReaderPtr reader, + int prop, + int value); +XMLPUBFUN int XMLCALL + xmlTextReaderGetParserProp (xmlTextReaderPtr reader, + int prop); +XMLPUBFUN xmlNodePtr XMLCALL + xmlTextReaderCurrentNode (xmlTextReaderPtr reader); + +XMLPUBFUN int XMLCALL + xmlTextReaderGetParserLineNumber(xmlTextReaderPtr reader); + +XMLPUBFUN int XMLCALL + xmlTextReaderGetParserColumnNumber(xmlTextReaderPtr reader); + +XMLPUBFUN xmlNodePtr XMLCALL + xmlTextReaderPreserve (xmlTextReaderPtr reader); +#ifdef LIBXML_PATTERN_ENABLED +XMLPUBFUN int XMLCALL + xmlTextReaderPreservePattern(xmlTextReaderPtr reader, + const xmlChar *pattern, + const xmlChar **namespaces); +#endif /* LIBXML_PATTERN_ENABLED */ +XMLPUBFUN xmlDocPtr XMLCALL + xmlTextReaderCurrentDoc (xmlTextReaderPtr reader); +XMLPUBFUN xmlNodePtr XMLCALL + xmlTextReaderExpand (xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderNext (xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderNextSibling (xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderIsValid (xmlTextReaderPtr reader); +#ifdef LIBXML_SCHEMAS_ENABLED +XMLPUBFUN int XMLCALL + xmlTextReaderRelaxNGValidate(xmlTextReaderPtr reader, + const char *rng); +XMLPUBFUN int XMLCALL + xmlTextReaderRelaxNGSetSchema(xmlTextReaderPtr reader, + xmlRelaxNGPtr schema); +XMLPUBFUN int XMLCALL + xmlTextReaderSchemaValidate (xmlTextReaderPtr reader, + const char *xsd); +XMLPUBFUN int XMLCALL + xmlTextReaderSetSchema (xmlTextReaderPtr reader, + xmlSchemaPtr schema); +#endif +XMLPUBFUN const xmlChar * XMLCALL + xmlTextReaderConstXmlVersion(xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderStandalone (xmlTextReaderPtr reader); + + +/* + * Index lookup + */ +XMLPUBFUN long XMLCALL + xmlTextReaderByteConsumed (xmlTextReaderPtr reader); + +/* + * New more complete APIs for simpler creation and reuse of readers + */ +XMLPUBFUN xmlTextReaderPtr XMLCALL + xmlReaderWalker (xmlDocPtr doc); +XMLPUBFUN xmlTextReaderPtr XMLCALL + xmlReaderForDoc (const xmlChar * cur, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlTextReaderPtr XMLCALL + xmlReaderForFile (const char *filename, + const char *encoding, + int options); +XMLPUBFUN xmlTextReaderPtr XMLCALL + xmlReaderForMemory (const char *buffer, + int size, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlTextReaderPtr XMLCALL + xmlReaderForFd (int fd, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlTextReaderPtr XMLCALL + xmlReaderForIO (xmlInputReadCallback ioread, + xmlInputCloseCallback ioclose, + void *ioctx, + const char *URL, + const char *encoding, + int options); + +XMLPUBFUN int XMLCALL + xmlReaderNewWalker (xmlTextReaderPtr reader, + xmlDocPtr doc); +XMLPUBFUN int XMLCALL + xmlReaderNewDoc (xmlTextReaderPtr reader, + const xmlChar * cur, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN int XMLCALL + xmlReaderNewFile (xmlTextReaderPtr reader, + const char *filename, + const char *encoding, + int options); +XMLPUBFUN int XMLCALL + xmlReaderNewMemory (xmlTextReaderPtr reader, + const char *buffer, + int size, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN int XMLCALL + xmlReaderNewFd (xmlTextReaderPtr reader, + int fd, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN int XMLCALL + xmlReaderNewIO (xmlTextReaderPtr reader, + xmlInputReadCallback ioread, + xmlInputCloseCallback ioclose, + void *ioctx, + const char *URL, + const char *encoding, + int options); +/* + * Error handling extensions + */ +typedef void * xmlTextReaderLocatorPtr; +typedef void (XMLCALL *xmlTextReaderErrorFunc) (void *arg, + const char *msg, + xmlParserSeverities severity, + xmlTextReaderLocatorPtr locator); +XMLPUBFUN int XMLCALL + xmlTextReaderLocatorLineNumber(xmlTextReaderLocatorPtr locator); +/*int xmlTextReaderLocatorLinePosition(xmlTextReaderLocatorPtr locator);*/ +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderLocatorBaseURI (xmlTextReaderLocatorPtr locator); +XMLPUBFUN void XMLCALL + xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader, + xmlTextReaderErrorFunc f, + void *arg); +XMLPUBFUN void XMLCALL + xmlTextReaderSetStructuredErrorHandler(xmlTextReaderPtr reader, + xmlStructuredErrorFunc f, + void *arg); +XMLPUBFUN void XMLCALL + xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader, + xmlTextReaderErrorFunc *f, + void **arg); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_READER_ENABLED */ + +#endif /* __XML_XMLREADER_H__ */ + diff --git a/include/libxml/xmlregexp.h b/include/libxml/xmlregexp.h new file mode 100644 index 0000000..a7b3b29 --- /dev/null +++ b/include/libxml/xmlregexp.h @@ -0,0 +1,108 @@ +/* + * Summary: regular expressions handling + * Description: basic API for libxml regular expressions handling used + * for XML Schemas and validation. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_REGEXP_H__ +#define __XML_REGEXP_H__ + +#include + +#ifdef LIBXML_REGEXP_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlRegexpPtr: + * + * A libxml regular expression, they can actually be far more complex + * thank the POSIX regex expressions. + */ +typedef struct _xmlRegexp xmlRegexp; +typedef xmlRegexp *xmlRegexpPtr; + +/** + * xmlRegExecCtxtPtr: + * + * A libxml progressive regular expression evaluation context + */ +typedef struct _xmlRegExecCtxt xmlRegExecCtxt; +typedef xmlRegExecCtxt *xmlRegExecCtxtPtr; + +#ifdef __cplusplus +} +#endif +#include +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The POSIX like API + */ +XMLPUBFUN xmlRegexpPtr XMLCALL + xmlRegexpCompile (const xmlChar *regexp); +XMLPUBFUN void XMLCALL xmlRegFreeRegexp(xmlRegexpPtr regexp); +XMLPUBFUN int XMLCALL + xmlRegexpExec (xmlRegexpPtr comp, + const xmlChar *value); +XMLPUBFUN void XMLCALL + xmlRegexpPrint (FILE *output, + xmlRegexpPtr regexp); +XMLPUBFUN int XMLCALL + xmlRegexpIsDeterminist(xmlRegexpPtr comp); + +/* + * Callback function when doing a transition in the automata + */ +typedef void (*xmlRegExecCallbacks) (xmlRegExecCtxtPtr exec, + const xmlChar *token, + void *transdata, + void *inputdata); + +/* + * The progressive API + */ +XMLPUBFUN xmlRegExecCtxtPtr XMLCALL + xmlRegNewExecCtxt (xmlRegexpPtr comp, + xmlRegExecCallbacks callback, + void *data); +XMLPUBFUN void XMLCALL + xmlRegFreeExecCtxt (xmlRegExecCtxtPtr exec); +XMLPUBFUN int XMLCALL + xmlRegExecPushString(xmlRegExecCtxtPtr exec, + const xmlChar *value, + void *data); +XMLPUBFUN int XMLCALL + xmlRegExecPushString2(xmlRegExecCtxtPtr exec, + const xmlChar *value, + const xmlChar *value2, + void *data); + +XMLPUBFUN int XMLCALL + xmlRegExecNextValues(xmlRegExecCtxtPtr exec, + int *nbval, + int *nbneg, + xmlChar **values, + int *terminal); +XMLPUBFUN int XMLCALL + xmlRegExecErrInfo (xmlRegExecCtxtPtr exec, + const xmlChar **string, + int *nbval, + int *nbneg, + xmlChar **values, + int *terminal); +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_REGEXP_ENABLED */ + +#endif /*__XML_REGEXP_H__ */ diff --git a/include/libxml/xmlsave.h b/include/libxml/xmlsave.h new file mode 100644 index 0000000..534fefd --- /dev/null +++ b/include/libxml/xmlsave.h @@ -0,0 +1,83 @@ +/* + * Summary: the XML document serializer + * Description: API to save document or subtree of document + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XMLSAVE_H__ +#define __XML_XMLSAVE_H__ + +#include +#include +#include +#include + +#ifdef LIBXML_OUTPUT_ENABLED +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlSaveOption: + * + * This is the set of XML save options that can be passed down + * to the xmlSaveToFd() and similar calls. + */ +typedef enum { + XML_SAVE_FORMAT = 1<<0 /* format save output */ +} xmlSaveOption; + + +typedef struct _xmlSaveCtxt xmlSaveCtxt; +typedef xmlSaveCtxt *xmlSaveCtxtPtr; + +XMLPUBFUN xmlSaveCtxtPtr XMLCALL + xmlSaveToFd (int fd, + const char *encoding, + int options); +XMLPUBFUN xmlSaveCtxtPtr XMLCALL + xmlSaveToFilename (const char *filename, + const char *encoding, + int options); +/****** + Not yet implemented. + +XMLPUBFUN xmlSaveCtxtPtr XMLCALL + xmlSaveToBuffer (xmlBufferPtr buffer, + const char *encoding, + int options); + ******/ +XMLPUBFUN xmlSaveCtxtPtr XMLCALL + xmlSaveToIO (xmlOutputWriteCallback iowrite, + xmlOutputCloseCallback ioclose, + void *ioctx, + const char *encoding, + int options); + +XMLPUBFUN long XMLCALL + xmlSaveDoc (xmlSaveCtxtPtr ctxt, + xmlDocPtr doc); +XMLPUBFUN long XMLCALL + xmlSaveTree (xmlSaveCtxtPtr ctxt, + xmlNodePtr node); + +XMLPUBFUN int XMLCALL + xmlSaveFlush (xmlSaveCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlSaveClose (xmlSaveCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlSaveSetEscape (xmlSaveCtxtPtr ctxt, + xmlCharEncodingOutputFunc escape); +XMLPUBFUN int XMLCALL + xmlSaveSetAttrEscape (xmlSaveCtxtPtr ctxt, + xmlCharEncodingOutputFunc escape); +#ifdef __cplusplus +} +#endif +#endif /* LIBXML_OUTPUT_ENABLED */ +#endif /* __XML_XMLSAVE_H__ */ + + diff --git a/include/libxml/xmlschemas.h b/include/libxml/xmlschemas.h new file mode 100644 index 0000000..6cecffd --- /dev/null +++ b/include/libxml/xmlschemas.h @@ -0,0 +1,190 @@ +/* + * Summary: incomplete XML Schemas structure implementation + * Description: interface to the XML Schemas handling and schema validity + * checking, it is incomplete right now. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + + +#ifndef __XML_SCHEMA_H__ +#define __XML_SCHEMA_H__ + +#include + +#ifdef LIBXML_SCHEMAS_ENABLED + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * This error codes are obsolete; not used any more. + */ +typedef enum { + XML_SCHEMAS_ERR_OK = 0, + XML_SCHEMAS_ERR_NOROOT = 1, + XML_SCHEMAS_ERR_UNDECLAREDELEM, + XML_SCHEMAS_ERR_NOTTOPLEVEL, + XML_SCHEMAS_ERR_MISSING, + XML_SCHEMAS_ERR_WRONGELEM, + XML_SCHEMAS_ERR_NOTYPE, + XML_SCHEMAS_ERR_NOROLLBACK, + XML_SCHEMAS_ERR_ISABSTRACT, + XML_SCHEMAS_ERR_NOTEMPTY, + XML_SCHEMAS_ERR_ELEMCONT, + XML_SCHEMAS_ERR_HAVEDEFAULT, + XML_SCHEMAS_ERR_NOTNILLABLE, + XML_SCHEMAS_ERR_EXTRACONTENT, + XML_SCHEMAS_ERR_INVALIDATTR, + XML_SCHEMAS_ERR_INVALIDELEM, + XML_SCHEMAS_ERR_NOTDETERMINIST, + XML_SCHEMAS_ERR_CONSTRUCT, + XML_SCHEMAS_ERR_INTERNAL, + XML_SCHEMAS_ERR_NOTSIMPLE, + XML_SCHEMAS_ERR_ATTRUNKNOWN, + XML_SCHEMAS_ERR_ATTRINVALID, + XML_SCHEMAS_ERR_VALUE, + XML_SCHEMAS_ERR_FACET, + XML_SCHEMAS_ERR_, + XML_SCHEMAS_ERR_XXX +} xmlSchemaValidError; + +/* +* ATTENTION: Change xmlSchemaSetValidOptions's check +* for invalid values, if adding to the validation +* options below. +*/ +/** + * xmlSchemaValidOption: + * + * This is the set of XML Schema validation options. + */ +typedef enum { + XML_SCHEMA_VAL_VC_I_CREATE = 1<<0 + /* Default/fixed: create an attribute node + * or an element's text node on the instance. + */ +} xmlSchemaValidOption; + +/* + XML_SCHEMA_VAL_XSI_ASSEMBLE = 1<<1, + * assemble schemata using + * xsi:schemaLocation and + * xsi:noNamespaceSchemaLocation +*/ + +/** + * The schemas related types are kept internal + */ +typedef struct _xmlSchema xmlSchema; +typedef xmlSchema *xmlSchemaPtr; + +/** + * A schemas validation context + */ +typedef void (*xmlSchemaValidityErrorFunc) (void *ctx, const char *msg, ...); +typedef void (*xmlSchemaValidityWarningFunc) (void *ctx, const char *msg, ...); + +typedef struct _xmlSchemaParserCtxt xmlSchemaParserCtxt; +typedef xmlSchemaParserCtxt *xmlSchemaParserCtxtPtr; + +typedef struct _xmlSchemaValidCtxt xmlSchemaValidCtxt; +typedef xmlSchemaValidCtxt *xmlSchemaValidCtxtPtr; + +/* + * Interfaces for parsing. + */ +XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL + xmlSchemaNewParserCtxt (const char *URL); +XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL + xmlSchemaNewMemParserCtxt (const char *buffer, + int size); +XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL + xmlSchemaNewDocParserCtxt (xmlDocPtr doc); +XMLPUBFUN void XMLCALL + xmlSchemaFreeParserCtxt (xmlSchemaParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlSchemaSetParserErrors (xmlSchemaParserCtxtPtr ctxt, + xmlSchemaValidityErrorFunc err, + xmlSchemaValidityWarningFunc warn, + void *ctx); +XMLPUBFUN int XMLCALL + xmlSchemaGetParserErrors(xmlSchemaParserCtxtPtr ctxt, + xmlSchemaValidityErrorFunc * err, + xmlSchemaValidityWarningFunc * warn, + void **ctx); +XMLPUBFUN int XMLCALL + xmlSchemaIsValid (xmlSchemaValidCtxtPtr ctxt); + +XMLPUBFUN xmlSchemaPtr XMLCALL + xmlSchemaParse (xmlSchemaParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlSchemaFree (xmlSchemaPtr schema); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void XMLCALL + xmlSchemaDump (FILE *output, + xmlSchemaPtr schema); +#endif /* LIBXML_OUTPUT_ENABLED */ +/* + * Interfaces for validating + */ +XMLPUBFUN void XMLCALL + xmlSchemaSetValidErrors (xmlSchemaValidCtxtPtr ctxt, + xmlSchemaValidityErrorFunc err, + xmlSchemaValidityWarningFunc warn, + void *ctx); +XMLPUBFUN int XMLCALL + xmlSchemaGetValidErrors (xmlSchemaValidCtxtPtr ctxt, + xmlSchemaValidityErrorFunc *err, + xmlSchemaValidityWarningFunc *warn, + void **ctx); +XMLPUBFUN int XMLCALL + xmlSchemaSetValidOptions (xmlSchemaValidCtxtPtr ctxt, + int options); +XMLPUBFUN int XMLCALL + xmlSchemaValidCtxtGetOptions(xmlSchemaValidCtxtPtr ctxt); + +XMLPUBFUN xmlSchemaValidCtxtPtr XMLCALL + xmlSchemaNewValidCtxt (xmlSchemaPtr schema); +XMLPUBFUN void XMLCALL + xmlSchemaFreeValidCtxt (xmlSchemaValidCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlSchemaValidateDoc (xmlSchemaValidCtxtPtr ctxt, + xmlDocPtr instance); +XMLPUBFUN int XMLCALL + xmlSchemaValidateOneElement (xmlSchemaValidCtxtPtr ctxt, + xmlNodePtr elem); +XMLPUBFUN int XMLCALL + xmlSchemaValidateStream (xmlSchemaValidCtxtPtr ctxt, + xmlParserInputBufferPtr input, + xmlCharEncoding enc, + xmlSAXHandlerPtr sax, + void *user_data); +XMLPUBFUN int XMLCALL + xmlSchemaValidateFile (xmlSchemaValidCtxtPtr ctxt, + const char * filename, + int options); + +/* + * Interface to insert Schemas SAX velidation in a SAX stream + */ +typedef struct _xmlSchemaSAXPlug xmlSchemaSAXPlugStruct; +typedef xmlSchemaSAXPlugStruct *xmlSchemaSAXPlugPtr; + +XMLPUBFUN xmlSchemaSAXPlugPtr XMLCALL + xmlSchemaSAXPlug (xmlSchemaValidCtxtPtr ctxt, + xmlSAXHandlerPtr *sax, + void **user_data); +XMLPUBFUN int XMLCALL + xmlSchemaSAXUnplug (xmlSchemaSAXPlugPtr plug); +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_SCHEMAS_ENABLED */ +#endif /* __XML_SCHEMA_H__ */ diff --git a/include/libxml/xmlschemastypes.h b/include/libxml/xmlschemastypes.h new file mode 100644 index 0000000..9a3a7a1 --- /dev/null +++ b/include/libxml/xmlschemastypes.h @@ -0,0 +1,151 @@ +/* + * Summary: implementation of XML Schema Datatypes + * Description: module providing the XML Schema Datatypes implementation + * both definition and validity checking + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + + +#ifndef __XML_SCHEMA_TYPES_H__ +#define __XML_SCHEMA_TYPES_H__ + +#include + +#ifdef LIBXML_SCHEMAS_ENABLED + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + XML_SCHEMA_WHITESPACE_UNKNOWN = 0, + XML_SCHEMA_WHITESPACE_PRESERVE = 1, + XML_SCHEMA_WHITESPACE_REPLACE = 2, + XML_SCHEMA_WHITESPACE_COLLAPSE = 3 +} xmlSchemaWhitespaceValueType; + +XMLPUBFUN void XMLCALL + xmlSchemaInitTypes (void); +XMLPUBFUN void XMLCALL + xmlSchemaCleanupTypes (void); +XMLPUBFUN xmlSchemaTypePtr XMLCALL + xmlSchemaGetPredefinedType (const xmlChar *name, + const xmlChar *ns); +XMLPUBFUN int XMLCALL + xmlSchemaValidatePredefinedType (xmlSchemaTypePtr type, + const xmlChar *value, + xmlSchemaValPtr *val); +XMLPUBFUN int XMLCALL + xmlSchemaValPredefTypeNode (xmlSchemaTypePtr type, + const xmlChar *value, + xmlSchemaValPtr *val, + xmlNodePtr node); +XMLPUBFUN int XMLCALL + xmlSchemaValidateFacet (xmlSchemaTypePtr base, + xmlSchemaFacetPtr facet, + const xmlChar *value, + xmlSchemaValPtr val); +XMLPUBFUN int XMLCALL + xmlSchemaValidateFacetWhtsp (xmlSchemaFacetPtr facet, + xmlSchemaWhitespaceValueType fws, + xmlSchemaValType valType, + const xmlChar *value, + xmlSchemaValPtr val, + xmlSchemaWhitespaceValueType ws); +XMLPUBFUN void XMLCALL + xmlSchemaFreeValue (xmlSchemaValPtr val); +XMLPUBFUN xmlSchemaFacetPtr XMLCALL + xmlSchemaNewFacet (void); +XMLPUBFUN int XMLCALL + xmlSchemaCheckFacet (xmlSchemaFacetPtr facet, + xmlSchemaTypePtr typeDecl, + xmlSchemaParserCtxtPtr ctxt, + const xmlChar *name); +XMLPUBFUN void XMLCALL + xmlSchemaFreeFacet (xmlSchemaFacetPtr facet); +XMLPUBFUN int XMLCALL + xmlSchemaCompareValues (xmlSchemaValPtr x, + xmlSchemaValPtr y); +XMLPUBFUN xmlSchemaTypePtr XMLCALL + xmlSchemaGetBuiltInListSimpleTypeItemType (xmlSchemaTypePtr type); +XMLPUBFUN int XMLCALL + xmlSchemaValidateListSimpleTypeFacet (xmlSchemaFacetPtr facet, + const xmlChar *value, + unsigned long actualLen, + unsigned long *expectedLen); +XMLPUBFUN xmlSchemaTypePtr XMLCALL + xmlSchemaGetBuiltInType (xmlSchemaValType type); +XMLPUBFUN int XMLCALL + xmlSchemaIsBuiltInTypeFacet (xmlSchemaTypePtr type, + int facetType); +XMLPUBFUN xmlChar * XMLCALL + xmlSchemaCollapseString (const xmlChar *value); +XMLPUBFUN xmlChar * XMLCALL + xmlSchemaWhiteSpaceReplace (const xmlChar *value); +XMLPUBFUN unsigned long XMLCALL + xmlSchemaGetFacetValueAsULong (xmlSchemaFacetPtr facet); +XMLPUBFUN int XMLCALL + xmlSchemaValidateLengthFacet (xmlSchemaTypePtr type, + xmlSchemaFacetPtr facet, + const xmlChar *value, + xmlSchemaValPtr val, + unsigned long *length); +XMLPUBFUN int XMLCALL + xmlSchemaValidateLengthFacetWhtsp(xmlSchemaFacetPtr facet, + xmlSchemaValType valType, + const xmlChar *value, + xmlSchemaValPtr val, + unsigned long *length, + xmlSchemaWhitespaceValueType ws); +XMLPUBFUN int XMLCALL + xmlSchemaValPredefTypeNodeNoNorm(xmlSchemaTypePtr type, + const xmlChar *value, + xmlSchemaValPtr *val, + xmlNodePtr node); +XMLPUBFUN int XMLCALL + xmlSchemaGetCanonValue (xmlSchemaValPtr val, + const xmlChar **retValue); +XMLPUBFUN int XMLCALL + xmlSchemaGetCanonValueWhtsp (xmlSchemaValPtr val, + const xmlChar **retValue, + xmlSchemaWhitespaceValueType ws); +XMLPUBFUN int XMLCALL + xmlSchemaValueAppend (xmlSchemaValPtr prev, + xmlSchemaValPtr cur); +XMLPUBFUN xmlSchemaValPtr XMLCALL + xmlSchemaValueGetNext (xmlSchemaValPtr cur); +XMLPUBFUN const xmlChar * XMLCALL + xmlSchemaValueGetAsString (xmlSchemaValPtr val); +XMLPUBFUN int XMLCALL + xmlSchemaValueGetAsBoolean (xmlSchemaValPtr val); +XMLPUBFUN xmlSchemaValPtr XMLCALL + xmlSchemaNewStringValue (xmlSchemaValType type, + const xmlChar *value); +XMLPUBFUN xmlSchemaValPtr XMLCALL + xmlSchemaNewNOTATIONValue (const xmlChar *name, + const xmlChar *ns); +XMLPUBFUN xmlSchemaValPtr XMLCALL + xmlSchemaNewQNameValue (const xmlChar *namespaceName, + const xmlChar *localName); +XMLPUBFUN int XMLCALL + xmlSchemaCompareValuesWhtsp (xmlSchemaValPtr x, + xmlSchemaWhitespaceValueType xws, + xmlSchemaValPtr y, + xmlSchemaWhitespaceValueType yws); +XMLPUBFUN xmlSchemaValPtr XMLCALL + xmlSchemaCopyValue (xmlSchemaValPtr val); +XMLPUBFUN xmlSchemaValType XMLCALL + xmlSchemaGetValType (xmlSchemaValPtr val); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_SCHEMAS_ENABLED */ +#endif /* __XML_SCHEMA_TYPES_H__ */ diff --git a/include/libxml/xmlstring.h b/include/libxml/xmlstring.h new file mode 100644 index 0000000..39f846e --- /dev/null +++ b/include/libxml/xmlstring.h @@ -0,0 +1,141 @@ +/* + * Summary: set of routines to process strings + * Description: type and interfaces needed for the internal string handling + * of the library, especially UTF8 processing. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_STRING_H__ +#define __XML_STRING_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlChar: + * + * This is a basic byte in an UTF-8 encoded string. + * It's unsigned allowing to pinpoint case where char * are assigned + * to xmlChar * (possibly making serialization back impossible). + */ + +typedef unsigned char xmlChar; + +/** + * BAD_CAST: + * + * Macro to cast a string to an xmlChar * when one know its safe. + */ +#define BAD_CAST (xmlChar *) + +/* + * xmlChar handling + */ +XMLPUBFUN xmlChar * XMLCALL + xmlStrdup (const xmlChar *cur); +XMLPUBFUN xmlChar * XMLCALL + xmlStrndup (const xmlChar *cur, + int len); +XMLPUBFUN xmlChar * XMLCALL + xmlCharStrndup (const char *cur, + int len); +XMLPUBFUN xmlChar * XMLCALL + xmlCharStrdup (const char *cur); +XMLPUBFUN xmlChar * XMLCALL + xmlStrsub (const xmlChar *str, + int start, + int len); +XMLPUBFUN const xmlChar * XMLCALL + xmlStrchr (const xmlChar *str, + xmlChar val); +XMLPUBFUN const xmlChar * XMLCALL + xmlStrstr (const xmlChar *str, + const xmlChar *val); +XMLPUBFUN const xmlChar * XMLCALL + xmlStrcasestr (const xmlChar *str, + xmlChar *val); +XMLPUBFUN int XMLCALL + xmlStrcmp (const xmlChar *str1, + const xmlChar *str2); +XMLPUBFUN int XMLCALL + xmlStrncmp (const xmlChar *str1, + const xmlChar *str2, + int len); +XMLPUBFUN int XMLCALL + xmlStrcasecmp (const xmlChar *str1, + const xmlChar *str2); +XMLPUBFUN int XMLCALL + xmlStrncasecmp (const xmlChar *str1, + const xmlChar *str2, + int len); +XMLPUBFUN int XMLCALL + xmlStrEqual (const xmlChar *str1, + const xmlChar *str2); +XMLPUBFUN int XMLCALL + xmlStrQEqual (const xmlChar *pref, + const xmlChar *name, + const xmlChar *str); +XMLPUBFUN int XMLCALL + xmlStrlen (const xmlChar *str); +XMLPUBFUN xmlChar * XMLCALL + xmlStrcat (xmlChar *cur, + const xmlChar *add); +XMLPUBFUN xmlChar * XMLCALL + xmlStrncat (xmlChar *cur, + const xmlChar *add, + int len); +XMLPUBFUN xmlChar * XMLCALL + xmlStrncatNew (const xmlChar *str1, + const xmlChar *str2, + int len); +XMLPUBFUN int XMLCALL + xmlStrPrintf (xmlChar *buf, + int len, + const xmlChar *msg, + ...); +XMLPUBFUN int XMLCALL + xmlStrVPrintf (xmlChar *buf, + int len, + const xmlChar *msg, + va_list ap); + +XMLPUBFUN int XMLCALL + xmlGetUTF8Char (const unsigned char *utf, + int *len); +XMLPUBFUN int XMLCALL + xmlCheckUTF8 (const unsigned char *utf); +XMLPUBFUN int XMLCALL + xmlUTF8Strsize (const xmlChar *utf, + int len); +XMLPUBFUN xmlChar * XMLCALL + xmlUTF8Strndup (const xmlChar *utf, + int len); +XMLPUBFUN const xmlChar * XMLCALL + xmlUTF8Strpos (const xmlChar *utf, + int pos); +XMLPUBFUN int XMLCALL + xmlUTF8Strloc (const xmlChar *utf, + const xmlChar *utfchar); +XMLPUBFUN xmlChar * XMLCALL + xmlUTF8Strsub (const xmlChar *utf, + int start, + int len); +XMLPUBFUN int XMLCALL + xmlUTF8Strlen (const xmlChar *utf); +XMLPUBFUN int XMLCALL + xmlUTF8Size (const xmlChar *utf); +XMLPUBFUN int XMLCALL + xmlUTF8Charcmp (const xmlChar *utf1, + const xmlChar *utf2); + +#ifdef __cplusplus +} +#endif +#endif /* __XML_STRING_H__ */ diff --git a/include/libxml/xmlunicode.h b/include/libxml/xmlunicode.h new file mode 100644 index 0000000..3882b1f --- /dev/null +++ b/include/libxml/xmlunicode.h @@ -0,0 +1,202 @@ +/* + * Summary: Unicode character APIs + * Description: API for the Unicode character APIs + * + * This file is automatically generated from the + * UCS description files of the Unicode Character Database + * http://www.unicode.org/Public/4.0-Update1/UCD-4.0.1d5b.html + * using the genUnicode.py Python script. + * + * Generation date: Mon Nov 10 22:35:10 2003 + * Sources: Blocks-4.0.1d1b.txt UnicodeData-4.0.1d1b.txt + * Author: Daniel Veillard + */ + +#ifndef __XML_UNICODE_H__ +#define __XML_UNICODE_H__ + +#include + +#ifdef LIBXML_UNICODE_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +XMLPUBFUN int XMLCALL xmlUCSIsAegeanNumbers (int code); +XMLPUBFUN int XMLCALL xmlUCSIsAlphabeticPresentationForms (int code); +XMLPUBFUN int XMLCALL xmlUCSIsArabic (int code); +XMLPUBFUN int XMLCALL xmlUCSIsArabicPresentationFormsA (int code); +XMLPUBFUN int XMLCALL xmlUCSIsArabicPresentationFormsB (int code); +XMLPUBFUN int XMLCALL xmlUCSIsArmenian (int code); +XMLPUBFUN int XMLCALL xmlUCSIsArrows (int code); +XMLPUBFUN int XMLCALL xmlUCSIsBasicLatin (int code); +XMLPUBFUN int XMLCALL xmlUCSIsBengali (int code); +XMLPUBFUN int XMLCALL xmlUCSIsBlockElements (int code); +XMLPUBFUN int XMLCALL xmlUCSIsBopomofo (int code); +XMLPUBFUN int XMLCALL xmlUCSIsBopomofoExtended (int code); +XMLPUBFUN int XMLCALL xmlUCSIsBoxDrawing (int code); +XMLPUBFUN int XMLCALL xmlUCSIsBraillePatterns (int code); +XMLPUBFUN int XMLCALL xmlUCSIsBuhid (int code); +XMLPUBFUN int XMLCALL xmlUCSIsByzantineMusicalSymbols (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCJKCompatibility (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCJKCompatibilityForms (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCJKCompatibilityIdeographs (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCJKCompatibilityIdeographsSupplement (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCJKRadicalsSupplement (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCJKSymbolsandPunctuation (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCJKUnifiedIdeographs (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCJKUnifiedIdeographsExtensionA (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCJKUnifiedIdeographsExtensionB (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCherokee (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCombiningDiacriticalMarks (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCombiningDiacriticalMarksforSymbols (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCombiningHalfMarks (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCombiningMarksforSymbols (int code); +XMLPUBFUN int XMLCALL xmlUCSIsControlPictures (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCurrencySymbols (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCypriotSyllabary (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCyrillic (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCyrillicSupplement (int code); +XMLPUBFUN int XMLCALL xmlUCSIsDeseret (int code); +XMLPUBFUN int XMLCALL xmlUCSIsDevanagari (int code); +XMLPUBFUN int XMLCALL xmlUCSIsDingbats (int code); +XMLPUBFUN int XMLCALL xmlUCSIsEnclosedAlphanumerics (int code); +XMLPUBFUN int XMLCALL xmlUCSIsEnclosedCJKLettersandMonths (int code); +XMLPUBFUN int XMLCALL xmlUCSIsEthiopic (int code); +XMLPUBFUN int XMLCALL xmlUCSIsGeneralPunctuation (int code); +XMLPUBFUN int XMLCALL xmlUCSIsGeometricShapes (int code); +XMLPUBFUN int XMLCALL xmlUCSIsGeorgian (int code); +XMLPUBFUN int XMLCALL xmlUCSIsGothic (int code); +XMLPUBFUN int XMLCALL xmlUCSIsGreek (int code); +XMLPUBFUN int XMLCALL xmlUCSIsGreekExtended (int code); +XMLPUBFUN int XMLCALL xmlUCSIsGreekandCoptic (int code); +XMLPUBFUN int XMLCALL xmlUCSIsGujarati (int code); +XMLPUBFUN int XMLCALL xmlUCSIsGurmukhi (int code); +XMLPUBFUN int XMLCALL xmlUCSIsHalfwidthandFullwidthForms (int code); +XMLPUBFUN int XMLCALL xmlUCSIsHangulCompatibilityJamo (int code); +XMLPUBFUN int XMLCALL xmlUCSIsHangulJamo (int code); +XMLPUBFUN int XMLCALL xmlUCSIsHangulSyllables (int code); +XMLPUBFUN int XMLCALL xmlUCSIsHanunoo (int code); +XMLPUBFUN int XMLCALL xmlUCSIsHebrew (int code); +XMLPUBFUN int XMLCALL xmlUCSIsHighPrivateUseSurrogates (int code); +XMLPUBFUN int XMLCALL xmlUCSIsHighSurrogates (int code); +XMLPUBFUN int XMLCALL xmlUCSIsHiragana (int code); +XMLPUBFUN int XMLCALL xmlUCSIsIPAExtensions (int code); +XMLPUBFUN int XMLCALL xmlUCSIsIdeographicDescriptionCharacters (int code); +XMLPUBFUN int XMLCALL xmlUCSIsKanbun (int code); +XMLPUBFUN int XMLCALL xmlUCSIsKangxiRadicals (int code); +XMLPUBFUN int XMLCALL xmlUCSIsKannada (int code); +XMLPUBFUN int XMLCALL xmlUCSIsKatakana (int code); +XMLPUBFUN int XMLCALL xmlUCSIsKatakanaPhoneticExtensions (int code); +XMLPUBFUN int XMLCALL xmlUCSIsKhmer (int code); +XMLPUBFUN int XMLCALL xmlUCSIsKhmerSymbols (int code); +XMLPUBFUN int XMLCALL xmlUCSIsLao (int code); +XMLPUBFUN int XMLCALL xmlUCSIsLatin1Supplement (int code); +XMLPUBFUN int XMLCALL xmlUCSIsLatinExtendedA (int code); +XMLPUBFUN int XMLCALL xmlUCSIsLatinExtendedB (int code); +XMLPUBFUN int XMLCALL xmlUCSIsLatinExtendedAdditional (int code); +XMLPUBFUN int XMLCALL xmlUCSIsLetterlikeSymbols (int code); +XMLPUBFUN int XMLCALL xmlUCSIsLimbu (int code); +XMLPUBFUN int XMLCALL xmlUCSIsLinearBIdeograms (int code); +XMLPUBFUN int XMLCALL xmlUCSIsLinearBSyllabary (int code); +XMLPUBFUN int XMLCALL xmlUCSIsLowSurrogates (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMalayalam (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMathematicalAlphanumericSymbols (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMathematicalOperators (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMiscellaneousMathematicalSymbolsA (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMiscellaneousMathematicalSymbolsB (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMiscellaneousSymbols (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMiscellaneousSymbolsandArrows (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMiscellaneousTechnical (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMongolian (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMusicalSymbols (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMyanmar (int code); +XMLPUBFUN int XMLCALL xmlUCSIsNumberForms (int code); +XMLPUBFUN int XMLCALL xmlUCSIsOgham (int code); +XMLPUBFUN int XMLCALL xmlUCSIsOldItalic (int code); +XMLPUBFUN int XMLCALL xmlUCSIsOpticalCharacterRecognition (int code); +XMLPUBFUN int XMLCALL xmlUCSIsOriya (int code); +XMLPUBFUN int XMLCALL xmlUCSIsOsmanya (int code); +XMLPUBFUN int XMLCALL xmlUCSIsPhoneticExtensions (int code); +XMLPUBFUN int XMLCALL xmlUCSIsPrivateUse (int code); +XMLPUBFUN int XMLCALL xmlUCSIsPrivateUseArea (int code); +XMLPUBFUN int XMLCALL xmlUCSIsRunic (int code); +XMLPUBFUN int XMLCALL xmlUCSIsShavian (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSinhala (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSmallFormVariants (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSpacingModifierLetters (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSpecials (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSuperscriptsandSubscripts (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSupplementalArrowsA (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSupplementalArrowsB (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSupplementalMathematicalOperators (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSupplementaryPrivateUseAreaA (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSupplementaryPrivateUseAreaB (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSyriac (int code); +XMLPUBFUN int XMLCALL xmlUCSIsTagalog (int code); +XMLPUBFUN int XMLCALL xmlUCSIsTagbanwa (int code); +XMLPUBFUN int XMLCALL xmlUCSIsTags (int code); +XMLPUBFUN int XMLCALL xmlUCSIsTaiLe (int code); +XMLPUBFUN int XMLCALL xmlUCSIsTaiXuanJingSymbols (int code); +XMLPUBFUN int XMLCALL xmlUCSIsTamil (int code); +XMLPUBFUN int XMLCALL xmlUCSIsTelugu (int code); +XMLPUBFUN int XMLCALL xmlUCSIsThaana (int code); +XMLPUBFUN int XMLCALL xmlUCSIsThai (int code); +XMLPUBFUN int XMLCALL xmlUCSIsTibetan (int code); +XMLPUBFUN int XMLCALL xmlUCSIsUgaritic (int code); +XMLPUBFUN int XMLCALL xmlUCSIsUnifiedCanadianAboriginalSyllabics (int code); +XMLPUBFUN int XMLCALL xmlUCSIsVariationSelectors (int code); +XMLPUBFUN int XMLCALL xmlUCSIsVariationSelectorsSupplement (int code); +XMLPUBFUN int XMLCALL xmlUCSIsYiRadicals (int code); +XMLPUBFUN int XMLCALL xmlUCSIsYiSyllables (int code); +XMLPUBFUN int XMLCALL xmlUCSIsYijingHexagramSymbols (int code); + +XMLPUBFUN int XMLCALL xmlUCSIsBlock (int code, const char *block); + +XMLPUBFUN int XMLCALL xmlUCSIsCatC (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatCc (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatCf (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatCo (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatCs (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatL (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatLl (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatLm (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatLo (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatLt (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatLu (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatM (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatMc (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatMe (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatMn (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatN (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatNd (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatNl (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatNo (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatP (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatPc (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatPd (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatPe (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatPf (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatPi (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatPo (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatPs (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatS (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatSc (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatSk (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatSm (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatSo (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatZ (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatZl (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatZp (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatZs (int code); + +XMLPUBFUN int XMLCALL xmlUCSIsCat (int code, const char *cat); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_UNICODE_ENABLED */ + +#endif /* __XML_UNICODE_H__ */ diff --git a/include/libxml/xmlversion.h b/include/libxml/xmlversion.h new file mode 100644 index 0000000..b58982b --- /dev/null +++ b/include/libxml/xmlversion.h @@ -0,0 +1,373 @@ +/* + * Summary: compile-time version informations + * Description: compile-time version informations for the XML library + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_VERSION_H__ +#define __XML_VERSION_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * use those to be sure nothing nasty will happen if + * your library and includes mismatch + */ +#ifndef LIBXML2_COMPILING_MSCCDEF +XMLPUBFUN void XMLCALL xmlCheckVersion(int version); +#endif /* LIBXML2_COMPILING_MSCCDEF */ + +/** + * LIBXML_DOTTED_VERSION: + * + * the version string like "1.2.3" + */ +#define LIBXML_DOTTED_VERSION "2.6.20" + +/** + * LIBXML_VERSION: + * + * the version number: 1.2.3 value is 1002003 + */ +#define LIBXML_VERSION 20620 + +/** + * LIBXML_VERSION_STRING: + * + * the version number string, 1.2.3 value is "1002003" + */ +#define LIBXML_VERSION_STRING "20620" + +/** + * LIBXML_VERSION_EXTRA: + * + * extra version information, used to show a CVS compilation + */ +#define LIBXML_VERSION_EXTRA "" + +/** + * LIBXML_TEST_VERSION: + * + * Macro to check that the libxml version in use is compatible with + * the version the software has been compiled against + */ +#define LIBXML_TEST_VERSION xmlCheckVersion(20620); + +#ifndef VMS +#if 0 +/** + * WITH_TRIO: + * + * defined if the trio support need to be configured in + */ +#define WITH_TRIO +#else +/** + * WITHOUT_TRIO: + * + * defined if the trio support should not be configured in + */ +#define WITHOUT_TRIO +#endif +#else /* VMS */ +/** + * WITH_TRIO: + * + * defined if the trio support need to be configured in + */ +#define WITH_TRIO 1 +#endif /* VMS */ + +/** + * LIBXML_THREAD_ENABLED: + * + * Whether the thread support is configured in + */ +#if 1 +#if defined(_REENTRANT) || defined(__MT__) || (_POSIX_C_SOURCE - 0 >= 199506L) +#define LIBXML_THREAD_ENABLED +#endif +#endif + +/** + * LIBXML_TREE_ENABLED: + * + * Whether the DOM like tree manipulation API support is configured in + */ +#if 1 +#define LIBXML_TREE_ENABLED +#endif + +/** + * LIBXML_OUTPUT_ENABLED: + * + * Whether the serialization/saving support is configured in + */ +#if 1 +#define LIBXML_OUTPUT_ENABLED +#endif + +/** + * LIBXML_PUSH_ENABLED: + * + * Whether the push parsing interfaces are configured in + */ +#if 1 +#define LIBXML_PUSH_ENABLED +#endif + +/** + * LIBXML_READER_ENABLED: + * + * Whether the xmlReader parsing interface is configured in + */ +#if 1 +#define LIBXML_READER_ENABLED +#endif + +/** + * LIBXML_PATTERN_ENABLED: + * + * Whether the xmlPattern node selection interface is configured in + */ +#if 1 +#define LIBXML_PATTERN_ENABLED +#endif + +/** + * LIBXML_WRITER_ENABLED: + * + * Whether the xmlWriter saving interface is configured in + */ +#if 1 +#define LIBXML_WRITER_ENABLED +#endif + +/** + * LIBXML_SAX1_ENABLED: + * + * Whether the older SAX1 interface is configured in + */ +#if 1 +#define LIBXML_SAX1_ENABLED +#endif + +/** + * LIBXML_FTP_ENABLED: + * + * Whether the FTP support is configured in + */ +#if 1 +#define LIBXML_FTP_ENABLED +#endif + +/** + * LIBXML_HTTP_ENABLED: + * + * Whether the HTTP support is configured in + */ +#if 1 +#define LIBXML_HTTP_ENABLED +#endif + +/** + * LIBXML_VALID_ENABLED: + * + * Whether the DTD validation support is configured in + */ +#if 1 +#define LIBXML_VALID_ENABLED +#endif + +/** + * LIBXML_HTML_ENABLED: + * + * Whether the HTML support is configured in + */ +#if 1 +#define LIBXML_HTML_ENABLED +#endif + +/** + * LIBXML_LEGACY_ENABLED: + * + * Whether the deprecated APIs are compiled in for compatibility + */ +#if 1 +#define LIBXML_LEGACY_ENABLED +#endif + +/** + * LIBXML_C14N_ENABLED: + * + * Whether the Canonicalization support is configured in + */ +#if 1 +#define LIBXML_C14N_ENABLED +#endif + +/** + * LIBXML_CATALOG_ENABLED: + * + * Whether the Catalog support is configured in + */ +#if 1 +#define LIBXML_CATALOG_ENABLED +#endif + +/** + * LIBXML_DOCB_ENABLED: + * + * Whether the SGML Docbook support is configured in + */ +#if 1 +#define LIBXML_DOCB_ENABLED +#endif + +/** + * LIBXML_XPATH_ENABLED: + * + * Whether XPath is configured in + */ +#if 1 +#define LIBXML_XPATH_ENABLED +#endif + +/** + * LIBXML_XPTR_ENABLED: + * + * Whether XPointer is configured in + */ +#if 1 +#define LIBXML_XPTR_ENABLED +#endif + +/** + * LIBXML_XINCLUDE_ENABLED: + * + * Whether XInclude is configured in + */ +#if 1 +#define LIBXML_XINCLUDE_ENABLED +#endif + +/** + * LIBXML_ICONV_ENABLED: + * + * Whether iconv support is available + */ +#if 1 +#define LIBXML_ICONV_ENABLED +#endif + +/** + * LIBXML_ISO8859X_ENABLED: + * + * Whether ISO-8859-* support is made available in case iconv is not + */ +#if 1 +#define LIBXML_ISO8859X_ENABLED +#endif + +/** + * LIBXML_DEBUG_ENABLED: + * + * Whether Debugging module is configured in + */ +#if 1 +#define LIBXML_DEBUG_ENABLED +#endif + +/** + * DEBUG_MEMORY_LOCATION: + * + * Whether the memory debugging is configured in + */ +#if 0 +#define DEBUG_MEMORY_LOCATION +#endif + +/** + * LIBXML_DEBUG_RUNTIME: + * + * Whether the runtime debugging is configured in + */ +#if 0 +#define LIBXML_DEBUG_RUNTIME +#endif + +/** + * LIBXML_UNICODE_ENABLED: + * + * Whether the Unicode related interfaces are compiled in + */ +#if 1 +#define LIBXML_UNICODE_ENABLED +#endif + +/** + * LIBXML_REGEXP_ENABLED: + * + * Whether the regular expressions interfaces are compiled in + */ +#if 1 +#define LIBXML_REGEXP_ENABLED +#endif + +/** + * LIBXML_AUTOMATA_ENABLED: + * + * Whether the automata interfaces are compiled in + */ +#if 1 +#define LIBXML_AUTOMATA_ENABLED +#endif + +/** + * LIBXML_SCHEMAS_ENABLED: + * + * Whether the Schemas validation interfaces are compiled in + */ +#if 1 +#define LIBXML_SCHEMAS_ENABLED +#endif + +/** + * LIBXML_MODULES_ENABLED: + * + * Whether the module interfaces are compiled in + */ +#if 1 +#define LIBXML_MODULES_ENABLED +#define LIBXML_MODULE_EXTENSION ".so" +#endif + +/** + * ATTRIBUTE_UNUSED: + * + * Macro used to signal to GCC unused function parameters + */ +#ifdef __GNUC__ +#ifdef HAVE_ANSIDECL_H +#include +#endif +#ifndef ATTRIBUTE_UNUSED +#define ATTRIBUTE_UNUSED __attribute__((unused)) +#endif +#else +#define ATTRIBUTE_UNUSED +#endif + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif + + diff --git a/include/libxml/xmlversion.h.in b/include/libxml/xmlversion.h.in new file mode 100644 index 0000000..47a28b9 --- /dev/null +++ b/include/libxml/xmlversion.h.in @@ -0,0 +1,373 @@ +/* + * Summary: compile-time version informations + * Description: compile-time version informations for the XML library + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_VERSION_H__ +#define __XML_VERSION_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * use those to be sure nothing nasty will happen if + * your library and includes mismatch + */ +#ifndef LIBXML2_COMPILING_MSCCDEF +XMLPUBFUN void XMLCALL xmlCheckVersion(int version); +#endif /* LIBXML2_COMPILING_MSCCDEF */ + +/** + * LIBXML_DOTTED_VERSION: + * + * the version string like "1.2.3" + */ +#define LIBXML_DOTTED_VERSION "@VERSION@" + +/** + * LIBXML_VERSION: + * + * the version number: 1.2.3 value is 1002003 + */ +#define LIBXML_VERSION @LIBXML_VERSION_NUMBER@ + +/** + * LIBXML_VERSION_STRING: + * + * the version number string, 1.2.3 value is "1002003" + */ +#define LIBXML_VERSION_STRING "@LIBXML_VERSION_NUMBER@" + +/** + * LIBXML_VERSION_EXTRA: + * + * extra version information, used to show a CVS compilation + */ +#define LIBXML_VERSION_EXTRA "@LIBXML_VERSION_EXTRA@" + +/** + * LIBXML_TEST_VERSION: + * + * Macro to check that the libxml version in use is compatible with + * the version the software has been compiled against + */ +#define LIBXML_TEST_VERSION xmlCheckVersion(@LIBXML_VERSION_NUMBER@); + +#ifndef VMS +#if @WITH_TRIO@ +/** + * WITH_TRIO: + * + * defined if the trio support need to be configured in + */ +#define WITH_TRIO +#else +/** + * WITHOUT_TRIO: + * + * defined if the trio support should not be configured in + */ +#define WITHOUT_TRIO +#endif +#else /* VMS */ +/** + * WITH_TRIO: + * + * defined if the trio support need to be configured in + */ +#define WITH_TRIO 1 +#endif /* VMS */ + +/** + * LIBXML_THREAD_ENABLED: + * + * Whether the thread support is configured in + */ +#if @WITH_THREADS@ +#if defined(_REENTRANT) || defined(__MT__) || (_POSIX_C_SOURCE - 0 >= 199506L) +#define LIBXML_THREAD_ENABLED +#endif +#endif + +/** + * LIBXML_TREE_ENABLED: + * + * Whether the DOM like tree manipulation API support is configured in + */ +#if @WITH_TREE@ +#define LIBXML_TREE_ENABLED +#endif + +/** + * LIBXML_OUTPUT_ENABLED: + * + * Whether the serialization/saving support is configured in + */ +#if @WITH_OUTPUT@ +#define LIBXML_OUTPUT_ENABLED +#endif + +/** + * LIBXML_PUSH_ENABLED: + * + * Whether the push parsing interfaces are configured in + */ +#if @WITH_PUSH@ +#define LIBXML_PUSH_ENABLED +#endif + +/** + * LIBXML_READER_ENABLED: + * + * Whether the xmlReader parsing interface is configured in + */ +#if @WITH_READER@ +#define LIBXML_READER_ENABLED +#endif + +/** + * LIBXML_PATTERN_ENABLED: + * + * Whether the xmlPattern node selection interface is configured in + */ +#if @WITH_PATTERN@ +#define LIBXML_PATTERN_ENABLED +#endif + +/** + * LIBXML_WRITER_ENABLED: + * + * Whether the xmlWriter saving interface is configured in + */ +#if @WITH_WRITER@ +#define LIBXML_WRITER_ENABLED +#endif + +/** + * LIBXML_SAX1_ENABLED: + * + * Whether the older SAX1 interface is configured in + */ +#if @WITH_SAX1@ +#define LIBXML_SAX1_ENABLED +#endif + +/** + * LIBXML_FTP_ENABLED: + * + * Whether the FTP support is configured in + */ +#if @WITH_FTP@ +#define LIBXML_FTP_ENABLED +#endif + +/** + * LIBXML_HTTP_ENABLED: + * + * Whether the HTTP support is configured in + */ +#if @WITH_HTTP@ +#define LIBXML_HTTP_ENABLED +#endif + +/** + * LIBXML_VALID_ENABLED: + * + * Whether the DTD validation support is configured in + */ +#if @WITH_VALID@ +#define LIBXML_VALID_ENABLED +#endif + +/** + * LIBXML_HTML_ENABLED: + * + * Whether the HTML support is configured in + */ +#if @WITH_HTML@ +#define LIBXML_HTML_ENABLED +#endif + +/** + * LIBXML_LEGACY_ENABLED: + * + * Whether the deprecated APIs are compiled in for compatibility + */ +#if @WITH_LEGACY@ +#define LIBXML_LEGACY_ENABLED +#endif + +/** + * LIBXML_C14N_ENABLED: + * + * Whether the Canonicalization support is configured in + */ +#if @WITH_C14N@ +#define LIBXML_C14N_ENABLED +#endif + +/** + * LIBXML_CATALOG_ENABLED: + * + * Whether the Catalog support is configured in + */ +#if @WITH_CATALOG@ +#define LIBXML_CATALOG_ENABLED +#endif + +/** + * LIBXML_DOCB_ENABLED: + * + * Whether the SGML Docbook support is configured in + */ +#if @WITH_DOCB@ +#define LIBXML_DOCB_ENABLED +#endif + +/** + * LIBXML_XPATH_ENABLED: + * + * Whether XPath is configured in + */ +#if @WITH_XPATH@ +#define LIBXML_XPATH_ENABLED +#endif + +/** + * LIBXML_XPTR_ENABLED: + * + * Whether XPointer is configured in + */ +#if @WITH_XPTR@ +#define LIBXML_XPTR_ENABLED +#endif + +/** + * LIBXML_XINCLUDE_ENABLED: + * + * Whether XInclude is configured in + */ +#if @WITH_XINCLUDE@ +#define LIBXML_XINCLUDE_ENABLED +#endif + +/** + * LIBXML_ICONV_ENABLED: + * + * Whether iconv support is available + */ +#if @WITH_ICONV@ +#define LIBXML_ICONV_ENABLED +#endif + +/** + * LIBXML_ISO8859X_ENABLED: + * + * Whether ISO-8859-* support is made available in case iconv is not + */ +#if @WITH_ISO8859X@ +#define LIBXML_ISO8859X_ENABLED +#endif + +/** + * LIBXML_DEBUG_ENABLED: + * + * Whether Debugging module is configured in + */ +#if @WITH_DEBUG@ +#define LIBXML_DEBUG_ENABLED +#endif + +/** + * DEBUG_MEMORY_LOCATION: + * + * Whether the memory debugging is configured in + */ +#if @WITH_MEM_DEBUG@ +#define DEBUG_MEMORY_LOCATION +#endif + +/** + * LIBXML_DEBUG_RUNTIME: + * + * Whether the runtime debugging is configured in + */ +#if @WITH_MEM_DEBUG@ +#define LIBXML_DEBUG_RUNTIME +#endif + +/** + * LIBXML_UNICODE_ENABLED: + * + * Whether the Unicode related interfaces are compiled in + */ +#if @WITH_REGEXPS@ +#define LIBXML_UNICODE_ENABLED +#endif + +/** + * LIBXML_REGEXP_ENABLED: + * + * Whether the regular expressions interfaces are compiled in + */ +#if @WITH_REGEXPS@ +#define LIBXML_REGEXP_ENABLED +#endif + +/** + * LIBXML_AUTOMATA_ENABLED: + * + * Whether the automata interfaces are compiled in + */ +#if @WITH_REGEXPS@ +#define LIBXML_AUTOMATA_ENABLED +#endif + +/** + * LIBXML_SCHEMAS_ENABLED: + * + * Whether the Schemas validation interfaces are compiled in + */ +#if @WITH_SCHEMAS@ +#define LIBXML_SCHEMAS_ENABLED +#endif + +/** + * LIBXML_MODULES_ENABLED: + * + * Whether the module interfaces are compiled in + */ +#if @WITH_MODULES@ +#define LIBXML_MODULES_ENABLED +#define LIBXML_MODULE_EXTENSION "@MODULE_EXTENSION@" +#endif + +/** + * ATTRIBUTE_UNUSED: + * + * Macro used to signal to GCC unused function parameters + */ +#ifdef __GNUC__ +#ifdef HAVE_ANSIDECL_H +#include +#endif +#ifndef ATTRIBUTE_UNUSED +#define ATTRIBUTE_UNUSED __attribute__((unused)) +#endif +#else +#define ATTRIBUTE_UNUSED +#endif + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif + + diff --git a/include/libxml/xmlwriter.h b/include/libxml/xmlwriter.h new file mode 100644 index 0000000..31ceb5f --- /dev/null +++ b/include/libxml/xmlwriter.h @@ -0,0 +1,459 @@ + +/* + * Summary: text writing API for XML + * Description: text writing API for XML + * + * Copy: See Copyright for the status of this software. + * + * Author: Alfred Mickautsch + */ + +#ifndef __XML_XMLWRITER_H__ +#define __XML_XMLWRITER_H__ + +#include + +#ifdef LIBXML_WRITER_ENABLED + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + + typedef struct _xmlTextWriter xmlTextWriter; + typedef xmlTextWriter *xmlTextWriterPtr; + +/* + * Constructors & Destructor + */ + XMLPUBFUN xmlTextWriterPtr XMLCALL + xmlNewTextWriter(xmlOutputBufferPtr out); + XMLPUBFUN xmlTextWriterPtr XMLCALL + xmlNewTextWriterFilename(const char *uri, int compression); + XMLPUBFUN xmlTextWriterPtr XMLCALL + xmlNewTextWriterMemory(xmlBufferPtr buf, int compression); + XMLPUBFUN xmlTextWriterPtr XMLCALL + xmlNewTextWriterPushParser(xmlParserCtxtPtr ctxt, int compression); + XMLPUBFUN xmlTextWriterPtr XMLCALL + xmlNewTextWriterDoc(xmlDocPtr * doc, int compression); + XMLPUBFUN xmlTextWriterPtr XMLCALL + xmlNewTextWriterTree(xmlDocPtr doc, xmlNodePtr node, + int compression); + XMLPUBFUN void XMLCALL xmlFreeTextWriter(xmlTextWriterPtr writer); + +/* + * Functions + */ + + +/* + * Document + */ + XMLPUBFUN int XMLCALL + xmlTextWriterStartDocument(xmlTextWriterPtr writer, + const char *version, + const char *encoding, + const char *standalone); + XMLPUBFUN int XMLCALL xmlTextWriterEndDocument(xmlTextWriterPtr + writer); + +/* + * Comments + */ + XMLPUBFUN int XMLCALL xmlTextWriterStartComment(xmlTextWriterPtr + writer); + XMLPUBFUN int XMLCALL xmlTextWriterEndComment(xmlTextWriterPtr writer); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatComment(xmlTextWriterPtr writer, + const char *format, ...); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatComment(xmlTextWriterPtr writer, + const char *format, + va_list argptr); + XMLPUBFUN int XMLCALL xmlTextWriterWriteComment(xmlTextWriterPtr + writer, + const xmlChar * + content); + +/* + * Elements + */ + XMLPUBFUN int XMLCALL + xmlTextWriterStartElement(xmlTextWriterPtr writer, + const xmlChar * name); + XMLPUBFUN int XMLCALL xmlTextWriterStartElementNS(xmlTextWriterPtr + writer, + const xmlChar * + prefix, + const xmlChar * name, + const xmlChar * + namespaceURI); + XMLPUBFUN int XMLCALL xmlTextWriterEndElement(xmlTextWriterPtr writer); + XMLPUBFUN int XMLCALL xmlTextWriterFullEndElement(xmlTextWriterPtr + writer); + +/* + * Elements conveniency functions + */ + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatElement(xmlTextWriterPtr writer, + const xmlChar * name, + const char *format, ...); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatElement(xmlTextWriterPtr writer, + const xmlChar * name, + const char *format, + va_list argptr); + XMLPUBFUN int XMLCALL xmlTextWriterWriteElement(xmlTextWriterPtr + writer, + const xmlChar * name, + const xmlChar * + content); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatElementNS(xmlTextWriterPtr writer, + const xmlChar * prefix, + const xmlChar * name, + const xmlChar * namespaceURI, + const char *format, ...); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatElementNS(xmlTextWriterPtr writer, + const xmlChar * prefix, + const xmlChar * name, + const xmlChar * namespaceURI, + const char *format, + va_list argptr); + XMLPUBFUN int XMLCALL xmlTextWriterWriteElementNS(xmlTextWriterPtr + writer, + const xmlChar * + prefix, + const xmlChar * name, + const xmlChar * + namespaceURI, + const xmlChar * + content); + +/* + * Text + */ + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatRaw(xmlTextWriterPtr writer, + const char *format, ...); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatRaw(xmlTextWriterPtr writer, + const char *format, va_list argptr); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteRawLen(xmlTextWriterPtr writer, + const xmlChar * content, int len); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteRaw(xmlTextWriterPtr writer, + const xmlChar * content); + XMLPUBFUN int XMLCALL xmlTextWriterWriteFormatString(xmlTextWriterPtr + writer, + const char + *format, ...); + XMLPUBFUN int XMLCALL xmlTextWriterWriteVFormatString(xmlTextWriterPtr + writer, + const char + *format, + va_list argptr); + XMLPUBFUN int XMLCALL xmlTextWriterWriteString(xmlTextWriterPtr writer, + const xmlChar * + content); + XMLPUBFUN int XMLCALL xmlTextWriterWriteBase64(xmlTextWriterPtr writer, + const char *data, + int start, int len); + XMLPUBFUN int XMLCALL xmlTextWriterWriteBinHex(xmlTextWriterPtr writer, + const char *data, + int start, int len); + +/* + * Attributes + */ + XMLPUBFUN int XMLCALL + xmlTextWriterStartAttribute(xmlTextWriterPtr writer, + const xmlChar * name); + XMLPUBFUN int XMLCALL xmlTextWriterStartAttributeNS(xmlTextWriterPtr + writer, + const xmlChar * + prefix, + const xmlChar * + name, + const xmlChar * + namespaceURI); + XMLPUBFUN int XMLCALL xmlTextWriterEndAttribute(xmlTextWriterPtr + writer); + +/* + * Attributes conveniency functions + */ + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatAttribute(xmlTextWriterPtr writer, + const xmlChar * name, + const char *format, ...); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatAttribute(xmlTextWriterPtr writer, + const xmlChar * name, + const char *format, + va_list argptr); + XMLPUBFUN int XMLCALL xmlTextWriterWriteAttribute(xmlTextWriterPtr + writer, + const xmlChar * name, + const xmlChar * + content); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatAttributeNS(xmlTextWriterPtr writer, + const xmlChar * prefix, + const xmlChar * name, + const xmlChar * namespaceURI, + const char *format, ...); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatAttributeNS(xmlTextWriterPtr writer, + const xmlChar * prefix, + const xmlChar * name, + const xmlChar * namespaceURI, + const char *format, + va_list argptr); + XMLPUBFUN int XMLCALL xmlTextWriterWriteAttributeNS(xmlTextWriterPtr + writer, + const xmlChar * + prefix, + const xmlChar * + name, + const xmlChar * + namespaceURI, + const xmlChar * + content); + +/* + * PI's + */ + XMLPUBFUN int XMLCALL + xmlTextWriterStartPI(xmlTextWriterPtr writer, + const xmlChar * target); + XMLPUBFUN int XMLCALL xmlTextWriterEndPI(xmlTextWriterPtr writer); + +/* + * PI conveniency functions + */ + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatPI(xmlTextWriterPtr writer, + const xmlChar * target, + const char *format, ...); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatPI(xmlTextWriterPtr writer, + const xmlChar * target, + const char *format, va_list argptr); + XMLPUBFUN int XMLCALL + xmlTextWriterWritePI(xmlTextWriterPtr writer, + const xmlChar * target, + const xmlChar * content); + +/** + * xmlTextWriterWriteProcessingInstruction: + * + * This macro maps to xmlTextWriterWritePI + */ +#define xmlTextWriterWriteProcessingInstruction xmlTextWriterWritePI + +/* + * CDATA + */ + XMLPUBFUN int XMLCALL xmlTextWriterStartCDATA(xmlTextWriterPtr writer); + XMLPUBFUN int XMLCALL xmlTextWriterEndCDATA(xmlTextWriterPtr writer); + +/* + * CDATA conveniency functions + */ + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatCDATA(xmlTextWriterPtr writer, + const char *format, ...); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatCDATA(xmlTextWriterPtr writer, + const char *format, va_list argptr); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteCDATA(xmlTextWriterPtr writer, + const xmlChar * content); + +/* + * DTD + */ + XMLPUBFUN int XMLCALL + xmlTextWriterStartDTD(xmlTextWriterPtr writer, + const xmlChar * name, + const xmlChar * pubid, + const xmlChar * sysid); + XMLPUBFUN int XMLCALL xmlTextWriterEndDTD(xmlTextWriterPtr writer); + +/* + * DTD conveniency functions + */ + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatDTD(xmlTextWriterPtr writer, + const xmlChar * name, + const xmlChar * pubid, + const xmlChar * sysid, + const char *format, ...); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatDTD(xmlTextWriterPtr writer, + const xmlChar * name, + const xmlChar * pubid, + const xmlChar * sysid, + const char *format, va_list argptr); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteDTD(xmlTextWriterPtr writer, + const xmlChar * name, + const xmlChar * pubid, + const xmlChar * sysid, + const xmlChar * subset); + +/** + * xmlTextWriterWriteDocType: + * + * this macro maps to xmlTextWriterWriteDTD + */ +#define xmlTextWriterWriteDocType xmlTextWriterWriteDTD + +/* + * DTD element definition + */ + XMLPUBFUN int XMLCALL + xmlTextWriterStartDTDElement(xmlTextWriterPtr writer, + const xmlChar * name); + XMLPUBFUN int XMLCALL xmlTextWriterEndDTDElement(xmlTextWriterPtr + writer); + +/* + * DTD element definition conveniency functions + */ + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatDTDElement(xmlTextWriterPtr writer, + const xmlChar * name, + const char *format, ...); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatDTDElement(xmlTextWriterPtr writer, + const xmlChar * name, + const char *format, + va_list argptr); + XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDElement(xmlTextWriterPtr + writer, + const xmlChar * + name, + const xmlChar * + content); + +/* + * DTD attribute list definition + */ + XMLPUBFUN int XMLCALL + xmlTextWriterStartDTDAttlist(xmlTextWriterPtr writer, + const xmlChar * name); + XMLPUBFUN int XMLCALL xmlTextWriterEndDTDAttlist(xmlTextWriterPtr + writer); + +/* + * DTD attribute list definition conveniency functions + */ + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatDTDAttlist(xmlTextWriterPtr writer, + const xmlChar * name, + const char *format, ...); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatDTDAttlist(xmlTextWriterPtr writer, + const xmlChar * name, + const char *format, + va_list argptr); + XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDAttlist(xmlTextWriterPtr + writer, + const xmlChar * + name, + const xmlChar * + content); + +/* + * DTD entity definition + */ + XMLPUBFUN int XMLCALL + xmlTextWriterStartDTDEntity(xmlTextWriterPtr writer, + int pe, const xmlChar * name); + XMLPUBFUN int XMLCALL xmlTextWriterEndDTDEntity(xmlTextWriterPtr + writer); + +/* + * DTD entity definition conveniency functions + */ + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatDTDInternalEntity(xmlTextWriterPtr writer, + int pe, + const xmlChar * name, + const char *format, ...); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatDTDInternalEntity(xmlTextWriterPtr writer, + int pe, + const xmlChar * name, + const char *format, + va_list argptr); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteDTDInternalEntity(xmlTextWriterPtr writer, + int pe, + const xmlChar * name, + const xmlChar * content); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteDTDExternalEntity(xmlTextWriterPtr writer, + int pe, + const xmlChar * name, + const xmlChar * pubid, + const xmlChar * sysid, + const xmlChar * ndataid); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteDTDExternalEntityContents(xmlTextWriterPtr + writer, + const xmlChar * pubid, + const xmlChar * sysid, + const xmlChar * + ndataid); + XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDEntity(xmlTextWriterPtr + writer, int pe, + const xmlChar * name, + const xmlChar * + pubid, + const xmlChar * + sysid, + const xmlChar * + ndataid, + const xmlChar * + content); + +/* + * DTD notation definition + */ + XMLPUBFUN int XMLCALL + xmlTextWriterWriteDTDNotation(xmlTextWriterPtr writer, + const xmlChar * name, + const xmlChar * pubid, + const xmlChar * sysid); + +/* + * Indentation + */ + XMLPUBFUN int XMLCALL + xmlTextWriterSetIndent(xmlTextWriterPtr writer, int indent); + XMLPUBFUN int XMLCALL + xmlTextWriterSetIndentString(xmlTextWriterPtr writer, + const xmlChar * str); + +/* + * misc + */ + XMLPUBFUN int XMLCALL xmlTextWriterFlush(xmlTextWriterPtr writer); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_WRITER_ENABLED */ + +#endif /* __XML_XMLWRITER_H__ */ diff --git a/include/libxml/xpath.h b/include/libxml/xpath.h new file mode 100644 index 0000000..eee2630 --- /dev/null +++ b/include/libxml/xpath.h @@ -0,0 +1,513 @@ +/* + * Summary: XML Path Language implementation + * Description: API for the XML Path Language implementation + * + * XML Path Language implementation + * XPath is a language for addressing parts of an XML document, + * designed to be used by both XSLT and XPointer + * http://www.w3.org/TR/xpath + * + * Implements + * W3C Recommendation 16 November 1999 + * http://www.w3.org/TR/1999/REC-xpath-19991116 + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XPATH_H__ +#define __XML_XPATH_H__ + +#include + +#ifdef LIBXML_XPATH_ENABLED + +#include +#include +#include +#endif /* LIBXML_XPATH_ENABLED */ + +#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) +#ifdef __cplusplus +extern "C" { +#endif +#endif /* LIBXML_XPATH_ENABLED or LIBXML_SCHEMAS_ENABLED */ + +#ifdef LIBXML_XPATH_ENABLED +typedef struct _xmlXPathContext xmlXPathContext; +typedef xmlXPathContext *xmlXPathContextPtr; +typedef struct _xmlXPathParserContext xmlXPathParserContext; +typedef xmlXPathParserContext *xmlXPathParserContextPtr; + +/** + * The set of XPath error codes. + */ + +typedef enum { + XPATH_EXPRESSION_OK = 0, + XPATH_NUMBER_ERROR, + XPATH_UNFINISHED_LITERAL_ERROR, + XPATH_START_LITERAL_ERROR, + XPATH_VARIABLE_REF_ERROR, + XPATH_UNDEF_VARIABLE_ERROR, + XPATH_INVALID_PREDICATE_ERROR, + XPATH_EXPR_ERROR, + XPATH_UNCLOSED_ERROR, + XPATH_UNKNOWN_FUNC_ERROR, + XPATH_INVALID_OPERAND, + XPATH_INVALID_TYPE, + XPATH_INVALID_ARITY, + XPATH_INVALID_CTXT_SIZE, + XPATH_INVALID_CTXT_POSITION, + XPATH_MEMORY_ERROR, + XPTR_SYNTAX_ERROR, + XPTR_RESOURCE_ERROR, + XPTR_SUB_RESOURCE_ERROR, + XPATH_UNDEF_PREFIX_ERROR, + XPATH_ENCODING_ERROR, + XPATH_INVALID_CHAR_ERROR, + XPATH_INVALID_CTXT +} xmlXPathError; + +/* + * A node-set (an unordered collection of nodes without duplicates). + */ +typedef struct _xmlNodeSet xmlNodeSet; +typedef xmlNodeSet *xmlNodeSetPtr; +struct _xmlNodeSet { + int nodeNr; /* number of nodes in the set */ + int nodeMax; /* size of the array as allocated */ + xmlNodePtr *nodeTab; /* array of nodes in no particular order */ + /* @@ with_ns to check wether namespace nodes should be looked at @@ */ +}; + +/* + * An expression is evaluated to yield an object, which + * has one of the following four basic types: + * - node-set + * - boolean + * - number + * - string + * + * @@ XPointer will add more types ! + */ + +typedef enum { + XPATH_UNDEFINED = 0, + XPATH_NODESET = 1, + XPATH_BOOLEAN = 2, + XPATH_NUMBER = 3, + XPATH_STRING = 4, + XPATH_POINT = 5, + XPATH_RANGE = 6, + XPATH_LOCATIONSET = 7, + XPATH_USERS = 8, + XPATH_XSLT_TREE = 9 /* An XSLT value tree, non modifiable */ +} xmlXPathObjectType; + +typedef struct _xmlXPathObject xmlXPathObject; +typedef xmlXPathObject *xmlXPathObjectPtr; +struct _xmlXPathObject { + xmlXPathObjectType type; + xmlNodeSetPtr nodesetval; + int boolval; + double floatval; + xmlChar *stringval; + void *user; + int index; + void *user2; + int index2; +}; + +/** + * xmlXPathConvertFunc: + * @obj: an XPath object + * @type: the number of the target type + * + * A conversion function is associated to a type and used to cast + * the new type to primitive values. + * + * Returns -1 in case of error, 0 otherwise + */ +typedef int (*xmlXPathConvertFunc) (xmlXPathObjectPtr obj, int type); + +/* + * Extra type: a name and a conversion function. + */ + +typedef struct _xmlXPathType xmlXPathType; +typedef xmlXPathType *xmlXPathTypePtr; +struct _xmlXPathType { + const xmlChar *name; /* the type name */ + xmlXPathConvertFunc func; /* the conversion function */ +}; + +/* + * Extra variable: a name and a value. + */ + +typedef struct _xmlXPathVariable xmlXPathVariable; +typedef xmlXPathVariable *xmlXPathVariablePtr; +struct _xmlXPathVariable { + const xmlChar *name; /* the variable name */ + xmlXPathObjectPtr value; /* the value */ +}; + +/** + * xmlXPathEvalFunc: + * @ctxt: an XPath parser context + * @nargs: the number of arguments passed to the function + * + * An XPath evaluation function, the parameters are on the XPath context stack. + */ + +typedef void (*xmlXPathEvalFunc)(xmlXPathParserContextPtr ctxt, + int nargs); + +/* + * Extra function: a name and a evaluation function. + */ + +typedef struct _xmlXPathFunct xmlXPathFunct; +typedef xmlXPathFunct *xmlXPathFuncPtr; +struct _xmlXPathFunct { + const xmlChar *name; /* the function name */ + xmlXPathEvalFunc func; /* the evaluation function */ +}; + +/** + * xmlXPathAxisFunc: + * @ctxt: the XPath interpreter context + * @cur: the previous node being explored on that axis + * + * An axis traversal function. To traverse an axis, the engine calls + * the first time with cur == NULL and repeat until the function returns + * NULL indicating the end of the axis traversal. + * + * Returns the next node in that axis or NULL if at the end of the axis. + */ + +typedef xmlXPathObjectPtr (*xmlXPathAxisFunc) (xmlXPathParserContextPtr ctxt, + xmlXPathObjectPtr cur); + +/* + * Extra axis: a name and an axis function. + */ + +typedef struct _xmlXPathAxis xmlXPathAxis; +typedef xmlXPathAxis *xmlXPathAxisPtr; +struct _xmlXPathAxis { + const xmlChar *name; /* the axis name */ + xmlXPathAxisFunc func; /* the search function */ +}; + +/** + * xmlXPathFunction: + * @ctxt: the XPath interprestation context + * @nargs: the number of arguments + * + * An XPath function. + * The arguments (if any) are popped out from the context stack + * and the result is pushed on the stack. + */ + +typedef void (*xmlXPathFunction) (xmlXPathParserContextPtr ctxt, int nargs); + +/* + * Function and Variable Lookup. + */ + +/** + * xmlXPathVariableLookupFunc: + * @ctxt: an XPath context + * @name: name of the variable + * @ns_uri: the namespace name hosting this variable + * + * Prototype for callbacks used to plug variable lookup in the XPath + * engine. + * + * Returns the XPath object value or NULL if not found. + */ +typedef xmlXPathObjectPtr (*xmlXPathVariableLookupFunc) (void *ctxt, + const xmlChar *name, + const xmlChar *ns_uri); + +/** + * xmlXPathFuncLookupFunc: + * @ctxt: an XPath context + * @name: name of the function + * @ns_uri: the namespace name hosting this function + * + * Prototype for callbacks used to plug function lookup in the XPath + * engine. + * + * Returns the XPath function or NULL if not found. + */ +typedef xmlXPathFunction (*xmlXPathFuncLookupFunc) (void *ctxt, + const xmlChar *name, + const xmlChar *ns_uri); + +/** + * xmlXPathContext: + * + * Expression evaluation occurs with respect to a context. + * he context consists of: + * - a node (the context node) + * - a node list (the context node list) + * - a set of variable bindings + * - a function library + * - the set of namespace declarations in scope for the expression + * Following the switch to hash tables, this need to be trimmed up at + * the next binary incompatible release. + */ + +struct _xmlXPathContext { + xmlDocPtr doc; /* The current document */ + xmlNodePtr node; /* The current node */ + + int nb_variables_unused; /* unused (hash table) */ + int max_variables_unused; /* unused (hash table) */ + xmlHashTablePtr varHash; /* Hash table of defined variables */ + + int nb_types; /* number of defined types */ + int max_types; /* max number of types */ + xmlXPathTypePtr types; /* Array of defined types */ + + int nb_funcs_unused; /* unused (hash table) */ + int max_funcs_unused; /* unused (hash table) */ + xmlHashTablePtr funcHash; /* Hash table of defined funcs */ + + int nb_axis; /* number of defined axis */ + int max_axis; /* max number of axis */ + xmlXPathAxisPtr axis; /* Array of defined axis */ + + /* the namespace nodes of the context node */ + xmlNsPtr *namespaces; /* Array of namespaces */ + int nsNr; /* number of namespace in scope */ + void *user; /* function to free */ + + /* extra variables */ + int contextSize; /* the context size */ + int proximityPosition; /* the proximity position */ + + /* extra stuff for XPointer */ + int xptr; /* it this an XPointer context */ + xmlNodePtr here; /* for here() */ + xmlNodePtr origin; /* for origin() */ + + /* the set of namespace declarations in scope for the expression */ + xmlHashTablePtr nsHash; /* The namespaces hash table */ + xmlXPathVariableLookupFunc varLookupFunc;/* variable lookup func */ + void *varLookupData; /* variable lookup data */ + + /* Possibility to link in an extra item */ + void *extra; /* needed for XSLT */ + + /* The function name and URI when calling a function */ + const xmlChar *function; + const xmlChar *functionURI; + + /* function lookup function and data */ + xmlXPathFuncLookupFunc funcLookupFunc;/* function lookup func */ + void *funcLookupData; /* function lookup data */ + + /* temporary namespace lists kept for walking the namespace axis */ + xmlNsPtr *tmpNsList; /* Array of namespaces */ + int tmpNsNr; /* number of namespace in scope */ + + /* error reporting mechanism */ + void *userData; /* user specific data block */ + xmlStructuredErrorFunc error; /* the callback in case of errors */ + xmlError lastError; /* the last error */ + xmlNodePtr debugNode; /* the source node XSLT */ + + /* dictionnary */ + xmlDictPtr dict; /* dictionnary if any */ +}; + +/* + * The structure of a compiled expression form is not public. + */ + +typedef struct _xmlXPathCompExpr xmlXPathCompExpr; +typedef xmlXPathCompExpr *xmlXPathCompExprPtr; + +/** + * xmlXPathParserContext: + * + * An XPath parser context. It contains pure parsing informations, + * an xmlXPathContext, and the stack of objects. + */ +struct _xmlXPathParserContext { + const xmlChar *cur; /* the current char being parsed */ + const xmlChar *base; /* the full expression */ + + int error; /* error code */ + + xmlXPathContextPtr context; /* the evaluation context */ + xmlXPathObjectPtr value; /* the current value */ + int valueNr; /* number of values stacked */ + int valueMax; /* max number of values stacked */ + xmlXPathObjectPtr *valueTab; /* stack of values */ + + xmlXPathCompExprPtr comp; /* the precompiled expression */ + int xptr; /* it this an XPointer expression */ + xmlNodePtr ancestor; /* used for walking preceding axis */ +}; + +/************************************************************************ + * * + * Public API * + * * + ************************************************************************/ + +/** + * Objects and Nodesets handling + */ + +XMLPUBVAR double xmlXPathNAN; +XMLPUBVAR double xmlXPathPINF; +XMLPUBVAR double xmlXPathNINF; + +/* These macros may later turn into functions */ +/** + * xmlXPathNodeSetGetLength: + * @ns: a node-set + * + * Implement a functionality similar to the DOM NodeList.length. + * + * Returns the number of nodes in the node-set. + */ +#define xmlXPathNodeSetGetLength(ns) ((ns) ? (ns)->nodeNr : 0) +/** + * xmlXPathNodeSetItem: + * @ns: a node-set + * @index: index of a node in the set + * + * Implements a functionality similar to the DOM NodeList.item(). + * + * Returns the xmlNodePtr at the given @index in @ns or NULL if + * @index is out of range (0 to length-1) + */ +#define xmlXPathNodeSetItem(ns, index) \ + ((((ns) != NULL) && \ + ((index) >= 0) && ((index) < (ns)->nodeNr)) ? \ + (ns)->nodeTab[(index)] \ + : NULL) +/** + * xmlXPathNodeSetIsEmpty: + * @ns: a node-set + * + * Checks whether @ns is empty or not. + * + * Returns %TRUE if @ns is an empty node-set. + */ +#define xmlXPathNodeSetIsEmpty(ns) \ + (((ns) == NULL) || ((ns)->nodeNr == 0) || ((ns)->nodeTab == NULL)) + + +XMLPUBFUN void XMLCALL + xmlXPathFreeObject (xmlXPathObjectPtr obj); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathNodeSetCreate (xmlNodePtr val); +XMLPUBFUN void XMLCALL + xmlXPathFreeNodeSetList (xmlXPathObjectPtr obj); +XMLPUBFUN void XMLCALL + xmlXPathFreeNodeSet (xmlNodeSetPtr obj); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathObjectCopy (xmlXPathObjectPtr val); +XMLPUBFUN int XMLCALL + xmlXPathCmpNodes (xmlNodePtr node1, + xmlNodePtr node2); +/** + * Conversion functions to basic types. + */ +XMLPUBFUN int XMLCALL + xmlXPathCastNumberToBoolean (double val); +XMLPUBFUN int XMLCALL + xmlXPathCastStringToBoolean (const xmlChar * val); +XMLPUBFUN int XMLCALL + xmlXPathCastNodeSetToBoolean(xmlNodeSetPtr ns); +XMLPUBFUN int XMLCALL + xmlXPathCastToBoolean (xmlXPathObjectPtr val); + +XMLPUBFUN double XMLCALL + xmlXPathCastBooleanToNumber (int val); +XMLPUBFUN double XMLCALL + xmlXPathCastStringToNumber (const xmlChar * val); +XMLPUBFUN double XMLCALL + xmlXPathCastNodeToNumber (xmlNodePtr node); +XMLPUBFUN double XMLCALL + xmlXPathCastNodeSetToNumber (xmlNodeSetPtr ns); +XMLPUBFUN double XMLCALL + xmlXPathCastToNumber (xmlXPathObjectPtr val); + +XMLPUBFUN xmlChar * XMLCALL + xmlXPathCastBooleanToString (int val); +XMLPUBFUN xmlChar * XMLCALL + xmlXPathCastNumberToString (double val); +XMLPUBFUN xmlChar * XMLCALL + xmlXPathCastNodeToString (xmlNodePtr node); +XMLPUBFUN xmlChar * XMLCALL + xmlXPathCastNodeSetToString (xmlNodeSetPtr ns); +XMLPUBFUN xmlChar * XMLCALL + xmlXPathCastToString (xmlXPathObjectPtr val); + +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathConvertBoolean (xmlXPathObjectPtr val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathConvertNumber (xmlXPathObjectPtr val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathConvertString (xmlXPathObjectPtr val); + +/** + * Context handling. + */ +XMLPUBFUN xmlXPathContextPtr XMLCALL + xmlXPathNewContext (xmlDocPtr doc); +XMLPUBFUN void XMLCALL + xmlXPathFreeContext (xmlXPathContextPtr ctxt); + +/** + * Evaluation functions. + */ +XMLPUBFUN long XMLCALL + xmlXPathOrderDocElems (xmlDocPtr doc); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathEval (const xmlChar *str, + xmlXPathContextPtr ctx); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathEvalExpression (const xmlChar *str, + xmlXPathContextPtr ctxt); +XMLPUBFUN int XMLCALL + xmlXPathEvalPredicate (xmlXPathContextPtr ctxt, + xmlXPathObjectPtr res); +/** + * Separate compilation/evaluation entry points. + */ +XMLPUBFUN xmlXPathCompExprPtr XMLCALL + xmlXPathCompile (const xmlChar *str); +XMLPUBFUN xmlXPathCompExprPtr XMLCALL + xmlXPathCtxtCompile (xmlXPathContextPtr ctxt, + const xmlChar *str); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathCompiledEval (xmlXPathCompExprPtr comp, + xmlXPathContextPtr ctx); +XMLPUBFUN void XMLCALL + xmlXPathFreeCompExpr (xmlXPathCompExprPtr comp); +#endif /* LIBXML_XPATH_ENABLED */ +#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) +XMLPUBFUN void XMLCALL + xmlXPathInit (void); +XMLPUBFUN int XMLCALL + xmlXPathIsNaN (double val); +XMLPUBFUN int XMLCALL + xmlXPathIsInf (double val); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_XPATH_ENABLED or LIBXML_SCHEMAS_ENABLED*/ +#endif /* ! __XML_XPATH_H__ */ diff --git a/include/libxml/xpathInternals.h b/include/libxml/xpathInternals.h new file mode 100644 index 0000000..dcd5243 --- /dev/null +++ b/include/libxml/xpathInternals.h @@ -0,0 +1,630 @@ +/* + * Summary: internal interfaces for XML Path Language implementation + * Description: internal interfaces for XML Path Language implementation + * used to build new modules on top of XPath like XPointer and + * XSLT + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XPATH_INTERNALS_H__ +#define __XML_XPATH_INTERNALS_H__ + +#include +#include + +#ifdef LIBXML_XPATH_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************ + * * + * Helpers * + * * + ************************************************************************/ + +/* + * Many of these macros may later turn into functions. They + * shouldn't be used in #ifdef's preprocessor instructions. + */ +/** + * xmlXPathSetError: + * @ctxt: an XPath parser context + * @err: an xmlXPathError code + * + * Raises an error. + */ +#define xmlXPathSetError(ctxt, err) \ + { xmlXPatherror((ctxt), __FILE__, __LINE__, (err)); \ + if ((ctxt) != NULL) (ctxt)->error = (err); } + +/** + * xmlXPathSetArityError: + * @ctxt: an XPath parser context + * + * Raises an XPATH_INVALID_ARITY error. + */ +#define xmlXPathSetArityError(ctxt) \ + xmlXPathSetError((ctxt), XPATH_INVALID_ARITY) + +/** + * xmlXPathSetTypeError: + * @ctxt: an XPath parser context + * + * Raises an XPATH_INVALID_TYPE error. + */ +#define xmlXPathSetTypeError(ctxt) \ + xmlXPathSetError((ctxt), XPATH_INVALID_TYPE) + +/** + * xmlXPathGetError: + * @ctxt: an XPath parser context + * + * Get the error code of an XPath context. + * + * Returns the context error. + */ +#define xmlXPathGetError(ctxt) ((ctxt)->error) + +/** + * xmlXPathCheckError: + * @ctxt: an XPath parser context + * + * Check if an XPath error was raised. + * + * Returns true if an error has been raised, false otherwise. + */ +#define xmlXPathCheckError(ctxt) ((ctxt)->error != XPATH_EXPRESSION_OK) + +/** + * xmlXPathGetDocument: + * @ctxt: an XPath parser context + * + * Get the document of an XPath context. + * + * Returns the context document. + */ +#define xmlXPathGetDocument(ctxt) ((ctxt)->context->doc) + +/** + * xmlXPathGetContextNode: + * @ctxt: an XPath parser context + * + * Get the context node of an XPath context. + * + * Returns the context node. + */ +#define xmlXPathGetContextNode(ctxt) ((ctxt)->context->node) + +XMLPUBFUN int XMLCALL + xmlXPathPopBoolean (xmlXPathParserContextPtr ctxt); +XMLPUBFUN double XMLCALL + xmlXPathPopNumber (xmlXPathParserContextPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlXPathPopString (xmlXPathParserContextPtr ctxt); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathPopNodeSet (xmlXPathParserContextPtr ctxt); +XMLPUBFUN void * XMLCALL + xmlXPathPopExternal (xmlXPathParserContextPtr ctxt); + +/** + * xmlXPathReturnBoolean: + * @ctxt: an XPath parser context + * @val: a boolean + * + * Pushes the boolean @val on the context stack. + */ +#define xmlXPathReturnBoolean(ctxt, val) \ + valuePush((ctxt), xmlXPathNewBoolean(val)) + +/** + * xmlXPathReturnTrue: + * @ctxt: an XPath parser context + * + * Pushes true on the context stack. + */ +#define xmlXPathReturnTrue(ctxt) xmlXPathReturnBoolean((ctxt), 1) + +/** + * xmlXPathReturnFalse: + * @ctxt: an XPath parser context + * + * Pushes false on the context stack. + */ +#define xmlXPathReturnFalse(ctxt) xmlXPathReturnBoolean((ctxt), 0) + +/** + * xmlXPathReturnNumber: + * @ctxt: an XPath parser context + * @val: a double + * + * Pushes the double @val on the context stack. + */ +#define xmlXPathReturnNumber(ctxt, val) \ + valuePush((ctxt), xmlXPathNewFloat(val)) + +/** + * xmlXPathReturnString: + * @ctxt: an XPath parser context + * @str: a string + * + * Pushes the string @str on the context stack. + */ +#define xmlXPathReturnString(ctxt, str) \ + valuePush((ctxt), xmlXPathWrapString(str)) + +/** + * xmlXPathReturnEmptyString: + * @ctxt: an XPath parser context + * + * Pushes an empty string on the stack. + */ +#define xmlXPathReturnEmptyString(ctxt) \ + valuePush((ctxt), xmlXPathNewCString("")) + +/** + * xmlXPathReturnNodeSet: + * @ctxt: an XPath parser context + * @ns: a node-set + * + * Pushes the node-set @ns on the context stack. + */ +#define xmlXPathReturnNodeSet(ctxt, ns) \ + valuePush((ctxt), xmlXPathWrapNodeSet(ns)) + +/** + * xmlXPathReturnEmptyNodeSet: + * @ctxt: an XPath parser context + * + * Pushes an empty node-set on the context stack. + */ +#define xmlXPathReturnEmptyNodeSet(ctxt) \ + valuePush((ctxt), xmlXPathNewNodeSet(NULL)) + +/** + * xmlXPathReturnExternal: + * @ctxt: an XPath parser context + * @val: user data + * + * Pushes user data on the context stack. + */ +#define xmlXPathReturnExternal(ctxt, val) \ + valuePush((ctxt), xmlXPathWrapExternal(val)) + +/** + * xmlXPathStackIsNodeSet: + * @ctxt: an XPath parser context + * + * Check if the current value on the XPath stack is a node set or + * an XSLT value tree. + * + * Returns true if the current object on the stack is a node-set. + */ +#define xmlXPathStackIsNodeSet(ctxt) \ + (((ctxt)->value != NULL) \ + && (((ctxt)->value->type == XPATH_NODESET) \ + || ((ctxt)->value->type == XPATH_XSLT_TREE))) + +/** + * xmlXPathStackIsExternal: + * @ctxt: an XPath parser context + * + * Checks if the current value on the XPath stack is an external + * object. + * + * Returns true if the current object on the stack is an external + * object. + */ +#define xmlXPathStackIsExternal(ctxt) \ + ((ctxt->value != NULL) && (ctxt->value->type == XPATH_USERS)) + +/** + * xmlXPathEmptyNodeSet: + * @ns: a node-set + * + * Empties a node-set. + */ +#define xmlXPathEmptyNodeSet(ns) \ + { while ((ns)->nodeNr > 0) (ns)->nodeTab[(ns)->nodeNr--] = NULL; } + +/** + * CHECK_ERROR: + * + * Macro to return from the function if an XPath error was detected. + */ +#define CHECK_ERROR \ + if (ctxt->error != XPATH_EXPRESSION_OK) return + +/** + * CHECK_ERROR0: + * + * Macro to return 0 from the function if an XPath error was detected. + */ +#define CHECK_ERROR0 \ + if (ctxt->error != XPATH_EXPRESSION_OK) return(0) + +/** + * XP_ERROR: + * @X: the error code + * + * Macro to raise an XPath error and return. + */ +#define XP_ERROR(X) \ + { xmlXPathErr(ctxt, X); return; } + +/** + * XP_ERROR0: + * @X: the error code + * + * Macro to raise an XPath error and return 0. + */ +#define XP_ERROR0(X) \ + { xmlXPathErr(ctxt, X); return(0); } + +/** + * CHECK_TYPE: + * @typeval: the XPath type + * + * Macro to check that the value on top of the XPath stack is of a given + * type. + */ +#define CHECK_TYPE(typeval) \ + if ((ctxt->value == NULL) || (ctxt->value->type != typeval)) \ + XP_ERROR(XPATH_INVALID_TYPE) + +/** + * CHECK_TYPE0: + * @typeval: the XPath type + * + * Macro to check that the value on top of the XPath stack is of a given + * type. Return(0) in case of failure + */ +#define CHECK_TYPE0(typeval) \ + if ((ctxt->value == NULL) || (ctxt->value->type != typeval)) \ + XP_ERROR0(XPATH_INVALID_TYPE) + +/** + * CHECK_ARITY: + * @x: the number of expected args + * + * Macro to check that the number of args passed to an XPath function matches. + */ +#define CHECK_ARITY(x) \ + if (ctxt == NULL) return; \ + if (nargs != (x)) \ + XP_ERROR(XPATH_INVALID_ARITY); + +/** + * CAST_TO_STRING: + * + * Macro to try to cast the value on the top of the XPath stack to a string. + */ +#define CAST_TO_STRING \ + if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING)) \ + xmlXPathStringFunction(ctxt, 1); + +/** + * CAST_TO_NUMBER: + * + * Macro to try to cast the value on the top of the XPath stack to a number. + */ +#define CAST_TO_NUMBER \ + if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER)) \ + xmlXPathNumberFunction(ctxt, 1); + +/** + * CAST_TO_BOOLEAN: + * + * Macro to try to cast the value on the top of the XPath stack to a boolean. + */ +#define CAST_TO_BOOLEAN \ + if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_BOOLEAN)) \ + xmlXPathBooleanFunction(ctxt, 1); + +/* + * Variable Lookup forwarding. + */ + +XMLPUBFUN void XMLCALL + xmlXPathRegisterVariableLookup (xmlXPathContextPtr ctxt, + xmlXPathVariableLookupFunc f, + void *data); + +/* + * Function Lookup forwarding. + */ + +XMLPUBFUN void XMLCALL + xmlXPathRegisterFuncLookup (xmlXPathContextPtr ctxt, + xmlXPathFuncLookupFunc f, + void *funcCtxt); + +/* + * Error reporting. + */ +XMLPUBFUN void XMLCALL + xmlXPatherror (xmlXPathParserContextPtr ctxt, + const char *file, + int line, + int no); + +XMLPUBFUN void XMLCALL + xmlXPathErr (xmlXPathParserContextPtr ctxt, + int error); + +#ifdef LIBXML_DEBUG_ENABLED +XMLPUBFUN void XMLCALL + xmlXPathDebugDumpObject (FILE *output, + xmlXPathObjectPtr cur, + int depth); +XMLPUBFUN void XMLCALL + xmlXPathDebugDumpCompExpr(FILE *output, + xmlXPathCompExprPtr comp, + int depth); +#endif +/** + * NodeSet handling. + */ +XMLPUBFUN int XMLCALL + xmlXPathNodeSetContains (xmlNodeSetPtr cur, + xmlNodePtr val); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathDifference (xmlNodeSetPtr nodes1, + xmlNodeSetPtr nodes2); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathIntersection (xmlNodeSetPtr nodes1, + xmlNodeSetPtr nodes2); + +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathDistinctSorted (xmlNodeSetPtr nodes); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathDistinct (xmlNodeSetPtr nodes); + +XMLPUBFUN int XMLCALL + xmlXPathHasSameNodes (xmlNodeSetPtr nodes1, + xmlNodeSetPtr nodes2); + +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathNodeLeadingSorted (xmlNodeSetPtr nodes, + xmlNodePtr node); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathLeadingSorted (xmlNodeSetPtr nodes1, + xmlNodeSetPtr nodes2); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathNodeLeading (xmlNodeSetPtr nodes, + xmlNodePtr node); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathLeading (xmlNodeSetPtr nodes1, + xmlNodeSetPtr nodes2); + +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathNodeTrailingSorted (xmlNodeSetPtr nodes, + xmlNodePtr node); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathTrailingSorted (xmlNodeSetPtr nodes1, + xmlNodeSetPtr nodes2); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathNodeTrailing (xmlNodeSetPtr nodes, + xmlNodePtr node); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathTrailing (xmlNodeSetPtr nodes1, + xmlNodeSetPtr nodes2); + + +/** + * Extending a context. + */ + +XMLPUBFUN int XMLCALL + xmlXPathRegisterNs (xmlXPathContextPtr ctxt, + const xmlChar *prefix, + const xmlChar *ns_uri); +XMLPUBFUN const xmlChar * XMLCALL + xmlXPathNsLookup (xmlXPathContextPtr ctxt, + const xmlChar *prefix); +XMLPUBFUN void XMLCALL + xmlXPathRegisteredNsCleanup (xmlXPathContextPtr ctxt); + +XMLPUBFUN int XMLCALL + xmlXPathRegisterFunc (xmlXPathContextPtr ctxt, + const xmlChar *name, + xmlXPathFunction f); +XMLPUBFUN int XMLCALL + xmlXPathRegisterFuncNS (xmlXPathContextPtr ctxt, + const xmlChar *name, + const xmlChar *ns_uri, + xmlXPathFunction f); +XMLPUBFUN int XMLCALL + xmlXPathRegisterVariable (xmlXPathContextPtr ctxt, + const xmlChar *name, + xmlXPathObjectPtr value); +XMLPUBFUN int XMLCALL + xmlXPathRegisterVariableNS (xmlXPathContextPtr ctxt, + const xmlChar *name, + const xmlChar *ns_uri, + xmlXPathObjectPtr value); +XMLPUBFUN xmlXPathFunction XMLCALL + xmlXPathFunctionLookup (xmlXPathContextPtr ctxt, + const xmlChar *name); +XMLPUBFUN xmlXPathFunction XMLCALL + xmlXPathFunctionLookupNS (xmlXPathContextPtr ctxt, + const xmlChar *name, + const xmlChar *ns_uri); +XMLPUBFUN void XMLCALL + xmlXPathRegisteredFuncsCleanup (xmlXPathContextPtr ctxt); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathVariableLookup (xmlXPathContextPtr ctxt, + const xmlChar *name); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathVariableLookupNS (xmlXPathContextPtr ctxt, + const xmlChar *name, + const xmlChar *ns_uri); +XMLPUBFUN void XMLCALL + xmlXPathRegisteredVariablesCleanup(xmlXPathContextPtr ctxt); + +/** + * Utilities to extend XPath. + */ +XMLPUBFUN xmlXPathParserContextPtr XMLCALL + xmlXPathNewParserContext (const xmlChar *str, + xmlXPathContextPtr ctxt); +XMLPUBFUN void XMLCALL + xmlXPathFreeParserContext (xmlXPathParserContextPtr ctxt); + +/* TODO: remap to xmlXPathValuePop and Push. */ +XMLPUBFUN xmlXPathObjectPtr XMLCALL + valuePop (xmlXPathParserContextPtr ctxt); +XMLPUBFUN int XMLCALL + valuePush (xmlXPathParserContextPtr ctxt, + xmlXPathObjectPtr value); + +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathNewString (const xmlChar *val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathNewCString (const char *val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathWrapString (xmlChar *val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathWrapCString (char * val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathNewFloat (double val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathNewBoolean (int val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathNewNodeSet (xmlNodePtr val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathNewValueTree (xmlNodePtr val); +XMLPUBFUN void XMLCALL + xmlXPathNodeSetAdd (xmlNodeSetPtr cur, + xmlNodePtr val); +XMLPUBFUN void XMLCALL + xmlXPathNodeSetAddUnique (xmlNodeSetPtr cur, + xmlNodePtr val); +XMLPUBFUN void XMLCALL + xmlXPathNodeSetAddNs (xmlNodeSetPtr cur, + xmlNodePtr node, + xmlNsPtr ns); +XMLPUBFUN void XMLCALL + xmlXPathNodeSetSort (xmlNodeSetPtr set); + +XMLPUBFUN void XMLCALL + xmlXPathRoot (xmlXPathParserContextPtr ctxt); +XMLPUBFUN void XMLCALL + xmlXPathEvalExpr (xmlXPathParserContextPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlXPathParseName (xmlXPathParserContextPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlXPathParseNCName (xmlXPathParserContextPtr ctxt); + +/* + * Existing functions. + */ +XMLPUBFUN double XMLCALL + xmlXPathStringEvalNumber (const xmlChar *str); +XMLPUBFUN int XMLCALL + xmlXPathEvaluatePredicateResult (xmlXPathParserContextPtr ctxt, + xmlXPathObjectPtr res); +XMLPUBFUN void XMLCALL + xmlXPathRegisterAllFunctions (xmlXPathContextPtr ctxt); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathNodeSetMerge (xmlNodeSetPtr val1, + xmlNodeSetPtr val2); +XMLPUBFUN void XMLCALL + xmlXPathNodeSetDel (xmlNodeSetPtr cur, + xmlNodePtr val); +XMLPUBFUN void XMLCALL + xmlXPathNodeSetRemove (xmlNodeSetPtr cur, + int val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathNewNodeSetList (xmlNodeSetPtr val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathWrapNodeSet (xmlNodeSetPtr val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathWrapExternal (void *val); + +XMLPUBFUN int XMLCALL xmlXPathEqualValues(xmlXPathParserContextPtr ctxt); +XMLPUBFUN int XMLCALL xmlXPathNotEqualValues(xmlXPathParserContextPtr ctxt); +XMLPUBFUN int XMLCALL xmlXPathCompareValues(xmlXPathParserContextPtr ctxt, int inf, int strict); +XMLPUBFUN void XMLCALL xmlXPathValueFlipSign(xmlXPathParserContextPtr ctxt); +XMLPUBFUN void XMLCALL xmlXPathAddValues(xmlXPathParserContextPtr ctxt); +XMLPUBFUN void XMLCALL xmlXPathSubValues(xmlXPathParserContextPtr ctxt); +XMLPUBFUN void XMLCALL xmlXPathMultValues(xmlXPathParserContextPtr ctxt); +XMLPUBFUN void XMLCALL xmlXPathDivValues(xmlXPathParserContextPtr ctxt); +XMLPUBFUN void XMLCALL xmlXPathModValues(xmlXPathParserContextPtr ctxt); + +XMLPUBFUN int XMLCALL xmlXPathIsNodeType(const xmlChar *name); + +/* + * Some of the axis navigation routines. + */ +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextSelf(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextChild(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextDescendant(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextDescendantOrSelf(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextParent(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextAncestorOrSelf(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextFollowingSibling(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextFollowing(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextNamespace(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextAttribute(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextPreceding(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextAncestor(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextPrecedingSibling(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +/* + * The official core of XPath functions. + */ +XMLPUBFUN void XMLCALL xmlXPathLastFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathPositionFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathCountFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathIdFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathLocalNameFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathNamespaceURIFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathStringFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathStringLengthFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathConcatFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathContainsFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathStartsWithFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathSubstringFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathSubstringBeforeFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathSubstringAfterFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathNormalizeFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathTranslateFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathNotFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathTrueFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathFalseFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathLangFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathNumberFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathSumFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathFloorFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathCeilingFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathRoundFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathBooleanFunction(xmlXPathParserContextPtr ctxt, int nargs); + +/** + * Really internal functions + */ +XMLPUBFUN void XMLCALL xmlXPathNodeSetFreeNs(xmlNsPtr ns); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_XPATH_ENABLED */ +#endif /* ! __XML_XPATH_INTERNALS_H__ */ diff --git a/include/libxml/xpointer.h b/include/libxml/xpointer.h new file mode 100644 index 0000000..dde1dfb --- /dev/null +++ b/include/libxml/xpointer.h @@ -0,0 +1,114 @@ +/* + * Summary: API to handle XML Pointers + * Description: API to handle XML Pointers + * Base implementation was made accordingly to + * W3C Candidate Recommendation 7 June 2000 + * http://www.w3.org/TR/2000/CR-xptr-20000607 + * + * Added support for the element() scheme described in: + * W3C Proposed Recommendation 13 November 2002 + * http://www.w3.org/TR/2002/PR-xptr-element-20021113/ + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XPTR_H__ +#define __XML_XPTR_H__ + +#include + +#ifdef LIBXML_XPTR_ENABLED + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * A Location Set + */ +typedef struct _xmlLocationSet xmlLocationSet; +typedef xmlLocationSet *xmlLocationSetPtr; +struct _xmlLocationSet { + int locNr; /* number of locations in the set */ + int locMax; /* size of the array as allocated */ + xmlXPathObjectPtr *locTab;/* array of locations */ +}; + +/* + * Handling of location sets. + */ + +XMLPUBFUN xmlLocationSetPtr XMLCALL + xmlXPtrLocationSetCreate (xmlXPathObjectPtr val); +XMLPUBFUN void XMLCALL + xmlXPtrFreeLocationSet (xmlLocationSetPtr obj); +XMLPUBFUN xmlLocationSetPtr XMLCALL + xmlXPtrLocationSetMerge (xmlLocationSetPtr val1, + xmlLocationSetPtr val2); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrNewRange (xmlNodePtr start, + int startindex, + xmlNodePtr end, + int endindex); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrNewRangePoints (xmlXPathObjectPtr start, + xmlXPathObjectPtr end); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrNewRangeNodePoint (xmlNodePtr start, + xmlXPathObjectPtr end); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrNewRangePointNode (xmlXPathObjectPtr start, + xmlNodePtr end); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrNewRangeNodes (xmlNodePtr start, + xmlNodePtr end); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrNewLocationSetNodes (xmlNodePtr start, + xmlNodePtr end); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrNewLocationSetNodeSet(xmlNodeSetPtr set); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrNewRangeNodeObject (xmlNodePtr start, + xmlXPathObjectPtr end); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrNewCollapsedRange (xmlNodePtr start); +XMLPUBFUN void XMLCALL + xmlXPtrLocationSetAdd (xmlLocationSetPtr cur, + xmlXPathObjectPtr val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrWrapLocationSet (xmlLocationSetPtr val); +XMLPUBFUN void XMLCALL + xmlXPtrLocationSetDel (xmlLocationSetPtr cur, + xmlXPathObjectPtr val); +XMLPUBFUN void XMLCALL + xmlXPtrLocationSetRemove (xmlLocationSetPtr cur, + int val); + +/* + * Functions. + */ +XMLPUBFUN xmlXPathContextPtr XMLCALL + xmlXPtrNewContext (xmlDocPtr doc, + xmlNodePtr here, + xmlNodePtr origin); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrEval (const xmlChar *str, + xmlXPathContextPtr ctx); +XMLPUBFUN void XMLCALL + xmlXPtrRangeToFunction (xmlXPathParserContextPtr ctxt, + int nargs); +XMLPUBFUN xmlNodePtr XMLCALL + xmlXPtrBuildNodeList (xmlXPathObjectPtr obj); +XMLPUBFUN void XMLCALL + xmlXPtrEvalRangePredicate (xmlXPathParserContextPtr ctxt); +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_XPTR_ENABLED */ +#endif /* __XML_XPTR_H__ */ diff --git a/include/r5-only/BePodder_R5.h b/include/r5-only/BePodder_R5.h new file mode 100644 index 0000000..4a963f9 --- /dev/null +++ b/include/r5-only/BePodder_R5.h @@ -0,0 +1,14 @@ +struct pair { + const char* key; + const char* data; +}; + +#define NUMBER 5 + +const pair r5languge[NUMBER]={ + {"alert1","\nYou are going to remove the selected item.\n\nAre you sure?\n(you will lost the enclosure file if any)"}, + {"alert2a","\nYou are going to remove the channel:\n\n"}, + {"alert2b","\n\nWould you like just to archive this channel (keeping all the files and enclosures downloaded so far) or do you want to DELETE the whole channel from you computer?"}, + {"alert3","\nParsing archive.."}, + {"not down","not downloaded"} +}; \ No newline at end of file diff --git a/include/r5-only/ObjectList.h b/include/r5-only/ObjectList.h new file mode 100644 index 0000000..bfa1832 --- /dev/null +++ b/include/r5-only/ObjectList.h @@ -0,0 +1,866 @@ +/* +Open Tracker License + +Terms and Conditions + +Copyright (c) 1991-2000, Be Incorporated. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice applies to all licensees +and shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of Be Incorporated shall not be +used in advertising or otherwise to promote the sale, use or other dealings in +this Software without prior written authorization from Be Incorporated. + +Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks +of Be Incorporated in the United States and other countries. Other brand product +names are registered trademarks or trademarks of their respective holders. +All rights reserved. +*/ + +/**************************************************************************** +** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ** +** ** +** DANGER, WILL ROBINSON! ** +** ** +** The interfaces contained here are part of BeOS's ** +** ** +** >> PRIVATE NOT FOR PUBLIC USE << ** +** ** +** implementation. ** +** ** +** These interfaces WILL CHANGE in future releases. ** +** If you use them, your app WILL BREAK at some future time. ** +** ** +** (And yes, this does mean that binaries built from OpenTracker will not ** +** be compatible with some future releases of the OS. When that happens, ** +** we will provide an updated version of this file to keep compatibility.) ** +** ** +** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ** +****************************************************************************/ + +// +// ObjectList is a wrapper around BList that adds type safety, +// optional object ownership, search, insert operations, etc. +// + +#ifndef __OBJECT_LIST__ +#define __OBJECT_LIST__ + +#ifndef _BE_H +#include +#endif + +#include + + +template class BObjectList; + +template +struct UnaryPredicate { + + virtual int operator()(const T *) const + // virtual could be avoided here if FindBinaryInsertionIndex, + // etc. were member template functions + { return 0; } + +private: + static int _unary_predicate_glue(const void *item, void *context); + +friend class BObjectList; +}; + +template +int +UnaryPredicate::_unary_predicate_glue(const void *item, void *context) +{ + return ((UnaryPredicate *)context)->operator()((const T *)item); +} + + +class _PointerList_ : public BList { +public: + _PointerList_(const _PointerList_ &list); + _PointerList_(int32 itemsPerBlock = 20, bool owning = false); + ~_PointerList_(); + + typedef void *(* GenericEachFunction)(void *, void *); + typedef int (* GenericCompareFunction)(const void *, const void *); + typedef int (* GenericCompareFunctionWithState)(const void *, const void *, + void *); + typedef int (* UnaryPredicateGlue)(const void *, void *); + + void *EachElement(GenericEachFunction, void *); + void SortItems(GenericCompareFunction); + void SortItems(GenericCompareFunctionWithState, void *state); + void HSortItems(GenericCompareFunction); + void HSortItems(GenericCompareFunctionWithState, void *state); + + void *BinarySearch(const void *, GenericCompareFunction) const; + void *BinarySearch(const void *, GenericCompareFunctionWithState, void *state) const; + + int32 BinarySearchIndex(const void *, GenericCompareFunction) const; + int32 BinarySearchIndex(const void *, GenericCompareFunctionWithState, void *state) const; + int32 BinarySearchIndexByPredicate(const void *, UnaryPredicateGlue) const; + + bool Owning() const; + bool ReplaceItem(int32, void *); + +protected: + bool owning; + +}; + +template +class BObjectList : private _PointerList_ { +public: + + // iteration and sorting + typedef T *(* EachFunction)(T *, void *); + typedef const T *(* ConstEachFunction)(const T *, void *); + typedef int (* CompareFunction)(const T *, const T *); + typedef int (* CompareFunctionWithState)(const T *, const T *, void *state); + + BObjectList(int32 itemsPerBlock = 20, bool owning = false); + BObjectList(const BObjectList &list); + // clones list; if list is owning, makes copies of all + // the items + + virtual ~BObjectList(); + + BObjectList &operator=(const BObjectList &list); + // clones list; if list is owning, makes copies of all + // the items + + // adding and removing + // ToDo: + // change Add calls to return const item + bool AddItem(T *); + bool AddItem(T *, int32); + bool AddList(BObjectList *); + bool AddList(BObjectList *, int32); + + bool RemoveItem(T *, bool deleteIfOwning = true); + // if owning, deletes the removed item + T *RemoveItemAt(int32); + // returns the removed item + + void MakeEmpty(bool deleteIfOwning = true); + + // item access + T *ItemAt(int32) const; + + bool ReplaceItem(int32 index, T *); + // if list is owning, deletes the item at first + T *SwapWithItem(int32 index, T *newItem); + // same as ReplaceItem, except does not delete old item at , + // returns it instead + + T *FirstItem() const; + T *LastItem() const; + + // misc. getters + int32 IndexOf(const T *) const; + bool HasItem(const T *) const; + bool IsEmpty() const; + int32 CountItems() const; + + T *EachElement(EachFunction, void *); + const T *EachElement(ConstEachFunction, void *) const; + + void SortItems(CompareFunction); + void SortItems(CompareFunctionWithState, void *state); + void HSortItems(CompareFunction); + void HSortItems(CompareFunctionWithState, void *state); + + // linear search, returns first item that matches predicate + const T *FindIf(const UnaryPredicate &) const; + T *FindIf(const UnaryPredicate &); + + // list must be sorted with CompareFunction for these to work + T *BinarySearch(const T &, CompareFunction) const; + T *BinarySearch(const T &, CompareFunctionWithState, void *state) const; + + template + T *BinarySearchByKey(const Key &key, int (*compare)(const Key *, const T *)) + const; + + template + T *BinarySearchByKey(const Key &key, + int (*compare)(const Key *, const T *, void *), void *state) const; + + int32 BinarySearchIndex(const T &item, CompareFunction compare) const; + int32 BinarySearchIndex(const T &item, CompareFunctionWithState compare, + void *state) const; + + template + int32 BinarySearchIndexByKey(const Key &key, + int (*compare)(const Key *, const T *)) const; + + // Binary insertion - list must be sorted with CompareFunction for + // these to work + + // simple insert + bool BinaryInsert(T *, CompareFunction); + bool BinaryInsert(T *, CompareFunctionWithState, void *state); + bool BinaryInsert(T *, const UnaryPredicate &); + + // unique insert, returns false if item already in list + bool BinaryInsertUnique(T *, CompareFunction); + bool BinaryInsertUnique(T *, CompareFunctionWithState, void *state); + bool BinaryInsertUnique(T *, const UnaryPredicate &); + + // insert a copy of the item, returns new inserted item + T *BinaryInsertCopy(const T ©This, CompareFunction); + T *BinaryInsertCopy(const T ©This, CompareFunctionWithState, void *state); + + // insert a copy of the item if not in list already + // returns new inserted item or existing item in case of a conflict + T *BinaryInsertCopyUnique(const T ©This, CompareFunction); + T *BinaryInsertCopyUnique(const T ©This, CompareFunctionWithState, void *state); + + int32 FindBinaryInsertionIndex(const UnaryPredicate &, bool *alreadyInList = 0) const; + // returns either the index into which a new item should be inserted + // or index of an existing item that matches the predicate + + // deprecated API, will go away + BList *AsBList() + { return this; } + const BList *AsBList() const + { return this; } +private: + void SetItem(int32, T *); +}; + +template +Result +WhileEachListItem(BObjectList *list, Result (Item::*func)(Param1), Param1 p1) +{ + Result result = 0; + int32 count = list->CountItems(); + + for (int32 index = 0; index < count; index++) + if ((result = (list->ItemAt(index)->*func)(p1)) != 0) + break; + + return result; +} + +template +Result +WhileEachListItem(BObjectList *list, Result (*func)(Item *, Param1), Param1 p1) +{ + Result result = 0; + int32 count = list->CountItems(); + + for (int32 index = 0; index < count; index++) + if ((result = (*func)(list->ItemAt(index), p1)) != 0) + break; + + return result; +} + +template +Result +WhileEachListItem(BObjectList *list, Result (Item::*func)(Param1, Param2), + Param1 p1, Param2 p2) +{ + Result result = 0; + int32 count = list->CountItems(); + + for (int32 index = 0; index < count; index++) + if ((result = (list->ItemAt(index)->*func)(p1, p2)) != 0) + break; + + return result; +} + +template +Result +WhileEachListItem(BObjectList *list, Result (*func)(Item *, Param1, Param2), + Param1 p1, Param2 p2) +{ + Result result = 0; + int32 count = list->CountItems(); + + for (int32 index = 0; index < count; index++) + if ((result = (*func)(list->ItemAt(index), p1, p2)) != 0) + break; + + return result; +} + +template +Result +WhileEachListItem(BObjectList *list, Result (*func)(Item *, Param1, Param2, + Param3, Param4), Param1 p1, Param2 p2, Param3 p3, Param4 p4) +{ + Result result = 0; + int32 count = list->CountItems(); + + for (int32 index = 0; index < count; index++) + if ((result = (*func)(list->ItemAt(index), p1, p2, p3, p4)) != 0) + break; + + return result; +} + +template +void +EachListItemIgnoreResult(BObjectList *list, Result (Item::*func)()) +{ + int32 count = list->CountItems(); + for (int32 index = 0; index < count; index++) + (list->ItemAt(index)->*func)(); +} + +template +void +EachListItem(BObjectList *list, void (*func)(Item *, Param1), Param1 p1) +{ + int32 count = list->CountItems(); + for (int32 index = 0; index < count; index++) + (func)(list->ItemAt(index), p1); +} + +template +void +EachListItem(BObjectList *list, void (Item::*func)(Param1, Param2), + Param1 p1, Param2 p2) +{ + int32 count = list->CountItems(); + for (int32 index = 0; index < count; index++) + (list->ItemAt(index)->*func)(p1, p2); +} + +template +void +EachListItem(BObjectList *list, void (*func)(Item *,Param1, Param2), + Param1 p1, Param2 p2) +{ + int32 count = list->CountItems(); + for (int32 index = 0; index < count; index++) + (func)(list->ItemAt(index), p1, p2); +} + +template +void +EachListItem(BObjectList *list, void (*func)(Item *,Param1, Param2, + Param3), Param1 p1, Param2 p2, Param3 p3) +{ + int32 count = list->CountItems(); + for (int32 index = 0; index < count; index++) + (func)(list->ItemAt(index), p1, p2, p3); +} + + +template +void +EachListItem(BObjectList *list, void (*func)(Item *,Param1, Param2, + Param3, Param4), Param1 p1, Param2 p2, Param3 p3, Param4 p4) +{ + int32 count = list->CountItems(); + for (int32 index = 0; index < count; index++) + (func)(list->ItemAt(index), p1, p2, p3, p4); +} + +// inline code + +inline bool +_PointerList_::Owning() const +{ + return owning; +} + +template +BObjectList::BObjectList(int32 itemsPerBlock, bool owning) + : _PointerList_(itemsPerBlock, owning) +{ +} + +template +BObjectList::BObjectList(const BObjectList &list) + : _PointerList_(list) +{ + owning = list.owning; + if (owning) { + // make our own copies in an owning list + int32 count = list.CountItems(); + for (int32 index = 0; index < count; index++) { + T *item = list.ItemAt(index); + if (item) + item = new T(*item); + SetItem(index, item); + } + } +} + +template +BObjectList::~BObjectList() +{ + if (Owning()) + // have to nuke elements first + MakeEmpty(); +} + +template +BObjectList & +BObjectList::operator=(const BObjectList &list) +{ + owning = list.owning; + BObjectList &result = (BObjectList &)_PointerList_::operator=(list); + if (owning) { + // make our own copies in an owning list + int32 count = list.CountItems(); + for (int32 index = 0; index < count; index++) { + T *item = list.ItemAt(index); + if (item) + item = new T(*item); + SetItem(index, item); + } + } + return result; +} + +template +bool +BObjectList::AddItem(T *item) +{ + // need to cast to void * to make T work for const pointers + return _PointerList_::AddItem((void *)item); +} + +template +bool +BObjectList::AddItem(T *item, int32 atIndex) +{ + return _PointerList_::AddItem((void *)item, atIndex); +} + +template +bool +BObjectList::AddList(BObjectList *newItems) +{ + return _PointerList_::AddList(newItems); +} + +template +bool +BObjectList::AddList(BObjectList *newItems, int32 atIndex) +{ + return _PointerList_::AddList(newItems, atIndex); +} + + +template +bool +BObjectList::RemoveItem(T *item, bool deleteIfOwning) +{ + bool result = _PointerList_::RemoveItem((void *)item); + + if (result && Owning() && deleteIfOwning) + delete item; + + return result; +} + +template +T * +BObjectList::RemoveItemAt(int32 index) +{ + return (T *)_PointerList_::RemoveItem(index); +} + +template +inline T * +BObjectList::ItemAt(int32 index) const +{ + return (T *)_PointerList_::ItemAt(index); +} + +template +bool +BObjectList::ReplaceItem(int32 index, T *item) +{ + if (owning) + delete ItemAt(index); + return _PointerList_::ReplaceItem(index, (void *)item); +} + +template +T * +BObjectList::SwapWithItem(int32 index, T *newItem) +{ + T *result = ItemAt(index); + _PointerList_::ReplaceItem(index, (void *)newItem); + return result; +} + +template +void +BObjectList::SetItem(int32 index, T *newItem) +{ + _PointerList_::ReplaceItem(index, (void *)newItem); +} + +template +int32 +BObjectList::IndexOf(const T *item) const +{ + return _PointerList_::IndexOf((void *)item); +} + +template +T * +BObjectList::FirstItem() const +{ + return (T *)_PointerList_::FirstItem(); +} + +template +T * +BObjectList::LastItem() const +{ + return (T *)_PointerList_::LastItem(); +} + +template +bool +BObjectList::HasItem(const T *item) const +{ + return _PointerList_::HasItem((void *)item); +} + +template +bool +BObjectList::IsEmpty() const +{ + return _PointerList_::IsEmpty(); +} + +template +int32 +BObjectList::CountItems() const +{ + return _PointerList_::CountItems(); +} + +template +void +BObjectList::MakeEmpty(bool deleteIfOwning) +{ + if (owning && deleteIfOwning) { + int32 count = CountItems(); + for (int32 index = 0; index < count; index++) + delete ItemAt(index); + } + _PointerList_::MakeEmpty(); +} + +template +T * +BObjectList::EachElement(EachFunction func, void *params) +{ + return (T *)_PointerList_::EachElement((GenericEachFunction)func, params); +} + + +template +const T * +BObjectList::EachElement(ConstEachFunction func, void *params) const +{ + return (const T *) + const_cast *>(this)->_PointerList_::EachElement( + (GenericEachFunction)func, params); +} + +template +const T * +BObjectList::FindIf(const UnaryPredicate &predicate) const +{ + int32 count = CountItems(); + for (int32 index = 0; index < count; index++) + if (predicate.operator()(ItemAt(index)) == 0) + return ItemAt(index); + return 0; +} + +template +T * +BObjectList::FindIf(const UnaryPredicate &predicate) +{ + int32 count = CountItems(); + for (int32 index = 0; index < count; index++) + if (predicate.operator()(ItemAt(index)) == 0) + return ItemAt(index); + return 0; +} + + +template +void +BObjectList::SortItems(CompareFunction function) +{ + _PointerList_::SortItems((GenericCompareFunction)function); +} + +template +void +BObjectList::SortItems(CompareFunctionWithState function, void *state) +{ + _PointerList_::SortItems((GenericCompareFunctionWithState)function, state); +} + +template +void +BObjectList::HSortItems(CompareFunction function) +{ + _PointerList_::HSortItems((GenericCompareFunction)function); +} + +template +void +BObjectList::HSortItems(CompareFunctionWithState function, void *state) +{ + _PointerList_::HSortItems((GenericCompareFunctionWithState)function, state); +} + +template +T * +BObjectList::BinarySearch(const T &key, CompareFunction func) const +{ + return (T*)_PointerList_::BinarySearch(&key, + (GenericCompareFunction)func); +} + +template +T * +BObjectList::BinarySearch(const T &key, CompareFunctionWithState func, void *state) const +{ + return (T*)_PointerList_::BinarySearch(&key, + (GenericCompareFunctionWithState)func, state); +} + + +template +template +T * +BObjectList::BinarySearchByKey(const Key &key, + int (*compare)(const Key *, const T *)) const +{ + return (T*)_PointerList_::BinarySearch(&key, + (GenericCompareFunction)compare); +} + + +template +template +T * +BObjectList::BinarySearchByKey(const Key &key, + int (*compare)(const Key *, const T *, void *), void *state) const +{ + return (T*)_PointerList_::BinarySearch(&key, + (GenericCompareFunctionWithState)compare, state); +} + + +template +int32 +BObjectList::BinarySearchIndex(const T &item, CompareFunction compare) const +{ + return _PointerList_::BinarySearchIndex(&item, + (GenericCompareFunction)compare); +} + + +template +int32 +BObjectList::BinarySearchIndex(const T &item, + CompareFunctionWithState compare, void *state) const +{ + return _PointerList_::BinarySearchIndex(&item, + (GenericCompareFunctionWithState)compare, state); +} + + +template +template +int32 +BObjectList::BinarySearchIndexByKey(const Key &key, + int (*compare)(const Key *, const T *)) const +{ + return _PointerList_::BinarySearchIndex(&key, + (GenericCompareFunction)compare); +} + + +template +bool +BObjectList::BinaryInsert(T *item, CompareFunction func) +{ + int32 index = _PointerList_::BinarySearchIndex(item, + (GenericCompareFunction)func); + if (index >= 0) { + // already in list, add after existing + return AddItem(item, index + 1); + } + + return AddItem(item, -index - 1); +} + +template +bool +BObjectList::BinaryInsert(T *item, CompareFunctionWithState func, void *state) +{ + int32 index = _PointerList_::BinarySearchIndex(item, + (GenericCompareFunctionWithState)func, state); + if (index >= 0) { + // already in list, add after existing + return AddItem(item, index + 1); + } + + return AddItem(item, -index - 1); +} + +template +bool +BObjectList::BinaryInsertUnique(T *item, CompareFunction func) +{ + int32 index = _PointerList_::BinarySearchIndex(item, + (GenericCompareFunction)func); + if (index >= 0) + return false; + + return AddItem(item, -index - 1); +} + +template +bool +BObjectList::BinaryInsertUnique(T *item, CompareFunctionWithState func, void *state) +{ + int32 index = _PointerList_::BinarySearchIndex(item, + (GenericCompareFunctionWithState)func, state); + if (index >= 0) + return false; + + return AddItem(item, -index - 1); +} + + +template +T * +BObjectList::BinaryInsertCopy(const T ©This, CompareFunction func) +{ + int32 index = _PointerList_::BinarySearchIndex(©This, + (GenericCompareFunction)func); + + if (index >= 0) + index++; + else + index = -index - 1; + + T *newItem = new T(copyThis); + AddItem(newItem, index); + return newItem; +} + +template +T * +BObjectList::BinaryInsertCopy(const T ©This, CompareFunctionWithState func, void *state) +{ + int32 index = _PointerList_::BinarySearchIndex(©This, + (GenericCompareFunctionWithState)func, state); + + if (index >= 0) + index++; + else + index = -index - 1; + + T *newItem = new T(copyThis); + AddItem(newItem, index); + return newItem; +} + +template +T * +BObjectList::BinaryInsertCopyUnique(const T ©This, CompareFunction func) +{ + int32 index = _PointerList_::BinarySearchIndex(©This, + (GenericCompareFunction)func); + if (index >= 0) + return ItemAt(index); + + index = -index - 1; + T *newItem = new T(copyThis); + AddItem(newItem, index); + return newItem; +} + +template +T * +BObjectList::BinaryInsertCopyUnique(const T ©This, CompareFunctionWithState func, + void *state) +{ + int32 index = _PointerList_::BinarySearchIndex(©This, + (GenericCompareFunctionWithState)func, state); + if (index >= 0) + return ItemAt(index); + + index = -index - 1; + T *newItem = new T(copyThis); + AddItem(newItem, index); + return newItem; +} + +template +int32 +BObjectList::FindBinaryInsertionIndex(const UnaryPredicate &pred, bool *alreadyInList) + const +{ + int32 index = _PointerList_::BinarySearchIndexByPredicate(&pred, + (UnaryPredicateGlue)&UnaryPredicate::_unary_predicate_glue); + + if (alreadyInList) + *alreadyInList = index >= 0; + + if (index < 0) + index = -index - 1; + + return index; +} + +template +bool +BObjectList::BinaryInsert(T *item, const UnaryPredicate &pred) +{ + return AddItem(item, FindBinaryInsertionIndex(pred)); +} + +template +bool +BObjectList::BinaryInsertUnique(T *item, const UnaryPredicate &pred) +{ + bool alreadyInList; + int32 index = FindBinaryInsertionIndex(pred, &alreadyInList); + if (alreadyInList) + return false; + + AddItem(item, index); + return true; +} + +#endif /* __OBJECT_LIST__ */ diff --git a/include/r5-only/R5Locale.h b/include/r5-only/R5Locale.h new file mode 100644 index 0000000..c74b13e --- /dev/null +++ b/include/r5-only/R5Locale.h @@ -0,0 +1,9 @@ +#ifndef _R5Locale_H +#define _R5Locale_H + +#include "String.h" + +const char* +findKey(const char*); + +#endif \ No newline at end of file diff --git a/include/r5-only/iconv.h b/include/r5-only/iconv.h new file mode 100644 index 0000000..a59a6f3 --- /dev/null +++ b/include/r5-only/iconv.h @@ -0,0 +1,120 @@ +/* Copyright (C) 1999-2002 Free Software Foundation, Inc. + This file is part of the GNU LIBICONV Library. + + The GNU LIBICONV Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + The GNU LIBICONV 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU LIBICONV Library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, Inc., 59 Temple Place - + Suite 330, Boston, MA 02111-1307, USA. */ + +/* When installed, this file is called "iconv.h". */ + +#ifndef _LIBICONV_H +#define _LIBICONV_H + +#define _LIBICONV_VERSION 0x0108 /* version number: (major<<8) + minor */ +extern int _libiconv_version; /* Likewise */ + +/* We would like to #include any system header file which could define + iconv_t, 1. in order to eliminate the risk that the user gets compilation + errors because some other system header file includes /usr/include/iconv.h + which defines iconv_t or declares iconv after this file, 2. when compiling + for LIBICONV_PLUG, we need the proper iconv_t type in order to produce + binary compatible code. + But gcc's #include_next is not portable. Thus, once libiconv's iconv.h + has been installed in /usr/local/include, there is no way any more to + include the original /usr/include/iconv.h. We simply have to get away + without it. + Ad 1. The risk that a system header file does + #include "iconv.h" or #include_next "iconv.h" + is small. They all do #include . + Ad 2. The iconv_t type is a pointer type in all cases I have seen. (It + has to be a scalar type because (iconv_t)(-1) is a possible return value + from iconv_open().) */ + +/* Define iconv_t ourselves. */ +#undef iconv_t +#define iconv_t libiconv_t +typedef void* iconv_t; + +/* Get size_t declaration. */ +#include + +/* Get errno declaration and values. */ +#include +/* Some systems, like SunOS 4, don't have EILSEQ. Some systems, like BSD/OS, + have EILSEQ in a different header. On these systems, define EILSEQ + ourselves. */ +#ifndef EILSEQ +#define EILSEQ +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Allocates descriptor for code conversion from encoding `fromcode' to + encoding `tocode'. */ +#ifndef LIBICONV_PLUG +#define iconv_open libiconv_open +#endif +extern iconv_t iconv_open (const char* tocode, const char* fromcode); + +/* Converts, using conversion descriptor `cd', at most `*inbytesleft' bytes + starting at `*inbuf', writing at most `*outbytesleft' bytes starting at + `*outbuf'. + Decrements `*inbytesleft' and increments `*inbuf' by the same amount. + Decrements `*outbytesleft' and increments `*outbuf' by the same amount. */ +#ifndef LIBICONV_PLUG +#define iconv libiconv +#endif +extern size_t iconv (iconv_t cd, const char* * inbuf, size_t *inbytesleft, char* * outbuf, size_t *outbytesleft); + +/* Frees resources allocated for conversion descriptor `cd'. */ +#ifndef LIBICONV_PLUG +#define iconv_close libiconv_close +#endif +extern int iconv_close (iconv_t cd); + + +#ifndef LIBICONV_PLUG + +/* Nonstandard extensions. */ + +/* Control of attributes. */ +#define iconvctl libiconvctl +extern int iconvctl (iconv_t cd, int request, void* argument); + +/* Requests for iconvctl. */ +#define ICONV_TRIVIALP 0 /* int *argument */ +#define ICONV_GET_TRANSLITERATE 1 /* int *argument */ +#define ICONV_SET_TRANSLITERATE 2 /* const int *argument */ +#define ICONV_GET_DISCARD_ILSEQ 3 /* int *argument */ +#define ICONV_SET_DISCARD_ILSEQ 4 /* const int *argument */ + +/* Listing of locale independent encodings. */ +#define iconvlist libiconvlist +extern void iconvlist (int (*do_one) (unsigned int namescount, + const char * const * names, + void* data), + void* data); +#endif + + +#ifdef __cplusplus +} +#endif + + +#endif /* _LIBICONV_H */ diff --git a/include/runview/RVAction.h b/include/runview/RVAction.h new file mode 100644 index 0000000..4bbeebb --- /dev/null +++ b/include/runview/RVAction.h @@ -0,0 +1,15 @@ +#ifndef _RVAction_h_ +#define _RVAction_h_ + +class RVAction +{ + public: + + virtual ~RVAction(){}; + + virtual status_t Perform(BString param) = 0; + virtual BString GetDescription() = 0; + +}; + +#endif diff --git a/include/runview/RunView.h b/include/runview/RunView.h new file mode 100644 index 0000000..8cb55d6 --- /dev/null +++ b/include/runview/RunView.h @@ -0,0 +1,249 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Vision. + * + * The Initial Developer of the Original Code is The Vision Team. + * Portions created by The Vision Team are + * Copyright (C) 1999, 2000, 2001 The Vision Team. All Rights + * Reserved. + * + * Contributor(s): Rene Gollent + * Todd Lair + */ + +#ifndef RUNVIEW_H_ +#define RUNVIEW_H_ + +#define LINE_COUNT 1000 + +#include + + +//#include "main.h" + +struct Line; +class RVAction; //by xeD +class Theme; +class RunView; +class BScrollView; +class BCursor; +class BMessageRunner; +class BPopUpMenu; + + +const uint32 kResizeMessage = 'irsz'; +const uint32 M_LOOKUP_WEBSTER = 'rvlw'; +const uint32 M_LOOKUP_GOOGLE = 'rvlg'; +const uint32 M_LOOKUP_ACRONYM = 'rvla'; +const uint32 M_CLEAR = 'rvcl'; + +const uint32 M_OFFVIEW_SELECTION = 'rvos'; +const uint32 M_THEME_FOREGROUND_CHANGE = 'rvtf'; +const uint32 M_THEME_BACKGROUND_CHANGE = 'rvtb'; +const uint32 M_THEME_FONT_CHANGE = 'rvto'; + +#define C_URL 0 +#define C_TIMESTAMP 1 +#define C_TEXT 2 +#define C_OWNNICK 3 +#define C_OTHERNICK 4 +#define C_ACTION 5 +#define C_SELECTION 6 +#define C_TIMESTAMP_DUMMY 7 // Needed to fake a TS +#define MAX_COLORS 8 + +/* +#define F_URL 0 +#define F_TEXT 1 +#define F_TIMESTAMP 2 +#define F_ACTION 3 +#define F_EMOTICON 4 // new style by xeD ;) +#define F_STYLE_0 4 // new style by xeD ;) +#define F_TIMESTAMP_DUMMY 5 // Needed to fake TS +#define MAX_FONTS 6 +*/ + +enum { + F_URL = 0, + F_TEXT, + F_TIMESTAMP, + F_ACTION, + F_EMOTICON, + F_STYLE_0, + F_STYLE_1, + F_STYLE_2, + F_TIMESTAMP_DUMMY, //DON'T TOUCH NOT USE + MAX_FONTS //DON'T TOUCH NOT USE +}; + +class SelectPos +{ + public: + + int16 fLine; + int16 fOffset; + + SelectPos ( + int16 selLine = 0, + int16 selOffset = 0) + : fLine (selLine), + fOffset (selOffset) + { } + + SelectPos (const SelectPos &pos) + : fLine (pos.fLine), + fOffset (pos.fOffset) + { } + + ~SelectPos (void) + { } + + SelectPos &operator = (const SelectPos &pos) + { + fLine = pos.fLine; + fOffset = pos.fOffset; + + return *this; + } + + inline int operator == (const SelectPos &rhs) const + { + return ((fLine == rhs.fLine) && (fOffset == rhs.fOffset)); + } + + inline int operator != (const SelectPos &rhs) const + { + return (!(*this == rhs)); + } + + +}; + +class RunView : public BView +{ + BScrollView *fScroller; + BCursor *fURLCursor; + Theme *fTheme; + + Line *fWorking; + Line *fLines[LINE_COUNT]; + int16 fLine_count, + fClickCount; + + char *fStamp_format; + char *fClipping_name; + + SelectPos fSp_start, fSp_end; + + int32 fTracking; + SelectPos fTrack_offset; + BMessageRunner *fOff_view_runner; + bigtime_t fOff_view_time; + + bool fResizedirty; + bool fFontsdirty; + BPopUpMenu *fMyPopUp; + BPoint fLastClick; + bigtime_t fLastClickTime; + + BMessage urls; //by xeD + BMessage actions; //by xeD + + bool fIndent; //by xeD + + RVAction* fDefaultURLAction; //by xeD + + RVAction* FindAction(const char* symbolicName); //by xeD + void InvokeAction(BString mangledName); //by xeD + + bool RecalcScrollBar (bool constrain); + void ResizeRecalc (void); + void FontChangeRecalc (void); + void ExtendTrackingSelect (BPoint); + void ShiftTrackingSelect (BPoint, bool, bigtime_t); + void CheckURLCursor (BPoint); + bool CheckURL(BPoint); //by xeD + BString GetURL(BPoint); + + void BuildPopUp (BPoint point); + + bool CheckClickBounds (const SelectPos &, const BPoint &) const; + void LoadURL(const char *url); + + public: + + RunView ( + BRect, + const char *, + Theme *, + uint32 = B_FOLLOW_LEFT | B_FOLLOW_TOP, + uint32 = 0UL); + virtual ~RunView (void); + + virtual void AttachedToWindow (void); + virtual void DetachedFromWindow (void); + virtual void FrameResized (float, float); + + virtual void TextResized(BRect /*r*/){}; //by xeD Callback when text bounds changed. + virtual float ExtraTextSize(){ return 0;}; //by xeD does we use more Vert space than the text? + + virtual void TargetedByScrollView (BScrollView *); + virtual void Show (); + virtual void Draw (BRect); + virtual void MessageReceived (BMessage *); + + virtual void SetViewColor (rgb_color); + void SetViewColor (uchar red, uchar green, uchar blue, uchar alpha = 255) + { rgb_color color = {red, green, blue, alpha}; SetViewColor (color); } + + + virtual void MouseDown (BPoint); + virtual void MouseMoved (BPoint, uint32, const BMessage *); + virtual void MouseUp (BPoint); + + //by xeD + void SetIndentWrappedLine(bool val){ fIndent = val;} + + void Append (const char *, int32, int16, int16, int16); + void Append (const char *, int16, int16, int16); + void AppendURL(const char *,const char *,int16 font); + void AppendURL(const char *,const char *,int16 back,int16 font); + + void ClearActions(); //by xeD + void AddAction(const char* symbolicName,RVAction*); //by xeD + void SetDefaultOpenURLAction(RVAction*); //by xeD + + void Clear (void); + + int16 LineCount (void) const; + const char *LineAt (int16) const; + + void SetTimeStampFormat (const char *); + void SetTheme (Theme *); + + SelectPos PositionAt (BPoint) const; + BPoint PointAt (SelectPos) const; + + BRect GetTextFrame (const SelectPos &, const SelectPos &) const; + bool IntersectSelection (const SelectPos &, const SelectPos &) const; + void GetSelectionText (BString &) const; + void Select (const SelectPos &, const SelectPos &); + void SelectAll (void); + void SetClippingName (const char *); + bool FindText(const char *); + + void ScrollToBottom(void); + void ScrollToSelection(void); + +}; + +#endif diff --git a/include/runview/TextRender.h b/include/runview/TextRender.h new file mode 100644 index 0000000..700fcc3 --- /dev/null +++ b/include/runview/TextRender.h @@ -0,0 +1,25 @@ +#ifndef _TextRender_H_ +#define _TextRender_H_ + +class TextRender +{ + public: + TextRender(){}; + virtual ~TextRender() {}; + + virtual void Render(BView *target,const char*,int16 num,BPoint pos,BRect drawRect) = 0; + + virtual void GetHeight(font_height *height) = 0; + virtual void GetEscapements(const char charArray[], int32 numChars,float escapementArray[])=0; + virtual float Size(float maxwidth) = 0; + + virtual void MarginAfterTheText(BView *target,rgb_color view_color, BRect rect){ + // Margin after fText + target->SetDrawingMode (B_OP_COPY); + target->SetLowColor (view_color); + target->FillRect (rect, B_SOLID_LOW); + } + // + +}; +#endif diff --git a/include/runview/Theme.h b/include/runview/Theme.h new file mode 100644 index 0000000..762be7d --- /dev/null +++ b/include/runview/Theme.h @@ -0,0 +1,109 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Vision. + * + * The Initial Developer of the Original Code is The Vision Team. + * Portions created by The Vision Team are + * Copyright (C) 1999, 2000, 2001 The Vision Team. All Rights + * Reserved. + * + * Contributor(s): Rene Gollent + * Todd Lair + */ + +#ifndef THEME_H_ +#define THEME_H_ + +#include +#include +#include + +#include "TextRender.h" + +class BView; +class NormalTextRender; + +class Theme +{ + char *name; + rgb_color *fores; + rgb_color *backs; + //BFont *fonts; + TextRender **text_renders; //FIX!! + + int16 fore_count; + int16 back_count; + int16 render_count; + + BList list; + sem_id sid; + + public: + + static int16 TimestampFore; + static int16 TimestampBack; + static int16 TimestampFont; + static int16 TimespaceFore; + static int16 TimespaceBack; + static int16 TimespaceFont; + static int16 NormalFore; + static int16 NormalBack; + static int16 NormalFont; + static int16 SelectionBack; + + Theme ( + const char *, + int16, + int16, + int16); + virtual ~Theme (void); + + const char *Name (void) const + { return name; } + + void ReadLock (void); + void ReadUnlock (void); + void WriteLock (void); + void WriteUnlock (void); + + int16 CountForegrounds (void) const; + int16 CountBackgrounds (void) const; +// int16 CountFonts (void) const; + int16 CountTextRenders (void) const; + + const rgb_color ForegroundAt (int16) const; + const rgb_color BackgroundAt (int16) const; + + //const BFont &FontAt (int16) const; + + TextRender* TextRenderAt(int16); + + bool SetForeground (int16, const rgb_color); + bool SetForeground (int16 w, uchar r, uchar g, uchar b, uchar a = 255) + { rgb_color color = {r, g, b, a}; return SetForeground (w, color); } + bool SetBackground (int16, const rgb_color); + bool SetBackground (int16 w, uchar r, uchar g, uchar b, uchar a = 255) + { rgb_color color = {r, g, b, a}; return SetBackground (w, color); } + + //bool SetFont (int16, const BFont &); + bool SetTextRender(int16, TextRender *); + + + + + void AddView (BView *); + void RemoveView (BView *); + + NormalTextRender *normal_textrender; +}; + +#endif diff --git a/library/Jamfile b/library/Jamfile new file mode 100644 index 0000000..2fd4553 --- /dev/null +++ b/library/Jamfile @@ -0,0 +1,8 @@ +SubDir TOP ; +SubInclude TOP libfunky ; +SubInclude TOP libclv ; +SubInclude TOP libfish ; +SubInclude TOP librunview ; +MakeDistro distro ; + + diff --git a/library/Jamrules b/library/Jamrules new file mode 100644 index 0000000..089a2cb --- /dev/null +++ b/library/Jamrules @@ -0,0 +1,67 @@ + +# The directories used by the build. +BUILD_DIR = [ FDirName $(TOP) build ] ; +GENERATED_DIR = [ FDirName $(TOP) generated ] ; +DISTRO_DIR = [ FDirName $(TOP) generated distro ] ; + +include [ FDirName $(BUILD_DIR) HelperRules ] ; +include [ FDirName $(BUILD_DIR) ConfigRules ] ; +include [ FDirName $(BUILD_DIR) OverriddenJamRules ] ; +include [ FDirName $(BUILD_DIR) MainBuildRules ] ; +include [ FDirName $(BUILD_DIR) BuildSettings ] ; + +# Include UserBuildConfig. +{ + local userBuildConfig = [ GLOB $(BUILD_DIR) : UserBuildConfig ] ; + if $(userBuildConfig) + { + LOCATE on UserBuildConfig = $(BUILD_DIR) ; + include UserBuildConfig ; + } +} + +# default to strip generated apps if not specified otherwise: +STRIP_APPS ?= 1 ; + +# Cache files for header scanning and jamfile caching. +HCACHEFILE = header_cache ; +JCACHEFILE = jamfile_cache ; +LOCATE on $(HCACHEFILE) $(JCACHEFILE) = $(GENERATED_DIR) ; + + +rule MakeDistro +{ + # MakeDistro + + local target = $1 ; + + NotFile $(target) ; + Always $(target) ; +} + +actions MakeDistro +{ + echo "making distro $(DISTRO_DIR)" ; + + jam + + ln -sf ../library/librunview/include ../include/runview + ln -sf ../library/libclv/include ../include/libclv + ln -sf ../library/libfish/include ../include/libfish + ln -sf ../library/libfunky/include ../include/libfunky + + cp $(DISTRO_DIR)/libclv.a ../libs/libclv.a + + if [ $(DEFINES)="ZETA" ] + then + echo "zeta" + cp $(DISTRO_DIR)/libfish.a ../libs/libfish.a + cp $(DISTRO_DIR)/librunview.a ../libs/librunview.a + cp $(DISTRO_DIR)/libfunky.a ../libs/libfunky.a + else + echo "beos" + cp $(DISTRO_DIR)/libfish.a ../libs/libfish.r5.a + cp $(DISTRO_DIR)/librunview.a ../libs/librunview.r5.a + cp $(DISTRO_DIR)/libfunky.a ../libs/libfunky.r5.a + fi +} diff --git a/library/build/BuildSettings b/library/build/BuildSettings new file mode 100644 index 0000000..bb9332d --- /dev/null +++ b/library/build/BuildSettings @@ -0,0 +1,127 @@ +# BuildSettings +# +# Setup global variables. + +# C and C++ flags +if $(OSPLAT) = PPC { + # filter out -nosyspath + CFLAGS = [ FFilter $(CFLAGS) : -nosyspath ] ; + C++FLAGS = [ FFilter $(C++FLAGS) : -nosyspath ] ; + LINKFLAGS += -warn -export pragma ; + + # set file containing preprocessed headers: + PREFIX_FILE ?= [ FDirName $(LOCATE_TARGET) pe.headers ] ; +} + +if $(OSPLAT) = X86 { + # check for BONE... + local haveBone = [ GLOB /boot/develop/headers/be/bone/arpa : inet.h ] ; + if $(haveBone) { + CCFLAGS += -DBONE_BUILD ; + C++FLAGS += -DBONE_BUILD ; + SYSHDRS += /boot/develop/headers/be/bone /boot/develop/headers/be/bone/sys ; + LINKLIBS += -lsocket -lbind ; + } else { + LINKLIBS += -lnet ; + } + # check for Zeta... + local haveZeta = [ GLOB /boot/beos/system/lib : libzeta.so ] ; + if $(haveZeta) { + LINKLIBS += -lzeta ; + DEFINES += ZETA ; + } +} + +# Use copyattr for copying. +CP = copyattr --data ; + +# Default paths for bison and flex: +BISON = bison ; +LEX = flex ; + +# mkdir shall not fail, if the directory already exists. +MKDIR = mkdir -p ; + +# Modify the main target dirs for languages and extensions. +SetConfigVar LOCATE_MAIN_TARGET : TOP Languages + : [ FDirName $(DISTRO_DIR) Languages ] ; +SetConfigVar LOCATE_MAIN_TARGET : TOP Extensions + : [ FDirName $(DISTRO_DIR) Extensions ] ; + +rule SetUpSubDirBuildSettings { + # SetUpSubDirBuildSettings ; + # + # Sets up the compiler flags and defines based on the WARNINGS, DEBUG, and + # OPTIMIZE variables. Also sets the locations for the targets (objects, + # libraries and executables). + # + # : Parameters as passed to the SubDir rule, i.e. the name of the + # TOP variable and the subdir tokens. + # + local dir = $(1) ; + + # warnings settings + if $(WARNINGS) != 0 { + if $(OSPLAT) = X86 { + CCFLAGS += -Wall -Wno-multichar -Wmissing-prototypes ; + CCFLAGS += -Wpointer-arith -Wcast-align -Wsign-compare ; + C++FLAGS += -Wall -Wno-multichar -Wmissing-prototypes ; + C++FLAGS += -Wno-ctor-dtor-privacy -Woverloaded-virtual ; + C++FLAGS += -Wpointer-arith -Wcast-align -Wsign-compare ; + C++FLAGS += -Wno-unknown-pragmas ; + } else { + CCFLAGS += -w on -requireprotos ; + } + } + + # set the objects-folder according to debugging settings: + if $(DEBUG) && $(DEBUG) != 0 + { + OBJECTS_DIR = [ FDirName $(TOP) generated objects-debug ] ; + } + else + { + OBJECTS_DIR = [ FDirName $(TOP) generated objects-nodebug ] ; + } + + # debugging settings + if $(DEBUG) > 0 { + OPTIMIZE = 0 ; + STRIP_APPS = 0 ; + DEFINES += DEBUG=$(DEBUG) ; + CCFLAGS += -g ; + C++FLAGS += -g ; + LINKFLAGS += -g ; + } + + # optimization settings + if $(OPTIMIZE) = 0 { + if $(OSPLAT) = X86 { + OPTIM = -O0 ; + } else { + OPTIM = -O0 ; + } + } else { + if $(OSPLAT) = X86 { + OPTIM ?= -O2 ; + } else { + OPTIM ?= -O7 ; + } + } + + # setup objects location + local objdir = [ FDirName $(OBJECTS_DIR) $(dir[2-]) ] ; + SEARCH_SOURCE += $(objdir) ; + LOCATE_SOURCE = $(objdir) ; + LOCATE_TARGET = $(objdir) ; + + # setup main targets location + LOCATE_MAIN_TARGET ?= [ FDirName $(DISTRO_DIR) ] ; +} + +# The LOCATE_MAIN_TARGET variable shall be reset for each subdirectory. +AUTO_SET_UP_CONFIG_VARIABLES += LOCATE_MAIN_TARGET ; + +# Add the rules setting up the build settings for a subdirectory to the +# rules invoked by SubDir. +SUBDIRRULES += SetUpSubDirBuildSettings ; diff --git a/library/build/ConfigRules b/library/build/ConfigRules new file mode 100644 index 0000000..082ec46 --- /dev/null +++ b/library/build/ConfigRules @@ -0,0 +1,146 @@ +# ConfigRules +# +# Contains rules providing the config variable feature. It allows to set the +# values for certain variables for subdirectories in a central place. That is +# one can, for instance, specify in a file like UserBuildConfig for which +# directories to enable debugging, warnings, set special defines, compiler +# flags and the like without needing to edit the Jamfiles for the respective +# dirs. + +rule ConfigObject +{ + # ConfigObject ; + # + # Private rule. Returns the dummy object on which the config variables are + # set for a given subdir. + # + # : Parameters as passed to the SubDir rule, i.e. the name of the + # TOP variable and the subdir tokens. + # + local config = __config__ ; + local grist = [ FGrist root $(1) ] ; + return $(config:G=$(grist)) ; +} + +rule SetConfigVar +{ + # SetConfigVar : : [ : ] ; + # + # Sets a config variable for a specified directory to the given value. + # + # : The name of the variable to be set. + # : Parameters as passed to the SubDir rule, i.e. the name of the + # TOP variable and the subdir tokens. + # : The value to which the variable shall be set. + # : Either "global" or "local". The former implies that the variable + # value shall also be used for subdirectories (recursively), if + # for them the variable has not been set. The latter has the same + # effect regarding subdirs as if the variable for the directory + # is not set. Defaults to "global". + # + local var = $(1[1]) ; + local config = [ ConfigObject $(2) ] ; + local scope = $(4) ; + if ! $(scope) { + scope = global ; + } + $(var) on $(config) = $(3) ; + __set_$(var) on $(config) = $(scope) ; +} + +rule AppendToConfigVar +{ + # AppendToConfigVar : : [ : ] ; + # + # Appends a value to a config variable for a specified directory. Shortcut + # for + # SetConfigVar : : [ ConfigVar : ] ; + # + # : The name of the variable to be set. + # : Parameters as passed to the SubDir rule, i.e. the name of the + # TOP variable and the subdir tokens. + # : The value which to append to the variables current value. + # : Either "global" or "local". The former implies that the variable + # value shall also be used for subdirectories (recursively), if + # for them the variable has not been set. The latter has the same + # effect regarding subdirs as if the variable for the directory + # is not set. Defaults to "global". + # + SetConfigVar $(1) : $(2) : [ ConfigVar $(1) : $(2) ] $(3) : $(4) ; +} + +rule ConfigVar +{ + # ConfigVar : [ : ] ; + # + # Returns the value of a configuration variable for a given subdir. + # If the variable is not set for the subdir, the rule is invoked + # recursively for the parent directory with the scope "global". When + # the root is reached without yielding a value, the value of the global + # variable is returned. + # + # : The name of the variable whose value shall be returned. + # : Parameters as passed to the SubDir rule, i.e. the name of the + # TOP variable and the subdir tokens. + # : If not given any scope passed to SetConfigVar for the given + # directory will be accepted, otherwise it must match the scope + # passed to SetConfigVar. + # + local var = $(1[1]) ; + local dir = $(2) ; + local config = [ ConfigObject $(dir) ] ; + local scope = $(3) ; + local varScope = [ on $(config) return $(__set_$(var)) ] ; + if ( ! $(scope) && $(varScope) ) + || ( $(scope) && $(scope) = $(varScope) ) + || ! $(dir) { + on $(config) return $($(var)) ; + } else { + dir = [ FReverse $(dir) ] ; + return [ ConfigVar $(var) : [ FReverse $(dir[2-]) ] : global ] ; + } +} + +rule SetUpConfigVars { + # SetUpConfigVars ; + # + # Sets the global variables defined in AUTO_SET_UP_CONFIG_VARIABLES to the + # values specified for the subdirectory . + # + # : Parameters as passed to the SubDir rule, i.e. the name of the + # TOP variable and the subdir tokens. + # + local dir = $(1) ; + + # Backup the global variable value on first invocation, otherwise restore + # them, so that ConfigVar returns the right values for not explicity set + # local variables. + local var ; + if ! $(__config_var_backup__) { + __config_var_backup__ = true ; + for var in $(AUTO_SET_UP_CONFIG_VARIABLES) { + __config_var_backup_$(var)__ = $($(var)) ; + } + } else { + for var in $(AUTO_SET_UP_CONFIG_VARIABLES) { + $(var) = $(__config_var_backup_$(var)__) ; + } + } + + # Set the variables to their configured values. + for var in $(AUTO_SET_UP_CONFIG_VARIABLES) { + $(var) = [ ConfigVar $(var) : $(dir) ] ; + } +} + +# Add the SetUpConfigVars rule to the rules that are invoked at the end of the +# SubDir rule. Prepend it, so that the variables are set up before any other +# rule is invoked. +SUBDIRRULES = SetUpConfigVars $(SUBDIRRULES) ; + +# Some config variables that should be set up automatically for subdirs. +AUTO_SET_UP_CONFIG_VARIABLES += + CCFLAGS C++FLAGS DEBUG DEFINES HDRS LINKFLAGS OPTIM OPTIMIZE + SYSHDRS WARNINGS +; diff --git a/library/build/HelperRules b/library/build/HelperRules new file mode 100644 index 0000000..dda3e89 --- /dev/null +++ b/library/build/HelperRules @@ -0,0 +1,51 @@ +# HelperRules +# +# Helper rules without side effects. + +rule FFilter +{ + # FFilter : ; + # + # Removes all occurrences of in . + + local list = $(1) ; + local excludes = $(2) ; + local newList ; + local item ; + for item in $(list) { + local skip ; + local exclude ; + for exclude in $(excludes) { + if $(item) = $(exclude) { + skip = true ; + } + } + if ! $(skip) { + newList += $(item) ; + } + } + return $(newList) ; +} + +rule FSplitPath +{ + # FSplitPath ; + # + # Decomposes a path into its components. + # + # : The path to be decomposed. + # + local path = $(1:G=) ; + + local components ; + # $(path:D) for "/" is "/". Therefore the second condition. + while $(path:D) && $(path:D) != $(path) + { + # Note: $(path:B) returns "." for "..", but $(path:D=) is fine. + components = $(path:D=) $(components) ; + path = $(path:D) ; + } + components = $(path) $(components) ; + return $(components) ; +} + diff --git a/library/build/MainBuildRules b/library/build/MainBuildRules new file mode 100644 index 0000000..f5768f3 --- /dev/null +++ b/library/build/MainBuildRules @@ -0,0 +1,428 @@ +# MainBuildRules +# +# Rules that specify what to build and how to do it. + +rule Application +{ + # Application : : ; + # + # Creates an application from sources. + # + # : Name of the application. Grist is allowed. + # : List of source files. Grist will be set. + # : List of libraries to link against. + # + local app = $(1) ; + local sources = $(2) ; + local libs = $(3) ; + + Main $(app) : $(sources) ; + MakeLocate $(app) : $(LOCATE_MAIN_TARGET) ; + LinkAgainst $(app) : $(libs) ; + +} + +actions Strip +{ + strip "$(1)" ; +} + +rule AddOn +{ + # AddOn : : ; + # + # Creates an add-on from sources. + # + # : Name of the add-on. Grist is allowed. + # : List of source files. Grist will be set. + # : List of libraries to link against. + # + SharedLibrary $(1) : $(2) : $(3) ; +} + +rule SharedLibrary +{ + # SharedLibrary : : ; + # + # Creates a shared library from sources. + # + # : Name of the shared library. Grist is allowed. + # : List of source files. Grist will be set. + # : List of libraries to link against. + # + local lib = $(1) ; + local sources = $(2) ; + local libs = $(3) ; + + Main $(lib) : $(sources) ; + MakeLocate $(lib) : $(LOCATE_MAIN_TARGET) ; + local linkFlags ; + if $(OSPLAT) = X86 { + linkFlags = -nostart -Xlinker -soname=\"$(lib)\" ; + } else { + linkFlags = -xms ; + } + LINKFLAGS on $(lib) = [ on $(lib) return $(LINKFLAGS) ] $(linkFlags) ; + LinkAgainst $(lib) : $(libs) ; +} + +rule StaticLibrary +{ + # StaticLibrary : ; + # + # Creates a static library from sources. + # + # : Name of the static library. Grist is allowed. + # : List of source files. Grist will be set. + # + local lib = $(1) ; + Library $(lib) : $(2) ; + MakeLocate $(lib) : $(LOCATE_MAIN_TARGET) ; + + # If KEEPOBJS is set, Library doesn't make the library depend on `lib'. + if $(KEEPOBJS) { + Depends lib : $(lib) ; + } +} + +rule LinkAgainst +{ + # LinkAgainst : ; + # + # Adds libraries to the list of libraries a (Main) target shall be linked + # against. + # + # : The name of the target for which to add libraries. + # : The libraries (actually arbitrary shared objects and static + # libraries) to be added. Valid elements are e.g. "be" or + # "libopenbeos.so" or "/boot/.../libfoo.so". If the basename starts + # with "lib" or the thingy has a dirname or grist, it is added to + # the NEEDLIBS variable (i.e. the file will be bound!), otherwise + # it is prefixed "-l" and added to LINKLIBS. If you want to specify + # a target that isn't a library and also has neither grist nor a + # dirname, you can prepend "" as grist; it will be + # stripped by this rule. + # + for i in $(>) + { + local isfile = ; + if $(i:D) || $(i:G) { + isfile = true ; + if $(i:G) = { + i = $(i:G=) ; + } + } else { + switch $(i:B) + { + # XXX: _APP_ and _KERNEL_ should not be needed for ELF. + case _APP_ : isfile = true ; + case _KERNEL_ : isfile = true ; + case lib* : isfile = true ; + case * : isfile = ; + } + if ! $(isfile) && ( $(i:S) = .so || $(i:S) = .a ) { + isfile = true ; + } + } + if $(isfile) { + NEEDLIBS on $(1) = [ on $(1) return $(NEEDLIBS) ] $(i) ; + Depends $(1) : $(i) ; + } else { + LINKLIBS on $(1) = [ on $(1) return $(LINKLIBS) ] -l$(i) ; + } + } +} + +rule XRes +{ + # XRes : ; + # + # Adds resources to a file. + # + # : The files to which resources shall be added. + # : The resource files. + # + if $(2) + { + Depends $(1) : $(2) ; + XRes1 $(1) : $(2) ; + } +} + +actions XRes1 +{ + xres -o "$(1)" "$(2)" ; +} + +actions MimeSet +{ + mimeset -f "$(1)" ; +} + +rule LexC++ +{ + Depends $(1) : $(2) ; + MakeLocate $(1) : $(LOCATE_SOURCE) ; + Clean clean : $(1) ; +} + +actions LexC++ +{ + $(LEX) -i -o$(1) $(2) +} + +rule Bison +{ + local _h ; + + _h = $(1).h ; + + MakeLocate $(<) $(_h) : $(LOCATE_SOURCE) ; + + Depends $(<) $(_h) : $(>) ; + BisonC++ $(<) $(_h) : $(>) ; + Clean clean : $(<) $(_h) ; + + # make sure someone includes $(_h) else it will be + # a deadly independent target + + Includes $(<) : $(_h) ; +} + +actions BisonC++ +{ + $(BISON) $(YACCFLAGS) -o $(1[1]) $(2) +} + +rule Rez +{ + # Rez : [ : ] ; + # + local output = $(1) ; + local rezFile = $(2) ; + local flags = $(3) ; + + REZHDRS on $(output) = [ on $(output) FIncludes $(HDRS) ] ; + REZFLAGS on $(output) = [ on $(output) return $(REZFLAGS) ] $(flags) ; + Depends $(output) : rez $(rezFile) ; + Rez1 $(output) : rez $(rezFile) ; +} + +actions Rez1 +{ + $(2[1]) $(REZFLAGS) $(REZHDRS) -o "$(1)" "$(2[2-])" ; +} + +rule RezObjects +{ + local rezFiles = $(1) ; + local rezFile ; + for rezFile in $(rezFiles) { + local rsrcFile = $(rezFile:BS=.rsrc) ; + RezObject $(rsrcFile) : [ FGristFiles $(rezFile) ] ; + } +} + +rule RezObject +{ + # RezObject : ; + # + local _rsrc = $(1) ; + local _r = $(2) ; + + local tmp = [ FGristFiles $(_rsrc)_tmp ] ; + + SEARCH on $(_r) = $(SEARCH_SOURCE) ; + + # include directories to by used + HDRS on $(_rsrc) $(tmp) = $(SEARCH_SOURCE) $(SUBDIRHDRS) $(HDRS) ; + + # preprocess the rez file + PreProcess $(tmp) : $(_r) ; + + # generate the resource file from the preprocessed rez file + MakeLocate $(_rsrc) : $(LOCATE_TARGET) ; + Rez $(_rsrc) : $(tmp) : -t ; + + RmTemps $(_rsrc) : $(tmp) ; + Clean clean : $(_rsrc) ; +} + +rule PreProcess +{ + # PreProcess : ; + # + local target = $(1) ; + local source = $(2) ; + + Depends $(target) : $(source) ; + + CPPHDRS on $(target) = [ on $(target) FIncludes $(HDRS) ] ; + + MakeLocate $(target) : $(LOCATE_SOURCE) ; +} + +if $(OSPLAT) = PPC { + actions PreProcess + { + mwcc -preprocess $(CPPHDRS) -o "$(1)" $(2) + } +} else { + actions PreProcess + { + gcc -E -x c $(CPPHDRS) -o "$(1)" $(2) + } +} + +rule RezHeader +{ + # RezHeader : : + # + # generates a header from a given resource file. + # + local _hdr = $(1) ; + local _rsrc = $(2) ; + + SEARCH on $(_rsrc) = $(SEARCH_SOURCE) ; + HDRS on $(_hdr) = $(SEARCH_SOURCE) $(SUBDIRHDRS) $(HDRS) ; + MakeLocate $(_hdr) : $(LOCATE_SOURCE) ; + Clean clean : $(_hdr) ; + + Rez $(_hdr) : $(_rsrc) : -h ; +} + +rule PreCompile +{ + # PreCompile : + # + # precompiles the given src (a headerfile) into the specified header. + # + local _hdr = $(1) ; + local _src = $(2) ; + MakeLocate $(_hdr) : $(LOCATE_TARGET) ; + PreComp $(_hdr) : $(_src) ; + Clean clean : $(_hdr) ; +} + +rule PreComp +{ + Depends $(<) : $(>) ; +} + +actions PreComp +{ + mwcc -precompile $(<) -lang cplus "$(>)" ; +} + +rule PeLanguage +{ + # PeLanguage : : : + # + # generates a SharedLib which extends Pe with syntax-highlighting for + # that specific language. + # + local lang = $(1) ; + local srcs = $(2) ; + local libs = $(3) ; + local rsrc = $(4) ; # contains keywords + + SharedLibrary $(lang) : $(srcs) : $(libs) ; + XRes $(lang) : $(rsrc) ; +} + +rule PeExtension +{ + # PeExtension : : : + # + # generates a SharedLib which extends Pe with a specific feature. + # + local ext = $(1) ; + local srcs = [ FGristFiles $(2) ] ; + local libs = $(3) ; + local rsrc = [ FGristFiles $(4) ] ; # optional resource file + + if $(rsrc) { + local header = $(rsrc:BS=.r.h) ; + + Includes $(srcs) : $(header) ; + RezHeader $(header) : $(rsrc) ; + } + SharedLibrary $(ext) : $(srcs) : $(libs) ; + + SymlinkDistroExtensionsLibDir $(ext) ; +} + +rule SymlinkDistroExtensionsLibDir +{ + # SymlinkDistroExtensionsLibDir ; + # + local extension = $(1) ; + + Depends $(extension) : lib ; + NoUpdate lib ; + MakeLocate lib : $(DISTRO_DIR)/Extensions ; + + SymlinkDistroExtensionsLibDir1 lib ; +} + +actions together SymlinkDistroExtensionsLibDir1 +{ # create a link to the folder where libhekkel.so lives + ln -sfn ../lib $(1) ; +} + +rule SubDirSysHdrs +{ + # SubDirSysHdrs ; + # + # Adds directories to the system include search paths for the current + # subdirectory. Counterpart of SubDirHdrs which adds non-system include + # search paths. + # + # : The directories to be added to the current subdir's system + # include search paths. + # + SUBDIRSYSHDRS += [ FDirName $(1) ] ; +} + +rule ObjectSysHdrs +{ + # SubDirSysHdrs : ; + # + # Adds directories to the system include search paths for the given + # sources or objects. Counterpart of ObjectHdrs which adds non-system + # include search paths. + # + # NOTE: This rule must be invoked *after* the rule that generates the + # objects. + # + # : The targets for which to add system include + # search paths. + # : The directories to be added to the given objects' system + # include search paths. + # + + local s ; + for s in [ FGristFiles $(<:S=$(SUFOBJ)) ] { + SYSHDRS on $(s) += $(>) ; + CCHDRS on $(s) = [ on $(s) FIncludes $(HDRS) ] + $(HDRS_INCLUDES_SEPARATOR) [ on $(s) FSysIncludes $(SYSHDRS) ] ; + } +} + + +# FSysIncludes ; +# +# Counterpart of FIncludes for system include search paths. +# +if $(OSPLAT) = X86 { + rule FSysIncludes { return -I$(<) ; } +} else { + rule FSysIncludes { return "-i "$(<) ; } +} + +# Variable referring to the STL. +if $(OSPLAT) = X86 { + STDC++LIB = stdc++.r4 ; +} else { + STDC++LIB = mslcpp_4_0 ; +} diff --git a/library/build/OverriddenJamRules b/library/build/OverriddenJamRules new file mode 100644 index 0000000..c0fef0c --- /dev/null +++ b/library/build/OverriddenJamRules @@ -0,0 +1,214 @@ +# OverriddenJamRules +# +# Jam rules that need to be overridden for good reasons. + +# Overridden to allow for spaces in file names and to support resources. +# Also set the on target LINKFLAGS variable to prevent later changes to +# the global variable from having an effect on the setting for the target. +rule Link +{ + local dbg = [ on $(1) return $(DEBUG) ] ; + if $(STRIP_APPS) && $(STRIP_APPS) != 0 && (!$(dbg) || $(dbg) = 0) { + # strip app if requested so and if not in debug mode! + Strip $(1) ; + } + # Note: RESFILES must be set before invocation. + MODE on $(1) = $(EXEMODE) ; + on $(1) XRes $(1) : $(RESFILES) ; + Chmod $(1) ; + MimeSet $(1) ; + LINKFLAGS on $(1) = [ on $(1) return $(LINKFLAGS) ] ; +} + +actions Link bind NEEDLIBS +{ + $(LINK) $(LINKFLAGS) -o "$(1)" $(UNDEFS) "$(2)" "$(NEEDLIBS)" $(LINKLIBS) +} + + +# Overridden to allow for spaces in file names. +actions Chmod1 +{ + $(CHMOD) "$(MODE)" "$(1)" +} + +# Overridden to allow for spaces in file names. +actions piecemeal together existing Clean +{ + $(RM) "$(>)" +} + +# Changes to rules for sake of discrimination between system and non-system +# headers. + +if $(OSPLAT) = X86 { + HDRS_INCLUDES_SEPARATOR = -I- ; +} else { + HDRS_INCLUDES_SEPARATOR = -i- ; +} + +rule Cc +{ + Depends $(<) : $(>) ; + + # If the compiler's -o flag doesn't work, relocate the .o + + if $(RELOCATE) + { + CcMv $(<) : $(>) ; + } + + # Just to clarify here: this sets the per-target CCFLAGS to + # be the current value of (global) CCFLAGS and SUBDIRCCFLAGS. + # CCHDRS and CCDEFS must be reformatted each time for some + # compiles (VMS, NT) that malign multiple -D or -I flags. + + CCFLAGS on $(<) += $(CCFLAGS) $(SUBDIRCCFLAGS) $(OPTIM) ; + + CCHDRS on $(<) = [ on $(<) FIncludes $(HDRS) ] + $(HDRS_INCLUDES_SEPARATOR) [ on $(<) FSysIncludes $(SYSHDRS) ] ; + CCDEFS on $(<) = [ on $(<) FDefines $(DEFINES) ] ; +} + +rule C++ +{ + Depends $(<) : $(>) ; + + if $(RELOCATE) + { + CcMv $(<) : $(>) ; + } + + C++FLAGS on $(<) += $(C++FLAGS) $(SUBDIRC++FLAGS) $(OPTIM) ; + + CCHDRS on $(<) = [ on $(<) FIncludes $(HDRS) ] + $(HDRS_INCLUDES_SEPARATOR) [ on $(<) FSysIncludes $(SYSHDRS) ] ; + CCDEFS on $(<) = [ on $(<) FDefines $(DEFINES) ] ; +} + +rule Object +{ + # locate object and search for source, if wanted + + Clean clean : $(<) ; + + MakeLocate $(<) : $(LOCATE_TARGET) ; + SEARCH on $(>) = $(SEARCH_SOURCE) ; + + # Save HDRS for -I$(HDRS) on compile. + # We shouldn't need -I$(SEARCH_SOURCE) as cc can find headers + # in the .c file's directory, but generated .c files (from + # yacc, lex, etc) are located in $(LOCATE_TARGET), possibly + # different from $(SEARCH_SOURCE). + + HDRS on $(<) = $(SEARCH_SOURCE) $(SUBDIRHDRS) $(HDRS) ; + SYSHDRS on $(<) = $(SUBDIRSYSHDRS) $(SYSHDRS) ; + + # handle #includes for source: Jam scans for headers with + # the regexp pattern $(HDRSCAN) and then invokes $(HDRRULE) + # with the scanned file as the target and the found headers + # as the sources. HDRSEARCH is the value of SEARCH used for + # the found header files. Finally, if jam must deal with + # header files of the same name in different directories, + # they can be distinguished with HDRGRIST. + + # $(SEARCH_SOURCE:E) is where cc first looks for #include + # "foo.h" files. If the source file is in a distant directory, + # look there. Else, look in "" (the current directory). + + HDRRULE on $(>) = HdrRule ; + HDRSCAN on $(>) = $(HDRPATTERN) ; + HDRSEARCH on $(>) = + $(SEARCH_SOURCE:E) $(SUBDIRHDRS) $(HDRS) $(SYSHDRS) $(STDHDRS) ; + + HDRGRIST on $(>) = $(HDRGRIST) ; + + # propagate target specific-defines + + DEFINES on $(<) += $(DEFINES) ; + + # if source is not .c, generate .c with specific rule + + switch $(>:S) + { + case .asm : As $(<) : $(>) ; + case .c : Cc $(<) : $(>) ; + case .C : C++ $(<) : $(>) ; + case .cc : C++ $(<) : $(>) ; + case .cpp : C++ $(<) : $(>) ; + case .f : Fortran $(<) : $(>) ; + case .l : C++ $(<) : $(<:S=.cpp) ; + LexC++ $(<:S=.cpp) : $(>) ; + case .s : As $(<) : $(>) ; + case .y : C++ $(<) : $(<:S=.cpp) ; + Bison $(<:S=.cpp) : $(>) ; + case * : UserObject $(<) : $(>) ; + } +} + +rule ObjectHdrs +{ + local s ; + for s in [ FGristFiles $(<:S=$(SUFOBJ)) ] { + HDRS on $(s) += $(>) ; + CCHDRS on $(s) = [ on $(s) FIncludes $(HDRS) ] + $(HDRS_INCLUDES_SEPARATOR) [ on $(s) FSysIncludes $(SYSHDRS) ] ; + } +} + +# Override Jam 2.5rc3 MakeLocate and MkDir to deal more intelligently +# with grist set on the supplied directory name. +rule MakeLocate +{ + if $(2[1]) + { + local dir = $(2[1]) ; + if ! $(dir:G) { + dir = $(dir:G=dir) ; + } + LOCATE on $(1) = $(dir:G=) ; + Depends $(1) : $(dir) ; + MkDir $(dir) ; + } +} + +rule MkDir +{ + # If dir exists, don't update it + # Do this even for $(DOT). + + local dir = $(<) ; + if ! $(dir:G) { + dir = $(dir:G=dir) ; + } + + NoUpdate $(dir) ; + + if $(dir:G=) != $(DOT) && ! $($(dir:G=)-mkdir) { + local s ; + + # Cheesy gate to prevent multiple invocations on same dir + # MkDir1 has the actions + # Arrange for jam dirs + + $(dir:G=)-mkdir = true ; + MkDir1 $(dir) ; + Depends dirs : $(dir) ; + + # Recursively make parent directories. + # $(dir:P) = $(dir)'s parent, & we recurse until root + + s = $(dir:P) ; # parent keeps grist + + if $(s:G=) && $(s) != $(dir) { + Depends $(dir) : $(s) ; + MkDir $(s) ; + } else if $(s) { + NotFile $(s) ; + } + } +} + +# Add SUBDIRSYSHDRS to the variables that shall be reset automatically by the +# SubDir rule. +SUBDIRRESET += SYSHDRS ; diff --git a/library/build/UserBuildConfig b/library/build/UserBuildConfig new file mode 100644 index 0000000..f2165f0 --- /dev/null +++ b/library/build/UserBuildConfig @@ -0,0 +1,63 @@ +# UserBuildConfig +# +# Sample of a UserBuildConfig file. It is a central place where the user can +# set variables affecting certain aspects of the build, such as debug, +# warnings and optimization settings. The file is ignored by CVS. +# +# The following variables can be set: +# +# CCFLAGS, C++FLAGS - Flags passed to the C/C++ compiler. +# DEBUG - If not empty, will turn on debugging, i.e. will +# add respective C/C++ compiler and linker flags and +# the CPP DEBUG macro. +# DEFINES - CPP macros to be defined, e.g. something like +# `SPECIAL_FEATURE' or `CACHE_SIZE=1024'. +# HDRS - List of directories to be added to the local include +# search paths. +# LINKFLAGS - Flags passed to the linker. +# LOCATE_MAIN_TARGET - Directory where the main targets (i.e. applications, +# libraries shall be placed). Should usually not be +# tampered with by the user. +# OPTIM - Optimization specific flags passed to the C/C++ +# compiler. Usually you want to use OPTIMIZE instead. +# OPTIMIZE - If not set to `0', will turn on optimization, i.e. +# will set the respective C/C++ compiler flags +# (i.e. the OPTIM variable). +# STRIP_APPS - if not set to '0', will cause all generated apps to +# be stripped. Default is '0', i.e. no stripping +# SYSHDRS - List of directories to be added to the system include +# search paths. +# WARNINGS - If not set to `0', will turn on warnings, i.e. will +# set the respective C/C++ compiler flags. + +# Examples: + +OPTIMIZE = 0 ; + +# Globally turn off debugging: +# +# DEBUG = 0 ; + +# Globally activate debugging: +# +# DEBUG = 1 ; + +# ... e.g. like this, for the `add-ons/catalogs' directory and all its +# subdirectories. +# +# SetConfigVar WARNINGS : TOP add-ons catalogs : 1 ; + +# Turn on debugging for the the directory `Languages' and all its subdirectories. +# +# SetConfigVar DEBUG : TOP Languages : 1 ; + +# Turn off optimization for the `rez' directory and all its subdirectories. +# +# SetConfigVar OPTIMIZE : TOP rez : 0 ; + +# Define the CPP macro INSANE_DEBUGGING_LEVEL to the value `100' in the +# `lpe' directory, but NOT in its subdirectories (note the use of the +# optional fourth parameter `local', which works for both SetConfigVar and +# AppendToConfigVar). +# +# AppendToConfigVar DEFINES : TOP lpe : INSANE_DEBUGGING_LEVEL=100 : local ; diff --git a/library/build/UserBuildConfig.sample b/library/build/UserBuildConfig.sample new file mode 100644 index 0000000..67cf7c7 --- /dev/null +++ b/library/build/UserBuildConfig.sample @@ -0,0 +1,61 @@ +# UserBuildConfig +# +# Sample of a UserBuildConfig file. It is a central place where the user can +# set variables affecting certain aspects of the build, such as debug, +# warnings and optimization settings. The file is ignored by CVS. +# +# The following variables can be set: +# +# CCFLAGS, C++FLAGS - Flags passed to the C/C++ compiler. +# DEBUG - If not empty, will turn on debugging, i.e. will +# add respective C/C++ compiler and linker flags and +# the CPP DEBUG macro. +# DEFINES - CPP macros to be defined, e.g. something like +# `SPECIAL_FEATURE' or `CACHE_SIZE=1024'. +# HDRS - List of directories to be added to the local include +# search paths. +# LINKFLAGS - Flags passed to the linker. +# LOCATE_MAIN_TARGET - Directory where the main targets (i.e. applications, +# libraries shall be placed). Should usually not be +# tampered with by the user. +# OPTIM - Optimization specific flags passed to the C/C++ +# compiler. Usually you want to use OPTIMIZE instead. +# OPTIMIZE - If not set to `0', will turn on optimization, i.e. +# will set the respective C/C++ compiler flags +# (i.e. the OPTIM variable). +# STRIP_APPS - if not set to '0', will cause all generated apps to +# be stripped. Default is '0', i.e. no stripping +# SYSHDRS - List of directories to be added to the system include +# search paths. +# WARNINGS - If not set to `0', will turn on warnings, i.e. will +# set the respective C/C++ compiler flags. + +# Examples: + +# Globally turn off debugging: +# +# DEBUG = 0 ; + +# Globally activate debugging: +# +# DEBUG = 1 ; + +# ... e.g. like this, for the `add-ons/catalogs' directory and all its +# subdirectories. +# +# SetConfigVar WARNINGS : TOP add-ons catalogs : 1 ; + +# Turn on debugging for the the directory `Languages' and all its subdirectories. +# +# SetConfigVar DEBUG : TOP Languages : 1 ; + +# Turn off optimization for the `rez' directory and all its subdirectories. +# +# SetConfigVar OPTIMIZE : TOP rez : 0 ; + +# Define the CPP macro INSANE_DEBUGGING_LEVEL to the value `100' in the +# `lpe' directory, but NOT in its subdirectories (note the use of the +# optional fourth parameter `local', which works for both SetConfigVar and +# AppendToConfigVar). +# +# AppendToConfigVar DEFINES : TOP lpe : INSANE_DEBUGGING_LEVEL=100 : local ; diff --git a/library/libclv/ColorTools.cpp b/library/libclv/ColorTools.cpp new file mode 100644 index 0000000..4865d3b --- /dev/null +++ b/library/libclv/ColorTools.cpp @@ -0,0 +1,76 @@ +/******************************************************************************* +/ +/ File: ColorTools.cpp +/ +/ Description: Additional experimental color manipulation functions. +/ +/ Copyright 2000, Be Incorporated, All Rights Reserved +/ +*******************************************************************************/ + +#include "ColorTools.h" + +#if B_BEOS_VERSION <= B_BEOS_VERSION_MAUI + +namespace BExperimental { + +#if DEBUG +#define DB_INLINE +#else +#define DB_INLINE inline +#endif + +static DB_INLINE void mix_color_func(rgb_color* target, const rgb_color other, uint8 amount) +{ + target->red = (uint8)( ((int16(other.red)-int16(target->red))*amount)/255 + + target->red ); + target->green = (uint8)( ((int16(other.green)-int16(target->green))*amount)/255 + + target->green ); + target->blue = (uint8)( ((int16(other.blue)-int16(target->blue))*amount)/255 + + target->blue ); + target->alpha = (uint8)( ((int16(other.alpha)-int16(target->alpha))*amount)/255 + + target->alpha ); +} + +static DB_INLINE void blend_color_func(rgb_color* target, const rgb_color other, uint8 amount) +{ + const uint8 alphaMix = (uint8)( ((int16(other.alpha)-int16(255-target->alpha))*amount)/255 + + (255-target->alpha) ); + target->red = (uint8)( ((int16(other.red)-int16(target->red))*alphaMix)/255 + + target->red ); + target->green = (uint8)( ((int16(other.green)-int16(target->green))*alphaMix)/255 + + target->green ); + target->blue = (uint8)( ((int16(other.blue)-int16(target->blue))*alphaMix)/255 + + target->blue ); + target->alpha = (uint8)( ((int16(other.alpha)-int16(target->alpha))*amount)/255 + + target->alpha ); +} + +static DB_INLINE void disable_color_func(rgb_color* target, const rgb_color background) +{ + blend_color_func(target, background, 255-70); +} + +// -------------------------------------------------------------------------- + +rgb_color mix_color(rgb_color color1, rgb_color color2, uint8 amount) +{ + mix_color_func(&color1, color2, amount); + return color1; +} + +rgb_color blend_color(rgb_color color1, rgb_color color2, uint8 amount) +{ + blend_color_func(&color1, color2, amount); + return color1; +} + +rgb_color disable_color(rgb_color color, rgb_color background) +{ + disable_color_func(&color, background); + return color; +} + +} + +#endif diff --git a/library/libclv/ColumnListView.cpp b/library/libclv/ColumnListView.cpp new file mode 100644 index 0000000..05bc07b --- /dev/null +++ b/library/libclv/ColumnListView.cpp @@ -0,0 +1,4128 @@ +/******************************************************************************* +/ +/ File: ColumnListView.cpp +/ +/ Description: Experimental multi-column list view. +/ +/ Copyright 2000+, Be Incorporated, All Rights Reserved +/ By Jeff Bush +/ +*******************************************************************************/ + +#include + +#include +#include + +#include +#include +#if _INCLUDES_CLASS_CURSOR +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ObjectList.h" +#include "ColumnListView.h" +#include "ColorTools.h" +/* +#ifndef _ARCHIVE_DEFS_H +#include +#endif +*/ +#define DOUBLE_BUFFERED_COLUMN_RESIZE 1 +#define SMART_REDRAW 0 +#define DRAG_TITLE_OUTLINE 1 +#define CONSTRAIN_CLIPPING_REGION 1 +#define LOWER_SCROLLBAR 1 + +namespace BPrivate { + +static const unsigned char kResizeCursorData[] = { + 16, 1, 8, 8, + 0, 0, 1, 0x80, 1, 0x80, 1, 0x80, 9, 0x90, 0x19, 0x98, 0x39, 0x09c, 0x79, 0x9e, + 0x79, 0x9e, 0x39, 0x9c, 0x19, 0x98, 0x9, 0x90, 1, 0x80, 1, 0x80, 1, 0x80, 0, 0, + 3, 0xc0, 3, 0xc0, 3, 0xc0, 0xf, 0xf0, 0x1f, 0xf8, 0x3f, 0xfa, 0x7f, 0xfe, 0xff, 0xff, + 0xff, 0xff, 0x7f, 0xfe, 0x3f, 0xfa, 0x1f, 0xf8, 0xf, 0xf0, 3, 0xc0, 3, 0xc0, 3, 0xc0 +}; + +static const unsigned char kMaxResizeCursorData[] = { + 16, 1, 8, 8, + 0, 0, 1, 0x80, 1, 0x80, 1, 0x80, 9, 0x80, 0x19, 0x80, 0x39, 0x80, 0x79, 0x80, + 0x79, 0x80, 0x39, 0x80, 0x19, 0x80, 0x9, 0x80, 1, 0x80, 1, 0x80, 1, 0x80, 0, 0, + 3, 0xc0, 3, 0xc0, 3, 0xc0, 0xf, 0xc0, 0x1f, 0xc0, 0x3f, 0xc0, 0x7f, 0xc0, 0xff, 0xc0, + 0xff, 0xc0, 0x7f, 0xc0, 0x3f, 0xc0, 0x1f, 0xc0, 0xf, 0xc0, 3, 0xc0, 3, 0xc0, 3, 0xc0 +}; + +static const unsigned char kMinResizeCursorData[] = { + 16, 1, 8, 8, + 0, 0, 1, 0x80, 1, 0x80, 1, 0x80, 1, 0x90, 1, 0x98, 1, 0x09c, 1, 0x9e, + 1, 0x9e, 1, 0x9c, 1, 0x98, 1, 0x90, 1, 0x80, 1, 0x80, 1, 0x80, 0, 0, + 3, 0xc0, 3, 0xc0, 3, 0xc0, 3, 0xf0, 3, 0xf8, 3, 0xfa, 3, 0xfe, 3, 0xff, + 3, 0xff, 3, 0xfe, 3, 0xfa, 3, 0xf8, 3, 0xf0, 3, 0xc0, 3, 0xc0, 3, 0xc0 +}; + +static const unsigned char kColumnMoveCursorData[] = { + 16, 1, 8, 8, + 1, 0x80, 3, 0xc0, 7, 0xe0, 0, 0, 0, 0, 0x20, 4, 0x61, 0x86, 0xe3, 0xc7, + 0xe3, 0xc7, 0x61, 0x86, 0x20, 4, 0, 0, 0, 0, 7, 0xe0, 3, 0xc0, 1, 0x80, + 1, 0x80, 3, 0xc0, 7, 0xe0, 0, 0, 0, 0, 0x20, 4, 0x61, 0x86, 0xe3, 0xc7, + 0xe3, 0xc7, 0x61, 0x86, 0x20, 4, 0, 0, 0, 0, 7, 0xe0, 3, 0xc0, 1, 0x80 +}; + +static const unsigned char kUpSortArrow8x8[] = { + 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff +}; + +static const unsigned char kDownSortArrow8x8[] = { + 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff +}; + +static const unsigned char kUpSortArrow8x8Invert[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x1f, 0x1f, 0x1f, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0xff +}; + +static const unsigned char kDownSortArrow8x8Invert[] = { + 0xff, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x1f, 0x1f, 0x1f, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff +}; + +/* +static const rgb_color kTitleColor = {215, 215, 215, 255}; +static const rgb_color kTitleTextColor = { 0, 0, 0, 255 }; +static const rgb_color kDefaultBackgroundColor = {236, 236, 236, 255}; +static const rgb_color kRowDividerColor = {148, 148, 148, 255}; +static const rgb_color kDefaultSelectionColor = {255, 255, 255, 255}; +static const rgb_color kDefaultEditColor = {180, 180, 180, 180}; +static const rgb_color kNonFocusSelectionColor = {220, 220, 220, 255}; +*/ + +static const float kTitleHeight = 17.0; +static const float kLatchWidth = 15.0; + + +static const rgb_color kColor[B_COLOR_TOTAL] = +{ + {236, 236, 236, 255}, // B_COLOR_BACKGROUND + { 0, 0, 0, 255}, // B_COLOR_TEXT + {148, 148, 148, 255}, // B_COLOR_ROW_DIVIDER + {255, 255, 255, 255}, // B_COLOR_SELECTION + { 0, 0, 0, 255}, // B_COLOR_SELECTION_TEXT + {220, 220, 220, 255}, // B_COLOR_NON_FOCUS_SELECTION + {180, 180, 180, 180}, // B_COLOR_EDIT_BACKGROUND + { 0, 0, 0, 255}, // B_COLOR_EDIT_TEXT + {215, 215, 215, 255}, // B_COLOR_HEADER_BACKGROUND + { 0, 0, 0, 255}, // B_COLOR_HEADER_TEXT + { 0, 0, 0, 255}, // B_COLOR_SEPARATOR_LINE + { 0, 0, 0, 255}, // B_COLOR_SEPARATOR_BORDER +}; + +static const int32 kMaxDepth = 1024; +static const float kLeftMargin = kLatchWidth; +static const float kRightMargin = kLatchWidth; +static const float kBottomMargin = kLatchWidth; +static const float kOutlineLevelIndent = kLatchWidth; +static const float kColumnResizeAreaWidth = 10.0; +static const float kRowDragSensitivity = 5.0; +static const float kDoubleClickMoveSensitivity = 4.0; +static const float kSortIndicatorWidth = 9.0; +static const float kDropHighlightLineHeight = 2.0; + +static const uint32 kToggleColumn = 'BTCL'; + +class BRowContainer : public BObjectList +{ +}; + +class TitleView : public BView { +public: + TitleView(BRect, OutlineView*, BList *visibleColumns, BList *sortColumns, + BColumnListView *masterView); + ~TitleView(); + void ColumnAdded(BColumn*); + void SetColumnVisible(BColumn*, bool); + + virtual void Draw(BRect rect); + virtual void ScrollTo(BPoint); + virtual void MessageReceived(BMessage*); + virtual void MouseDown(BPoint); + virtual void MouseMoved(BPoint, uint32, const BMessage*); + virtual void MouseUp(BPoint position); + virtual void FrameResized(float width, float height); + + void MoveColumn(BColumn *column, int32 index); + void SetColumnFlags(column_flags flags); + + void SetEditMode(bool state) { fEditMode = state; } + + +private: + void GetTitleRect(BColumn*, BRect *out_rect); + int32 FindColumn(BPoint, float *out_leftEdge); + void FixScrollBar(bool scrollToFit); + void DragSelectedColumn(BPoint); + void ResizeSelectedColumn(BPoint); + void ComputeDragBoundries(BColumn*, BPoint); + void DrawTitle(BView*, BRect, BColumn*, bool depressed); + + OutlineView *fOutlineView; + BList *fColumns; + BList *fSortColumns; + float fColumnsWidth; + BRect fVisibleRect; + +#if DOUBLE_BUFFERED_COLUMN_RESIZE + BBitmap *fDrawBuffer; + BView *fDrawBufferView; +#endif + + enum { + INACTIVE, + RESIZING_COLUMN, + PRESSING_COLUMN, + DRAG_COLUMN_INSIDE_TITLE, + DRAG_COLUMN_OUTSIDE_TITLE + } fCurrentState; + + BPopUpMenu *fColumnPop; + BColumnListView *fMasterView; + bool fEditMode; + int32 fColumnFlags; + + // State information for resizing/dragging + BColumn *fSelectedColumn; + BRect fSelectedColumnRect; + bool fResizingFirstColumn; + BPoint fClickPoint; // offset within cell + float fLeftDragBoundry; + float fRightDragBoundry; + BPoint fCurrentDragPosition; + + + BBitmap *fUpSortArrow; + BBitmap *fDownSortArrow; +#if _INCLUDES_CLASS_CURSOR + BCursor *fResizeCursor; + BCursor *fMinResizeCursor; + BCursor *fMaxResizeCursor; + BCursor *fColumnMoveCursor; +#endif + + + typedef BView _inherited; +}; + +class OutlineView : public BView { +public: + OutlineView(BRect, BList *visibleColumns, BList *sortColumns, BColumnListView *listView); + ~OutlineView(); + + virtual void Draw(BRect); + const BRect& VisibleRect() const; + + void RedrawColumn(BColumn *column, float leftEdge, bool isFirstColumn); + void StartSorting(); + + void AddRow(BRow*, int32 index, BRow *TheRow); + BRow* CurrentSelection(BRow *lastSelected) const; + void ToggleFocusRowSelection(bool selectRange); + void ToggleFocusRowOpen(); + void ChangeFocusRow(bool up, bool updateSelection, bool addToCurrentSelection); + void MoveFocusToVisibleRect(); + void ExpandOrCollapse(BRow *parent, bool expand); + void RemoveRow(BRow*); + BRowContainer* RowList(); + void UpdateRow(BRow*); + bool FindParent(BRow *row, BRow **out_parent, bool *out_isVisible); + int32 IndexOf(BRow *row); + void Deselect(BRow*); + void AddToSelection(BRow*); + void DeselectAll(); + BRow* FocusRow() const; + void SetFocusRow(BRow *row, bool select); + BRow* FindRow(float ypos, int32 *out_indent, float *out_top); + bool FindRect(const BRow *row, BRect *out_rect); + void ScrollTo(const BRow* Row); + + void Clear(); + void SetSelectionMode(list_view_type); + list_view_type SelectionMode() const; + void SetMouseTrackingEnabled(bool); + void FixScrollBar(bool scrollToFit); + void SetEditMode(bool state) { fEditMode = state; } + + virtual void FrameResized(float width, float height); + virtual void ScrollTo(BPoint pt); + virtual void MouseDown(BPoint); + virtual void MouseMoved(BPoint, uint32, const BMessage*); + virtual void MouseUp(BPoint); + virtual void MessageReceived(BMessage*); + +private: + bool SortList(BRowContainer *list, bool isVisible); + static int32 DeepSortThreadEntry(void *outlineView); + void DeepSort(); + void SelectRange(BRow *start, BRow *end); + int32 CompareRows(BRow *row1, BRow *row2); + void AddSorted(BRowContainer *list, BRow *row); + void RecursiveDeleteRows(BRowContainer *list, bool owner); + void InvalidateCachedPositions(); + bool FindVisibleRect(BRow *row, BRect *out_rect); + + BList* fColumns; + BList* fSortColumns; + float fItemsHeight; + BRowContainer fRows; + BRect fVisibleRect; + +#if DOUBLE_BUFFERED_COLUMN_RESIZE + BBitmap* fDrawBuffer; + BView* fDrawBufferView; +#endif + + BRow* fFocusRow; + BRect fFocusRowRect; + BRow* fRollOverRow; + + BRow fSelectionListDummyHead; + BRow* fLastSelectedItem; + BRow* fFirstSelectedItem; + + thread_id fSortThread; + int32 fNumSorted; + bool fSortCancelled; + + enum CurrentState + { + INACTIVE, + LATCH_CLICKED, + ROW_CLICKED, + DRAGGING_ROWS + }; + + CurrentState fCurrentState; + + + BColumnListView* fMasterView; + list_view_type fSelectionMode; + bool fTrackMouse; + BField* fCurrentField; + BRow* fCurrentRow; + BColumn* fCurrentColumn; + bool fMouseDown; + BRect fFieldRect; + int32 fCurrentCode; + bool fEditMode; + + // State information for mouse/keyboard interaction + BPoint fClickPoint; + bool fDragging; + int32 fClickCount; + BRow *fTargetRow; + float fTargetRowTop; + BRect fLatchRect; + float fDropHighlightY; + + friend class RecursiveOutlineIterator; + typedef BView _inherited; +}; + +class RecursiveOutlineIterator { +public: + RecursiveOutlineIterator(BRowContainer*, bool openBranchesOnly = true); + BRow *CurrentRow() const; + int32 CurrentLevel() const; + void GoToNext(); + +private: + struct { + BRowContainer *fRowSet; + int32 fIndex; + int32 fDepth; + } fStack[kMaxDepth]; + + int32 fStackIndex; + BRowContainer *fCurrentList; + int32 fCurrentListIndex; + int32 fCurrentListDepth; + bool fOpenBranchesOnly; +}; + +} // namespace BPrivate + +using namespace BPrivate; + +BField::BField() +{ +} + +BField::~BField() +{ +} + +// #pragma mark - + +void BColumn::MouseMoved(BColumnListView */*parent*/, BRow */*row*/, BField */*field*/, + BRect /*field_rect*/, BPoint/*point*/, uint32 /*buttons*/, int32 /*code*/) +{ +} + +void BColumn::MouseDown( BColumnListView */*parent*/, BRow */*row*/, BField */*field*/, + BRect /*field_rect*/, BPoint /*point*/, uint32 /*buttons*/) +{ +} + +void BColumn::MouseUp(BColumnListView */*parent*/, BRow */*row*/, BField */*field*/) +{ +} + +// #pragma mark - + +BRow::BRow(float height) + : fChildList(NULL), + fIsExpanded(false), + fHeight(height), + fNextSelected(NULL), + fPrevSelected(NULL), + fParent(NULL), + fList(NULL) +{ +} + +BRow::~BRow() +{ + while (true) { + BField *field = (BField*) fFields.RemoveItem(0L); + if (field == 0) + break; + + delete field; + } +} + +bool BRow::HasLatch() const +{ + return fChildList != 0; +} + +int32 BRow::CountFields() const +{ + return fFields.CountItems(); +} + +BField* BRow::GetField(int32 index) +{ + return (BField*) fFields.ItemAt(index); +} + +const BField* BRow::GetField(int32 index) const +{ + return (const BField*) fFields.ItemAt(index); +} + +void BRow::SetField(BField *field, int32 logicalFieldIndex) +{ + if (fFields.ItemAt(logicalFieldIndex) != 0) + delete (BField*) fFields.RemoveItem(logicalFieldIndex); + + if( NULL != fList ) { + ValidateField(field, logicalFieldIndex); + BRect inv; + fList->GetRowRect(this, &inv); + fList->Invalidate(inv); + } + + fFields.AddItem(field, logicalFieldIndex); +} + +float BRow::Height() const +{ + return fHeight; +} + +bool BRow::IsExpanded() const +{ + return fIsExpanded; +} + +void +BRow::ValidateFields() const +{ + for( int32 i = 0; i < CountFields(); i++ ) + { + ValidateField(GetField(i), i); + } +} + +void +BRow::ValidateField(const BField *field, int32 logicalFieldIndex) const +{ + // The Fields may be moved by the user, but the logicalFieldIndexes + // do not change, so we need to map them over when checking the + // Field types. + BColumn* col = NULL; + int32 items = fList->CountColumns(); + for( int32 i = 0 ; i < items; ++i ) + { + col = fList->ColumnAt(i); + if( col->LogicalFieldNum() == logicalFieldIndex ) + break; + } + + if( NULL == col ) + { + BString dbmessage("\n\n\tThe parent BColumnListView does not have " + "\n\ta BColumn at the logical field index "); + dbmessage << logicalFieldIndex << ".\n\n"; + printf(dbmessage.String()); + } + else + { + if( false == col->AcceptsField(field) ) + { + BString dbmessage("\n\n\tThe BColumn of type "); + dbmessage << typeid(*col).name() << "\n\tat logical field index " + << logicalFieldIndex << "\n\tdoes not support the field type " + << typeid(*field).name() << ".\n\n"; + debugger(dbmessage.String()); + } + } +} + + +// #pragma mark - + +BColumn::BColumn(float width, float minWidth, float maxWidth, alignment align) + : fWidth(width), + fMinWidth(minWidth), + fMaxWidth(maxWidth), + fVisible(true), + fList(0), + fShowHeading(true), + fAlignment(align) +{ +} + +BColumn::~BColumn() +{ +} + +float BColumn::Width() const +{ + return fWidth; +} + +void BColumn::SetWidth(float width) +{ + fWidth = width; +} + +float BColumn::MinWidth() const +{ + return fMinWidth; +} + +float BColumn::MaxWidth() const +{ + return fMaxWidth; +} + +void BColumn::DrawTitle(BRect, BView*) +{ +} + +void BColumn::DrawField(BField*, BRect, BView*) +{ +} + +int BColumn::CompareFields(BField *, BField *) +{ + return 0; +} + +void BColumn::GetColumnName(BString* into) const +{ + *into = "(Unnamed)"; +} + +bool BColumn::IsVisible() const +{ + return fVisible; +} + +void BColumn::SetVisible(bool visible) +{ + if (fList && (fVisible != visible)) + fList->SetColumnVisible(this, visible); +} + +bool BColumn::ShowHeading() const +{ + return fShowHeading; +} + +void BColumn::SetShowHeading(bool state) +{ + fShowHeading = state; +} + +alignment BColumn::Alignment() const +{ + return fAlignment; +} + +void BColumn::SetAlignment(alignment align) +{ + fAlignment = align; +} + +bool BColumn::WantsEvents() const +{ + return fWantsEvents; +} + +void BColumn::SetWantsEvents(bool state) +{ + fWantsEvents = state; +} + +int32 BColumn::LogicalFieldNum() const +{ + return fFieldID; +} + +bool +BColumn::AcceptsField(const BField*) const +{ + return true; +} + + +// #pragma mark - + +BColumnListView::BColumnListView(BRect rect, const char *name, uint32 resizingMode, + uint32 drawFlags, border_style border, bool showHorizontalScrollbar) + : BView(rect, name, resizingMode, drawFlags | B_WILL_DRAW | B_FRAME_EVENTS | B_FULL_UPDATE_ON_RESIZE), + fStatusView(0), + fSelectionMessage(0), + fSortingEnabled(true), + fLatchWidth(kLatchWidth), + fBorderStyle(border) +{ + SetViewColor(B_TRANSPARENT_32_BIT); + + BRect bounds(rect); + bounds.OffsetTo(0, 0); + + for (int i = 0; i < (int)B_COLOR_TOTAL; i++) + fColorList[i] = kColor[i]; + + BRect titleRect(bounds); + titleRect.bottom = titleRect.top + kTitleHeight; +#if !LOWER_SCROLLBAR + titleRect.right -= B_V_SCROLL_BAR_WIDTH + 1; +#endif + + BRect outlineRect(bounds); + outlineRect.top = titleRect.bottom + 1.0; + outlineRect.right -= B_V_SCROLL_BAR_WIDTH + 1; + if(showHorizontalScrollbar) + outlineRect.bottom -= B_H_SCROLL_BAR_HEIGHT + 1; + + BRect vScrollBarRect(bounds); +#if LOWER_SCROLLBAR + vScrollBarRect.top += kTitleHeight; +#endif + + vScrollBarRect.left = vScrollBarRect.right - B_V_SCROLL_BAR_WIDTH; + if(showHorizontalScrollbar) + vScrollBarRect.bottom -= B_H_SCROLL_BAR_HEIGHT; + + BRect hScrollBarRect(bounds); + hScrollBarRect.top = hScrollBarRect.bottom - B_H_SCROLL_BAR_HEIGHT; + hScrollBarRect.right -= B_V_SCROLL_BAR_WIDTH; + + // Adjust stuff so the border will fit. + if (fBorderStyle == B_PLAIN_BORDER) { + titleRect.InsetBy(1, 0); + titleRect.top++; + outlineRect.InsetBy(1, 0); + outlineRect.bottom--; + + vScrollBarRect.OffsetBy(-1, 0); + vScrollBarRect.InsetBy(0, 1); + hScrollBarRect.OffsetBy(0, -1); + hScrollBarRect.InsetBy(1, 0); + } else if (fBorderStyle == B_FANCY_BORDER) { + titleRect.InsetBy(2, 0); + titleRect.top += 2; + outlineRect.InsetBy(2, 0); + outlineRect.bottom -= 2; + + vScrollBarRect.OffsetBy(-2, 0); + vScrollBarRect.InsetBy(0, 2); + hScrollBarRect.OffsetBy(0, -2); + hScrollBarRect.InsetBy(2, 0); + } + + fOutlineView = new OutlineView(outlineRect, &fColumns, &fSortColumns, this); + AddChild(fOutlineView); + fTitleView = new TitleView(titleRect, fOutlineView, &fColumns, &fSortColumns, this); + + AddChild(fTitleView); + fVerticalScrollBar = new BScrollBar(vScrollBarRect, "vertical_scroll_bar", + fOutlineView, 0.0, bounds.Height(), B_VERTICAL); + AddChild(fVerticalScrollBar); + fHorizontalScrollBar = new BScrollBar(hScrollBarRect, "horizontal_scroll_bar", + fTitleView, 0.0, bounds.Width(), B_HORIZONTAL); + AddChild(fHorizontalScrollBar); + if(!showHorizontalScrollbar) + fHorizontalScrollBar->Hide(); + fOutlineView->FixScrollBar(true); +} + +BColumnListView::~BColumnListView() +{ + while (true) { + BColumn *column = (BColumn*) fColumns.RemoveItem(0L); + if (column == 0) + break; + + delete column; + } +} + +bool BColumnListView::InitiateDrag(BPoint, bool) +{ + return false; +} + +void BColumnListView::MessageDropped(BMessage*, BPoint) +{ +} + +void BColumnListView::ExpandOrCollapse(BRow* Row, bool Open) +{ + fOutlineView->ExpandOrCollapse(Row, Open); +} + +status_t BColumnListView::Invoke(BMessage *message) +{ + if (message == 0) + message = Message(); + + return BInvoker::Invoke(message); +} + +void BColumnListView::ItemInvoked() +{ + Invoke(); +} + +void BColumnListView::SetInvocationMessage(BMessage *message) +{ + SetMessage(message); +} + +BMessage* BColumnListView::InvocationMessage() const +{ + return Message(); +} + +uint32 BColumnListView::InvocationCommand() const +{ + return Command(); +} + +BRow* BColumnListView::FocusRow() const +{ + return fOutlineView->FocusRow(); +} + +void BColumnListView::SetFocusRow(int32 Index, bool Select) +{ + SetFocusRow(RowAt(Index), Select); +} + +void BColumnListView::SetFocusRow(BRow* Row, bool Select) +{ + fOutlineView->SetFocusRow(Row, Select); +} + +void BColumnListView::SetMouseTrackingEnabled(bool Enabled) +{ + fOutlineView->SetMouseTrackingEnabled(Enabled); +} + +list_view_type BColumnListView::SelectionMode() const +{ + return fOutlineView->SelectionMode(); +} + +void BColumnListView::Deselect(BRow *row) +{ + fOutlineView->Deselect(row); +} + +void BColumnListView::AddToSelection(BRow *row) +{ + fOutlineView->AddToSelection(row); +} + +void BColumnListView::DeselectAll() +{ + fOutlineView->DeselectAll(); +} + +BRow* BColumnListView::CurrentSelection(BRow *lastSelected) const +{ + return fOutlineView->CurrentSelection(lastSelected); +} + +void BColumnListView::SelectionChanged() +{ + if (fSelectionMessage) + Invoke(fSelectionMessage); +} + +void BColumnListView::SetSelectionMessage(BMessage *message) +{ + if (fSelectionMessage == message) + return; + + delete fSelectionMessage; + fSelectionMessage = message; +} + +BMessage* BColumnListView::SelectionMessage() +{ + return fSelectionMessage; +} + +uint32 BColumnListView::SelectionCommand() const +{ + if (fSelectionMessage) + return fSelectionMessage->what; + + return 0; +} + +void BColumnListView::SetSelectionMode(list_view_type mode) +{ + fOutlineView->SetSelectionMode(mode); +} + +void BColumnListView::SetSortingEnabled(bool enabled) +{ + fSortingEnabled = enabled; + fSortColumns.MakeEmpty(); + fTitleView->Invalidate(); // Erase sort indicators +} + +bool BColumnListView::SortingEnabled() const +{ + return fSortingEnabled; +} + +void BColumnListView::SetSortColumn(BColumn *column, bool add, bool ascending) +{ + if (!SortingEnabled()) + return; + + if (!add) + fSortColumns.MakeEmpty(); + + if (!fSortColumns.HasItem(column)) + fSortColumns.AddItem(column); + + column->fSortAscending = ascending; + fTitleView->Invalidate(); + fOutlineView->StartSorting(); +} + +void BColumnListView::ClearSortColumns() +{ + fSortColumns.MakeEmpty(); + fTitleView->Invalidate(); // Erase sort indicators +} + +void BColumnListView::AddStatusView(BView *view) +{ + BRect bounds = Bounds(); + float width = view->Bounds().Width(); + if (width > bounds.Width() / 2) + width = bounds.Width() / 2; + + fStatusView = view; + + Window()->BeginViewTransaction(); + fHorizontalScrollBar->ResizeBy(-(width + 1), 0); + fHorizontalScrollBar->MoveBy((width + 1), 0); + AddChild(view); + + BRect viewRect(bounds); + viewRect.right = width; + viewRect.top = viewRect.bottom - B_H_SCROLL_BAR_HEIGHT; + if (fBorderStyle == B_PLAIN_BORDER) + viewRect.OffsetBy(1, -1); + else if (fBorderStyle == B_FANCY_BORDER) + viewRect.OffsetBy(2, -2); + + view->SetResizingMode(B_FOLLOW_LEFT | B_FOLLOW_BOTTOM); + view->ResizeTo(viewRect.Width(), viewRect.Height()); + view->MoveTo(viewRect.left, viewRect.top); + Window()->EndViewTransaction(); +} + +BView* BColumnListView::RemoveStatusView() +{ + if (fStatusView) { + float width = fStatusView->Bounds().Width(); + Window()->BeginViewTransaction(); + fStatusView->RemoveSelf(); + fHorizontalScrollBar->MoveBy(-width, 0); + fHorizontalScrollBar->ResizeBy(width, 0); + Window()->EndViewTransaction(); + } + + BView *view = fStatusView; + fStatusView = 0; + return view; +} +void BColumnListView::AddColumn(BColumn *column, int32 logicalFieldIndex) +{ + ASSERT(column != 0); + + column->fList = this; + column->fFieldID = logicalFieldIndex; + + // sanity check. If there is already a field with this ID, remove it. + for (int32 index = 0; index < fColumns.CountItems(); index++) { + BColumn *existingColumn = (BColumn*) fColumns.ItemAt(index); + if (existingColumn && existingColumn->fFieldID == logicalFieldIndex) { + RemoveColumn(existingColumn); + break; + } + } + + if (column->Width() < column->MinWidth()) + column->SetWidth(column->MinWidth()); + else if (column->Width() > column->MaxWidth()) + column->SetWidth(column->MaxWidth()); + + fColumns.AddItem((void*) column); + fTitleView->ColumnAdded(column); +} + +void BColumnListView::MoveColumn(BColumn *column, int32 index) +{ + ASSERT(column != 0); + fTitleView->MoveColumn(column, index); +} + +void BColumnListView::RemoveColumn(BColumn *column) +{ + if (fColumns.HasItem(column)) { + SetColumnVisible(column, false); + Window()->UpdateIfNeeded(); + fColumns.RemoveItem(column); + } +} + +int32 BColumnListView::CountColumns() const +{ + return fColumns.CountItems(); +} + +BColumn* BColumnListView::ColumnAt(int32 field) const +{ + return (BColumn*) fColumns.ItemAt(field); +} + +void BColumnListView::SetColumnVisible(BColumn *column, bool visible) +{ + fTitleView->SetColumnVisible(column, visible); +} + +void BColumnListView::SetColumnVisible(int32 index, bool isVisible) +{ + BColumn *column = ColumnAt(index); + if (column) + column->SetVisible(isVisible); +} + +bool BColumnListView::IsColumnVisible(int32 index) const +{ + BColumn *column = ColumnAt(index); + if (column) + return column->IsVisible(); + + return false; +} + +void BColumnListView::SetColumnFlags(column_flags flags) +{ + fTitleView->SetColumnFlags(flags); +} + +const BRow* BColumnListView::RowAt(int32 Index, BRow* ParentRow) const +{ + if (ParentRow == 0) + return fOutlineView->RowList()->ItemAt(Index); + + return ParentRow->fChildList ? ParentRow->fChildList->ItemAt(Index) : NULL; +} + +BRow* BColumnListView::RowAt(int32 Index, BRow* ParentRow) +{ + if (ParentRow == 0) + return fOutlineView->RowList()->ItemAt(Index); + + return ParentRow->fChildList ? ParentRow->fChildList->ItemAt(Index) : 0; +} + +const BRow* BColumnListView::RowAt(BPoint point) const +{ + float top; + int32 indent; + return fOutlineView->FindRow(point.y, &indent, &top); +} + +BRow* BColumnListView::RowAt(BPoint point) +{ + float top; + int32 indent; + return fOutlineView->FindRow(point.y, &indent, &top); +} + +bool BColumnListView::GetRowRect(const BRow *row, BRect *outRect) const +{ + return fOutlineView->FindRect(row, outRect); +} + +bool BColumnListView::FindParent(BRow *row, BRow **out_parent, bool *out_isVisible) const +{ + return fOutlineView->FindParent(row, out_parent, out_isVisible); +} + +int32 BColumnListView::IndexOf(BRow *row) +{ + return fOutlineView->IndexOf(row); +} + +int32 BColumnListView::CountRows(BRow* ParentRow) const +{ + if (ParentRow == 0) + return fOutlineView->RowList()->CountItems(); + if (ParentRow->fChildList) + return ParentRow->fChildList->CountItems(); + else + return 0; +} + +void BColumnListView::AddRow(BRow *row, BRow* ParentRow) +{ + AddRow(row, -1, ParentRow); +} + +void BColumnListView::AddRow(BRow *row, int32 index, BRow* ParentRow) +{ + row->fChildList = 0; + row->fList = this; + row->ValidateFields(); + fOutlineView->AddRow(row, index, ParentRow); +} + +void BColumnListView::RemoveRow(BRow *row) +{ + fOutlineView->RemoveRow(row); + row->fList = NULL; +} + +void BColumnListView::UpdateRow(BRow *row) +{ + fOutlineView->UpdateRow(row); +} + +void BColumnListView::ScrollTo(const BRow* Row) +{ + fOutlineView->ScrollTo(Row); +} + +void BColumnListView::Clear() +{ + fOutlineView->Clear(); +} + +void BColumnListView::SetFont(const BFont *font, uint32 mask) +{ + // This method is deprecated. + fOutlineView->SetFont(font, mask); + fTitleView->SetFont(font, mask); +} + +void BColumnListView::SetFont(ColumnListViewFont font_num, const BFont* font, uint32 mask) +{ + switch (font_num) { + case B_FONT_ROW: + fOutlineView->SetFont(font, mask); + break; + + case B_FONT_HEADER: + fTitleView->SetFont(font, mask); + break; + + default: + ASSERT(false); + break; + }; +} + +void BColumnListView::GetFont(ColumnListViewFont font_num, BFont* font) const +{ + switch (font_num) { + case B_FONT_ROW: + fOutlineView->GetFont(font); + break; + + case B_FONT_HEADER: + fTitleView->GetFont(font); + break; + + default: + ASSERT(false); + break; + }; +} + +void BColumnListView::SetColor(ColumnListViewColor color_num, const rgb_color color) +{ + if ((int)color_num < 0) + { + ASSERT(false); + color_num = (ColumnListViewColor) 0; + } + + if ((int)color_num >= (int)B_COLOR_TOTAL) + { + ASSERT(false); + color_num = (ColumnListViewColor) (B_COLOR_TOTAL - 1); + } + + fColorList[color_num] = color; +} + +rgb_color BColumnListView::Color(ColumnListViewColor color_num) const +{ + if ((int)color_num < 0) + { + ASSERT(false); + color_num = (ColumnListViewColor) 0; + } + + if ((int)color_num >= (int)B_COLOR_TOTAL) + { + ASSERT(false); + color_num = (ColumnListViewColor) (B_COLOR_TOTAL - 1); + } + + return fColorList[color_num]; +} + +void BColumnListView::SetHighColor(rgb_color color) +{ + BView::SetHighColor(color); +// fOutlineView->Invalidate(); // Redraw things with the new color + // Note that this will currently cause + // an infinite loop, refreshing over and over. + // A better solution is needed. +} + +void BColumnListView::SetSelectionColor(rgb_color color) +{ + fColorList[B_COLOR_SELECTION] = color; +} + +void BColumnListView::SetBackgroundColor(rgb_color color) +{ + fColorList[B_COLOR_BACKGROUND] = color; + fOutlineView->Invalidate(); // Repaint with new color +} + +void BColumnListView::SetEditColor(rgb_color color) +{ + fColorList[B_COLOR_EDIT_BACKGROUND] = color; +} + +const rgb_color BColumnListView::SelectionColor() const +{ + return fColorList[B_COLOR_SELECTION]; +} + +const rgb_color BColumnListView::BackgroundColor() const +{ + return fColorList[B_COLOR_BACKGROUND]; +} + +const rgb_color BColumnListView::EditColor() const +{ + return fColorList[B_COLOR_EDIT_BACKGROUND]; +} + +BPoint BColumnListView::SuggestTextPosition(const BRow* row, const BColumn* inColumn) const +{ + BRect rect; + GetRowRect(row, &rect); + if (inColumn) { + float leftEdge = MAX(kLeftMargin, LatchWidth()); + for (int index = 0; index < fColumns.CountItems(); index++) { + BColumn *column = (BColumn*) fColumns.ItemAt(index); + if (!column->IsVisible()) + continue; + + if (column == inColumn) { + rect.left = leftEdge; + rect.right = rect.left + column->Width(); + break; + } + + leftEdge += column->Width() + 1; + } + } + + font_height fh; + fOutlineView->GetFontHeight(&fh); + float baseline = floor(rect.top + fh.ascent + + (rect.Height()+1-(fh.ascent+fh.descent))/2); + return BPoint(rect.left + 8, baseline); +} + +void BColumnListView::SetLatchWidth(float width) +{ + fLatchWidth = width; + Invalidate(); +} + +float BColumnListView::LatchWidth() const +{ + return fLatchWidth; +} + +void BColumnListView::DrawLatch(BView *view, BRect rect, LatchType position, BRow *) +{ + const int32 rectInset = 4; + + view->SetHighColor(0, 0, 0); + + // Make Square + int32 sideLen = rect.IntegerWidth(); + if( sideLen > rect.IntegerHeight() ) + { + sideLen = rect.IntegerHeight(); + } + + // Make Center + int32 halfWidth = rect.IntegerWidth() / 2; + int32 halfHeight = rect.IntegerHeight() / 2; + int32 halfSide = sideLen / 2; + + float left = rect.left + halfWidth - halfSide; + float top = rect.top + halfHeight - halfSide; + + BRect itemRect(left, top, left + sideLen, top + sideLen); + + // Why it is a pixel high? I don't know. + itemRect.OffsetBy(0, -1); + + itemRect.InsetBy(rectInset, rectInset); + + // Make it an odd number of pixels wide, the latch looks better this way + if (1 == (itemRect.IntegerWidth() % 2)) + { + itemRect.right += 1; + itemRect.bottom += 1; + } + + switch (position) { + case B_OPEN_LATCH: + view->StrokeRect(itemRect); + view->StrokeLine(BPoint(itemRect.left + 2, (itemRect.top + itemRect.bottom) / 2), + BPoint(itemRect.right - 2, (itemRect.top + itemRect.bottom) / 2)); + break; + + case B_PRESSED_LATCH: + view->StrokeRect(itemRect); + view->StrokeLine(BPoint(itemRect.left + 2, (itemRect.top + itemRect.bottom) / 2), + BPoint(itemRect.right - 2, (itemRect.top + itemRect.bottom) / 2)); + view->StrokeLine(BPoint((itemRect.left + itemRect.right) / 2, itemRect.top + 2), + BPoint((itemRect.left + itemRect.right) / 2, itemRect.bottom - 2)); + view->InvertRect(itemRect); + break; + + case B_CLOSED_LATCH: + view->StrokeRect(itemRect); + view->StrokeLine(BPoint(itemRect.left + 2, (itemRect.top + itemRect.bottom) / 2), + BPoint(itemRect.right - 2, (itemRect.top + itemRect.bottom) / 2)); + view->StrokeLine(BPoint((itemRect.left + itemRect.right) / 2, itemRect.top + 2), + BPoint((itemRect.left + itemRect.right) / 2, itemRect.bottom - 2)); + break; + + case B_NO_LATCH: + // No drawing + break; + } +} + +void BColumnListView::MakeFocus(bool isFocus) +{ + Invalidate(); // Redraw focus marks around view + BView::MakeFocus(isFocus); +} + +void BColumnListView::MessageReceived(BMessage *message) +{ + // Propagate mouse wheel messages down to child, so that it can + // scroll. Note we have done so, so we don't go into infinite + // recursion if this comes back up here. + if (message->what == B_MOUSE_WHEEL_CHANGED) { + bool handled; + if (message->FindBool("be:clvhandled", &handled) != B_OK) { + message->AddBool("be:clvhandled", true); + fOutlineView->MessageReceived(message); + return; + } + } + BView::MessageReceived(message); +} + +void BColumnListView::KeyDown(const char *bytes, int32 numBytes) +{ + char c = bytes[0]; + switch (c) { + case B_RIGHT_ARROW: + case B_LEFT_ARROW: { + float minVal, maxVal; + fHorizontalScrollBar->GetRange(&minVal, &maxVal); + float smallStep, largeStep; + fHorizontalScrollBar->GetSteps(&smallStep, &largeStep); + float oldVal = fHorizontalScrollBar->Value(); + float newVal = oldVal; + + if (c == B_LEFT_ARROW) + newVal -= smallStep; + else if (c == B_RIGHT_ARROW) + newVal += smallStep; + + if (newVal < minVal) + newVal = minVal; + else if (newVal > maxVal) + newVal = maxVal; + + fHorizontalScrollBar->SetValue(newVal); + break; + } + + case B_DOWN_ARROW: + fOutlineView->ChangeFocusRow(false, (modifiers() & B_CONTROL_KEY) == 0, + (modifiers() & B_SHIFT_KEY) != 0); + break; + + case B_UP_ARROW: + fOutlineView->ChangeFocusRow(true, (modifiers() & B_CONTROL_KEY) == 0, + (modifiers() & B_SHIFT_KEY) != 0); + break; + + case B_PAGE_UP: + case B_PAGE_DOWN: { + float minValue, maxValue; + fVerticalScrollBar->GetRange(&minValue, &maxValue); + float smallStep, largeStep; + fVerticalScrollBar->GetSteps(&smallStep, &largeStep); + float currentValue = fVerticalScrollBar->Value(); + float newValue = currentValue; + + if (c == B_PAGE_UP) + newValue -= largeStep; + else + newValue += largeStep; + + if (newValue > maxValue) + newValue = maxValue; + else if (newValue < minValue) + newValue = minValue; + + fVerticalScrollBar->SetValue(newValue); + + // Option + pgup or pgdn scrolls and changes the selection. + if (modifiers() & B_OPTION_KEY) + fOutlineView->MoveFocusToVisibleRect(); + + break; + } + + case B_ENTER: + Invoke(); + break; + + case B_SPACE: + fOutlineView->ToggleFocusRowSelection((modifiers() & B_SHIFT_KEY) != 0); + break; + + case '+': + case '-': + fOutlineView->ToggleFocusRowOpen(); + break; + + default: + BView::KeyDown(bytes, numBytes); + } +} + +void BColumnListView::AttachedToWindow() +{ + if (!Messenger().IsValid()) + SetTarget(Window()); + + if (SortingEnabled()) fOutlineView->StartSorting(); +} + +void BColumnListView::WindowActivated(bool active) +{ + fOutlineView->Invalidate(); + // Focus and selection appearance changes with focus + + Invalidate(); // Redraw focus marks around view + BView::WindowActivated(active); +} + +void BColumnListView::Draw(BRect) +{ + BRect rect = Bounds(); + PushState(); + + BRect cornerRect(rect.right - B_V_SCROLL_BAR_WIDTH, rect.bottom - B_H_SCROLL_BAR_HEIGHT, + rect.right, rect.bottom); + if (fBorderStyle == B_PLAIN_BORDER) { + BView::SetHighColor(0, 0, 0); + StrokeRect(rect); + cornerRect.OffsetBy(-1, -1); + } else if (fBorderStyle == B_FANCY_BORDER) { + bool isFocus = IsFocus() && Window()->IsActive(); + + if (isFocus) + BView::SetHighColor(0, 0, 190); // Need to find focus color programatically + else + BView::SetHighColor(255, 255, 255); + + StrokeRect(rect); + if (!isFocus) + BView::SetHighColor(184, 184, 184); + else + BView::SetHighColor(152, 152, 152); + + rect.InsetBy(1,1); + StrokeRect(rect); + cornerRect.OffsetBy(-2, -2); + } + + BView::SetHighColor(215, 215, 215); // fills lower right rect between scroll bars + FillRect(cornerRect); + PopState(); +} + +void BColumnListView::SaveState(BMessage *msg) +{ + msg->MakeEmpty(); + + // Damn compiler issuing l43m incorrect warnings. + int i; + for (i = 0; ;i++) + { + BColumn *col = (BColumn*) fColumns.ItemAt(i); + if(!col) + break; + msg->AddInt32("ID",col->fFieldID); + msg->AddFloat("width",col->fWidth); + msg->AddBool("visible",col->fVisible); + } + + msg->AddBool("sortingenabled",fSortingEnabled); + + if(fSortingEnabled) + { + for (i = 0; ;i++) + { + BColumn *col = (BColumn*) fSortColumns.ItemAt(i); + if(!col) + break; + msg->AddInt32("sortID",col->fFieldID); + msg->AddBool("sortascending",col->fSortAscending); + } + } +} + +void BColumnListView::LoadState(BMessage *msg) +{ + for(int i=0;;i++) + { + int32 ID; + if(B_OK!=msg->FindInt32("ID",i,&ID)) + break; + for(int j=0;;j++) + { + BColumn *col = (BColumn*) fColumns.ItemAt(j); + if(!col) + break; + if(col->fFieldID==ID) + { + // move this column to position 'i' and set its attributes + MoveColumn(col,i); + float f; + if(B_OK==msg->FindFloat("width",i,&f)) + col->SetWidth(f); + bool b; + if(B_OK==msg->FindBool("visible",i,&b)) + col->SetVisible(b); + } + } + } + bool b; + if(B_OK==msg->FindBool("sortingenabled",&b)) + { + SetSortingEnabled(b); + // Damn compiler issuing l43m incorrect warnings. + for(int k=0;;k++) + { + int32 ID; + if(B_OK!=msg->FindInt32("sortID", k, &ID)) + break; + for(int j=0;;j++) + { + BColumn *col = (BColumn*) fColumns.ItemAt(j); + if(!col) + break; + if(col->fFieldID==ID) + { + // add this column to the sort list + bool val; + if(B_OK==msg->FindBool("sortascending", k, &val)) + SetSortColumn(col, true, val); + } + } + } + } +} + +void BColumnListView::SetEditMode(bool state) +{ + fOutlineView->SetEditMode(state); + fTitleView->SetEditMode(state); +} + +void BColumnListView::Refresh() +{ + if(LockLooper()) + { + Invalidate(); + fOutlineView->FixScrollBar (true); + fOutlineView->Invalidate(); + Window()->UpdateIfNeeded(); + UnlockLooper(); + } +} + +// #pragma mark - + + +TitleView::TitleView(BRect rect, OutlineView *horizontalSlave, BList *visibleColumns, + BList *sortColumns, BColumnListView *listView) + : BView(rect, "title_view", B_FOLLOW_LEFT_RIGHT, B_WILL_DRAW | B_FRAME_EVENTS), + fOutlineView(horizontalSlave), + fColumns(visibleColumns), + fSortColumns(sortColumns), + fColumnsWidth(0), + fVisibleRect(rect.OffsetToCopy(0, 0)), + fCurrentState(INACTIVE), + fColumnPop(NULL), + fMasterView(listView), + fEditMode(false), + fColumnFlags(B_ALLOW_COLUMN_MOVE|B_ALLOW_COLUMN_RESIZE|B_ALLOW_COLUMN_POPUP|B_ALLOW_COLUMN_REMOVE) +{ + SetViewColor(B_TRANSPARENT_32_BIT); + +#if DOUBLE_BUFFERED_COLUMN_RESIZE + // xxx this needs to be smart about the size of the backbuffer. + BRect doubleBufferRect(0, 0, 600, 35); + fDrawBuffer = new BBitmap(doubleBufferRect, B_RGB32, true); + fDrawBufferView = new BView(doubleBufferRect, "double_buffer_view", + B_FOLLOW_ALL_SIDES, 0); + fDrawBuffer->Lock(); + fDrawBuffer->AddChild(fDrawBufferView); + fDrawBuffer->Unlock(); +#endif + + fUpSortArrow = new BBitmap(BRect(0, 0, 7, 7), B_COLOR_8_BIT); + fDownSortArrow = new BBitmap(BRect(0, 0, 7, 7), B_COLOR_8_BIT); + + fUpSortArrow->SetBits((const void*) kUpSortArrow8x8, 64, 0, B_COLOR_8_BIT); + fDownSortArrow->SetBits((const void*) kDownSortArrow8x8, 64, 0, B_COLOR_8_BIT); + +#if _INCLUDES_CLASS_CURSOR + fResizeCursor = new BCursor(kResizeCursorData); + fMinResizeCursor = new BCursor(kMinResizeCursorData); + fMaxResizeCursor = new BCursor(kMaxResizeCursorData); + fColumnMoveCursor = new BCursor(kColumnMoveCursorData); +#endif + FixScrollBar(true); +} + +TitleView::~TitleView() +{ + delete fColumnPop; + fColumnPop = NULL; + + fDrawBuffer->Lock(); + fDrawBufferView->RemoveSelf(); + fDrawBuffer->Unlock(); + delete fDrawBufferView; + delete fDrawBuffer; + delete fUpSortArrow; + delete fDownSortArrow; + +#if _INCLUDES_CLASS_CURSOR + delete fResizeCursor; + delete fMaxResizeCursor; + delete fMinResizeCursor; + delete fColumnMoveCursor; +#endif +} + +void TitleView::ColumnAdded(BColumn *column) +{ + fColumnsWidth += column->Width() + 1; + FixScrollBar(false); + Invalidate(); +} +// Could use a CopyBits here. +void TitleView::SetColumnVisible(BColumn *column, bool visible) +{ + if (column->fVisible == visible) + return; + + // If setting it visible, do this first so we can find its position + // to invalidate. If hiding it, do it last. + if (visible) + column->fVisible = visible; + + BRect titleInvalid; + GetTitleRect(column, &titleInvalid); + + // Now really set the visibility + column->fVisible = visible; + + if (visible) + fColumnsWidth += column->Width(); + else + fColumnsWidth -= column->Width(); + + BRect outlineInvalid(fOutlineView->VisibleRect()); + outlineInvalid.left = titleInvalid.left; + titleInvalid.right = outlineInvalid.right; + + Invalidate(titleInvalid); + fOutlineView->Invalidate(outlineInvalid); +} + +void TitleView::GetTitleRect(BColumn *findColumn, BRect *out_rect) +{ + float leftEdge = MAX(kLeftMargin, fMasterView->LatchWidth()); + int32 numColumns = fColumns->CountItems(); + for (int index = 0; index < numColumns; index++) { + BColumn *column = (BColumn*) fColumns->ItemAt(index); + if (!column->IsVisible()) + continue; + + if (column == findColumn) { + out_rect->Set(leftEdge, 0, leftEdge + column->Width(), fVisibleRect.bottom); + return; + } + + leftEdge += column->Width() + 1; + } + + TRESPASS(); +} + +int32 TitleView::FindColumn(BPoint position, float *out_leftEdge) +{ + float leftEdge = MAX(kLeftMargin, fMasterView->LatchWidth()); + int32 numColumns = fColumns->CountItems(); + for (int index = 0; index < numColumns; index++) { + BColumn *column = (BColumn*) fColumns->ItemAt(index); + if (!column->IsVisible()) + continue; + + if (leftEdge > position.x) + break; + + if (position.x >= leftEdge && position.x <= leftEdge + column->Width()) { + *out_leftEdge = leftEdge; + return index; + } + + leftEdge += column->Width() + 1; + } + + return 0; +} + +void TitleView::FixScrollBar(bool scrollToFit) +{ + BScrollBar *hScrollBar = ScrollBar(B_HORIZONTAL); + if (hScrollBar) { + float virtualWidth = fColumnsWidth + MAX(kLeftMargin, fMasterView->LatchWidth()) + + kRightMargin * 2; + + if (virtualWidth > fVisibleRect.Width()) { + hScrollBar->SetProportion(fVisibleRect.Width() / virtualWidth); + + // Perform the little trick if the user is scrolled over too far. + // See OutlineView::FixScrollBar for a more in depth explanation + float maxScrollBarValue = virtualWidth - fVisibleRect.Width(); + if (scrollToFit || hScrollBar->Value() <= maxScrollBarValue) { + hScrollBar->SetRange(0.0, maxScrollBarValue); + hScrollBar->SetSteps(50, fVisibleRect.Width()); + } + } else if (hScrollBar->Value() == 0.0) + hScrollBar->SetRange(0.0, 0.0); // disable scroll bar. + } +} + +void TitleView::DragSelectedColumn(BPoint position) +{ + float invalidLeft = fSelectedColumnRect.left; + float invalidRight = fSelectedColumnRect.right; + + float leftEdge; + int32 columnIndex = FindColumn(position, &leftEdge); + fSelectedColumnRect.OffsetTo(leftEdge, 0); + + MoveColumn(fSelectedColumn, columnIndex); + + fSelectedColumn->fVisible = true; + ComputeDragBoundries(fSelectedColumn, position); + + // Redraw the new column position + GetTitleRect(fSelectedColumn, &fSelectedColumnRect); + invalidLeft = MIN(fSelectedColumnRect.left, invalidLeft); + invalidRight = MAX(fSelectedColumnRect.right, invalidRight); + + Invalidate(BRect(invalidLeft, 0, invalidRight, fVisibleRect.bottom)); + fOutlineView->Invalidate(BRect(invalidLeft, 0, invalidRight, + fOutlineView->VisibleRect().bottom)); + + DrawTitle(this, fSelectedColumnRect, fSelectedColumn, true); +} + +void TitleView::MoveColumn(BColumn *column, int32 index) +{ + fColumns->RemoveItem((void*) column); + + if (-1 == index) + { + // Re-add the column at the end of the list. + fColumns->AddItem((void*) column); + } + else + { + fColumns->AddItem((void*) column, index); + } +} + +void TitleView::SetColumnFlags(column_flags flags) +{ + fColumnFlags = flags; +} + + +void TitleView::ResizeSelectedColumn(BPoint position) +{ + float minWidth = fSelectedColumn->MinWidth(); + float maxWidth = fSelectedColumn->MaxWidth(); + + float originalEdge = fSelectedColumnRect.left + fSelectedColumn->Width(); + if (position.x > fSelectedColumnRect.left + maxWidth) + fSelectedColumn->SetWidth(maxWidth); + else if (position.x < fSelectedColumnRect.left + minWidth) + fSelectedColumn->SetWidth(minWidth); + else + fSelectedColumn->SetWidth(position.x - fSelectedColumnRect.left - 1); + + float dX = fSelectedColumnRect.left + fSelectedColumn->Width() - originalEdge; + if (dX != 0) { + BRect originalRect(originalEdge, 0, 1000000.0, fVisibleRect.Height()); + BRect movedRect(originalRect); + movedRect.OffsetBy(dX, 0); + + // Update the size of the title column + BRect sourceRect(0, 0, fSelectedColumn->Width(), fVisibleRect.Height()); + BRect destRect(sourceRect); + destRect.OffsetBy(fSelectedColumnRect.left, 0); + +#if DOUBLE_BUFFERED_COLUMN_RESIZE + fDrawBuffer->Lock(); + fDrawBufferView->SetHighColor(fMasterView->Color(B_COLOR_HEADER_BACKGROUND)); + fDrawBufferView->FillRect(sourceRect); + DrawTitle(fDrawBufferView, sourceRect, fSelectedColumn, false); + fDrawBufferView->Sync(); + fDrawBuffer->Unlock(); + + CopyBits(originalRect, movedRect); + DrawBitmap(fDrawBuffer, sourceRect, destRect); +#else + CopyBits(originalRect, movedRect); + SetHighColor(fMasterView->Color(B_COLOR_HEADER_BACKGROUND)); + FillRect(destRect); + DrawTitle(this, destRect, fSelectedColumn, false); +#endif + + // Update the body view + BRect slaveSize = fOutlineView->VisibleRect(); + BRect slaveSource(originalRect); + slaveSource.bottom = slaveSize.bottom; + BRect slaveDest(movedRect); + slaveDest.bottom = slaveSize.bottom; + fOutlineView->CopyBits(slaveSource, slaveDest); + fOutlineView->RedrawColumn(fSelectedColumn, fSelectedColumnRect.left, + fResizingFirstColumn); + + fColumnsWidth += dX; + + // Update the cursor +#if _INCLUDES_CLASS_CURSOR + if (fSelectedColumn->Width() == minWidth) + SetViewCursor(fMinResizeCursor, false); + else if (fSelectedColumn->Width() == maxWidth) + SetViewCursor(fMaxResizeCursor, false); + else + SetViewCursor(fResizeCursor, false); +#endif + } +} + +void TitleView::ComputeDragBoundries(BColumn *findColumn, BPoint ) +{ + float previousColumnLeftEdge = -1000000.0; + float nextColumnRightEdge = 1000000.0; + + bool foundColumn = false; + float leftEdge = MAX(kLeftMargin, fMasterView->LatchWidth()); + int32 numColumns = fColumns->CountItems(); + for (int index = 0; index < numColumns; index++) { + BColumn *column = (BColumn*) fColumns->ItemAt(index); + if (!column->IsVisible()) + continue; + + if (column == findColumn) { + foundColumn = true; + continue; + } + + if (foundColumn) { + nextColumnRightEdge = leftEdge + column->Width(); + break; + } else + previousColumnLeftEdge = leftEdge; + + leftEdge += column->Width() + 1; + } + + float rightEdge = leftEdge + findColumn->Width(); + + fLeftDragBoundry = MIN(previousColumnLeftEdge + findColumn->Width(), leftEdge); + fRightDragBoundry = MAX(nextColumnRightEdge, rightEdge); +} + +void TitleView::DrawTitle(BView *view, BRect rect, BColumn *column, bool depressed) +{ + BRect drawRect; + rgb_color borderColor = mix_color(fMasterView->Color(B_COLOR_HEADER_BACKGROUND), make_color(0, 0, 0, 255), 128); + rgb_color backgroundColor; + + rgb_color bevelHigh; + rgb_color bevelLow; + // Want exterior borders to overlap. + rect.right += 1; + drawRect = rect; + drawRect.InsetBy(2, 2); + if (depressed) { + backgroundColor = mix_color(fMasterView->Color(B_COLOR_HEADER_BACKGROUND), make_color(0, 0, 0), 64); + bevelHigh = mix_color(backgroundColor, make_color(0, 0, 0), 64); + bevelLow = mix_color(backgroundColor, make_color(255, 255, 255), 128); + drawRect.left++; + drawRect.top++; + } else { + backgroundColor = fMasterView->Color(B_COLOR_HEADER_BACKGROUND); + bevelHigh = mix_color(backgroundColor, make_color(255, 255, 255), 192); + bevelLow = mix_color(backgroundColor, make_color(0, 0, 0), 64); + drawRect.bottom--; + drawRect.right--; + } + + view->SetHighColor(borderColor); + view->StrokeRect(rect); + view->BeginLineArray(4); + view->AddLine(BPoint(rect.left+1, rect.top+1), BPoint(rect.right-1, rect.top+1), bevelHigh); + view->AddLine(BPoint(rect.left+1, rect.top+1), BPoint(rect.left+1, rect.bottom-1), bevelHigh); + view->AddLine(BPoint(rect.right-1, rect.top+1), BPoint(rect.right-1, rect.bottom-1), bevelLow); + view->AddLine(BPoint(rect.left+2, rect.bottom-1), BPoint(rect.right-1, rect.bottom-1), bevelLow); + view->EndLineArray(); + + font_height fh; + GetFontHeight(&fh); + + float baseline = floor(drawRect.top + fh.ascent + + (drawRect.Height()+1-(fh.ascent+fh.descent))/2); + + view->SetHighColor(backgroundColor); + view->SetLowColor(backgroundColor); + + view->FillRect(rect.InsetByCopy(2, 2)); + + + // If no column given, nothing else to draw. + if (!column) + return; + + view->SetHighColor(fMasterView->Color(B_COLOR_HEADER_TEXT)); + + BFont font; + GetFont(&font); + view->SetFont(&font); + + int sortIndex = fSortColumns->IndexOf(column); + if (sortIndex >= 0) { + // Draw sort notation. + BPoint upperLeft(drawRect.right-kSortIndicatorWidth, baseline); + +// if (fSortColumns->CountItems() > 1) { +// char str[256]; +// sprintf(str, "%d", sortIndex + 1); +// const float w = view->StringWidth(str); +// upperLeft.x -= w; +// +// view->SetDrawingMode(B_OP_COPY); +// view->MovePenTo(BPoint(upperLeft.x + kSortIndicatorWidth, baseline)); +// view->DrawString(str); +// } + + float bmh = fDownSortArrow->Bounds().Height()+1; + + view->SetDrawingMode(B_OP_OVER); + + if (column->fSortAscending) { + BPoint leftTop(upperLeft.x, drawRect.top + (drawRect.IntegerHeight()-fDownSortArrow->Bounds().IntegerHeight())/2); + view->DrawBitmapAsync(fDownSortArrow, leftTop); + } else { + BPoint leftTop(upperLeft.x, drawRect.top + (drawRect.IntegerHeight()-fUpSortArrow->Bounds().IntegerHeight())/2); + view->DrawBitmapAsync(fUpSortArrow, leftTop); + } + + upperLeft.y = baseline-bmh+floor((fh.ascent+fh.descent-bmh)/2); + if (upperLeft.y < drawRect.top) upperLeft.y = drawRect.top; + + // Adjust title stuff for sort indicator + drawRect.right = upperLeft.x - 2; + } + + if (drawRect.right > drawRect.left) { +#if CONSTRAIN_CLIPPING_REGION + BRegion clipRegion; + clipRegion.Set(drawRect); + view->ConstrainClippingRegion(&clipRegion); + view->PushState(); +#endif + view->MovePenTo(BPoint(drawRect.left+8, baseline)); + view->SetDrawingMode(B_OP_COPY); + view->SetHighColor(fMasterView->Color(B_COLOR_HEADER_TEXT)); + column->DrawTitle(drawRect, view); + +#if CONSTRAIN_CLIPPING_REGION + view->PopState(); + view->ConstrainClippingRegion(NULL); +#endif + } +} + +void TitleView::Draw(BRect invalidRect) +{ + float columnLeftEdge = MAX(kLeftMargin, fMasterView->LatchWidth()); + for (int32 columnIndex = 0; columnIndex < fColumns->CountItems(); columnIndex++) { + BColumn *column = (BColumn*) fColumns->ItemAt(columnIndex); + if (!column->IsVisible()) + continue; + + if (columnLeftEdge > invalidRect.right) + break; + + if (columnLeftEdge + column->Width() >= invalidRect.left) { + BRect titleRect(columnLeftEdge, 0, + columnLeftEdge + column->Width(), fVisibleRect.Height()); + DrawTitle(this, titleRect, column, + (fCurrentState == DRAG_COLUMN_INSIDE_TITLE && fSelectedColumn == column)); + } + + columnLeftEdge += column->Width() + 1; + } + + + // Bevels for right title margin + if (columnLeftEdge <= invalidRect.right) { + BRect titleRect(columnLeftEdge, 0, Bounds().right+2, fVisibleRect.Height()); + DrawTitle(this, titleRect, NULL, false); + } + + // Bevels for left title margin + if (invalidRect.left < MAX(kLeftMargin, fMasterView->LatchWidth())) { + BRect titleRect(0, 0, MAX(kLeftMargin, fMasterView->LatchWidth()) - 1, fVisibleRect.Height()); + DrawTitle(this, titleRect, NULL, false); + } + +#if DRAG_TITLE_OUTLINE + // (Internal) Column Drag Indicator + if (fCurrentState == DRAG_COLUMN_INSIDE_TITLE) { + BRect dragRect(fSelectedColumnRect); + dragRect.OffsetTo(fCurrentDragPosition.x - fClickPoint.x, 0); + if (dragRect.Intersects(invalidRect)) { + SetHighColor(0, 0, 255); + StrokeRect(dragRect); + } + } +#endif +} + +void TitleView::ScrollTo(BPoint position) +{ + fOutlineView->ScrollBy(position.x - fVisibleRect.left, 0); + fVisibleRect.OffsetTo(position.x, position.y); + + // Perform the little trick if the user is scrolled over too far. + // See OutlineView::ScrollTo for a more in depth explanation + float maxScrollBarValue = fColumnsWidth + MAX(kLeftMargin, fMasterView->LatchWidth()) + + kRightMargin * 2 - fVisibleRect.Width(); + BScrollBar *hScrollBar = ScrollBar(B_HORIZONTAL); + float min, max; + hScrollBar->GetRange(&min, &max); + if (max != maxScrollBarValue && position.x > maxScrollBarValue) + FixScrollBar(true); + + _inherited::ScrollTo(position); +} + +void TitleView::MessageReceived(BMessage *message) +{ + if (message->what == kToggleColumn) { + int32 num; + if (message->FindInt32("be:field_num", &num) == B_OK) { + for (int index = 0; index < fColumns->CountItems(); index++) { + BColumn *column = (BColumn*) fColumns->ItemAt(index); + if (!column) continue; + if (column->LogicalFieldNum() == num) { + column->SetVisible(!column->IsVisible()); + FixScrollBar(false); + } + } + } + return; + } else { + BView::MessageReceived(message); + } +} + +void TitleView::MouseDown(BPoint position) +{ + if(fEditMode) + return; + + int32 buttons=1; + Window()->CurrentMessage()->FindInt32("buttons", &buttons); + if (buttons == B_SECONDARY_MOUSE_BUTTON && (fColumnFlags & B_ALLOW_COLUMN_POPUP)) { + // Right mouse button -- bring up menu to show/hide columns. + if (!fColumnPop) fColumnPop = new BPopUpMenu("Columns", false, false); + fColumnPop->RemoveItems(0, fColumnPop->CountItems(), true); + BMessenger me(this); + for (int index = 0; index < fColumns->CountItems(); index++) { + BColumn *column = (BColumn*) fColumns->ItemAt(index); + if (!column) continue; + if (column->ShowHeading() == false) continue; + BString name; + column->GetColumnName(&name); + BMessage* msg = new BMessage(kToggleColumn); + msg->AddInt32("be:field_num", column->LogicalFieldNum()); + BMenuItem* it = new BMenuItem(name.String(), msg); + it->SetMarked(column->IsVisible()); + it->SetTarget(me); + fColumnPop->AddItem(it); + } + BPoint screenPosition = ConvertToScreen(position); + BRect sticky(screenPosition, screenPosition); + sticky.InsetBy(-5, -5); + fColumnPop->Go(ConvertToScreen(position), true, false, sticky, true); + return; + } + + fResizingFirstColumn = true; + float leftEdge = MAX(kLeftMargin, fMasterView->LatchWidth()); + for (int index = 0; index < fColumns->CountItems(); index++) { + BColumn *column = (BColumn*) fColumns->ItemAt(index); + if (!column->IsVisible()) + continue; + + if (leftEdge > position.x + kColumnResizeAreaWidth / 2) + break; + + // Check for resizing a column + float rightEdge = leftEdge + column->Width(); + + if(column->ShowHeading()) { + if (position.x > rightEdge - kColumnResizeAreaWidth / 2 + && position.x < rightEdge + kColumnResizeAreaWidth / 2 + && column->MaxWidth() > column->MinWidth() + && (fColumnFlags & B_ALLOW_COLUMN_RESIZE)) { + fCurrentState = RESIZING_COLUMN; + fSelectedColumn = column; + fSelectedColumnRect.Set(leftEdge, 0, rightEdge, fVisibleRect.Height()); + SetMouseEventMask(B_POINTER_EVENTS, B_LOCK_WINDOW_FOCUS | + B_NO_POINTER_HISTORY); + break; + } + + fResizingFirstColumn = false; + + // Check for clicking on a column. + if (position.x > leftEdge && position.x < rightEdge) { + fCurrentState = PRESSING_COLUMN; + fSelectedColumn = column; + fSelectedColumnRect.Set(leftEdge, 0, rightEdge, fVisibleRect.Height()); + DrawTitle(this, fSelectedColumnRect, fSelectedColumn, true); + fClickPoint = BPoint(position.x - fSelectedColumnRect.left, position.y + - fSelectedColumnRect.top); + SetMouseEventMask(B_POINTER_EVENTS, B_LOCK_WINDOW_FOCUS | + B_NO_POINTER_HISTORY); + break; + } + } + leftEdge = rightEdge + 1; + } +} + +void TitleView::MouseMoved(BPoint position, uint32 transit, const BMessage *) +{ + if(fEditMode) + return; + + // Handle column manipulation + switch (fCurrentState) { + case RESIZING_COLUMN: + ResizeSelectedColumn(position); + break; + + case PRESSING_COLUMN: { + if (abs((int32)(position.x - (fClickPoint.x + fSelectedColumnRect.left))) > kColumnResizeAreaWidth + || abs((int32)(position.y - (fClickPoint.y + fSelectedColumnRect.top))) > kColumnResizeAreaWidth) { + // User has moved the mouse more than the tolerable amount, + // initiate a drag. + if (transit == B_INSIDE_VIEW || transit == B_ENTERED_VIEW) { + if(fColumnFlags & B_ALLOW_COLUMN_MOVE) { + fCurrentState = DRAG_COLUMN_INSIDE_TITLE; + ComputeDragBoundries(fSelectedColumn, position); +#if _INCLUDES_CLASS_CURSOR + SetViewCursor(fColumnMoveCursor, false); +#endif +#if DRAG_TITLE_OUTLINE + BRect invalidRect(fSelectedColumnRect); + invalidRect.OffsetTo(position.x - fClickPoint.x, 0); + fCurrentDragPosition = position; + Invalidate(invalidRect); +#endif + } + } else { + if(fColumnFlags & B_ALLOW_COLUMN_REMOVE) { + // Dragged outside view + fCurrentState = DRAG_COLUMN_OUTSIDE_TITLE; + fSelectedColumn->SetVisible(false); + BRect dragRect(fSelectedColumnRect); + + // There is a race condition where the mouse may have moved by the + // time we get to handle this message. If the user drags a column very + // quickly, this results in the annoying bug where the cursor is outside + // of the rectangle that is being dragged around. + // Call GetMouse with the checkQueue flag set to false so we + // can get the most recent position of the mouse. This minimizes + // this problem (although it is currently not possible to completely + // eliminate it). + uint32 buttons; + GetMouse(&position, &buttons, false); + dragRect.OffsetTo(position.x - fClickPoint.x, position.y - dragRect.Height() / 2); + BeginRectTracking(dragRect, B_TRACK_WHOLE_RECT); + } + } + } + + break; + } + + case DRAG_COLUMN_INSIDE_TITLE: { + if (transit == B_EXITED_VIEW && (fColumnFlags & B_ALLOW_COLUMN_REMOVE)) { + // Dragged outside view + fCurrentState = DRAG_COLUMN_OUTSIDE_TITLE; + fSelectedColumn->SetVisible(false); + BRect dragRect(fSelectedColumnRect); + + // See explanation above. + uint32 buttons; + GetMouse(&position, &buttons, false); + + dragRect.OffsetTo(position.x - fClickPoint.x, position.y - fClickPoint.y); + BeginRectTracking(dragRect, B_TRACK_WHOLE_RECT); + } else if (position.x < fLeftDragBoundry || position.x > fRightDragBoundry) + DragSelectedColumn(position); + +#if DRAG_TITLE_OUTLINE + // Set up the invalid rect to include the rect for the previous position + // of the drag rect, as well as the new one. + BRect invalidRect(fSelectedColumnRect); + invalidRect.OffsetTo(fCurrentDragPosition.x - fClickPoint.x, 0); + if (position.x < fCurrentDragPosition.x) + invalidRect.left -= fCurrentDragPosition.x - position.x; + else + invalidRect.right += position.x - fCurrentDragPosition.x; + + fCurrentDragPosition = position; + Invalidate(invalidRect); +#endif + break; + } + + case DRAG_COLUMN_OUTSIDE_TITLE: + if (transit == B_ENTERED_VIEW) { + // Drag back into view + EndRectTracking(); + fCurrentState = DRAG_COLUMN_INSIDE_TITLE; + fSelectedColumn->SetVisible(true); + DragSelectedColumn(position); + } + + break; + + case INACTIVE: + // Check for cursor changes if we are over the resize area for + // a column. + BColumn *resizeColumn = 0; + float leftEdge = MAX(kLeftMargin, fMasterView->LatchWidth()); + for (int index = 0; index < fColumns->CountItems(); index++) { + BColumn *column = (BColumn*) fColumns->ItemAt(index); + if (!column->IsVisible()) + continue; + + if (leftEdge > position.x + kColumnResizeAreaWidth / 2) + break; + + float rightEdge = leftEdge + column->Width(); + if (position.x > rightEdge - kColumnResizeAreaWidth / 2 + && position.x < rightEdge + kColumnResizeAreaWidth / 2 + && column->MaxWidth() > column->MinWidth()) { + resizeColumn = column; + break; + } + + leftEdge = rightEdge + 1; + } + + // Update the cursor +#if _INCLUDES_CLASS_CURSOR + if (resizeColumn) { + if (resizeColumn->Width() == resizeColumn->MinWidth()) + SetViewCursor(fMinResizeCursor, false); + else if (resizeColumn->Width() == resizeColumn->MaxWidth()) + SetViewCursor(fMaxResizeCursor, false); + else + SetViewCursor(fResizeCursor, false); + } else + SetViewCursor(B_CURSOR_SYSTEM_DEFAULT, false); +#endif + break; + } +} + +void TitleView::MouseUp(BPoint position) +{ + if(fEditMode) + return; + + switch (fCurrentState) { + case RESIZING_COLUMN: + ResizeSelectedColumn(position); + fCurrentState = INACTIVE; + FixScrollBar(false); +#if _INCLUDES_CLASS_CURSOR + SetViewCursor(B_CURSOR_SYSTEM_DEFAULT, false); +#endif + break; + + case PRESSING_COLUMN: { + if (fMasterView->SortingEnabled()) { + if (fSortColumns->HasItem(fSelectedColumn)) { + if ((modifiers() & B_CONTROL_KEY) == 0 && fSortColumns->CountItems() > 1) { + fSortColumns->MakeEmpty(); + fSortColumns->AddItem(fSelectedColumn); + } + + fSelectedColumn->fSortAscending = !fSelectedColumn->fSortAscending; + } else { + if ((modifiers() & B_CONTROL_KEY) == 0) + fSortColumns->MakeEmpty(); + + fSortColumns->AddItem(fSelectedColumn); + fSelectedColumn->fSortAscending = true; + } + + fOutlineView->StartSorting(); + } + + fCurrentState = INACTIVE; + Invalidate(); + break; + } + + case DRAG_COLUMN_INSIDE_TITLE: + fCurrentState = INACTIVE; + +#if DRAG_TITLE_OUTLINE + Invalidate(); // xxx Can make this smaller +#else + Invalidate(fSelectedColumnRect); +#endif +#if _INCLUDES_CLASS_CURSOR + SetViewCursor(B_CURSOR_SYSTEM_DEFAULT, false); +#endif + break; + + case DRAG_COLUMN_OUTSIDE_TITLE: + fCurrentState = INACTIVE; + EndRectTracking(); +#if _INCLUDES_CLASS_CURSOR + SetViewCursor(B_CURSOR_SYSTEM_DEFAULT, false); +#endif + break; + + default: + ; + } +} + +void TitleView::FrameResized(float width, float height) +{ + fVisibleRect.right = fVisibleRect.left + width; + fVisibleRect.bottom = fVisibleRect.top + height; + FixScrollBar(true); +} + +// #pragma mark - + +OutlineView::OutlineView(BRect rect, BList *visibleColumns, BList *sortColumns, + BColumnListView *listView) + : BView(rect, "outline_view", B_FOLLOW_ALL_SIDES, B_WILL_DRAW | B_FRAME_EVENTS), + fColumns(visibleColumns), + fSortColumns(sortColumns), + fItemsHeight(24.), + fVisibleRect(rect.OffsetToCopy(0, 0)), + fFocusRow(0), + fRollOverRow(0), + fLastSelectedItem(0), + fFirstSelectedItem(0), + fSortThread(B_BAD_THREAD_ID), + fCurrentState(INACTIVE), + fMasterView(listView), + fSelectionMode(B_MULTIPLE_SELECTION_LIST), + fTrackMouse(false), + fCurrentField(0), + fCurrentRow(0), + fCurrentColumn(0), + fMouseDown(false), + fCurrentCode(B_OUTSIDE_VIEW), + fEditMode(false), + fDragging(false), + fClickCount(0), + fDropHighlightY(-1) +{ + SetViewColor(B_TRANSPARENT_32_BIT); + +#if DOUBLE_BUFFERED_COLUMN_RESIZE + // xxx this needs to be smart about the size of the buffer. Also, the buffer can + // be shared with the title's buffer. + BRect doubleBufferRect(0, 0, 600, 35); + fDrawBuffer = new BBitmap(doubleBufferRect, B_RGB32, true); + fDrawBufferView = new BView(doubleBufferRect, "double_buffer_view", + B_FOLLOW_ALL_SIDES, 0); + fDrawBuffer->Lock(); + fDrawBuffer->AddChild(fDrawBufferView); + fDrawBuffer->Unlock(); +#endif + + FixScrollBar(true); + fSelectionListDummyHead.fNextSelected = &fSelectionListDummyHead; + fSelectionListDummyHead.fPrevSelected = &fSelectionListDummyHead; +} + +OutlineView::~OutlineView() +{ + fDrawBuffer->Lock(); + fDrawBufferView->RemoveSelf(); + fDrawBuffer->Unlock(); + delete fDrawBufferView; + delete fDrawBuffer; + + Clear(); +} + +void OutlineView::Clear() +{ + DeselectAll(); // Make sure selection list doesn't point to deleted rows! + RecursiveDeleteRows(&fRows, false); + Invalidate(); + fItemsHeight = 24.; + FixScrollBar(true); +} + +void OutlineView::SetSelectionMode(list_view_type mode) +{ + DeselectAll(); + fSelectionMode = mode; +} + +list_view_type OutlineView::SelectionMode() const +{ + return fSelectionMode; +} + +void OutlineView::Deselect(BRow *row) +{ + if (row) { + if (row->fNextSelected != 0) { + row->fNextSelected->fPrevSelected = row->fPrevSelected; + row->fPrevSelected->fNextSelected = row->fNextSelected; + row->fNextSelected = 0; + row->fPrevSelected = 0; + Invalidate(); + } + } +} + +void OutlineView::AddToSelection(BRow *row) +{ + if (row) { + if (row->fNextSelected == 0) { + if (fSelectionMode == B_SINGLE_SELECTION_LIST) + DeselectAll(); + + row->fNextSelected = fSelectionListDummyHead.fNextSelected; + row->fPrevSelected = &fSelectionListDummyHead; + row->fNextSelected->fPrevSelected = row; + row->fPrevSelected->fNextSelected = row; + + BRect invalidRect; + if (FindVisibleRect(row, &invalidRect)) + Invalidate(invalidRect); + } + } +} + +void OutlineView::RecursiveDeleteRows(BRowContainer* List, bool IsOwner) +{ + if (List) { + while (true) { + BRow *row = List->RemoveItemAt(0L); + if (row == 0) + break; + + if (row->fChildList) + RecursiveDeleteRows(row->fChildList, true); + + delete row; + } + + if (IsOwner) + delete List; + } +} + + +void OutlineView::RedrawColumn(BColumn *column, float leftEdge, bool isFirstColumn) +{ + if (column) { + font_height fh; + GetFontHeight(&fh); + float line = 0.0; + for (RecursiveOutlineIterator iterator(&fRows); iterator.CurrentRow(); + line += iterator.CurrentRow()->Height() + 1, iterator.GoToNext()) { + BRow *row = iterator.CurrentRow(); + float rowHeight = row->Height(); + if (line > fVisibleRect.bottom) + break; + + if (line + rowHeight >= fVisibleRect.top) { + BRect sourceRect(0, 0, column->Width(), rowHeight); + BRect destRect(leftEdge, line, leftEdge + column->Width(), line + rowHeight); + + #if DOUBLE_BUFFERED_COLUMN_RESIZE + fDrawBuffer->Lock(); + if (row->fNextSelected != 0) { + if(fEditMode) { + fDrawBufferView->SetHighColor(fMasterView->Color(B_COLOR_EDIT_BACKGROUND)); + fDrawBufferView->SetLowColor(fMasterView->Color(B_COLOR_EDIT_BACKGROUND)); + } else { + fDrawBufferView->SetHighColor(fMasterView->Color(B_COLOR_SELECTION)); + fDrawBufferView->SetLowColor(fMasterView->Color(B_COLOR_SELECTION)); + } + } else { + fDrawBufferView->SetHighColor(fMasterView->Color(B_COLOR_BACKGROUND)); + fDrawBufferView->SetLowColor(fMasterView->Color(B_COLOR_BACKGROUND)); + } + BFont font; + GetFont(&font); + fDrawBufferView->SetFont(&font); + fDrawBufferView->FillRect(sourceRect); + + if (isFirstColumn) { + // + //debugger("First"); + //row->DrawBackground(sourceRect,fDrawBufferView,false,false); + // If this is the first column, double buffer drawing the latch too. + destRect.left += iterator.CurrentLevel() * kOutlineLevelIndent + - fMasterView->LatchWidth(); + sourceRect.left += iterator.CurrentLevel() * kOutlineLevelIndent + - fMasterView->LatchWidth(); + + LatchType pos = B_NO_LATCH; + if (row->HasLatch()) + pos = row->fIsExpanded ? B_OPEN_LATCH : B_CLOSED_LATCH; + + BRect latchRect(sourceRect); + latchRect.right = latchRect.left + fMasterView->LatchWidth(); + fMasterView->DrawLatch(fDrawBufferView, latchRect, pos, row); + + } + + BField *field = row->GetField(column->fFieldID); + if (field) { + BRect fieldRect(sourceRect); + if (isFirstColumn) + fieldRect.left += fMasterView->LatchWidth(); + + #if CONSTRAIN_CLIPPING_REGION + BRegion clipRegion; + clipRegion.Set(fieldRect); + fDrawBufferView->ConstrainClippingRegion(&clipRegion); + fDrawBufferView->PushState(); + #endif + fDrawBufferView->SetHighColor(fMasterView->Color(row->fNextSelected ? B_COLOR_SELECTION_TEXT : B_COLOR_TEXT)); + float baseline = floor(fieldRect.top + fh.ascent + + (fieldRect.Height()+1-(fh.ascent+fh.descent))/2); + fDrawBufferView->MovePenTo(fieldRect.left + 8, baseline); + column->DrawField(field, fieldRect, fDrawBufferView); + #if CONSTRAIN_CLIPPING_REGION + fDrawBufferView->PopState(); + fDrawBufferView->ConstrainClippingRegion(NULL); + #endif + } + + if (fFocusRow == row) { + if(!fEditMode) { + fDrawBufferView->SetHighColor(fMasterView->Color(row->fNextSelected ? B_COLOR_SELECTION_TEXT : B_COLOR_TEXT)); + fDrawBufferView->StrokeRect(BRect(-1, sourceRect.top, 10000.0, sourceRect.bottom - 1)); + } + } + + fDrawBufferView->SetHighColor(fMasterView->Color(B_COLOR_ROW_DIVIDER)); + //1 StrokeLine(BPoint(0, line + rowHeight - 2), BPoint(Bounds().Width(), line + rowHeight - 2)); + //RedrawColumn StrokeLine(BPoint(0, line + rowHeight - 1), BPoint(Bounds().Width(), line + rowHeight - 1)); + fDrawBufferView->StrokeLine(BPoint(0, rowHeight), BPoint(Bounds().right, rowHeight)); + + fDrawBufferView->Sync(); + fDrawBuffer->Unlock(); + SetDrawingMode(B_OP_OVER); + DrawBitmap(fDrawBuffer, sourceRect, destRect); + + #else + + if (row->fNextSelected != 0) { + if(fEditMode) { + SetHighColor(fMasterView->Color(B_COLOR_EDIT_BACKGROUND)); + SetLowColor(fMasterView->Color(B_COLOR_EDIT_BACKGROUND)); + } + else { + SetHighColor(fMasterView->Color(B_COLOR_SELECTION)); + SetLowColor(fMasterView->Color(B_COLOR_SELECTION)); + } + } else { + SetHighColor(fMasterView->Color(B_COLOR_BACKGROUND)); + SetLowColor(fMasterView->Color(B_COLOR_BACKGROUND)); + } + + FillRect(destRect); + + BField *field = row->GetField(column->fFieldID); + if (field) { + #if CONSTRAIN_CLIPPING_REGION + BRegion clipRegion; + clipRegion.Set(destRect); + ConstrainClippingRegion(&clipRegion); + PushState(); + #endif + SetHighColor(fColorList[row->fNextSelected ? B_COLOR_SELECTION_TEXT : B_COLOR_TEXT]); + float baseline = floor(destRect.top + fh.ascent + + (destRect.Height()+1-(fh.ascent+fh.descent))/2); + MovePenTo(destRect.left + 8, baseline); + column->DrawField(field, destRect, this); + #if CONSTRAIN_CLIPPING_REGION + PopState(); + ConstrainClippingRegion(NULL); + #endif + } + + if (fFocusRow == row) { + if(!fEditMode) { + SetHighColor(fColorList[row->fNextSelected ? B_COLOR_SELECTION_TEXT : B_COLOR_TEXT]); + StrokeRect(BRect(0, destRect.top, 10000.0, destRect.bottom - 1)); + } + } + + rgb_color color = HighColor(); + SetHighColor(fMasterView->Color(B_COLOR_ROW_DIVIDER)); + //2 StrokeLine(BPoint(0, line + rowHeight - 2), BPoint(Bounds().Width(), line + rowHeight - 2)); + //RedrawColumn StrokeLine(BPoint(0, line + rowHeight - 1), BPoint(Bounds().Width(), line + rowHeight - 1)); + StrokeLine(BPoint(0, line + rowHeight), BPoint(Bounds().right, line + rowHeight)); + SetHighColor(color); + #endif + } + } + } +} + +void OutlineView::Draw(BRect invalidBounds) +{ +#if SMART_REDRAW + BRegion invalidRegion; + GetClippingRegion(&invalidRegion); +#endif + + font_height fh; + GetFontHeight(&fh); + + float line = 0.0; + int32 numColumns = fColumns->CountItems(); + for (RecursiveOutlineIterator iterator(&fRows); iterator.CurrentRow(); + iterator.GoToNext()) { + BRow *row = iterator.CurrentRow(); + if (line > invalidBounds.bottom) + break; + + float rowHeight = row->Height(); + + if (line > invalidBounds.top - rowHeight) { + bool isFirstColumn = true; + float fieldLeftEdge = MAX(kLeftMargin, fMasterView->LatchWidth()); + for (int columnIndex = 0; columnIndex < numColumns; columnIndex++) { + BColumn *column = (BColumn*) fColumns->ItemAt(columnIndex); + if (!column->IsVisible()) + continue; + + if (!isFirstColumn && fieldLeftEdge > invalidBounds.right) + break; + + if (fieldLeftEdge + column->Width() >= invalidBounds.left) { + BRect fullRect(fieldLeftEdge, line, + fieldLeftEdge + column->Width(), line + rowHeight); + + bool clippedFirstColumn = false; + // This happens when a column is indented past the + // beginning of the next column. + + if (row->fNextSelected != 0) { + if (Window()->IsActive()) { + if(fEditMode) + SetHighColor(fMasterView->Color(B_COLOR_EDIT_BACKGROUND)); + else + SetHighColor(fMasterView->Color(B_COLOR_SELECTION)); + } + else + SetHighColor(fMasterView->Color(B_COLOR_NON_FOCUS_SELECTION)); + } else + SetHighColor(fMasterView->Color(B_COLOR_BACKGROUND)); + + BRect destRect(fullRect); + if (isFirstColumn) { + fullRect.left -= fMasterView->LatchWidth(); + destRect.left += iterator.CurrentLevel() * kOutlineLevelIndent; + if (destRect.left >= destRect.right) { + // clipped + FillRect(BRect(0, line, fieldLeftEdge + column->Width(), + line + rowHeight)); + clippedFirstColumn = true; + } + + //SetHighColor(255,0,0); + FillRect(BRect(0, line, MAX(kLeftMargin, fMasterView->LatchWidth()), line + row->Height())); + + + + } + + +#if SMART_REDRAW + if (!clippedFirstColumn && invalidRegion.Intersects(fullRect)) +#else + if (!clippedFirstColumn) +#endif + { + FillRect(fullRect); // Using color set above + if (isFirstColumn) row->DrawBackground(fullRect,this,false,false); + + + // Draw the latch widget if it has one. + if (isFirstColumn) { + if (row == fTargetRow && fCurrentState == LATCH_CLICKED) { + // Note that this only occurs if the user is holding + // down a latch while items are added in the background. + BPoint pos; + uint32 buttons; + GetMouse(&pos, &buttons); + if (fLatchRect.Contains(pos)) + fMasterView->DrawLatch(this, fLatchRect, B_PRESSED_LATCH, + fTargetRow); + else + fMasterView->DrawLatch(this, fLatchRect, + row->fIsExpanded ? B_OPEN_LATCH : B_CLOSED_LATCH, + fTargetRow); + } else { + LatchType pos = B_NO_LATCH; + if (row->HasLatch()) + pos = row->fIsExpanded ? B_OPEN_LATCH : B_CLOSED_LATCH; + + fMasterView->DrawLatch(this, BRect(destRect.left - + fMasterView->LatchWidth(), + destRect.top, destRect.left, destRect.bottom), pos, + row); + } + } + + if (row->fNextSelected != 0) { + if (Window()->IsActive()) { + if(fEditMode) + SetLowColor(fMasterView->Color(B_COLOR_EDIT_BACKGROUND)); + else + SetLowColor(fMasterView->Color(B_COLOR_SELECTION)); + } + else + SetLowColor(fMasterView->Color(B_COLOR_NON_FOCUS_SELECTION)); + } else + SetLowColor(fMasterView->Color(B_COLOR_BACKGROUND)); + + SetHighColor(fMasterView->HighColor()); + // The master view just holds the high color for us. + + BField *field = row->GetField(column->fFieldID); + if (field) { +#if CONSTRAIN_CLIPPING_REGION + BRegion clipRegion; + clipRegion.Set(destRect); + ConstrainClippingRegion(&clipRegion); + PushState(); +#endif + SetHighColor(fMasterView->Color(row->fNextSelected ? B_COLOR_SELECTION_TEXT : B_COLOR_TEXT)); + float baseline = floor(destRect.top + fh.ascent + + (destRect.Height()+1-(fh.ascent+fh.descent))/2); + MovePenTo(destRect.left + 8, baseline); + column->DrawField(field, destRect, this); +#if CONSTRAIN_CLIPPING_REGION + PopState(); + ConstrainClippingRegion(NULL); +#endif + } + } + } + + isFirstColumn = false; + fieldLeftEdge += column->Width() + 1; + } + + if (fieldLeftEdge <= invalidBounds.right) { + if (row->fNextSelected != 0) { + if (Window()->IsActive()) { + if(fEditMode) + SetHighColor(fMasterView->Color(B_COLOR_EDIT_BACKGROUND)); + else + SetHighColor(fMasterView->Color(B_COLOR_SELECTION)); + } + else + SetHighColor(fMasterView->Color(B_COLOR_NON_FOCUS_SELECTION)); + } else + SetHighColor(fMasterView->Color(B_COLOR_BACKGROUND)); + + FillRect(BRect(fieldLeftEdge, line, invalidBounds.right, + line + rowHeight)); + } + } + + if (fFocusRow == row && fMasterView->IsFocus() && Window()->IsActive()) { + if(!fEditMode) { + SetHighColor(fMasterView->Color(row->fNextSelected ? B_COLOR_SELECTION_TEXT : B_COLOR_TEXT)); + StrokeRect(BRect(0, line, 10000.0, line + rowHeight - 1)); + } + } + rgb_color color = HighColor(); + SetHighColor(fMasterView->Color(B_COLOR_ROW_DIVIDER)); + StrokeLine(BPoint(invalidBounds.left, line + rowHeight), BPoint(invalidBounds.right, line + rowHeight)); + SetHighColor(color); + line += rowHeight + 1; + } + + if (line <= invalidBounds.bottom) { + SetHighColor(fMasterView->Color(B_COLOR_BACKGROUND)); + FillRect(BRect(invalidBounds.left, line, invalidBounds.right, invalidBounds.bottom)); + } + + // Draw the drop target line + if (fDropHighlightY != -1) + InvertRect(BRect(0, fDropHighlightY - kDropHighlightLineHeight / 2, 1000000, + fDropHighlightY + kDropHighlightLineHeight / 2)); +} + +BRow* OutlineView::FindRow(float ypos, int32 *out_rowIndent, float *out_top) +{ + if (out_rowIndent && out_top) { + float line = 0.0; + for (RecursiveOutlineIterator iterator(&fRows); iterator.CurrentRow(); + iterator.GoToNext()) { + BRow *row = iterator.CurrentRow(); + if (line > ypos) + break; + + float rowHeight = row->Height(); + if (ypos <= line + rowHeight) { + *out_top = line; + *out_rowIndent = iterator.CurrentLevel(); + return row; + } + + line += rowHeight + 1; + } + } + return 0; +} + +void OutlineView::SetMouseTrackingEnabled(bool enabled) +{ + fTrackMouse = enabled; + if (!enabled && fDropHighlightY != -1) { + InvertRect(BRect(0, fDropHighlightY - kDropHighlightLineHeight / 2, 1000000, + fDropHighlightY + kDropHighlightLineHeight / 2)); // Erase the old target line + fDropHighlightY = -1; + } +} + + +// +// Note that this interaction is not totally safe. If items are added to +// the list in the background, the widget rect will be incorrect, possibly +// resulting in drawing glitches. The code that adds items needs to be a little smarter +// about invalidating state. +// +void OutlineView::MouseDown(BPoint position) +{ + if(!fEditMode) + fMasterView->MakeFocus(true); + + // Check to see if the user is clicking on a widget to open a section + // of the list. + bool reset_click_count = false; + int32 indent; + float rowTop; + BRow *row = FindRow(position.y, &indent, &rowTop); + if (row) { + + // Update fCurrentField + bool handle_field = false; + BField *new_field = 0; + BRow *new_row = 0; + BColumn *new_column = 0; + BRect new_rect; + + if(position.y >=0 ) { + if(position.x >=0 ) { + float x=0; + for(int32 c=0;cCountColumns();c++) { + new_column = fMasterView->ColumnAt(c); + if (!new_column->IsVisible()) + continue; + if((MAX(kLeftMargin, fMasterView->LatchWidth())+x)+new_column->Width() >= position.x) { + if(new_column->WantsEvents()) { + new_field = row->GetField(c); + new_row = row; + FindRect(new_row,&new_rect); + new_rect.left = MAX(kLeftMargin, fMasterView->LatchWidth()) + x; + new_rect.right = new_rect.left + new_column->Width() - 1; + handle_field = true; + } + break; + } + x += new_column->Width(); + } + } + } + + // Handle mouse down + if(handle_field) { + fMouseDown = true; + fFieldRect = new_rect; + fCurrentColumn = new_column; + fCurrentRow = new_row; + fCurrentField = new_field; + fCurrentCode = B_INSIDE_VIEW; + fCurrentColumn->MouseDown(fMasterView,fCurrentRow,fCurrentField,fFieldRect,position,1); + } + + if(!fEditMode) { + + fTargetRow = row; + fTargetRowTop = rowTop; + FindVisibleRect(fFocusRow, &fFocusRowRect); + + float leftWidgetBoundry = indent * kOutlineLevelIndent + MAX(kLeftMargin, fMasterView->LatchWidth()) - + fMasterView->LatchWidth(); + fLatchRect.Set(leftWidgetBoundry, rowTop, leftWidgetBoundry + + fMasterView->LatchWidth(), rowTop + row->Height()); + if (fLatchRect.Contains(position) && row->HasLatch()) { + fCurrentState = LATCH_CLICKED; + if (fTargetRow->fNextSelected != 0) { + if(fEditMode) + SetHighColor(fMasterView->Color(B_COLOR_EDIT_BACKGROUND)); + else + SetHighColor(fMasterView->Color(B_COLOR_SELECTION)); + } + else + SetHighColor(fMasterView->Color(B_COLOR_BACKGROUND)); + + FillRect(fLatchRect); + if (fLatchRect.Contains(position)) + fMasterView->DrawLatch(this, fLatchRect, B_PRESSED_LATCH, row); + else + fMasterView->DrawLatch(this, fLatchRect, fTargetRow->fIsExpanded + ? B_OPEN_LATCH : B_CLOSED_LATCH, row); + + } else { + Invalidate(fFocusRowRect); + fFocusRow = fTargetRow; + FindVisibleRect(fFocusRow, &fFocusRowRect); + + ASSERT(fTargetRow != 0); + + if ((modifiers() & B_CONTROL_KEY) == 0) + DeselectAll(); + + if ((modifiers() & B_SHIFT_KEY) != 0 && fFirstSelectedItem != 0 + && fSelectionMode == B_MULTIPLE_SELECTION_LIST) { + SelectRange(fFirstSelectedItem, fTargetRow); + } + else { + if (fTargetRow->fNextSelected != 0) { + // Unselect row + fTargetRow->fNextSelected->fPrevSelected = fTargetRow->fPrevSelected; + fTargetRow->fPrevSelected->fNextSelected = fTargetRow->fNextSelected; + fTargetRow->fPrevSelected = 0; + fTargetRow->fNextSelected = 0; + fFirstSelectedItem = NULL; + } else { + // Select row + if (fSelectionMode == B_SINGLE_SELECTION_LIST) + DeselectAll(); + + fTargetRow->fNextSelected = fSelectionListDummyHead.fNextSelected; + fTargetRow->fPrevSelected = &fSelectionListDummyHead; + fTargetRow->fNextSelected->fPrevSelected = fTargetRow; + fTargetRow->fPrevSelected->fNextSelected = fTargetRow; + fFirstSelectedItem = fTargetRow; + } + + Invalidate(BRect(fVisibleRect.left, fTargetRowTop, fVisibleRect.right, + fTargetRowTop + fTargetRow->Height())); + } + + fCurrentState = ROW_CLICKED; + if (fLastSelectedItem != fTargetRow) + reset_click_count = true; + fLastSelectedItem = fTargetRow; + fMasterView->SelectionChanged(); + + } + } + + SetMouseEventMask(B_POINTER_EVENTS, B_LOCK_WINDOW_FOCUS | + B_NO_POINTER_HISTORY); + + } else if (fFocusRow != 0) { + // User clicked in open space, unhighlight focus row. + FindVisibleRect(fFocusRow, &fFocusRowRect); + fFocusRow = 0; + Invalidate(fFocusRowRect); + } + + // We stash the click counts here because the 'clicks' field + // is not in the CurrentMessage() when MouseUp is called... ;( + if (reset_click_count) + fClickCount = 1; + else + Window()->CurrentMessage()->FindInt32("clicks", &fClickCount); + fClickPoint = position; + +} // end of MouseDown() + +void OutlineView::MouseMoved(BPoint position, uint32 /*transit*/, const BMessage */*message*/) +{ + if(!fMouseDown) { + // Update fCurrentField + bool handle_field = false; + BField *new_field = 0; + BRow *new_row = 0; + BColumn *new_column = 0; + BRect new_rect(0,0,0,0); + if(position.y >=0 ) { + float top; + int32 indent; + BRow *row = FindRow(position.y, &indent, &top); + if(row && position.x >=0 ) { + float x=0; + for(int32 c=0;cCountColumns();c++) { + new_column = fMasterView->ColumnAt(c); + if (!new_column->IsVisible()) + continue; + if((MAX(kLeftMargin, fMasterView->LatchWidth())+x)+new_column->Width() > position.x) { + if(new_column->WantsEvents()) { + new_field = row->GetField(c); + new_row = row; + FindRect(new_row,&new_rect); + new_rect.left = MAX(kLeftMargin, fMasterView->LatchWidth()) + x; + new_rect.right = new_rect.left + new_column->Width() - 1; + handle_field = true; + } + break; + } + x += new_column->Width(); + } + } + } + + // Handle mouse moved + if(handle_field) { + if(new_field != fCurrentField) { + if(fCurrentField) { + fCurrentColumn->MouseMoved(fMasterView, fCurrentRow, + fCurrentField, fFieldRect, position, 0, fCurrentCode = B_EXITED_VIEW); + } + fCurrentColumn = new_column; + fCurrentRow = new_row; + fCurrentField = new_field; + fFieldRect = new_rect; + if(fCurrentField) { + fCurrentColumn->MouseMoved(fMasterView, fCurrentRow, + fCurrentField, fFieldRect, position, 0, fCurrentCode = B_ENTERED_VIEW); + } + } else { + if(fCurrentField) { + fCurrentColumn->MouseMoved(fMasterView, fCurrentRow, + fCurrentField, fFieldRect, position, 0, fCurrentCode = B_INSIDE_VIEW); + } + } + } else { + if(fCurrentField) { + fCurrentColumn->MouseMoved(fMasterView, fCurrentRow, + fCurrentField, fFieldRect, position, 0, fCurrentCode = B_EXITED_VIEW); + fCurrentField = 0; + fCurrentColumn = 0; + fCurrentRow = 0; + } + } + } else { + if(fCurrentField) { + if(fFieldRect.Contains(position)) { + if ( fCurrentCode == B_OUTSIDE_VIEW + || fCurrentCode == B_EXITED_VIEW + ) { + fCurrentColumn->MouseMoved(fMasterView, fCurrentRow, + fCurrentField, fFieldRect, position, 1, fCurrentCode = B_ENTERED_VIEW); + } else { + fCurrentColumn->MouseMoved(fMasterView, fCurrentRow, + fCurrentField, fFieldRect, position, 1, fCurrentCode = B_INSIDE_VIEW); + } + } else { + if ( fCurrentCode == B_INSIDE_VIEW + || fCurrentCode == B_ENTERED_VIEW + ) { + fCurrentColumn->MouseMoved(fMasterView, fCurrentRow, + fCurrentField, fFieldRect, position, 1, fCurrentCode = B_EXITED_VIEW); + } else { + fCurrentColumn->MouseMoved(fMasterView, fCurrentRow, + fCurrentField, fFieldRect, position, 1, fCurrentCode = B_OUTSIDE_VIEW); + } + } + } + } + + if(!fEditMode) { + + switch (fCurrentState) { + case LATCH_CLICKED: + if (fTargetRow->fNextSelected != 0) { + if(fEditMode) + SetHighColor(fMasterView->Color(B_COLOR_EDIT_BACKGROUND)); + else + SetHighColor(fMasterView->Color(B_COLOR_SELECTION)); + } + else + SetHighColor(fMasterView->Color(B_COLOR_BACKGROUND)); + + FillRect(fLatchRect); + if (fLatchRect.Contains(position)) + fMasterView->DrawLatch(this, fLatchRect, B_PRESSED_LATCH, fTargetRow); + else + fMasterView->DrawLatch(this, fLatchRect, fTargetRow->fIsExpanded + ? B_OPEN_LATCH : B_CLOSED_LATCH, fTargetRow); + + break; + + + case ROW_CLICKED: + if (abs((int)(position.x - fClickPoint.x)) > kRowDragSensitivity + || abs((int)(position.y - fClickPoint.y)) > kRowDragSensitivity) { + fCurrentState = DRAGGING_ROWS; + fMasterView->InitiateDrag(fClickPoint, fTargetRow->fNextSelected != 0); + } + break; + + case DRAGGING_ROWS: +#if 0 + // falls through... +#else + if (fTrackMouse /*&& message*/) { + if (fVisibleRect.Contains(position)) { + float top; + int32 indent; + BRow *target = FindRow(position.y, &indent, &top); + if(target) + SetFocusRow(target,true); + } + } + break; +#endif + + default: { + + if (fTrackMouse /*&& message*/) { + // Draw a highlight line... + if (fVisibleRect.Contains(position)) { + float top; + int32 indent; + BRow *target = FindRow(position.y, &indent, &top); + if(target==fRollOverRow) + break; + if(fRollOverRow) + { + BRect rect; + FindRect(fRollOverRow, &rect); + Invalidate(rect); + } + fRollOverRow=target; +#if 0 + SetFocusRow(fRollOverRow,false); +#else + PushState(); + SetDrawingMode(B_OP_BLEND); + SetHighColor(255,255,255,255); + BRect rect; + FindRect(fRollOverRow, &rect); + rect.bottom -= 1.0; + FillRect(rect); + PopState(); +#endif + } else { + if(fRollOverRow) + { + BRect rect; + FindRect(fRollOverRow, &rect); + Invalidate(rect); + fRollOverRow = NULL; + } + } + } + } + } + } +} // end of MouseMoved() + +void OutlineView::MouseUp(BPoint position) +{ + if(fCurrentField) { + fCurrentColumn->MouseUp(fMasterView,fCurrentRow,fCurrentField); + fMouseDown = false; + } + + if(!fEditMode) { + switch (fCurrentState) { + case LATCH_CLICKED: + if (fLatchRect.Contains(position)) + fMasterView->ExpandOrCollapse(fTargetRow, !fTargetRow->fIsExpanded); + + Invalidate(fLatchRect); + fCurrentState = INACTIVE; + break; + + case ROW_CLICKED: + if (fClickCount > 1 + && abs((int)fClickPoint.x - (int)position.x) < kDoubleClickMoveSensitivity + && abs((int)fClickPoint.y - (int)position.y) < kDoubleClickMoveSensitivity) { + fMasterView->ItemInvoked(); + } + fCurrentState = INACTIVE; + break; + + case DRAGGING_ROWS: + fCurrentState = INACTIVE; + // Falls through + + default: + if (fDropHighlightY != -1) { + InvertRect(BRect(0, fDropHighlightY - kDropHighlightLineHeight / 2, 1000000, + fDropHighlightY + kDropHighlightLineHeight / 2)); // Erase the old target line + fDropHighlightY = -1; + } + } + } +} // end of MouseUp() + +void OutlineView::MessageReceived(BMessage *message) +{ + if (message->WasDropped()) { + fMasterView->MessageDropped(message, ConvertFromScreen(message->DropPoint())); + } else { + BView::MessageReceived(message); + } +} + +void OutlineView::ChangeFocusRow(bool up, bool updateSelection, bool addToCurrentSelection) +{ + int32 indent; + float top; + float newRowPos = 0; + float verticalScroll = 0; + + if (fFocusRow) { + // A row currently has the focus, get information about it + newRowPos = fFocusRowRect.top + (up ? -4 : fFocusRow->Height() + 4); + if (newRowPos < fVisibleRect.top + 20) + verticalScroll = newRowPos - 20; + else if (newRowPos > fVisibleRect.bottom - 20) + verticalScroll = newRowPos - fVisibleRect.Height() + 20; + } else + newRowPos = fVisibleRect.top + 2; + // no row is currently focused, set this to the top of the window + // so we will select the first visible item in the list. + + BRow *newRow = FindRow(newRowPos, &indent, &top); + if (newRow) { + if (fFocusRow) { + fFocusRowRect.right = 10000; + Invalidate(fFocusRowRect); + } + fFocusRow = newRow; + fFocusRowRect.top = top; + fFocusRowRect.left = 0; + fFocusRowRect.right = 10000; + fFocusRowRect.bottom = fFocusRowRect.top + fFocusRow->Height(); + Invalidate(fFocusRowRect); + + if (updateSelection) { + if (!addToCurrentSelection || fSelectionMode == B_SINGLE_SELECTION_LIST) + DeselectAll(); + + if (fFocusRow->fNextSelected == 0) { + fFocusRow->fNextSelected = fSelectionListDummyHead.fNextSelected; + fFocusRow->fPrevSelected = &fSelectionListDummyHead; + fFocusRow->fNextSelected->fPrevSelected = fFocusRow; + fFocusRow->fPrevSelected->fNextSelected = fFocusRow; + } + + fLastSelectedItem = fFocusRow; + } + } else + Invalidate(fFocusRowRect); + + if (verticalScroll != 0) { + BScrollBar *vScrollBar = ScrollBar(B_VERTICAL); + float min, max; + vScrollBar->GetRange(&min, &max); + if (verticalScroll < min) + verticalScroll = min; + else if (verticalScroll > max) + verticalScroll = max; + + vScrollBar->SetValue(verticalScroll); + } + + if (newRow && updateSelection) + fMasterView->SelectionChanged(); +} + +void OutlineView::MoveFocusToVisibleRect() +{ + fFocusRow = 0; + ChangeFocusRow(true, true, false); +} + +BRow* OutlineView::CurrentSelection(BRow *lastSelected) const +{ + BRow *row; + if (lastSelected == 0) + row = fSelectionListDummyHead.fNextSelected; + else + row = lastSelected->fNextSelected; + + + if (row == &fSelectionListDummyHead) + row = 0; + + return row; +} + +void OutlineView::ToggleFocusRowSelection(bool selectRange) +{ + if (fFocusRow == 0) + return; + + if (selectRange && fSelectionMode == B_MULTIPLE_SELECTION_LIST) + SelectRange(fLastSelectedItem, fFocusRow); + else { + if (fFocusRow->fNextSelected != 0) { + // Unselect row + fFocusRow->fNextSelected->fPrevSelected = fFocusRow->fPrevSelected; + fFocusRow->fPrevSelected->fNextSelected = fFocusRow->fNextSelected; + fFocusRow->fPrevSelected = 0; + fFocusRow->fNextSelected = 0; + } else { + // Select row + if (fSelectionMode == B_SINGLE_SELECTION_LIST) + DeselectAll(); + + fFocusRow->fNextSelected = fSelectionListDummyHead.fNextSelected; + fFocusRow->fPrevSelected = &fSelectionListDummyHead; + fFocusRow->fNextSelected->fPrevSelected = fFocusRow; + fFocusRow->fPrevSelected->fNextSelected = fFocusRow; + } + } + + fLastSelectedItem = fFocusRow; + fMasterView->SelectionChanged(); + Invalidate(fFocusRowRect); +} + +void OutlineView::ToggleFocusRowOpen() +{ + if (fFocusRow) + fMasterView->ExpandOrCollapse(fFocusRow, !fFocusRow->fIsExpanded); +} + + +// xxx Could use CopyBits here to speed things up. +void OutlineView::ExpandOrCollapse(BRow* ParentRow, bool Expand) +{ + if (ParentRow) { + if (ParentRow->fIsExpanded == Expand) + return; + + ParentRow->fIsExpanded = Expand; + + BRect parentRect; + if (FindRect(ParentRow, &parentRect)) { + // Determine my new height + float subTreeHeight = 0.0; + if (ParentRow->fIsExpanded) + for (RecursiveOutlineIterator iterator(ParentRow->fChildList); + iterator.CurrentRow(); + iterator.GoToNext() + ) + { + subTreeHeight += iterator.CurrentRow()->Height()+1; + } + else + for (RecursiveOutlineIterator iterator(ParentRow->fChildList); + iterator.CurrentRow(); + iterator.GoToNext() + ) + { + subTreeHeight -= iterator.CurrentRow()->Height()+1; + } + fItemsHeight += subTreeHeight; + + // Adjust focus row if necessary. + if (FindRect(fFocusRow, &fFocusRowRect) == false) { + // focus row is in a subtree that has collapsed, move it up to the parent. + fFocusRow = ParentRow; + FindRect(fFocusRow, &fFocusRowRect); + } + + Invalidate(BRect(0, parentRect.top, fVisibleRect.right, fVisibleRect.bottom)); + FixScrollBar(false); + } + } +} + +void OutlineView::RemoveRow(BRow *row) +{ + if (row) { + BRow *parentRow; + bool parentIsVisible; + float subTreeHeight = row->Height(); + if (FindParent(row, &parentRow, &parentIsVisible)) { + // adjust height + if (parentIsVisible && (parentRow == 0 || parentRow->fIsExpanded)) { + if (row->fIsExpanded) { + for (RecursiveOutlineIterator iterator(row->fChildList); + iterator.CurrentRow(); iterator.GoToNext()) + subTreeHeight += iterator.CurrentRow()->Height(); + } + } + } + fItemsHeight -= subTreeHeight + 1; + FixScrollBar(false); + + if (parentRow) + parentRow->fChildList->RemoveItem(row); + else + fRows.RemoveItem(row); + + if (parentRow != 0 && parentRow->fChildList->CountItems() == 0) { + delete parentRow->fChildList; + parentRow->fChildList = 0; + if (parentIsVisible) + Invalidate(); // xxx crude way of redrawing latch + } + + if (parentIsVisible && (parentRow == 0 || parentRow->fIsExpanded)) + Invalidate(); // xxx make me smarter. + + + // Adjust focus row if necessary. + if (fFocusRow && FindRect(fFocusRow, &fFocusRowRect) == false) { + // focus row is in a subtree that is gone, move it up to the parent. + fFocusRow = parentRow; + if (fFocusRow) + FindRect(fFocusRow, &fFocusRowRect); + } + + // Remove this from the selection if necessary + if (row->fNextSelected != 0) { + row->fNextSelected->fPrevSelected = row->fPrevSelected; + row->fPrevSelected->fNextSelected = row->fNextSelected; + row->fPrevSelected = 0; + row->fNextSelected = 0; + fMasterView->SelectionChanged(); + } + + fCurrentColumn = 0; + fCurrentRow = 0; + fCurrentField = 0; + } +} + +BRowContainer* OutlineView::RowList() +{ + return &fRows; +} + +void OutlineView::UpdateRow(BRow *row) +{ + if (row) { + // Determine if this row has changed its sort order + BRow *parentRow = NULL; + bool parentIsVisible = false; + FindParent(row, &parentRow, &parentIsVisible); + + BRowContainer* list = (parentRow == NULL) ? &fRows : parentRow->fChildList; + + if(list) { + int32 rowIndex = list->IndexOf(row); + ASSERT(rowIndex >= 0); + ASSERT(list->ItemAt(rowIndex) == row); + + bool rowMoved = false; + if (rowIndex > 0 && CompareRows(list->ItemAt(rowIndex - 1), row) > 0) + rowMoved = true; + + if (rowIndex < list->CountItems() - 1 && CompareRows(list->ItemAt(rowIndex + 1), + row) < 0) + rowMoved = true; + + if (rowMoved) { + // Sort location of this row has changed. + // Remove and re-add in the right spot + SortList(list, parentIsVisible && (parentRow == NULL || parentRow->fIsExpanded)); + } else if (parentIsVisible && (parentRow == NULL || parentRow->fIsExpanded)) { + BRect invalidRect; + if (FindVisibleRect(row, &invalidRect)) + Invalidate(invalidRect); + } + } + } +} + +void OutlineView::AddRow(BRow* Row, int32 Index, BRow* ParentRow) +{ + if(Row) { + Row->fParent = ParentRow; + + if (fMasterView->SortingEnabled()) { + // Ignore index here. + if (ParentRow) { + if (ParentRow->fChildList == 0) + ParentRow->fChildList = new BRowContainer; + + AddSorted(ParentRow->fChildList, Row); + } else + AddSorted(&fRows, Row); + } else { + // Note, a -1 index implies add to end if sorting is not enabled + if (ParentRow) { + if (ParentRow->fChildList == 0) + ParentRow->fChildList = new BRowContainer; + + if (Index < 0 || Index > ParentRow->fChildList->CountItems()) + ParentRow->fChildList->AddItem(Row); + else + ParentRow->fChildList->AddItem(Row, Index); + } else { + if (Index < 0 || Index >= fRows.CountItems()) + fRows.AddItem(Row); + else + fRows.AddItem(Row, Index); + } + } + + if (ParentRow == 0 || ParentRow->fIsExpanded) + fItemsHeight += Row->Height() + 1; + + FixScrollBar(false); + + BRect newRowRect; + bool newRowIsInOpenBranch = FindRect(Row, &newRowRect); + + if (fFocusRow && fFocusRowRect.top > newRowRect.bottom) { + // The focus row has moved. + Invalidate(fFocusRowRect); + FindRect(fFocusRow, &fFocusRowRect); + Invalidate(fFocusRowRect); + } + + if (newRowIsInOpenBranch) { + if (fCurrentState == INACTIVE) { + if (newRowRect.bottom < fVisibleRect.top) { + // The new row is totally above the current viewport, move + // everything down and redraw the first line. + BRect source(fVisibleRect); + BRect dest(fVisibleRect); + source.bottom -= Row->Height() + 1; + dest.top += Row->Height() + 1; + CopyBits(source, dest); + Invalidate(BRect(fVisibleRect.left, fVisibleRect.top, fVisibleRect.right, + fVisibleRect.top + newRowRect.Height())); + } else if (newRowRect.top < fVisibleRect.bottom) { + // New item is somewhere in the current region. Scroll everything + // beneath it down and invalidate just the new row rect. + BRect source(fVisibleRect.left, newRowRect.top, fVisibleRect.right, + fVisibleRect.bottom - newRowRect.Height()); + BRect dest(source); + dest.OffsetBy(0, newRowRect.Height() + 1); + CopyBits(source, dest); + Invalidate(newRowRect); + } // otherwise, this is below the currently visible region + } else { + // Adding the item may have caused the item that the user is currently + // selected to move. This would cause annoying drawing and interaction + // bugs, as the position of that item is cached. If this happens, resize + // the scroll bar, then scroll back so the selected item is in view. + BRect targetRect; + if (FindRect(fTargetRow, &targetRect)) { + float delta = targetRect.top - fTargetRowTop; + if (delta != 0) { + // This causes a jump because ScrollBy will copy a chunk of the view. + // Since the actual contents of the view have been offset, we don't + // want this, we just want to change the virtual origin of the window. + // Constrain the clipping region so everything is clipped out so no + // copy occurs. + // + // xxx this currently doesn't work if the scroll bars aren't enabled. + // everything will still move anyway. A minor annoyance. + BRegion emptyRegion; + ConstrainClippingRegion(&emptyRegion); + PushState(); + ScrollBy(0, delta); + PopState(); + ConstrainClippingRegion(NULL); + + fTargetRowTop += delta; + fClickPoint.y += delta; + fLatchRect.OffsetBy(0, delta); + } + } + } + } + + // If the parent was previously childless, it will need to have a latch drawn. + BRect parentRect; + if (ParentRow && ParentRow->fChildList->CountItems() == 1 + && FindVisibleRect(ParentRow, &parentRect)) + Invalidate(parentRect); + } +} + + +void OutlineView::FixScrollBar(bool scrollToFit) +{ + BScrollBar *vScrollBar = ScrollBar(B_VERTICAL); + if (vScrollBar) { + if (fItemsHeight > fVisibleRect.Height()) { + float maxScrollBarValue = (fItemsHeight + kBottomMargin) - fVisibleRect.Height(); + vScrollBar->SetProportion(fVisibleRect.Height() / (fItemsHeight + kBottomMargin)); + + // If the user is scrolled down too far when makes the range smaller, the list + // will jump suddenly, which is undesirable. In this case, don't fix the scroll + // bar here. In ScrollTo, it checks to see if this has occured, and will + // fix the scroll bars sneakily if the user has scrolled up far enough. + if (scrollToFit || vScrollBar->Value() <= maxScrollBarValue) { + vScrollBar->SetRange(0.0, maxScrollBarValue); + vScrollBar->SetSteps(20.0, fVisibleRect.Height()); + } + } else if (vScrollBar->Value() == 0.0) + vScrollBar->SetRange(0.0, 0.0); // disable scroll bar. + } +} + +void OutlineView::AddSorted(BRowContainer *list, BRow *row) +{ + if (list && row) { + // Find general vicinity with binary search. + int32 lower = 0; + int32 upper = list->CountItems()-1; + while( lower < upper ) { + int32 middle = lower + (upper-lower+1)/2; + int32 cmp = CompareRows(row, list->ItemAt(middle)); + if( cmp < 0 ) upper = middle-1; + else if( cmp > 0 ) lower = middle+1; + else lower = upper = middle; + } + + // At this point, 'upper' and 'lower' at the last found item. + // Arbitrarily use 'upper' and determine the final insertion + // point -- either before or after this item. + if( upper < 0 ) upper = 0; + else if( upper < list->CountItems() ) { + if( CompareRows(row, list->ItemAt(upper)) > 0 ) upper++; + } + + if (upper >= list->CountItems()) + list->AddItem(row); // Adding to end. + else + list->AddItem(row, upper); // Insert + } +} + +int32 OutlineView::CompareRows(BRow *row1, BRow *row2) +{ + if (row1 && row2) { + for (int32 index = 0; index < fSortColumns->CountItems(); index++) { + BColumn *column = (BColumn*) fSortColumns->ItemAt(index); + int comp = 0; + BField *field1 = (BField*) row1->GetField(column->fFieldID); + BField *field2 = (BField*) row2->GetField(column->fFieldID); + if (field1 && field2) + comp = column->CompareFields(field1, field2); + + if (!column->fSortAscending) + comp = -comp; + + if (comp != 0) + return comp; + } + } + return 0; +} + +void OutlineView::FrameResized(float width, float height) +{ + fVisibleRect.right = fVisibleRect.left + width; + fVisibleRect.bottom = fVisibleRect.top + height; + FixScrollBar(true); + _inherited::FrameResized(width, height); +} + +void OutlineView::ScrollTo(BPoint position) +{ + fVisibleRect.OffsetTo(position.x, position.y); + + // In FixScrollBar, we might not have been able to change the size of + // the scroll bar because the user was scrolled down too far. Take + // this opportunity to sneak it in if we can. + BScrollBar *vScrollBar = ScrollBar(B_VERTICAL); + float maxScrollBarValue = (fItemsHeight + kBottomMargin) - fVisibleRect.Height(); + float min, max; + vScrollBar->GetRange(&min, &max); + if (max != maxScrollBarValue && position.y > maxScrollBarValue) + FixScrollBar(true); + + _inherited::ScrollTo(position); +} + +const BRect& OutlineView::VisibleRect() const +{ + return fVisibleRect; +} + + +bool OutlineView::FindVisibleRect(BRow *row, BRect *out_rect) +{ + if (row && out_rect) { + float line = 0.0; + for (RecursiveOutlineIterator iterator(&fRows); iterator.CurrentRow(); + iterator.GoToNext()) { + if (line > fVisibleRect.bottom) + break; + + if (iterator.CurrentRow() == row) { + out_rect->Set(fVisibleRect.left, line, fVisibleRect.right, line + row->Height()); + return true; + } + + line += iterator.CurrentRow()->Height() + 1; + } + } + return false; +} + +bool OutlineView::FindRect(const BRow *row, BRect *out_rect) +{ + float line = 0.0; + for (RecursiveOutlineIterator iterator(&fRows); iterator.CurrentRow(); + iterator.GoToNext()) { + if (iterator.CurrentRow() == row) { + out_rect->Set(fVisibleRect.left, line, fVisibleRect.right, line + row->Height()); + return true; + } + + line += iterator.CurrentRow()->Height() + 1; + } + + return false; +} + + +void OutlineView::ScrollTo(const BRow* Row) +{ + BRect rect; + if( true == FindRect(Row, &rect) ) + { + ScrollTo(BPoint(rect.left, rect.top)); + } +} + + +void OutlineView::DeselectAll() +{ + // Invalidate all selected rows + float line = 0.0; + for (RecursiveOutlineIterator iterator(&fRows); iterator.CurrentRow(); + iterator.GoToNext()) { + if (line > fVisibleRect.bottom) + break; + + BRow *row = iterator.CurrentRow(); + if (line + row->Height() > fVisibleRect.top) { + if (row->fNextSelected != 0) + Invalidate(BRect(fVisibleRect.left, line, fVisibleRect.right, + line + row->Height())); + } + + line += row->Height() + 1; + } + + // Set items not selected + while (fSelectionListDummyHead.fNextSelected != &fSelectionListDummyHead) { + BRow *row = fSelectionListDummyHead.fNextSelected; + row->fNextSelected->fPrevSelected = row->fPrevSelected; + row->fPrevSelected->fNextSelected = row->fNextSelected; + row->fNextSelected = 0; + row->fPrevSelected = 0; + } +} + +BRow* OutlineView::FocusRow() const +{ + return fFocusRow; +} + +void OutlineView::SetFocusRow(BRow* Row, bool Select) +{ + if (Row) + { + if(Select) + AddToSelection(Row); + + if(fFocusRow == Row) + return; + + Invalidate(fFocusRowRect); // invalidate previous + + fTargetRow = fFocusRow = Row; + + FindVisibleRect(fFocusRow, &fFocusRowRect); + Invalidate(fFocusRowRect); // invalidate current + + fFocusRowRect.right = 10000; + fMasterView->SelectionChanged(); + } +} + +bool OutlineView::SortList(BRowContainer *list, bool isVisible) +{ + if (list) { + // Shellsort + BRow **items = (BRow**) list->AsBList()->Items(); + int32 numItems = list->CountItems(); + int h; + for (h = 1; h < numItems / 9; h = 3 * h + 1) + ; + + for (;h > 0; h /= 3) { + for (int step = h; step < numItems; step++) { + BRow *temp = items[step]; + int i; + for (i = step - h; i >= 0; i -= h) { + if (CompareRows(temp, items[i]) < 0) + items[i + h] = items[i]; + else + break; + } + + items[i + h] = temp; + } + } + + if (isVisible) { + Invalidate(); + + InvalidateCachedPositions(); + int lockCount = Window()->CountLocks(); + for (int i = 0; i < lockCount; i++) + Window()->Unlock(); + + while (lockCount--) + if (!Window()->Lock()) + return false; // Window is gone... + } + } + return true; +} + +int32 OutlineView::DeepSortThreadEntry(void *_outlineView) +{ + ((OutlineView*) _outlineView)->DeepSort(); + return 0; +} + +void OutlineView::DeepSort() +{ + struct stack_entry { + bool isVisible; + BRowContainer *list; + int32 listIndex; + } stack[kMaxDepth]; + int32 stackTop = 0; + + stack[stackTop].list = &fRows; + stack[stackTop].isVisible = true; + stack[stackTop].listIndex = 0; + fNumSorted = 0; + + if (Window()->Lock() == false) + return; + + bool doneSorting = false; + while (!doneSorting && !fSortCancelled) { + + stack_entry *currentEntry = &stack[stackTop]; + + // xxx Can make the invalidate area smaller by finding the rect for the + // parent item and using that as the top of the invalid rect. + + bool haveLock = SortList(currentEntry->list, currentEntry->isVisible); + if (!haveLock) + return ; // window is gone. + + // Fix focus rect. + InvalidateCachedPositions(); + if (fCurrentState != INACTIVE) + fCurrentState = INACTIVE; // sorry... + + // next list. + bool foundNextList = false; + while (!foundNextList && !fSortCancelled) { + for (int32 index = currentEntry->listIndex; index < currentEntry->list->CountItems(); + index++) { + BRow *parentRow = currentEntry->list->ItemAt(index); + BRowContainer *childList = parentRow->fChildList; + if (childList != 0) { + currentEntry->listIndex = index + 1; + stackTop++; + ASSERT(stackTop < kMaxDepth); + stack[stackTop].listIndex = 0; + stack[stackTop].list = childList; + stack[stackTop].isVisible = (currentEntry->isVisible && parentRow->fIsExpanded); + foundNextList = true; + break; + } + } + + if (!foundNextList) { + // back up + if (--stackTop < 0) { + doneSorting = true; + break; + } + + currentEntry = &stack[stackTop]; + } + } + } + + Window()->Unlock(); +} + +void OutlineView::StartSorting() +{ + // If this view is not yet attached to a window, don't start a sort thread! + if (Window() == NULL) + return; + + if (fSortThread != B_BAD_THREAD_ID) { + thread_info tinfo; + if (get_thread_info(fSortThread, &tinfo) == B_OK) { + // Unlock window so this won't deadlock (sort thread is probably + // waiting to lock window). + + int lockCount = Window()->CountLocks(); + for (int i = 0; i < lockCount; i++) + Window()->Unlock(); + + fSortCancelled = true; + int32 status; + wait_for_thread(fSortThread, &status); + + while (lockCount--) + if (!Window()->Lock()) + return ; // Window is gone... + } + } + + fSortCancelled = false; + fSortThread = spawn_thread(DeepSortThreadEntry, "sort_thread", B_NORMAL_PRIORITY, this); + resume_thread(fSortThread); +} + +void OutlineView::SelectRange(BRow *start, BRow *end) +{ + if (!start || !end) + return; + + if (start == end) // start is always selected when this is called + return; + + RecursiveOutlineIterator iterator(&fRows, false); + while (iterator.CurrentRow() != 0) { + if (iterator.CurrentRow() == end) { + // reverse selection, swap to fix special case + BRow *temp = start; + start = end; + end = temp; + break; + } else if (iterator.CurrentRow() == start) + break; + + iterator.GoToNext(); + } + + while (true) { + BRow *row = iterator.CurrentRow(); + if(row) { + if (row->fNextSelected == 0) { + row->fNextSelected = fSelectionListDummyHead.fNextSelected; + row->fPrevSelected = &fSelectionListDummyHead; + row->fNextSelected->fPrevSelected = row; + row->fPrevSelected->fNextSelected = row; + } + } else + break; + + if (row == end) + break; + + iterator.GoToNext(); + } + + Invalidate(); // xxx make invalidation smaller +} + +bool OutlineView::FindParent(BRow *row, BRow **outParent, bool *out_parentIsVisible) +{ + bool result = false; + if (row && outParent) { + *outParent = row->fParent; + + // Walk up the parent chain to determine if this row is visible + bool isVisible = true; + for (BRow *currentRow = row->fParent; currentRow; currentRow = currentRow->fParent) { + if (!currentRow->fIsExpanded) { + isVisible = false; + break; + } + } + + if (out_parentIsVisible) *out_parentIsVisible = isVisible; + result = (NULL != *outParent); + } + + return result; +} + +int32 OutlineView::IndexOf(BRow *row) +{ + if (row) { + if (row->fParent == 0) + return fRows.IndexOf(row); + + ASSERT(row->fParent->fChildList); + return row->fParent->fChildList->IndexOf(row); + } + + return B_ERROR; +} + +void OutlineView::InvalidateCachedPositions() +{ + if (fFocusRow) + FindRect(fFocusRow, &fFocusRowRect); +} + +// #pragma mark - + + +RecursiveOutlineIterator::RecursiveOutlineIterator(BRowContainer *list, bool openBranchesOnly) + : fStackIndex(0), + fCurrentListIndex(0), + fCurrentListDepth(0), + fOpenBranchesOnly(openBranchesOnly) +{ + if (list == 0 || list->CountItems() == 0) + fCurrentList = 0; + else + fCurrentList = list; +} + +BRow* RecursiveOutlineIterator::CurrentRow() const +{ + if (fCurrentList == 0) + return 0; + + return fCurrentList->ItemAt(fCurrentListIndex); +} + +void RecursiveOutlineIterator::GoToNext() +{ + if (fCurrentList == 0) + return; + if (fCurrentListIndex < 0 || fCurrentListIndex >= fCurrentList->CountItems()) { + fCurrentList = 0; + return; + } + + BRow *currentRow = fCurrentList->ItemAt(fCurrentListIndex); + if(currentRow) { + if (currentRow->fChildList && (currentRow->fIsExpanded || !fOpenBranchesOnly) + && currentRow->fChildList->CountItems() > 0) { + // Visit child. + // Put current list on the stack if it needs to be revisited. + if (fCurrentListIndex < fCurrentList->CountItems() - 1) { + fStack[fStackIndex].fRowSet = fCurrentList; + fStack[fStackIndex].fIndex = fCurrentListIndex + 1; + fStack[fStackIndex].fDepth = fCurrentListDepth; + fStackIndex++; + } + + fCurrentList = currentRow->fChildList; + fCurrentListIndex = 0; + fCurrentListDepth++; + } else if (fCurrentListIndex < fCurrentList->CountItems() - 1) + fCurrentListIndex++; // next item in current list + else if (--fStackIndex >= 0) { + fCurrentList = fStack[fStackIndex].fRowSet; + fCurrentListIndex = fStack[fStackIndex].fIndex; + fCurrentListDepth = fStack[fStackIndex].fDepth; + } else + fCurrentList = 0; + } +} + +int32 RecursiveOutlineIterator::CurrentLevel() const +{ + return fCurrentListDepth; +} diff --git a/library/libclv/ColumnTypes.cpp b/library/libclv/ColumnTypes.cpp new file mode 100644 index 0000000..efa6c12 --- /dev/null +++ b/library/libclv/ColumnTypes.cpp @@ -0,0 +1,667 @@ +/******************************************************************************* +/ +/ File: ColumnTypes.h +/ +/ Description: Experimental classes that implement particular column/field +/ data types for use in BColumnListView. +/ +/ Copyright 2000+, Be Incorporated, All Rights Reserved +/ +*******************************************************************************/ + +#include "ColumnTypes.h" +#include +#include +#include + +#define kTEXT_MARGIN 8 + + +//===================================================================== + +BTitledColumn::BTitledColumn(const char* title, float width, float minWidth, + float maxWidth, alignment align) + :BColumn(width, minWidth, maxWidth, align), + fTitle(title) +{ + font_height fh; + + be_plain_font->GetHeight(&fh); + fFontHeight = fh.descent + fh.leading; +} + + +//-------------------------------------------------------------------- + +void BTitledColumn::DrawTitle(BRect rect, BView* parent) +{ + float width = rect.Width() - (2 * kTEXT_MARGIN); + BString out_string(fTitle); + + parent->TruncateString(&out_string, B_TRUNCATE_END, width + 2); + DrawString(out_string.String(), parent, rect); +} + + +//-------------------------------------------------------------------- + +void BTitledColumn::GetColumnName(BString* into) const +{ + *into = fTitle; +} + + +//-------------------------------------------------------------------- + +void BTitledColumn::DrawString(const char* string, BView* parent, BRect rect) +{ + float width = rect.Width() - (2 * kTEXT_MARGIN); + float y; + BFont font; + font_height finfo; + + parent->GetFont(&font); + font.GetHeight(&finfo); + y = rect.top + ((rect.Height() - (finfo.ascent + finfo.descent + finfo.leading)) / 2) + + (finfo.ascent + finfo.descent) - 2; + + switch (Alignment()) + { + case B_ALIGN_LEFT: + parent->MovePenTo(rect.left + kTEXT_MARGIN, y); + break; + + case B_ALIGN_CENTER: + parent->MovePenTo(rect.left + kTEXT_MARGIN + ((width - font.StringWidth(string)) / 2), y); + break; + + case B_ALIGN_RIGHT: + parent->MovePenTo(rect.right - kTEXT_MARGIN - font.StringWidth(string), y); + break; + } + parent->DrawString(string); +} + + +//-------------------------------------------------------------------- + +void BTitledColumn::SetTitle(const char* title) +{ + fTitle.SetTo(title); +} + + +//-------------------------------------------------------------------- + +void BTitledColumn::Title(BString* forTitle) const +{ + if (forTitle) + forTitle->SetTo(fTitle.String()); +} + + +//-------------------------------------------------------------------- + +float BTitledColumn::FontHeight() const +{ + return fFontHeight; +} + +// #pragma mark - + +//===================================================================== + +BStringField::BStringField(const char* string) + :fWidth(0), + fString(string), + fClippedString(string) +{ +} + + +//-------------------------------------------------------------------- + +void BStringField::SetString(const char* val) +{ + fString = val; + fClippedString = ""; + fWidth = 0; +} + + +//-------------------------------------------------------------------- + +const char* BStringField::String() const +{ + return fString.String(); +} + + +//-------------------------------------------------------------------- + +void BStringField::SetWidth(float width) +{ + fWidth = width; +} + +//-------------------------------------------------------------------- + +float BStringField::Width() +{ + return fWidth; +} + + +//-------------------------------------------------------------------- + +void BStringField::SetClippedString(const char* val) +{ + fClippedString = val; +} + + +//-------------------------------------------------------------------- + +const char* BStringField::ClippedString() +{ + return fClippedString.String(); +} + +// #pragma mark - + +//===================================================================== + +BStringColumn::BStringColumn(const char* title, float width, float minWidth, + float maxWidth, uint32 truncate, alignment align) + :BTitledColumn(title, width, minWidth, maxWidth, align), + fTruncate(truncate) +{ +} + + +//-------------------------------------------------------------------- + +void BStringColumn::DrawField(BField* _field, BRect rect, BView* parent) +{ + float width = rect.Width() - (2 * kTEXT_MARGIN); + BStringField* field = static_cast(_field); + + if (width != field->Width()) + { + BString out_string(field->String()); + + parent->TruncateString(&out_string, fTruncate, width + 2); + field->SetClippedString(out_string.String()); + field->SetWidth(width); + } + DrawString(field->ClippedString(), parent, rect); +} + + +//-------------------------------------------------------------------- + +int BStringColumn::CompareFields(BField* field1, BField* field2) +{ + return(ICompare(((BStringField*)field1)->String(), + (((BStringField*)field2)->String()))); +} + + +//-------------------------------------------------------------------- + +bool BStringColumn::AcceptsField(const BField *field) const +{ + return static_cast(dynamic_cast(field)); +} + +// #pragma mark - + +//===================================================================== + +BDateField::BDateField(time_t *t) + :fTime(*localtime(t)), + fUnixTime(*t), + fSeconds(0), + fClippedString(""), + fWidth(0) +{ + fSeconds = mktime(&fTime); +} + + +//-------------------------------------------------------------------- + +void BDateField::SetWidth(float width) +{ + fWidth = width; +} + + +//-------------------------------------------------------------------- + +float BDateField::Width() +{ + return fWidth; +} + + +//-------------------------------------------------------------------- + +void BDateField::SetClippedString(const char* val) +{ + fClippedString = val; +} + + +//-------------------------------------------------------------------- + +const char* BDateField::ClippedString() +{ + return fClippedString.String(); +} + + +//-------------------------------------------------------------------- + +time_t BDateField::Seconds() +{ + return fSeconds; +} + + +//-------------------------------------------------------------------- + +time_t BDateField::UnixTime() +{ + return fUnixTime; +} + +// #pragma mark - + +//===================================================================== + +BDateColumn::BDateColumn(const char* title, float width, float minWidth, + float maxWidth, alignment align) + :BTitledColumn(title, width, minWidth, maxWidth, align), + fTitle(title) +{ +} + + +//-------------------------------------------------------------------- + +const char *kTIME_FORMATS[] = { + "%A, %B %d %Y, %I:%M:%S %p", // Monday, July 09 1997, 05:08:15 PM + "%a, %b %d %Y, %I:%M:%S %p", // Mon, Jul 09 1997, 05:08:15 PM + "%a, %b %d %Y, %I:%M %p", // Mon, Jul 09 1997, 05:08 PM + "%b %d %Y, %I:%M %p", // Jul 09 1997, 05:08 PM + "%m/%d/%y, %I:%M %p", // 07/09/97, 05:08 PM + "%m/%d/%y", // 07/09/97 + NULL +}; + +void BDateColumn::DrawField(BField* _field, BRect rect, BView* parent) +{ + float width = rect.Width() - (2 * kTEXT_MARGIN); + BDateField* field = (BDateField*)_field; + + if (field->Width() != rect.Width()) + { + char dateString[256]; + time_t curtime = field->UnixTime(); + tm time_data; + BFont font; + + parent->GetFont(&font); + localtime_r(&curtime, &time_data); + for (int32 index = 0; ; index++) + { + if (!kTIME_FORMATS[index]) + break; + strftime(dateString, 256, kTIME_FORMATS[index], &time_data); + if (font.StringWidth(dateString) <= width) + break; + } + + if (font.StringWidth(dateString) > width) + { + BString out_string(dateString); + + parent->TruncateString(&out_string, B_TRUNCATE_MIDDLE, width + 2); + strcpy(dateString, out_string.String()); + } + field->SetClippedString(dateString); + field->SetWidth(width); + } + + DrawString(field->ClippedString(), parent, rect); +} + + +//-------------------------------------------------------------------- + +int BDateColumn::CompareFields(BField* field1, BField* field2) +{ + return((BDateField*)field1)->Seconds() - ((BDateField*)field2)->Seconds(); +} + +// #pragma mark - + +//===================================================================== + +BSizeField::BSizeField(off_t size) + :fSize(size) +{ +} + + +//-------------------------------------------------------------------- + +void BSizeField::SetSize(off_t size) +{ + fSize = size; +} + + +//-------------------------------------------------------------------- + +off_t BSizeField::Size() +{ + return fSize; +} + +// #pragma mark - + +//===================================================================== + +BSizeColumn::BSizeColumn(const char* title, float width, float minWidth, + float maxWidth, alignment align) + :BTitledColumn(title, width, minWidth, maxWidth, align) +{ +} + + +//-------------------------------------------------------------------- + +const int64 kKB_SIZE = 1024; +const int64 kMB_SIZE = 1048576; +const int64 kGB_SIZE = 1073741824; +const int64 kTB_SIZE = kGB_SIZE * kKB_SIZE; + +const char *kSIZE_FORMATS[] = { + "%.2f %s", + "%.1f %s", + "%.f %s", + "%.f%s", + 0 +}; + +void BSizeColumn::DrawField(BField* _field, BRect rect, BView* parent) +{ + char str[256]; + float width = rect.Width() - (2 * kTEXT_MARGIN); + BFont font; + BString string; + off_t size = ((BSizeField*)_field)->Size(); + + parent->GetFont(&font); + if (size < kKB_SIZE) + { + sprintf(str, "%Ld bytes", size); + if (font.StringWidth(str) > width) + sprintf(str, "%Ld B", size); + } + else + { + const char* suffix; + float float_value; + if (size >= kTB_SIZE) + { + suffix = "TB"; + float_value = (float)size / kTB_SIZE; + } + else if (size >= kGB_SIZE) + { + suffix = "GB"; + float_value = (float)size / kGB_SIZE; + } + else if (size >= kMB_SIZE) + { + suffix = "MB"; + float_value = (float)size / kMB_SIZE; + } + else + { + suffix = "KB"; + float_value = (float)size / kKB_SIZE; + } + + for (int32 index = 0; ; index++) + { + if (!kSIZE_FORMATS[index]) + break; + + sprintf(str, kSIZE_FORMATS[index], float_value, suffix); + // strip off an insignificant zero so we don't get readings + // such as 1.00 + char *period = 0; + char *tmp (NULL); + for (tmp = str; *tmp; tmp++) + { + if (*tmp == '.') + period = tmp; + } + if (period && period[1] && period[2] == '0') + // move the rest of the string over the insignificant zero + for (tmp = &period[2]; *tmp; tmp++) + *tmp = tmp[1]; + if (font.StringWidth(str) <= width) + break; + } + } + + + string = str; + parent->TruncateString(&string, B_TRUNCATE_MIDDLE, width + 2); + DrawString(string.String(), parent, rect); +} + + +//-------------------------------------------------------------------- + +int BSizeColumn::CompareFields(BField* field1, BField* field2) +{ + return ((BSizeField*)field1)->Size() - ((BSizeField*)field2)->Size(); +} + +// #pragma mark - + +//===================================================================== + +BIntegerField::BIntegerField(int32 number) + :fInteger(number) +{ +} + + +//-------------------------------------------------------------------- + +void BIntegerField::SetValue(int32 value) +{ + fInteger = value; +} + + +//-------------------------------------------------------------------- + +int32 BIntegerField::Value() +{ + return fInteger; +} + +// #pragma mark - + +//===================================================================== + +BIntegerColumn::BIntegerColumn(const char* title, float width, float minWidth, + float maxWidth, alignment align) + :BTitledColumn(title, width, minWidth, maxWidth, align) +{ +} + + +//-------------------------------------------------------------------- + +void BIntegerColumn::DrawField(BField *field, BRect rect, BView* parent) +{ + char formatted[256]; + float width = rect.Width() - (2 * kTEXT_MARGIN); + BString string; + + sprintf(formatted, "%d", (int)((BIntegerField*)field)->Value()); + + string = formatted; + parent->TruncateString(&string, B_TRUNCATE_MIDDLE, width + 2); + DrawString(string.String(), parent, rect); +} + + +//-------------------------------------------------------------------- + +int BIntegerColumn::CompareFields(BField *field1, BField *field2) +{ + return (((BIntegerField*)field1)->Value() - ((BIntegerField*)field2)->Value()); +} + +// #pragma mark - + +//===================================================================== + +GraphColumn::GraphColumn(const char* name, float width, float minWidth, + float maxWidth, alignment align) + :BIntegerColumn(name, width, minWidth, maxWidth, align) +{ +} + + +//-------------------------------------------------------------------- + +void GraphColumn::DrawField(BField* field, BRect rect, BView* parent) +{ + int number = ((BIntegerField*)field)->Value(); + + if (number > 100) + number = 100; + else if (number < 0) + number = 0; + + BRect graphRect(rect); + graphRect.InsetBy(5, 3); + parent->StrokeRect(graphRect); + if (number > 0) { + graphRect.InsetBy(1, 1); + float val = graphRect.Width() * (float) number / 100; + graphRect.right = graphRect.left + val; + parent->SetHighColor(0, 0, 190); + parent->FillRect(graphRect); + } + + parent->SetDrawingMode(B_OP_INVERT); + parent->SetHighColor(128, 128, 128); + char numstr[256]; + sprintf(numstr, "%d%%", number); + + float width = be_plain_font->StringWidth(numstr); + parent->MovePenTo(rect.left + rect.Width() / 2 - width / 2, rect.bottom - FontHeight()); + parent->DrawString(numstr); +} + +// #pragma mark - + +//===================================================================== + +BBitmapField::BBitmapField(BBitmap *bitmap) + :fBitmap(bitmap) +{ +} + + +//-------------------------------------------------------------------- + +const BBitmap* BBitmapField::Bitmap() +{ + return fBitmap; +} + +//-------------------------------------------------------------------- + +void BBitmapField::SetBitmap(BBitmap* bitmap) +{ + fBitmap = bitmap; +} + +// #pragma mark - + +//===================================================================== + +BBitmapColumn::BBitmapColumn(const char* title, float width, float minWidth, + float maxWidth, alignment align) + :BTitledColumn(title, width, minWidth, maxWidth, align) +{ +} + + +//-------------------------------------------------------------------- + +void BBitmapColumn::DrawField(BField* field, BRect rect, BView* parent) +{ + BBitmapField *bitmapField = static_cast(field); + const BBitmap *bitmap = bitmapField->Bitmap(); + + if (bitmap != NULL) + { + float x = 0.0; + float y; + BRect r = bitmap->Bounds(); + + y = rect.top + ((rect.Height() - r.Height()) / 2); + + switch (Alignment()) + { + case B_ALIGN_LEFT: + x = rect.left + kTEXT_MARGIN; + break; + + case B_ALIGN_CENTER: + x = rect.left + ((rect.Width() - r.Width()) / 2); + break; + + case B_ALIGN_RIGHT: + x = rect.right - kTEXT_MARGIN - r.Width(); + break; + } + parent->SetDrawingMode(B_OP_ALPHA); + parent->DrawBitmap(bitmap, BPoint(x, y)); + parent->SetDrawingMode(B_OP_OVER); + } +} + + +//-------------------------------------------------------------------- + +int BBitmapColumn::CompareFields(BField* /*field1*/, BField* /*field2*/) +{ + // Comparing bitmaps doesn't really make sense... + return 0; +} + + +//-------------------------------------------------------------------- + +bool +BBitmapColumn::AcceptsField(const BField *field) const +{ + return static_cast(dynamic_cast(field)); +} + + diff --git a/library/libclv/Jamfile b/library/libclv/Jamfile new file mode 100644 index 0000000..3392855 --- /dev/null +++ b/library/libclv/Jamfile @@ -0,0 +1,27 @@ + +SubDir TOP libclv ; + +if $(OSPLAT) = X86 { + C++FLAGS += -Wno-sign-compare -Wno-overloaded-virtual ; +} + + +SAVED_DEFINES = $(DEFINES) ; + +DEFINES = $(SAVED_DEFINES) ; + +SubDirSysHdrs $(TOP)/libclv/include ; +SubDirSysHdrs /boot/home/config/include ; +SubDirSysHdrs /boot/beos/etc/develop/zeta-r1-gcc2-x86/headers/be/locale ; + +LINKFLAGS += -L/boot/home/config/lib ; +LINKFLAGS += -L$(TOP)/libs ; +LINKFLAGS += -L/boot/develop/headers/be ; + +# +StaticLibrary libclv.a : + ColorTools.cpp + ColumnListView.cpp + ColumnTypes.cpp + ; +# diff --git a/library/libclv/ObjectList.h b/library/libclv/ObjectList.h new file mode 100644 index 0000000..bfa1832 --- /dev/null +++ b/library/libclv/ObjectList.h @@ -0,0 +1,866 @@ +/* +Open Tracker License + +Terms and Conditions + +Copyright (c) 1991-2000, Be Incorporated. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice applies to all licensees +and shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of Be Incorporated shall not be +used in advertising or otherwise to promote the sale, use or other dealings in +this Software without prior written authorization from Be Incorporated. + +Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks +of Be Incorporated in the United States and other countries. Other brand product +names are registered trademarks or trademarks of their respective holders. +All rights reserved. +*/ + +/**************************************************************************** +** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ** +** ** +** DANGER, WILL ROBINSON! ** +** ** +** The interfaces contained here are part of BeOS's ** +** ** +** >> PRIVATE NOT FOR PUBLIC USE << ** +** ** +** implementation. ** +** ** +** These interfaces WILL CHANGE in future releases. ** +** If you use them, your app WILL BREAK at some future time. ** +** ** +** (And yes, this does mean that binaries built from OpenTracker will not ** +** be compatible with some future releases of the OS. When that happens, ** +** we will provide an updated version of this file to keep compatibility.) ** +** ** +** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ** +****************************************************************************/ + +// +// ObjectList is a wrapper around BList that adds type safety, +// optional object ownership, search, insert operations, etc. +// + +#ifndef __OBJECT_LIST__ +#define __OBJECT_LIST__ + +#ifndef _BE_H +#include +#endif + +#include + + +template class BObjectList; + +template +struct UnaryPredicate { + + virtual int operator()(const T *) const + // virtual could be avoided here if FindBinaryInsertionIndex, + // etc. were member template functions + { return 0; } + +private: + static int _unary_predicate_glue(const void *item, void *context); + +friend class BObjectList; +}; + +template +int +UnaryPredicate::_unary_predicate_glue(const void *item, void *context) +{ + return ((UnaryPredicate *)context)->operator()((const T *)item); +} + + +class _PointerList_ : public BList { +public: + _PointerList_(const _PointerList_ &list); + _PointerList_(int32 itemsPerBlock = 20, bool owning = false); + ~_PointerList_(); + + typedef void *(* GenericEachFunction)(void *, void *); + typedef int (* GenericCompareFunction)(const void *, const void *); + typedef int (* GenericCompareFunctionWithState)(const void *, const void *, + void *); + typedef int (* UnaryPredicateGlue)(const void *, void *); + + void *EachElement(GenericEachFunction, void *); + void SortItems(GenericCompareFunction); + void SortItems(GenericCompareFunctionWithState, void *state); + void HSortItems(GenericCompareFunction); + void HSortItems(GenericCompareFunctionWithState, void *state); + + void *BinarySearch(const void *, GenericCompareFunction) const; + void *BinarySearch(const void *, GenericCompareFunctionWithState, void *state) const; + + int32 BinarySearchIndex(const void *, GenericCompareFunction) const; + int32 BinarySearchIndex(const void *, GenericCompareFunctionWithState, void *state) const; + int32 BinarySearchIndexByPredicate(const void *, UnaryPredicateGlue) const; + + bool Owning() const; + bool ReplaceItem(int32, void *); + +protected: + bool owning; + +}; + +template +class BObjectList : private _PointerList_ { +public: + + // iteration and sorting + typedef T *(* EachFunction)(T *, void *); + typedef const T *(* ConstEachFunction)(const T *, void *); + typedef int (* CompareFunction)(const T *, const T *); + typedef int (* CompareFunctionWithState)(const T *, const T *, void *state); + + BObjectList(int32 itemsPerBlock = 20, bool owning = false); + BObjectList(const BObjectList &list); + // clones list; if list is owning, makes copies of all + // the items + + virtual ~BObjectList(); + + BObjectList &operator=(const BObjectList &list); + // clones list; if list is owning, makes copies of all + // the items + + // adding and removing + // ToDo: + // change Add calls to return const item + bool AddItem(T *); + bool AddItem(T *, int32); + bool AddList(BObjectList *); + bool AddList(BObjectList *, int32); + + bool RemoveItem(T *, bool deleteIfOwning = true); + // if owning, deletes the removed item + T *RemoveItemAt(int32); + // returns the removed item + + void MakeEmpty(bool deleteIfOwning = true); + + // item access + T *ItemAt(int32) const; + + bool ReplaceItem(int32 index, T *); + // if list is owning, deletes the item at first + T *SwapWithItem(int32 index, T *newItem); + // same as ReplaceItem, except does not delete old item at , + // returns it instead + + T *FirstItem() const; + T *LastItem() const; + + // misc. getters + int32 IndexOf(const T *) const; + bool HasItem(const T *) const; + bool IsEmpty() const; + int32 CountItems() const; + + T *EachElement(EachFunction, void *); + const T *EachElement(ConstEachFunction, void *) const; + + void SortItems(CompareFunction); + void SortItems(CompareFunctionWithState, void *state); + void HSortItems(CompareFunction); + void HSortItems(CompareFunctionWithState, void *state); + + // linear search, returns first item that matches predicate + const T *FindIf(const UnaryPredicate &) const; + T *FindIf(const UnaryPredicate &); + + // list must be sorted with CompareFunction for these to work + T *BinarySearch(const T &, CompareFunction) const; + T *BinarySearch(const T &, CompareFunctionWithState, void *state) const; + + template + T *BinarySearchByKey(const Key &key, int (*compare)(const Key *, const T *)) + const; + + template + T *BinarySearchByKey(const Key &key, + int (*compare)(const Key *, const T *, void *), void *state) const; + + int32 BinarySearchIndex(const T &item, CompareFunction compare) const; + int32 BinarySearchIndex(const T &item, CompareFunctionWithState compare, + void *state) const; + + template + int32 BinarySearchIndexByKey(const Key &key, + int (*compare)(const Key *, const T *)) const; + + // Binary insertion - list must be sorted with CompareFunction for + // these to work + + // simple insert + bool BinaryInsert(T *, CompareFunction); + bool BinaryInsert(T *, CompareFunctionWithState, void *state); + bool BinaryInsert(T *, const UnaryPredicate &); + + // unique insert, returns false if item already in list + bool BinaryInsertUnique(T *, CompareFunction); + bool BinaryInsertUnique(T *, CompareFunctionWithState, void *state); + bool BinaryInsertUnique(T *, const UnaryPredicate &); + + // insert a copy of the item, returns new inserted item + T *BinaryInsertCopy(const T ©This, CompareFunction); + T *BinaryInsertCopy(const T ©This, CompareFunctionWithState, void *state); + + // insert a copy of the item if not in list already + // returns new inserted item or existing item in case of a conflict + T *BinaryInsertCopyUnique(const T ©This, CompareFunction); + T *BinaryInsertCopyUnique(const T ©This, CompareFunctionWithState, void *state); + + int32 FindBinaryInsertionIndex(const UnaryPredicate &, bool *alreadyInList = 0) const; + // returns either the index into which a new item should be inserted + // or index of an existing item that matches the predicate + + // deprecated API, will go away + BList *AsBList() + { return this; } + const BList *AsBList() const + { return this; } +private: + void SetItem(int32, T *); +}; + +template +Result +WhileEachListItem(BObjectList *list, Result (Item::*func)(Param1), Param1 p1) +{ + Result result = 0; + int32 count = list->CountItems(); + + for (int32 index = 0; index < count; index++) + if ((result = (list->ItemAt(index)->*func)(p1)) != 0) + break; + + return result; +} + +template +Result +WhileEachListItem(BObjectList *list, Result (*func)(Item *, Param1), Param1 p1) +{ + Result result = 0; + int32 count = list->CountItems(); + + for (int32 index = 0; index < count; index++) + if ((result = (*func)(list->ItemAt(index), p1)) != 0) + break; + + return result; +} + +template +Result +WhileEachListItem(BObjectList *list, Result (Item::*func)(Param1, Param2), + Param1 p1, Param2 p2) +{ + Result result = 0; + int32 count = list->CountItems(); + + for (int32 index = 0; index < count; index++) + if ((result = (list->ItemAt(index)->*func)(p1, p2)) != 0) + break; + + return result; +} + +template +Result +WhileEachListItem(BObjectList *list, Result (*func)(Item *, Param1, Param2), + Param1 p1, Param2 p2) +{ + Result result = 0; + int32 count = list->CountItems(); + + for (int32 index = 0; index < count; index++) + if ((result = (*func)(list->ItemAt(index), p1, p2)) != 0) + break; + + return result; +} + +template +Result +WhileEachListItem(BObjectList *list, Result (*func)(Item *, Param1, Param2, + Param3, Param4), Param1 p1, Param2 p2, Param3 p3, Param4 p4) +{ + Result result = 0; + int32 count = list->CountItems(); + + for (int32 index = 0; index < count; index++) + if ((result = (*func)(list->ItemAt(index), p1, p2, p3, p4)) != 0) + break; + + return result; +} + +template +void +EachListItemIgnoreResult(BObjectList *list, Result (Item::*func)()) +{ + int32 count = list->CountItems(); + for (int32 index = 0; index < count; index++) + (list->ItemAt(index)->*func)(); +} + +template +void +EachListItem(BObjectList *list, void (*func)(Item *, Param1), Param1 p1) +{ + int32 count = list->CountItems(); + for (int32 index = 0; index < count; index++) + (func)(list->ItemAt(index), p1); +} + +template +void +EachListItem(BObjectList *list, void (Item::*func)(Param1, Param2), + Param1 p1, Param2 p2) +{ + int32 count = list->CountItems(); + for (int32 index = 0; index < count; index++) + (list->ItemAt(index)->*func)(p1, p2); +} + +template +void +EachListItem(BObjectList *list, void (*func)(Item *,Param1, Param2), + Param1 p1, Param2 p2) +{ + int32 count = list->CountItems(); + for (int32 index = 0; index < count; index++) + (func)(list->ItemAt(index), p1, p2); +} + +template +void +EachListItem(BObjectList *list, void (*func)(Item *,Param1, Param2, + Param3), Param1 p1, Param2 p2, Param3 p3) +{ + int32 count = list->CountItems(); + for (int32 index = 0; index < count; index++) + (func)(list->ItemAt(index), p1, p2, p3); +} + + +template +void +EachListItem(BObjectList *list, void (*func)(Item *,Param1, Param2, + Param3, Param4), Param1 p1, Param2 p2, Param3 p3, Param4 p4) +{ + int32 count = list->CountItems(); + for (int32 index = 0; index < count; index++) + (func)(list->ItemAt(index), p1, p2, p3, p4); +} + +// inline code + +inline bool +_PointerList_::Owning() const +{ + return owning; +} + +template +BObjectList::BObjectList(int32 itemsPerBlock, bool owning) + : _PointerList_(itemsPerBlock, owning) +{ +} + +template +BObjectList::BObjectList(const BObjectList &list) + : _PointerList_(list) +{ + owning = list.owning; + if (owning) { + // make our own copies in an owning list + int32 count = list.CountItems(); + for (int32 index = 0; index < count; index++) { + T *item = list.ItemAt(index); + if (item) + item = new T(*item); + SetItem(index, item); + } + } +} + +template +BObjectList::~BObjectList() +{ + if (Owning()) + // have to nuke elements first + MakeEmpty(); +} + +template +BObjectList & +BObjectList::operator=(const BObjectList &list) +{ + owning = list.owning; + BObjectList &result = (BObjectList &)_PointerList_::operator=(list); + if (owning) { + // make our own copies in an owning list + int32 count = list.CountItems(); + for (int32 index = 0; index < count; index++) { + T *item = list.ItemAt(index); + if (item) + item = new T(*item); + SetItem(index, item); + } + } + return result; +} + +template +bool +BObjectList::AddItem(T *item) +{ + // need to cast to void * to make T work for const pointers + return _PointerList_::AddItem((void *)item); +} + +template +bool +BObjectList::AddItem(T *item, int32 atIndex) +{ + return _PointerList_::AddItem((void *)item, atIndex); +} + +template +bool +BObjectList::AddList(BObjectList *newItems) +{ + return _PointerList_::AddList(newItems); +} + +template +bool +BObjectList::AddList(BObjectList *newItems, int32 atIndex) +{ + return _PointerList_::AddList(newItems, atIndex); +} + + +template +bool +BObjectList::RemoveItem(T *item, bool deleteIfOwning) +{ + bool result = _PointerList_::RemoveItem((void *)item); + + if (result && Owning() && deleteIfOwning) + delete item; + + return result; +} + +template +T * +BObjectList::RemoveItemAt(int32 index) +{ + return (T *)_PointerList_::RemoveItem(index); +} + +template +inline T * +BObjectList::ItemAt(int32 index) const +{ + return (T *)_PointerList_::ItemAt(index); +} + +template +bool +BObjectList::ReplaceItem(int32 index, T *item) +{ + if (owning) + delete ItemAt(index); + return _PointerList_::ReplaceItem(index, (void *)item); +} + +template +T * +BObjectList::SwapWithItem(int32 index, T *newItem) +{ + T *result = ItemAt(index); + _PointerList_::ReplaceItem(index, (void *)newItem); + return result; +} + +template +void +BObjectList::SetItem(int32 index, T *newItem) +{ + _PointerList_::ReplaceItem(index, (void *)newItem); +} + +template +int32 +BObjectList::IndexOf(const T *item) const +{ + return _PointerList_::IndexOf((void *)item); +} + +template +T * +BObjectList::FirstItem() const +{ + return (T *)_PointerList_::FirstItem(); +} + +template +T * +BObjectList::LastItem() const +{ + return (T *)_PointerList_::LastItem(); +} + +template +bool +BObjectList::HasItem(const T *item) const +{ + return _PointerList_::HasItem((void *)item); +} + +template +bool +BObjectList::IsEmpty() const +{ + return _PointerList_::IsEmpty(); +} + +template +int32 +BObjectList::CountItems() const +{ + return _PointerList_::CountItems(); +} + +template +void +BObjectList::MakeEmpty(bool deleteIfOwning) +{ + if (owning && deleteIfOwning) { + int32 count = CountItems(); + for (int32 index = 0; index < count; index++) + delete ItemAt(index); + } + _PointerList_::MakeEmpty(); +} + +template +T * +BObjectList::EachElement(EachFunction func, void *params) +{ + return (T *)_PointerList_::EachElement((GenericEachFunction)func, params); +} + + +template +const T * +BObjectList::EachElement(ConstEachFunction func, void *params) const +{ + return (const T *) + const_cast *>(this)->_PointerList_::EachElement( + (GenericEachFunction)func, params); +} + +template +const T * +BObjectList::FindIf(const UnaryPredicate &predicate) const +{ + int32 count = CountItems(); + for (int32 index = 0; index < count; index++) + if (predicate.operator()(ItemAt(index)) == 0) + return ItemAt(index); + return 0; +} + +template +T * +BObjectList::FindIf(const UnaryPredicate &predicate) +{ + int32 count = CountItems(); + for (int32 index = 0; index < count; index++) + if (predicate.operator()(ItemAt(index)) == 0) + return ItemAt(index); + return 0; +} + + +template +void +BObjectList::SortItems(CompareFunction function) +{ + _PointerList_::SortItems((GenericCompareFunction)function); +} + +template +void +BObjectList::SortItems(CompareFunctionWithState function, void *state) +{ + _PointerList_::SortItems((GenericCompareFunctionWithState)function, state); +} + +template +void +BObjectList::HSortItems(CompareFunction function) +{ + _PointerList_::HSortItems((GenericCompareFunction)function); +} + +template +void +BObjectList::HSortItems(CompareFunctionWithState function, void *state) +{ + _PointerList_::HSortItems((GenericCompareFunctionWithState)function, state); +} + +template +T * +BObjectList::BinarySearch(const T &key, CompareFunction func) const +{ + return (T*)_PointerList_::BinarySearch(&key, + (GenericCompareFunction)func); +} + +template +T * +BObjectList::BinarySearch(const T &key, CompareFunctionWithState func, void *state) const +{ + return (T*)_PointerList_::BinarySearch(&key, + (GenericCompareFunctionWithState)func, state); +} + + +template +template +T * +BObjectList::BinarySearchByKey(const Key &key, + int (*compare)(const Key *, const T *)) const +{ + return (T*)_PointerList_::BinarySearch(&key, + (GenericCompareFunction)compare); +} + + +template +template +T * +BObjectList::BinarySearchByKey(const Key &key, + int (*compare)(const Key *, const T *, void *), void *state) const +{ + return (T*)_PointerList_::BinarySearch(&key, + (GenericCompareFunctionWithState)compare, state); +} + + +template +int32 +BObjectList::BinarySearchIndex(const T &item, CompareFunction compare) const +{ + return _PointerList_::BinarySearchIndex(&item, + (GenericCompareFunction)compare); +} + + +template +int32 +BObjectList::BinarySearchIndex(const T &item, + CompareFunctionWithState compare, void *state) const +{ + return _PointerList_::BinarySearchIndex(&item, + (GenericCompareFunctionWithState)compare, state); +} + + +template +template +int32 +BObjectList::BinarySearchIndexByKey(const Key &key, + int (*compare)(const Key *, const T *)) const +{ + return _PointerList_::BinarySearchIndex(&key, + (GenericCompareFunction)compare); +} + + +template +bool +BObjectList::BinaryInsert(T *item, CompareFunction func) +{ + int32 index = _PointerList_::BinarySearchIndex(item, + (GenericCompareFunction)func); + if (index >= 0) { + // already in list, add after existing + return AddItem(item, index + 1); + } + + return AddItem(item, -index - 1); +} + +template +bool +BObjectList::BinaryInsert(T *item, CompareFunctionWithState func, void *state) +{ + int32 index = _PointerList_::BinarySearchIndex(item, + (GenericCompareFunctionWithState)func, state); + if (index >= 0) { + // already in list, add after existing + return AddItem(item, index + 1); + } + + return AddItem(item, -index - 1); +} + +template +bool +BObjectList::BinaryInsertUnique(T *item, CompareFunction func) +{ + int32 index = _PointerList_::BinarySearchIndex(item, + (GenericCompareFunction)func); + if (index >= 0) + return false; + + return AddItem(item, -index - 1); +} + +template +bool +BObjectList::BinaryInsertUnique(T *item, CompareFunctionWithState func, void *state) +{ + int32 index = _PointerList_::BinarySearchIndex(item, + (GenericCompareFunctionWithState)func, state); + if (index >= 0) + return false; + + return AddItem(item, -index - 1); +} + + +template +T * +BObjectList::BinaryInsertCopy(const T ©This, CompareFunction func) +{ + int32 index = _PointerList_::BinarySearchIndex(©This, + (GenericCompareFunction)func); + + if (index >= 0) + index++; + else + index = -index - 1; + + T *newItem = new T(copyThis); + AddItem(newItem, index); + return newItem; +} + +template +T * +BObjectList::BinaryInsertCopy(const T ©This, CompareFunctionWithState func, void *state) +{ + int32 index = _PointerList_::BinarySearchIndex(©This, + (GenericCompareFunctionWithState)func, state); + + if (index >= 0) + index++; + else + index = -index - 1; + + T *newItem = new T(copyThis); + AddItem(newItem, index); + return newItem; +} + +template +T * +BObjectList::BinaryInsertCopyUnique(const T ©This, CompareFunction func) +{ + int32 index = _PointerList_::BinarySearchIndex(©This, + (GenericCompareFunction)func); + if (index >= 0) + return ItemAt(index); + + index = -index - 1; + T *newItem = new T(copyThis); + AddItem(newItem, index); + return newItem; +} + +template +T * +BObjectList::BinaryInsertCopyUnique(const T ©This, CompareFunctionWithState func, + void *state) +{ + int32 index = _PointerList_::BinarySearchIndex(©This, + (GenericCompareFunctionWithState)func, state); + if (index >= 0) + return ItemAt(index); + + index = -index - 1; + T *newItem = new T(copyThis); + AddItem(newItem, index); + return newItem; +} + +template +int32 +BObjectList::FindBinaryInsertionIndex(const UnaryPredicate &pred, bool *alreadyInList) + const +{ + int32 index = _PointerList_::BinarySearchIndexByPredicate(&pred, + (UnaryPredicateGlue)&UnaryPredicate::_unary_predicate_glue); + + if (alreadyInList) + *alreadyInList = index >= 0; + + if (index < 0) + index = -index - 1; + + return index; +} + +template +bool +BObjectList::BinaryInsert(T *item, const UnaryPredicate &pred) +{ + return AddItem(item, FindBinaryInsertionIndex(pred)); +} + +template +bool +BObjectList::BinaryInsertUnique(T *item, const UnaryPredicate &pred) +{ + bool alreadyInList; + int32 index = FindBinaryInsertionIndex(pred, &alreadyInList); + if (alreadyInList) + return false; + + AddItem(item, index); + return true; +} + +#endif /* __OBJECT_LIST__ */ diff --git a/library/libclv/include/ColorTools.h b/library/libclv/include/ColorTools.h new file mode 100644 index 0000000..ad23154 --- /dev/null +++ b/library/libclv/include/ColorTools.h @@ -0,0 +1,69 @@ +/******************************************************************************* +/ +/ File: ColorTools.h +/ +/ Description: Additional experimental color manipulation functions. +/ +/ Copyright 2000, Be Incorporated, All Rights Reserved +/ +*******************************************************************************/ + + +#ifndef _COLOR_TOOLS_H +#define _COLOR_TOOLS_H + +#include + +#if B_BEOS_VERSION <= B_BEOS_VERSION_MAUI + +namespace BExperimental { + +// Comparison operators. + +inline bool operator==(const rgb_color c1, const rgb_color c2) +{ + return (*((uint32*)&c1)) == (*((uint32*)&c2)); +} + +inline bool operator!=(const rgb_color c1, const rgb_color c2) +{ + return (*((uint32*)&c1)) != (*((uint32*)&c2)); +} + +// Color creation. +/* +inline rgb_color make_color(uint8 red, uint8 green, uint8 blue, uint8 alpha=255) +{ + rgb_color c; + c.red = red; + c.green = green; + c.blue = blue; + c.alpha = alpha; + return c; +}*/ + +// Mix two colors together, ignoring their relative alpha channels. +// If amount is 0, the result is color1; if 255, the result is color2; +// if another value, it is somewhere in-between. The resulting alpha +// channel is mixed exactly like the other color channels. +rgb_color mix_color(rgb_color color1, rgb_color color2, uint8 amount); + +// Blend two colors together, weighting by their relative alpha channels. +// The resulting color is the same as mix_color(), except that the amount +// used from color1 and color2's color channels is dependent on that color's +// alpha channel. For example, if color1.alpha is 0 and color2.alpha is +// 255, the resulting red, green, and blue values will be the same as those +// in color2, regardless of 'amount'. +rgb_color blend_color(rgb_color color1, rgb_color color2, uint8 amount); + +// Return a color that is the disabled representation of 'color' when drawn +// on a solid color 'background'. +rgb_color disable_color(rgb_color color, rgb_color background); + +} // namespace BExperimental + +using namespace BExperimental; + +#endif + +#endif diff --git a/library/libclv/include/ColumnListView.h b/library/libclv/include/ColumnListView.h new file mode 100644 index 0000000..6df9d99 --- /dev/null +++ b/library/libclv/include/ColumnListView.h @@ -0,0 +1,343 @@ +/******************************************************************************* +/ +/ File: ColumnListView.h +/ +/ Description: Experimental multi-column list view. +/ +/ Copyright 2000+, Be Incorporated, All Rights Reserved +/ +*******************************************************************************/ + + +#ifndef _COLUMN_LIST_VIEW_H +#define _COLUMN_LIST_VIEW_H + +#include +#include +#include +#include +#include + +class BScrollBar; + +namespace BPrivate { + +class OutlineView; +class TitleView; +class BRowContainer; +class RecursiveOutlineIterator; + +} // ns BPrivate + +class BField; +class BRow; +class BColumn; +class BColumnListView; + +enum LatchType { + B_NO_LATCH, + B_OPEN_LATCH, + B_PRESSED_LATCH, + B_CLOSED_LATCH +}; + +typedef enum { + B_ALLOW_COLUMN_NONE = 0, + B_ALLOW_COLUMN_MOVE = 1, + B_ALLOW_COLUMN_RESIZE = 2, + B_ALLOW_COLUMN_POPUP = 4, + B_ALLOW_COLUMN_REMOVE = 8, +} column_flags; + +enum ColumnListViewColor { + B_COLOR_BACKGROUND = 0, + B_COLOR_TEXT = 1, + B_COLOR_ROW_DIVIDER = 2, + B_COLOR_SELECTION = 3, + B_COLOR_SELECTION_TEXT = 4, + B_COLOR_NON_FOCUS_SELECTION = 5, + B_COLOR_EDIT_BACKGROUND = 6, + B_COLOR_EDIT_TEXT = 7, + B_COLOR_HEADER_BACKGROUND = 8, + B_COLOR_HEADER_TEXT = 9, + B_COLOR_SEPARATOR_LINE = 10, + B_COLOR_SEPARATOR_BORDER = 11, + + B_COLOR_TOTAL = 12 +}; + +enum ColumnListViewFont { + B_FONT_ROW = 0, + B_FONT_HEADER = 1, + + B_FONT_TOTAL = 2 +}; + + +// A single row/column intersection in the list. +class BField { +public: + BField(); + virtual ~BField(); +}; + +// A single line in the list. Each line contains a BField object +// for each column in the list, associated by their "logical field" +// index. Hierarchies are formed by adding other BRow objects as +// a parent of a row, using the AddRow() function in BColumnListView(). +class BRow { +public: + BRow(float height = 16.0); + virtual ~BRow(); + virtual bool HasLatch() const; + + int32 CountFields() const; + BField* GetField(int32 logicalFieldIndex); + const BField* GetField(int32 logicalFieldIndex) const; + void SetField(BField* field, int32 logicalFieldIndex); + + float Height() const; + void SetHeight(float h){fHeight=h;}; + bool IsExpanded() const; + + virtual void DrawBackground( + BRect /*_rect*/, + BView* /*_target_view*/, + bool /*_is_selected*/, + bool /*_is_focus */){} +private: + // Blows up into the debugger if the validation fails. + void ValidateFields() const; + void ValidateField(const BField *field, int32 logicalFieldIndex) const; +private: + BList fFields; + BPrivate:: + BRowContainer* fChildList; + bool fIsExpanded; + float fHeight; + BRow* fNextSelected; + BRow* fPrevSelected; + BRow* fParent; +protected: + BColumnListView* fList; +private: + + friend class BColumnListView; + friend class BPrivate::RecursiveOutlineIterator; + friend class BPrivate::OutlineView; +}; + +// Information about a single column in the list. A column knows +// how to display the BField objects that occur at its location in +// each of the list's rows. See ColumnTypes.h for particular +// subclasses of BField and BColumn that handle common data types. +class BColumn +{ +public: + BColumn(float width, + float minWidth, + float maxWidth, + alignment align = B_ALIGN_LEFT); + virtual ~BColumn(); + + float Width() const; + void SetWidth(float width); + float MinWidth() const; + float MaxWidth() const; + + virtual void DrawTitle(BRect rect, BView *targetView); + virtual void DrawField(BField *field, BRect rect, BView *targetView); + virtual int CompareFields(BField *field1, BField *field2); + + virtual void MouseMoved(BColumnListView *parent, BRow *row, BField *field, + BRect field_rect, BPoint point, uint32 buttons, int32 code); + virtual void MouseDown(BColumnListView *parent, BRow *row, BField *field, + BRect field_rect, BPoint point, uint32 buttons); + virtual void MouseUp(BColumnListView *parent, BRow *row, BField *field); + + virtual void GetColumnName(BString* into) const; + + bool IsVisible() const; + void SetVisible(bool); + + bool WantsEvents() const; + void SetWantsEvents(bool); + + bool ShowHeading() const; + void SetShowHeading(bool); + + alignment Alignment() const; + void SetAlignment(alignment); + + int32 LogicalFieldNum() const; + + /*! + \param field The BField derivative to validate. + + Implement this function on your BColumn derivatives to validate BField derivatives + that your BColumn will be drawing/manipulating. + + This function will be called when BFields are added to the Column, use dynamic_cast<> to + determine if it is of a kind that your BColumn know how ot handle. return false if it is not. + + \note The debugger will be called if you return false from here with information about + what type of BField and BColumn and the logical field index where it occured. + + \note Do not call the inherited version of this, it just returns true; + */ + virtual bool AcceptsField(const BField* field) const; + +private: + float fWidth; + float fMinWidth; + float fMaxWidth; + bool fVisible; + int32 fFieldID; + BColumnListView *fList; + bool fSortAscending; + bool fWantsEvents; + bool fShowHeading; + alignment fAlignment; + + friend class BPrivate::OutlineView; + friend class BColumnListView; + friend class BPrivate::TitleView; +}; + +// The column list view class. +class BColumnListView : public BView, public BInvoker +{ +public: + BColumnListView(BRect rect, + const char *name, + uint32 resizingMode, + uint32 drawFlags, + border_style = B_NO_BORDER, + bool showHorizontalScrollbar = true); + virtual ~BColumnListView(); + + // Interaction + virtual bool InitiateDrag(BPoint, bool wasSelected); + virtual void MessageDropped(BMessage*, BPoint point); + virtual void ExpandOrCollapse(BRow *row, bool expand); + virtual status_t Invoke(BMessage *message = NULL); + virtual void ItemInvoked(); + virtual void SetInvocationMessage(BMessage*); + BMessage* InvocationMessage() const; + uint32 InvocationCommand() const; + BRow* FocusRow() const; + void SetFocusRow(int32 index, bool select=false); + void SetFocusRow(BRow *row, bool select=false); + void SetMouseTrackingEnabled(bool); + + // Selection + list_view_type SelectionMode() const; + void Deselect(BRow *row); + void AddToSelection(BRow *row); + void DeselectAll(); + BRow* CurrentSelection(BRow *lastSelected = 0) const; + virtual void SelectionChanged(); + virtual void SetSelectionMessage(BMessage *); + BMessage* SelectionMessage(); + uint32 SelectionCommand() const; + void SetSelectionMode(list_view_type); // list_view_type is defined in ListView.h. + + // Sorting + void SetSortingEnabled(bool); + bool SortingEnabled() const; + void SetSortColumn(BColumn *column, bool add, bool ascending); + void ClearSortColumns(); + + // The status view is a little area in the lower left hand corner. + void AddStatusView(BView *view); + BView* RemoveStatusView(); + + // Column Manipulation + void AddColumn(BColumn*, int32 logicalFieldIndex); + void MoveColumn(BColumn*, int32 index); + void RemoveColumn(BColumn*); + int32 CountColumns() const; + BColumn* ColumnAt(int32 index) const; + void SetColumnVisible(BColumn*, bool isVisible); + void SetColumnVisible(int32, bool); + bool IsColumnVisible(int32) const; + void SetColumnFlags(column_flags flags); + + // Row manipulation + const BRow* RowAt(int32 index, BRow *parent = 0) const; + BRow* RowAt(int32 index, BRow *parent = 0); + const BRow* RowAt(BPoint) const; + BRow* RowAt(BPoint); + bool GetRowRect(const BRow *row, BRect *outRect) const; + bool FindParent(BRow *row, BRow **outs_parent, bool *out_isVisible) const; + int32 IndexOf(BRow *row); + int32 CountRows(BRow *parent = 0) const; + void AddRow(BRow*, BRow *parent = 0); + void AddRow(BRow*, int32 index, BRow *parent = 0); + + void ScrollTo(const BRow* Row); + + // Does not delete row or children at this time. + // todo: Make delete row and children + void RemoveRow(BRow*); + + void UpdateRow(BRow*); + void Clear(); + + // Appearance (DEPRECATED) + void GetFont(BFont* font) const {BView::GetFont(font);} + virtual void SetFont(const BFont *font, uint32 mask = B_FONT_ALL); + virtual void SetHighColor(rgb_color); + void SetSelectionColor(rgb_color); + void SetBackgroundColor(rgb_color); + void SetEditColor(rgb_color); + const rgb_color SelectionColor() const; + const rgb_color BackgroundColor() const; + const rgb_color EditColor() const; + + // Appearance (NEW STYLE) + void SetColor(ColumnListViewColor color_num, rgb_color color); + void SetFont(ColumnListViewFont font_num, const BFont* font, uint32 mask = B_FONT_ALL); + rgb_color Color(ColumnListViewColor color_num) const; + void GetFont(ColumnListViewFont font_num, BFont* font) const; + + BPoint SuggestTextPosition(const BRow* row, const BColumn* column=NULL) const; + + void SetLatchWidth(float width); + float LatchWidth() const; + virtual void DrawLatch(BView*, BRect, LatchType, BRow*); + virtual void MakeFocus(bool isfocus = true); + void SaveState(BMessage *msg); + void LoadState(BMessage *msg); + + BView* ScrollView() const { return (BView *)fOutlineView; } + void SetEditMode(bool state); + void Refresh(); + BView* GetScrollView(){ return (BView*)fOutlineView;} + BView* GetTitleView(){ return (BView*)fTitleView;} +protected: + virtual void MessageReceived(BMessage *message); + virtual void KeyDown(const char *bytes, int32 numBytes); + virtual void AttachedToWindow(); + virtual void WindowActivated(bool active); + virtual void Draw(BRect); + + + + +private: + rgb_color fColorList[B_COLOR_TOTAL]; + BPrivate::TitleView* fTitleView; + BPrivate::OutlineView* fOutlineView; + BList fColumns; + BScrollBar* fHorizontalScrollBar; + BScrollBar* fVerticalScrollBar; + BList fSortColumns; + BView* fStatusView; + BMessage* fSelectionMessage; + bool fSortingEnabled; + float fLatchWidth; + border_style fBorderStyle; +}; + +#endif diff --git a/library/libclv/include/ColumnTypes.h b/library/libclv/include/ColumnTypes.h new file mode 100644 index 0000000..9a02beb --- /dev/null +++ b/library/libclv/include/ColumnTypes.h @@ -0,0 +1,254 @@ +/******************************************************************************* +/ +/ File: ColumnTypes.h +/ +/ Description: Experimental classes that implement particular column/field +/ data types for use in BColumnListView. +/ +/ Copyright 2000+, Be Incorporated, All Rights Reserved +/ +*******************************************************************************/ + + +#ifndef _COLUMN_TYPES_H +#define _COLUMN_TYPES_H + +#include "ColumnListView.h" +#include +#include +#include + + +//===================================================================== +// Common base-class: a column that draws a standard title at its top. + +class BTitledColumn : public BColumn +{ + public: + BTitledColumn (const char *title, + float width, + float minWidth, + float maxWidth, + alignment align = B_ALIGN_LEFT); + virtual void DrawTitle (BRect rect, + BView* parent); + virtual void GetColumnName (BString* into) const; + + void DrawString (const char*, + BView*, + BRect); + void SetTitle (const char* title); + void Title (BString* forTitle) const; // sets the BString arg to be the title + float FontHeight () const; + + private: + float fFontHeight; + BString fTitle; +}; + + +//===================================================================== +// Field and column classes for strings. + +class BStringField : public BField +{ + public: + BStringField (const char* string); + + void SetString (const char* string); + const char* String () const; + void SetClippedString (const char* string); + const char* ClippedString (); + void SetWidth (float); + float Width (); + + private: + float fWidth; + BString fString; + BString fClippedString; +}; + + +//-------------------------------------------------------------------- + +class BStringColumn : public BTitledColumn +{ + public: + BStringColumn (const char *title, + float width, + float maxWidth, + float minWidth, + uint32 truncate, + alignment align = B_ALIGN_LEFT); + virtual void DrawField (BField* field, + BRect rect, + BView* parent); + virtual int CompareFields (BField* field1, + BField* field2); + virtual bool AcceptsField (const BField* field) const; + + private: + uint32 fTruncate; +}; + + +//===================================================================== +// Field and column classes for dates. + +class BDateField : public BField +{ + public: + BDateField (time_t* t); + void SetWidth (float); + float Width (); + void SetClippedString (const char*); + const char* ClippedString (); + time_t Seconds (); + time_t UnixTime (); + + private: + struct tm fTime; + time_t fUnixTime; + time_t fSeconds; + BString fClippedString; + float fWidth; +}; + + +//-------------------------------------------------------------------- + +class BDateColumn : public BTitledColumn +{ + public: + BDateColumn (const char* title, + float width, + float minWidth, + float maxWidth, + alignment align = B_ALIGN_LEFT); + virtual void DrawField (BField* field, + BRect rect, + BView* parent); + virtual int CompareFields (BField* field1, + BField* field2); + private: + BString fTitle; +}; + + +//===================================================================== +// Field and column classes for numeric sizes. + +class BSizeField : public BField +{ + public: + BSizeField (off_t size); + void SetSize (off_t); + off_t Size (); + + private: + off_t fSize; +}; + + +//-------------------------------------------------------------------- + +class BSizeColumn : public BTitledColumn +{ + public: + BSizeColumn (const char* title, + float width, + float minWidth, + float maxWidth, + alignment align = B_ALIGN_LEFT); + virtual void DrawField (BField* field, + BRect rect, + BView* parent); + virtual int CompareFields (BField* field1, + BField* field2); +}; + + +//===================================================================== +// Field and column classes for integers. + +class BIntegerField : public BField +{ + public: + BIntegerField (int32 number); + void SetValue (int32); + int32 Value (); + + private: + int32 fInteger; +}; + + +//-------------------------------------------------------------------- + +class BIntegerColumn : public BTitledColumn +{ + public: + BIntegerColumn (const char* title, + float width, + float minWidth, + float maxWidth, + alignment align = B_ALIGN_LEFT); + virtual void DrawField (BField* field, + BRect rect, + BView* parent); + virtual int CompareFields (BField* field1, + BField* field2); +}; + + +//===================================================================== +// Field and column classes for bitmaps + +class BBitmapField : public BField +{ + public: + BBitmapField (BBitmap* bitmap); + const BBitmap* Bitmap (); + void SetBitmap (BBitmap* bitmap); + + private: + BBitmap* fBitmap; +}; + + +//-------------------------------------------------------------------- + +class BBitmapColumn : public BTitledColumn +{ + public: + BBitmapColumn (const char* title, + float width, + float minWidth, + float maxWidth, + alignment align = B_ALIGN_LEFT); + virtual void DrawField (BField*field, + BRect rect, + BView* parent); + virtual int CompareFields (BField* field1, BField* field2); + virtual bool AcceptsField (const BField* field) const; +}; + + +//===================================================================== +// Column to display BIntegerField objects as a graph. + +class GraphColumn : public BIntegerColumn +{ + public: + GraphColumn (const char* name, + float width, + float minWidth, + float maxWidth, + alignment align = B_ALIGN_LEFT); + virtual void DrawField (BField*field, + BRect rect, + BView* parent); +}; + +#endif + diff --git a/library/libfish/BoxRenderer.cpp b/library/libfish/BoxRenderer.cpp new file mode 100644 index 0000000..5b52daf --- /dev/null +++ b/library/libfish/BoxRenderer.cpp @@ -0,0 +1,44 @@ +#include "BoxRenderer.h" + +InstanceBox* +BoxRenderer::CreateInstanceBox(BRect preferredSize,BString txt){ + InstanceBox *box=new InstanceBox(preferredSize,txt,this); + return box; +} + +bool +BoxRenderer::HasAction(InstanceBox* ibox,BPoint p,BString* action) { + if(ibox->action != "" && ibox->rect.Contains(p)) { + if(action) action->SetTo(ibox->action); + return true; + } + else + return false; +} + +void +BoxRenderer::HAlignBox(InstanceBox* box,float maxwidth){ + + alignment ali=box->box_alignment; + + switch (ali) + { + case B_ALIGN_LEFT: + break; + + case B_ALIGN_CENTER: + { + float diff = (maxwidth - box->rect.Width()) / 2.0; + if(diff>0) + box->rect.OffsetBy(diff,0); + break; + } + case B_ALIGN_RIGHT: + { + float diff = (maxwidth - box->rect.right); + if(diff>0) + box->rect.OffsetTo(diff, box->rect.top); + } + break; + } +} diff --git a/library/libfish/BoxRenderer.h b/library/libfish/BoxRenderer.h new file mode 100644 index 0000000..b39daf5 --- /dev/null +++ b/library/libfish/BoxRenderer.h @@ -0,0 +1,33 @@ +#ifndef BoxRenderer_H_ +#define BoxRenderer_H_ + +#include +#include "InstanceBox.h" + +class ContainerBox; + +class BoxRenderer { + + public: + + virtual ~BoxRenderer(){} + + virtual void DrawBox(BView* parent,InstanceBox* ibox) = 0; + virtual InstanceBox* CreateInstanceBox(BRect preferredSize,BString txt); + + + + + + virtual bool HasAction(InstanceBox* ibox,BPoint p,BString* action=NULL); + //virtual void InstanceClicked(InstanceBox* ibox,BPoint abs){}; +// protected: +// class HDoc; + virtual void InitInstanceBox(InstanceBox *,ContainerBox *) = 0; + virtual void FreeInstanceBox(InstanceBox*) = 0; + + protected: + void HAlignBox(InstanceBox* box,float maxwidth); +}; +#endif +//-- diff --git a/library/libfish/CompositeRenderer.cpp b/library/libfish/CompositeRenderer.cpp new file mode 100644 index 0000000..60ca2a1 --- /dev/null +++ b/library/libfish/CompositeRenderer.cpp @@ -0,0 +1,78 @@ +#include "CompositeRenderer.h" + +#define DEBUG 0 + +InstanceBox* +CompositeRenderer::CreateInstanceBox(BRect preferredSize,BString txt){ + ContainerBox *box=new ContainerBox(preferredSize,txt,this); + return (InstanceBox*)box; +} + +void +CompositeRenderer::DrawBox(BView* parent,InstanceBox* ibox){ + ContainerBox* doc=(ContainerBox*)ibox; + int32 count = doc->fBoxes.CountItems(); + BRect r(doc->rect); + InstanceBox* box; + for(int i=0;i< count ; i++){ + box = doc->fBoxes.ItemAt(i); + + if(r.Intersects(box->rect)){ + //draw! + if(DEBUG) + parent->StrokeRect(box->rect); + box->renderer->DrawBox(parent,box); + } + + } +} + +bool +CompositeRenderer::HasAction(InstanceBox* ibox,BPoint p,BString* action){ + ContainerBox* doc=(ContainerBox*)ibox; + int32 count = doc->fBoxes.CountItems(); + InstanceBox* box; + for(int i=0;i< count ; i++){ + box = doc->fBoxes.ItemAt(i); + if(box->renderer->HasAction(box,p,action)){ + return true; + } + } + + return false; +} + +void +CompositeRenderer::InitInstanceBox(InstanceBox *ibox,ContainerBox* parent){ + + //devo settare le dimensioni! + + //debugger("h"); + + ContainerBox* doc=(ContainerBox*)ibox; + + doc->InitSize(parent->MaxWidth()); + + InstanceBox* box; + int32 count = doc->fBoxes.CountItems(); + + for(int i=0;i< count ; i++){ + box = doc->fBoxes.ItemAt(i); + + //if(box->text.Compare("testContainer") == 0) debugger("inner"); + + doc->ArrangeBoxPosition(box); + box->renderer->InitInstanceBox(box,doc); + doc->UpdateSize(box); + + box->rect.OffsetBy(doc->rect.left,doc->rect.top); + } + + +} + + +void +CompositeRenderer::FreeInstanceBox(InstanceBox* ibox){ + //no cookie +} diff --git a/library/libfish/CompositeRenderer.h b/library/libfish/CompositeRenderer.h new file mode 100644 index 0000000..2d15c2f --- /dev/null +++ b/library/libfish/CompositeRenderer.h @@ -0,0 +1,22 @@ +#ifndef CompositeRenderer_H_ +#define CompositeRenderer_H_ + +#include +#include "BoxRenderer.h" +#include "ContainerBox.h" + +class CompositeRenderer : public BoxRenderer { + + public: + + InstanceBox* CreateInstanceBox(BRect preferredSize,BString txt); + + void DrawBox(BView* parent,InstanceBox* ibox); + + void InitInstanceBox(InstanceBox *,ContainerBox *); + void FreeInstanceBox(InstanceBox*); + + bool HasAction(InstanceBox* ibox,BPoint p,BString* action=NULL); +}; +#endif +//-- diff --git a/library/libfish/ContainerBox.h b/library/libfish/ContainerBox.h new file mode 100644 index 0000000..c76d034 --- /dev/null +++ b/library/libfish/ContainerBox.h @@ -0,0 +1,50 @@ +#ifndef ContainerBox_H_ +#define ContainerBox_H_ + +#include "InstanceBox.h" +#include + +class ContainerBox : public InstanceBox { + + public: + ContainerBox(BRect preferredSize,BString txt,BoxRenderer* render): + InstanceBox(preferredSize,txt,renderer){ left_margin=top_margin=0.0;} + + virtual ~ContainerBox(){ + + while(fBoxes.CountItems()){ + InstanceBox *box=fBoxes.ItemAt(0); + box->renderer->FreeInstanceBox(box); + delete box; + fBoxes.RemoveItem(box); + } + + } + + + + + virtual void AddInstanceBox(InstanceBox *box){ + if(!box) return; + //box->renderer->InitInstanceBox(box,this); + fBoxes.AddItem(box); + } + + float GetHeight(){ return rect.Height();} + float GetWidth(){ return rect.Width();} + + virtual void ArrangeBoxPosition(InstanceBox*) {}; + virtual void InitSize(float) {}; + virtual void UpdateSize(InstanceBox* box){} + virtual float MaxWidth(){ return rect.Width() ; /*by default*/} + + //this should be wrapped + BObjectList fBoxes; + + float top_margin; + float left_margin; + + + +}; +#endif diff --git a/library/libfish/HDoc.h b/library/libfish/HDoc.h new file mode 100644 index 0000000..d607f5d --- /dev/null +++ b/library/libfish/HDoc.h @@ -0,0 +1,31 @@ +#ifndef HDoc_H_ +#define HDoc_H_ + +#include "BoxRenderer.h" +#include "VerticalContainerBox.h" + +class HDoc : public VerticalContainerBox { //ContainerBox { + + public:// + + //refactoring: using a BRect. if rect.top==rect.bottom then canGrow = false! + + HDoc(BString fid,float w,float h,float margin,float parSpace):VerticalContainerBox(BRect(0,0,w-1,h-1),fid,NULL,parSpace){ + rgb_color white = {255,255,255,255}; + rgb_color black = {0,0,0,255}; + backColor = white; + foreColor = black; + textFontSize = 14; + titleFontSize = 20; + left_margin = top_margin = 5.0; + }; + + BString DocId(){ return text;} + + public: //TEMP fix me! + rgb_color backColor; + rgb_color foreColor; + int textFontSize; + int titleFontSize; +}; +#endif diff --git a/library/libfish/HelpViewer.cpp b/library/libfish/HelpViewer.cpp new file mode 100644 index 0000000..d0adec1 --- /dev/null +++ b/library/libfish/HelpViewer.cpp @@ -0,0 +1,239 @@ +#include "HelpViewer.h" +#include "OneSView.h" +#include +#include +#include "RVActionGoto.h" +#include "RVActionOpenURL.h" + + +OneSView *sview; //temp fix! +BScrollView *scroll; //temp fix + +RVActionGoto* agoto; +RVActionOpenURL* aopenurl; + +HelpViewer::HelpViewer(BRect r):BView(r,"HelpViewer",B_FOLLOW_ALL_SIDES,B_WILL_DRAW){ + //the view: + BRect rect(Bounds()); + rect.right -=B_V_SCROLL_BAR_WIDTH; + //OneSView * + + ///BView *avv=new BView(rect,"",B_FOLLOW_ALL,B_WILL_DRAW); + sview = new OneSView(rect); + //avv->AddChild(sview); + scroll= new BScrollView("",sview,B_FOLLOW_NONE,B_WILL_DRAW,false,true,B_NO_BORDER); + + rgb_color white = {255,255,255,255}; + rgb_color black = {0,0,0,255}; + backColor = white; + foreColor = black; + + Selected = -1; + SetViewColor(backColor); + AddChild(scroll); + + + sview->AddAction("goto",agoto=new RVActionGoto(this)); + sview->AddAction("openUrl",aopenurl=new RVActionOpenURL(this)); + fGotoHand = NULL; + +} + +void +HelpViewer::SetForeColor(rgb_color c){ foreColor=c;} ; + +void +HelpViewer::SetBackColor(rgb_color c){ backColor=c; SetViewColor(backColor); scroll->SetViewColor(backColor); sview->SetViewColor(backColor);} ; + +HelpViewer::~HelpViewer(){ + //first free all the documents ans InstanceBoxes.. + sview->DisplayDocument(NULL); + for(int i=0;i= fPages.CountItems()) return; + + Selected = newindex; + sview->DisplayDocument(fPages.ItemAt(Selected)); + RecalcScrollbar(); + +} + +int +HelpViewer::CountPage(){ + return fPages.CountItems(); +} + + +void +HelpViewer::LoadFile(const char* filename){ + + xmlParserCtxtPtr ctxt = xmlNewParserCtxt(); + xmlDocPtr doc = xmlCtxtReadFile(ctxt, filename, NULL, XML_PARSE_RECOVER); + xmlXPathContextPtr pathCtxt = xmlXPathNewContext(doc); + + { + xmlXPathObjectPtr itemNode = xmlXPathEvalExpression((const xmlChar *)"/help/page", pathCtxt); + if (itemNode == NULL) { + xmlFreeParserCtxt(ctxt); + xmlXPathFreeContext(pathCtxt); + xmlXPathFreeObject(itemNode); + return; + }; + + if(itemNode->nodesetval == NULL){ + xmlFreeParserCtxt(ctxt); + xmlXPathFreeContext(pathCtxt); + xmlXPathFreeObject(itemNode); + return; + }; + + printf("Number of pages %d\n",itemNode->nodesetval->nodeNr); + for(int i=0;inodesetval->nodeNr;i++){ + ParsePage(itemNode->nodesetval->nodeTab[i]); + } + + } + + + xmlFreeParserCtxt(ctxt); + xmlXPathFreeContext(pathCtxt); +} + +void +HelpViewer::AttachedToWindow(){ + SetBackColor(backColor); +} + + +void +HelpViewer::ParsePage(xmlNodePtr node){ + + BMessage attrs; + findAttribute(node,&attrs); + + BString id=attrs.FindString("id"); + if(id==NULL || id == "") return; + + HDoc* doc=sview->createHDoc(node->children,&attrs); + + if(doc) { + doc->foreColor=foreColor; + doc->backColor=backColor; + fPages.AddItem(doc); + } +} + +void +HelpViewer::findAttribute(xmlNodePtr cur_node,BMessage *attrs){ + + xmlAttr *attr = cur_node->properties; + + xmlAttr *cur_attr = NULL; + for (cur_attr = attr; cur_attr; cur_attr = cur_attr->next) { + BString battr((const char*)cur_attr->name); + xmlNodePtr node = cur_attr->children; + attrs->AddString(battr.String(),(const char*)node->content); + } + +} + + +void +HelpViewer::RecalcScrollbar(){ + + //debugger("recalc"); + HDoc* doc= sview->CurrentDisplayed(); + if(!doc) return; + + BScrollBar *bar; + if (scroll == NULL + || (bar = scroll->ScrollBar (B_VERTICAL)) == NULL) + return ; + + BRect bounds (Bounds()); + float div=bounds.Height() / sview->Frame().Height(); + if( div < 1.0){ + bar->Show(); + bar->SetProportion (div); //bounds.Height() / sview->Frame().bottom); + bar->SetRange (0.0, sview->Frame().bottom - bounds.Height()); + } + else { + + bar->Hide(); + bar->SetProportion (1); //bounds.Height() / sview->Frame().bottom); + bar->SetRange (0, 0); + } + sview->ScrollTo(0,0); + scroll->Invalidate(); +} + +void +HelpViewer::SearchSetPage(BString id){ + + for(uint i=0;iDocId().Compare(id) == 0){ + SetPage(i); + if(fGotoHand){ + BMessage* msg=new BMessage(HELPVIEWER_GOTO); + msg->AddInt32("selected",i); + BMessenger(fGotoHand).SendMessage(msg,fGotoHand); + return; + } + } + } +} + +void +HelpViewer::SetOpenUrlHandler(BHandler* hand){ + aopenurl->SetHandler(hand); +} + + +void +HelpViewer::SetGotoHandler(BHandler* hand){ + fGotoHand=hand; +} + +void +HelpViewer::MessageReceived(BMessage* msg){ + + switch(msg->what){ + case HELPVIEWER_GOTO: + { + BString param; + if(msg->FindString("goto",¶m)==B_OK){ + SearchSetPage(param); + + } + } + break; + case HELPVIEWER_OPEN_URL: + { + BString param; + if(msg->FindString("url",¶m)==B_OK){ + + BString app("text/html"); + //Net+ app.SetTo("application/x-vnd.Be-NPOS"); + const char *args[] = { param.String(), 0 }; + be_roster->Launch (app.String(), 1, const_cast(args)); + + } + } + break; + default: + BView::MessageReceived(msg); + break; + }; +} +//.. diff --git a/library/libfish/HorizontalContainerBox.h b/library/libfish/HorizontalContainerBox.h new file mode 100644 index 0000000..53abbb6 --- /dev/null +++ b/library/libfish/HorizontalContainerBox.h @@ -0,0 +1,59 @@ +#ifndef HorizontalContainerBox_H_ +#define HorizontalContainerBox_H_ + +#include "ContainerBox.h" + + +// here only the logic of the horiz stack model + +#define MIN_COLUMN_WIDTH 30 + +class HorizontalContainerBox : public ContainerBox { + + public: + + HorizontalContainerBox(BRect preferredSize,BString txt,BoxRenderer* render,float par_space): + ContainerBox(preferredSize,txt,render){ + fParSpace = par_space; + left_margin = top_margin = 5.0; + } + + void + InitSize(float maxwidth) { + + rect.right = rect.left + maxwidth; + + fStackRect = BRect(0 + left_margin, + 0 + top_margin, + 0 + maxwidth - left_margin - 1, + 0 + top_margin); //0 height box! + maxH = 0; + }; + + void + UpdateSize(InstanceBox* box){ + fStackRect.left = box->rect.right + left_margin; + if(box->rect.bottom > maxH) maxH = box->rect.bottom; + SetSize(rect.Width(),maxH + left_margin + 1); + } + + void + ArrangeBoxPosition(InstanceBox* box){ + box->rect = fStackRect; + if(box->rect.Width() < MIN_COLUMN_WIDTH ) + { + //si dovrebbe andare a capo.. + + } + } + + + + + private: + BRect fStackRect; + float fParSpace; + float maxH; +}; +#endif +//-- diff --git a/library/libfish/ImageRenderer.cpp b/library/libfish/ImageRenderer.cpp new file mode 100644 index 0000000..468b9ce --- /dev/null +++ b/library/libfish/ImageRenderer.cpp @@ -0,0 +1,67 @@ +#include "Utils.h" +#include "ImageRenderer.h" +#include "ImageCache.h" + +struct token { + BBitmap* image; + BPoint shift; +}; +void +ImageRenderer::DrawBox(BView* parent,InstanceBox* ibox) { + token *tok=(token*)ibox->cookie; + if(!tok->image) return; + parent->SetDrawingMode( B_OP_ALPHA ); + parent->DrawBitmap(tok->image,BPoint(ibox->rect.left,ibox->rect.top)+tok->shift); + parent->SetDrawingMode( B_OP_OVER ); +} + +void +ImageRenderer::InitInstanceBox(InstanceBox *ibox,ContainerBox *){ + + BBitmap *icon=LoadIcon(ibox->text.String()); + token *tok=new token; + ibox->cookie=(void*)tok; + tok->image=NULL; + tok->shift=BPoint(0,0); + + if(icon) { + tok->image=icon; + } + + float maxwidth=ibox->rect.Width(); + const float mw=maxwidth; + + float maxheight=ibox->rect.Height(); + if(!icon) return; + + if(icon->Bounds().Width()Bounds().Width(); + + maxheight = icon->Bounds().Height(); + + + //refine size: + if(ibox->hlimit>0 && ibox->hlimithlimit>maxwidth){ + + ibox->SetSize(ibox->hlimit,maxheight); + float diff = (ibox->hlimit -icon->Bounds().Width()) / 2.0; + if(diff<0) diff=0; + tok->shift=BPoint(diff,0); + } + else + { + ibox->SetSize(maxwidth,maxheight); + HAlignBox(ibox,mw); + } + +} + +void +ImageRenderer::FreeInstanceBox(InstanceBox* box){ + token *tok=(token*)box->cookie; + if(tok->image) + ImageCache::DeleteImage(box->text.String()); + + delete tok; +} + diff --git a/library/libfish/ImageRenderer.h b/library/libfish/ImageRenderer.h new file mode 100644 index 0000000..907e3bd --- /dev/null +++ b/library/libfish/ImageRenderer.h @@ -0,0 +1,19 @@ +#ifndef ImageRenderer_H_ +#define ImageRenderer_H_ + +#include +#include "BoxRenderer.h" + +class ContainerBox; + +class ImageRenderer : public BoxRenderer { + + public: + + void DrawBox(BView* parent,InstanceBox* ibox); + void InitInstanceBox(InstanceBox *,ContainerBox *); + void FreeInstanceBox(InstanceBox*); + +}; +#endif +//-- diff --git a/library/libfish/InstanceBox.h b/library/libfish/InstanceBox.h new file mode 100644 index 0000000..ef39ddd --- /dev/null +++ b/library/libfish/InstanceBox.h @@ -0,0 +1,36 @@ +#ifndef InstanceBox_H_ +#define InstanceBox_H_ + +class BoxRenderer; + +#include "String.h" + +class InstanceBox { + +public: + + InstanceBox(BRect preferredSize,BString txt,BoxRenderer* render){ + box_alignment = B_ALIGN_LEFT; + text=txt; + renderer=render; + rect = preferredSize; + hlimit = -1; + } + + void SetSize(float w,float h){ + rect.SetRightBottom(rect.LeftTop() + BPoint(w-1,h-1)); + } + + BString text; + BRect rect; + BoxRenderer* renderer; //don't like this. + + float hlimit; + + alignment box_alignment; + //this is used by the renderer..: + void* cookie; + BString action; +}; +#endif +//-- diff --git a/library/libfish/Jamfile b/library/libfish/Jamfile new file mode 100644 index 0000000..e6dc6c3 --- /dev/null +++ b/library/libfish/Jamfile @@ -0,0 +1,37 @@ + +SubDir TOP libfish ; + +if $(OSPLAT) = X86 { + C++FLAGS += -Wno-sign-compare -Wno-overloaded-virtual ; +} + + +SAVED_DEFINES = $(DEFINES) ; + +DEFINES = $(SAVED_DEFINES) ; + + +SubDirSysHdrs /boot/home/config/include ; +SubDirSysHdrs $(TOP)/libfish/include ; +SubDirSysHdrs $(TOP)/libfunky/include ; +SubDirSysHdrs /boot/beos/etc/develop/zeta-r1-gcc2-x86/headers/be/locale ; +SubDirSysHdrs $(TOP)/../include ; +SubDirSysHdrs $(TOP)/../include/r5-only ; + +LINKFLAGS += -L/boot/home/config/lib ; +LINKFLAGS += -L$(TOP)/libs ; +LINKFLAGS += -L/boot/develop/headers/be ; + +# +StaticLibrary libfish.a : + BoxRenderer.cpp + CompositeRenderer.cpp + ImageRenderer.cpp + OneSView.cpp + ParBoxRenderer.cpp + SView.cpp + TitleBoxRenderer.cpp + HelpViewer.cpp + ; +# + diff --git a/library/libfish/MultiLineBoxRenderer.h b/library/libfish/MultiLineBoxRenderer.h new file mode 100644 index 0000000..35d71a1 --- /dev/null +++ b/library/libfish/MultiLineBoxRenderer.h @@ -0,0 +1,143 @@ +#ifndef MultiLineBoxRenderer_H_ +#define MultiLineBoxRenderer_H_ + +#include "BoxRenderer.h" +#include +#define kTEXT_MARGIN 0 + +struct multi_line { + int count; + BList line; +}; + +class MultiLineBoxRenderer : public BoxRenderer { + + public: + MultiLineBoxRenderer(BFont fnt){ + font = fnt; + align = B_ALIGN_RIGHT; + } + + + void DrawBox(BView* parent,InstanceBox* ibox) { + parent->StrokeRect(ibox->rect); + parent->SetFont(&font); + multi_line *ml=(multi_line*)ibox->cookie; + BRect rect(ibox->rect); + rect.bottom = rect.top + font.Size() - 1; + for(int i=0;icount;i++){ + BString* str=(BString*)ml->line.ItemAt(i); + DrawString(str->String(),parent,rect); + rect.OffsetBy(0, font.Size()); + } + + }; + + float GetHeight(InstanceBox* ibox ) { + multi_line *ml=(multi_line*)ibox->cookie; + return font.Size()*ml->count; + }; + + float GetWidth(InstanceBox* ibox ) { + + multi_line *ml=(multi_line*)ibox->cookie; + + float maxsize=0; + for(int i=0;icount;i++){ + BString* str=(BString*)ml->line.ItemAt(i); + float size = font.StringWidth(str->String()); + if(size > maxsize) maxsize=size; + } + return maxsize; + }; + + + void + InitInstanceBox(InstanceBox* ibox,HDoc*) + { + //debugger("instance"); + //devo dividere il testo in più linee e farne un array di stringhe. + multi_line *ml=new multi_line; + ml->count=0; + + int32 index = 0; + int32 past_index = 0; + + index = ibox->text.FindFirst("\n",past_index); + + while( index > 0){ + ml->count++; + BString *s=new BString(); + ibox->text.CopyInto(*s,past_index,index-past_index); + ml->line.AddItem(s); + + past_index = index + 1; + index = ibox->text.FindFirst("\n",past_index); + } + + index = ibox->text.FindLast("\n",past_index); + if(index > 0){ + ml->count++; + BString *s=new BString(); + ibox->text.CopyInto(*s,past_index,index-past_index); + ml->line.AddItem(s); + } + else + { + ml->count=1; + ml->line.AddItem(&ibox->text); + } + + ibox->cookie=(void*)ml; + + ibox->SetSize(this->GetWidth(ibox),this->GetHeight(ibox)); + + } + + + + void DrawString(const char* string, BView* parent, BRect rect) +{ + float width = rect.Width() - (2 * kTEXT_MARGIN); + float y; + BFont font; + font_height finfo; + + parent->GetFont(&font); + font.GetHeight(&finfo); + y = rect.top + ((rect.Height() - (finfo.ascent + finfo.descent + finfo.leading)) / 2) + + (finfo.ascent + finfo.descent) - 2; + + switch (Alignment()) + { + case B_ALIGN_LEFT: + parent->MovePenTo(rect.left + kTEXT_MARGIN, y); + break; + + case B_ALIGN_CENTER: + parent->MovePenTo(rect.left + kTEXT_MARGIN + ((width - font.StringWidth(string)) / 2), y); + break; + + case B_ALIGN_RIGHT: + parent->MovePenTo(rect.right - kTEXT_MARGIN - font.StringWidth(string), y); + break; + } + parent->DrawString(string); +} + + void SetAlignment(alignment flag){ + align=flag; + }; + + alignment Alignment(void) const { + return align; + }; + + + private: + BFont font; + alignment align; + +}; +#endif +//-- diff --git a/library/libfish/OneSView.cpp b/library/libfish/OneSView.cpp new file mode 100644 index 0000000..f16c571 --- /dev/null +++ b/library/libfish/OneSView.cpp @@ -0,0 +1,402 @@ +#include "OneSView.h" +#include "ParBoxRenderer.h" +#include "TitleBoxRenderer.h" +#include "TextInstanceBox.h" +#include "ImageRenderer.h" +#include "HorizontalContainerBox.h" +#include "ContainerBox.h" +#include "Cursor.h" +#include "RVAction.h" +#ifdef ZETA + #include +#else + #define _T(A) A +#endif +#include +#define PAR_SPACE 14 + +enum{ + TITLE, + TEXT, + IMAGE, + VERTICAL, + HORIZONTAL +}; + +// cursor data for hovering over URLs + +static unsigned char URLCursorData[] = {16,1,2,2, + 0,0,0,0,56,0,36,0,36,0,19,224,18,92,9,42, + 8,1,60,33,76,49,66,121,48,125,12,253,2,0,1,0, + 0,0,0,0,56,0,60,0,60,0,31,224,31,252,15,254, + 15,255,63,255,127,255,127,255,63,255,15,255,3,254,1,248 +}; + +BCursor *fURLCursor; + +//test +ContainerBox *cbox; + +int textSize; //temp +int titleSize; //temp; + +OneSView::OneSView(BRect r):SView(r){ + RegisterBoxRenderer(TITLE,new TitleBoxRenderer()); + RegisterBoxRenderer(TEXT,new ParBoxRenderer()); + RegisterBoxRenderer(IMAGE,new ImageRenderer()); + cbox = (ContainerBox*)GetCompositeRenderer()->CreateInstanceBox(Bounds(),"null"); + fURLCursor = new BCursor (URLCursorData); +} + +OneSView::~OneSView(){ + + //then free all the renderers.. + delete GetRenderer(TITLE); + UnregisterBoxRenderer(TITLE); + + delete GetRenderer(TEXT); + UnregisterBoxRenderer(TEXT); + + delete GetRenderer(IMAGE); + UnregisterBoxRenderer(IMAGE); + + delete fURLCursor; +} + +HDoc* +OneSView::createHDoc(xmlNodePtr node,BMessage* attrs){ + + BString id; + attrs->FindString("id",&id); + HDoc *doc = new HDoc(id,0,0,10,PAR_SPACE); + + checkHDocAttributes(doc,attrs); + textSize = doc->textFontSize; + titleSize = doc->titleFontSize; + + checkContainerAttributes(doc,attrs); + + ParsePars(node,doc); + doc->renderer = GetCompositeRenderer(); + doc->renderer->InitInstanceBox(doc,cbox); + return doc; +} + + +void +OneSView::ParsePars(xmlNodePtr node,ContainerBox* container){ + + xmlNode *cur_node = NULL; + BRect rect(0,0,0,0); + + for (cur_node = node; cur_node; cur_node = cur_node->next) { + + if (cur_node->type == XML_ELEMENT_NODE) { + + + BString bname((const char*)cur_node->name); + + if (cur_node->children && (cur_node->children->type == XML_TEXT_NODE || cur_node->children->type == XML_CDATA_SECTION_NODE) ) { + + //text element.. + if(bname.ICompare("paragraph") == 0){ + // + BString content((const char*)cur_node->children->content); + content.SetTo(_T(content.String())); + + // type. + BMessage attrs; + int type = findAttribute(cur_node,&attrs); + if(type<0) break; + + switch(type){ + case TITLE: + AddTitle(content.String(),rect,container,&attrs); + break; + case TEXT: + AddPar(content.String(),rect,container,&attrs); + break; + case IMAGE: + AddImage(content.String(),rect,container,&attrs); + break; + default: + break; + } + } + else + if(bname.ICompare("block") == 0){ + + //parse degli attributi: + BMessage attrs; + int type = findAttribute(cur_node,&attrs); + ContainerBox* ncontainer = NULL; + //creiamo il tipo di block (v o h) + switch(type){ + case VERTICAL: + ncontainer = new VerticalContainerBox(rect,"testContainerV",GetCompositeRenderer(),5); + ncontainer->renderer = GetCompositeRenderer(); + break; + case HORIZONTAL: + ncontainer = new HorizontalContainerBox(rect,"testContainerH",GetCompositeRenderer(),5); + ncontainer->renderer = GetCompositeRenderer(); + break; + default: + + break; + } + //ricorrere è divino: + if(ncontainer) { + checkContainerAttributes(ncontainer,&attrs); + ParsePars(cur_node->children,ncontainer); + container->AddInstanceBox(ncontainer); + } + } + + + + } + + } + + } +} + +void +OneSView::AddTitle(const char* title,BRect rect,ContainerBox* doc,BMessage* attrs){ + TextInstanceBox* tib=(TextInstanceBox*)GetRenderer(TITLE)->CreateInstanceBox(rect,title); + tib->text_font.SetSize(titleSize); + doc->AddInstanceBox(tib); + checkCommonAttributes(tib,doc,attrs); + checkTextAttributes(tib,doc,attrs); +} + +void +OneSView::AddPar(const char* title,BRect rect,ContainerBox* doc,BMessage* attrs){ + TextInstanceBox* tib=(TextInstanceBox*)GetRenderer(TEXT)->CreateInstanceBox(rect,title); + tib->text_font.SetSize(textSize); + doc->AddInstanceBox(tib); + checkCommonAttributes(tib,doc,attrs); + checkTextAttributes(tib,doc,attrs); +} + +void +OneSView::AddImage(const char* title,BRect rect,ContainerBox* doc,BMessage* attrs){ + InstanceBox* tib=GetRenderer(IMAGE)->CreateInstanceBox(rect,title); + doc->AddInstanceBox(tib); + checkCommonAttributes(tib,doc,attrs); + +} + +void +OneSView::checkCommonAttributes(InstanceBox* box,ContainerBox* doc,BMessage* attrs){ + + BString align; + if(attrs->FindString("align",&align) == B_OK){ + + if(align.ICompare("center") == 0){ + box->box_alignment = B_ALIGN_CENTER; + } + else if(align.ICompare("right") == 0){ + box->box_alignment = B_ALIGN_RIGHT; + } + + } + + BString size; + if(attrs->FindString("hlimit",&size) == B_OK){ + int32 ssize=atoi(size.String()); + if(ssize>0) + box->hlimit = ssize; + } + BString action; + if(attrs->FindString("action",&action) == B_OK){ + box->action=action; + } + +} +void +OneSView::checkTextAttributes(TextInstanceBox* box,ContainerBox* doc,BMessage* attrs){ + + BString size; + if(attrs->FindString("fontsize",&size) == B_OK){ + int32 ssize=atoi(size.String()); + if(ssize>0) + box->text_font.SetSize(ssize); + } + + +} + +void +OneSView::checkHDocAttributes(HDoc* doc, BMessage* attrs){ + BString size; + if(attrs->FindString("textfontsize",&size) == B_OK){ + int32 ssize=atoi(size.String()); + if(ssize>0) + doc->textFontSize = ssize; + } + if(attrs->FindString("titlefontsize",&size) == B_OK){ + int32 ssize=atoi(size.String()); + if(ssize>0) + doc->titleFontSize = ssize; + } + +} + +void +OneSView::checkContainerAttributes(ContainerBox* box, BMessage* attrs){ + BString size; + if(attrs->FindString("leftmargin",&size) == B_OK){ + int32 ssize=atoi(size.String()); + if(ssize>=0) + box->left_margin = ssize; + } + if(attrs->FindString("topmargin",&size) == B_OK){ + int32 ssize=atoi(size.String()); + if(ssize>=0) + box->top_margin = ssize; + } + +} + + + + +int +OneSView::findAttribute(xmlNodePtr cur_node,BMessage *attrs){ + + xmlAttr *attr = cur_node->properties; + int type = -1; + + xmlAttr *cur_attr = NULL; + for (cur_attr = attr; cur_attr; cur_attr = cur_attr->next) { + + BString battr((const char*)cur_attr->name); + + if(battr.ICompare("type") == 0){ + + xmlNodePtr node = cur_attr->children; + BString stype ; + stype << (const char*)node->content; + + if(stype.ICompare("text") == 0){ + type=TEXT; + } + else + if(stype.ICompare("title") == 0){ + type=TITLE; + } + else + if(stype.ICompare("image") == 0){ + type= IMAGE; + } + else + if(stype.ICompare("vertical") == 0){ + type= VERTICAL; + } + else + if(stype.ICompare("horizontal") == 0){ + type= HORIZONTAL; + } + + } + else + { + xmlNodePtr node = cur_attr->children; + if(node){ + battr.ToLower(); + attrs->AddString(battr.String(),(const char*)node->content); + } + } + } + + //attrs->PrintToStream(); + return type; +} + + + +void +OneSView::MouseDown( BPoint /*where*/ ) +{ +/* SetMouseEventMask( B_POINTER_EVENTS, B_LOCK_WINDOW_FOCUS ); + + fMouseDown = true; + + Invalidate(); + */ +} + + +void +OneSView::MouseMoved( BPoint p, uint32 transition, const BMessage * ) +{ + switch ( transition ) + { + case B_ENTERED_VIEW: + case B_INSIDE_VIEW: + if(CurrentDisplayed()) + if(GetCompositeRenderer()->HasAction(CurrentDisplayed(),p)){ + SetViewCursor (fURLCursor); //B_CURSOR_I_BEAM + //printf("view c\n"); + } + else + SetViewCursor (B_CURSOR_SYSTEM_DEFAULT); + break; + case B_EXITED_VIEW: + //set mouse normal + SetViewCursor (B_CURSOR_SYSTEM_DEFAULT); + break; + } + +} + + +void +OneSView::MouseUp( BPoint p ) +{ + BString action; + if(CurrentDisplayed()) + if(GetCompositeRenderer()->HasAction(CurrentDisplayed(),p,&action)) + InvokeAction(action.String()); +} + +void +OneSView::ClearActions(){ + actions.MakeEmpty(); +} + +void +OneSView::AddAction(const char* symbolicName,RVAction* action){ + actions.AddPointer(symbolicName,(void*)action); +} + + +RVAction* +OneSView::FindAction(const char* symbolicName){ + RVAction* action=NULL; + actions.FindPointer(symbolicName,(void**)&action); + return action; +} + +void +OneSView::InvokeAction(BString mangledName){ + + int from = mangledName.FindFirst("("); + + BString actionName; + actionName.SetTo(mangledName,from); + + mangledName.Remove(0,from+1); + int to = mangledName.FindFirst(")"); + + BString param; + param.SetTo(mangledName,to); + + RVAction* action=FindAction(actionName.String()); + if(action) + action->Perform(param); + else + debugger(actionName.String()); +} + diff --git a/library/libfish/OneSView.h b/library/libfish/OneSView.h new file mode 100644 index 0000000..2815a00 --- /dev/null +++ b/library/libfish/OneSView.h @@ -0,0 +1,65 @@ +#ifndef OneSView_H_ +#define OneSView_H_ + +#include "SView.h" +#include "HDoc.h" + +#include "libxml/tree.h" +#include "libxml/xpath.h" +#include "libxml/xpathInternals.h" +#include "libxml/parserInternals.h" +#include "libxml/debugXML.h" + +#include "Message.h" + +class TextInstanceBox; +class RVAction; + +class OneSView : public SView { + public: + OneSView(BRect r); + ~OneSView(); + + HDoc* createHDoc(xmlNodePtr node,BMessage* attrs); + void AddAction(const char* symbolicName,RVAction*); //by xeD + + protected: + void AddTitle(const char* title, + BRect rect, + ContainerBox*, + BMessage *attrs); + + void AddPar(const char* title, + BRect rect, + ContainerBox*, + BMessage *attrs); + + void AddImage(const char* title, + BRect rect, + ContainerBox*, + BMessage *attrs); + + void MouseDown( BPoint ); + void MouseUp( BPoint ); + void MouseMoved( BPoint , uint32 transition, const BMessage *); + + + + private: + void ParsePars(xmlNodePtr node,ContainerBox*); + void checkCommonAttributes(InstanceBox* box,ContainerBox* doc,BMessage* attrs); + void checkTextAttributes(TextInstanceBox* box,ContainerBox* doc,BMessage* attrs); + void checkHDocAttributes(HDoc*, BMessage*); + void checkContainerAttributes(ContainerBox*, BMessage*); + + void InvokeAction(BString mangledName); + void ClearActions(); //by xeD + + RVAction* FindAction(const char* symbolicName); //by xeD + + //return type (as int) + int findAttribute(xmlNodePtr node,BMessage *attrs); + + BMessage actions; //by xeD +}; +#endif diff --git a/library/libfish/ParBoxRenderer.cpp b/library/libfish/ParBoxRenderer.cpp new file mode 100644 index 0000000..4a41264 --- /dev/null +++ b/library/libfish/ParBoxRenderer.cpp @@ -0,0 +1,238 @@ +#include "ParBoxRenderer.h" +#include "TextInstanceBox.h" + + +#include +#include + +#define kTEXT_MARGIN 0 + + + +inline int32 +UTF8_CHAR_LEN (uchar c) +{ + return (((0xE5000000 >> (((c) >> 3) & 0x1E)) & 3) + 1); +} + + +void addLine(const char* line,int size,multi_line* ml){ + ml->count++; + BString *s=new BString(line,size); + //ibox->text.CopyInto(*s,line,line + size); + //printf("Added line %d [%s]\n",ml->count-1,s->String()); + ml->line.AddItem(s); + +} + +InstanceBox* +ParBoxRenderer::CreateInstanceBox(BRect preferredSize,BString txt){ + return new TextInstanceBox(preferredSize,txt,this); +} + +void +ParBoxRenderer::DrawBox(BView* parent,InstanceBox* ibox) { + TextInstanceBox* t = (TextInstanceBox*)ibox; + parent->SetFont(&t->text_font); + multi_line *ml=(multi_line*)ibox->cookie; + if(!ml) return; + BRect rect(ibox->rect); + rect.bottom = rect.top + t->font_full_height -1; //t->text_font.Size() - 1; + for(int i=0;icount;i++){ + BString* str=(BString*)ml->line.ItemAt(i); + DrawString(str->String(),parent,rect,B_ALIGN_LEFT); + rect.OffsetBy(0, t->font_full_height); + } +}; + +void +ParBoxRenderer::InitInstanceBox(InstanceBox* ibox,ContainerBox*) { + // devo dividere il testo in più linee e farne un array di stringhe. + // in base agli spazi e non hai \n. + + TextInstanceBox* t = (TextInstanceBox*)ibox; + + multi_line *ml=new multi_line; + ml->count=0; + + + //first: remove all the \n + ibox->text.ReplaceAll("\n"," "); + ibox->text.RemoveAll("\t"); + + float maxwidth=ibox->rect.Width(); + + if(t->hlimit>0 && t->hlimithlimit; + + float width=0; + const int16 fLength=ibox->text.Length(); + int16 *fSpaces; + int16 fSpace_count; + + const char spacers[] = " \t\n-\\/"; + const char *buffer(ibox->text.String()); + size_t offset (0), n; + int16 count (0); + + fSpace_count = 0; + while ((n = strcspn (buffer + offset, spacers)) < fLength - offset){ + ++count; + offset += n + 1; + } + + fSpaces = new int16 [count + 1]; + + offset = 0; + while ((n = strcspn (buffer + offset, spacers)) < fLength - offset){ + fSpaces[fSpace_count++] = n + offset; + offset += n + 1; + } + + fSpaces[fSpace_count++] = ibox->text.Length(); + + //printf("Text: %s\n",ibox->text.String()); + //for(int i=0;i< fSpace_count;i++) + // printf("Space at %d (position %d)\n",i,fSpaces[i]); + + if(fSpace_count<=0) + debugger("no space?"); //impossible! (We just Append(" ")..) + + int curSpace = 0; + int curChar = 0; + + while(curSpacetext_font, + buffer + curChar, + fSpaces[curSpace] - curChar); + { + char copy[fSpaces[curSpace] - curChar + 1]; + memset(copy,0,fSpaces[curSpace] - curChar + 1); + strncpy(copy,buffer + curChar,fSpaces[curSpace] - curChar); + //printf("pixel (%s) until %d: %f (curSpace %d)\n",copy,fSpaces[curSpace],size,curSpace); + + } + + pixel += size; + + if( pixel >= maxwidth && pixel > size) { + addLine(buffer + from,(int)(curChar-from),ml); + if(pixel>width) width=pixel; + curChar++; //skip the space! + break; + } + + else + if(pixel >= maxwidth && pixel == size){ + + // a big word. brute split! + int i; + float size; + + for(i = fSpaces[curSpace] ; i > from; i-- ){ //UTF16 kind? + size = StringSize(&t->text_font,buffer + from, i - from); + if(size <= maxwidth){ + //found the breakpoint! + addLine(buffer + from,i - from,ml); + if(pixel>width) width=pixel; + break; + } + + }//for + if(i <= curSpace){ + i++; + ibox->cookie = NULL; + delete fSpaces; + return; + //debugger("less then one char bug"); + } + curChar = i; + break; + + } + + //qui controllo del flush ultra finale! + if(curSpace == fSpace_count-1) { + addLine(buffer + from,fSpaces[curSpace] - from,ml); + if(pixel>width) width=pixel; + } + + curChar = fSpaces[curSpace]; + curSpace++; + + + } + + //printf("-----\n"); + } + + ibox->cookie=(void*)ml; + font_height fh; + t->text_font.GetHeight(&fh); + t->font_full_height = ceil (fh.ascent + fh.descent + fh.leading); + if(width>ibox->rect.Width()) width = ibox->rect.Width(); + ibox->SetSize(width,t->font_full_height*ml->count); + + HAlignBox(ibox,maxwidth); + + delete fSpaces; + + return; + +} + +void +ParBoxRenderer::FreeInstanceBox(InstanceBox* box){ + if(box->cookie) + delete ((multi_line*)box->cookie); + +} + +float +ParBoxRenderer::StringSize(BFont* f,const char* string){ + return f->StringWidth(string); +} + +float +ParBoxRenderer::StringSize(BFont* f,const char* string,int lenght){ + return f->StringWidth(string,lenght); +} + + +void +ParBoxRenderer::DrawString(const char* string, BView* parent, BRect rect,alignment ali) +{ + float width = rect.Width() - (2 * kTEXT_MARGIN); + float y; + BFont font; + font_height finfo; + + parent->GetFont(&font); + font.GetHeight(&finfo); + y = rect.top + ((rect.Height() - (finfo.ascent + finfo.descent + finfo.leading)) / 2) + + (finfo.ascent + finfo.descent) - 2; + + switch (ali) + { + case B_ALIGN_LEFT: + parent->MovePenTo(rect.left + kTEXT_MARGIN, y); + break; + + case B_ALIGN_CENTER: + parent->MovePenTo(rect.left + kTEXT_MARGIN + ((width - font.StringWidth(string)) / 2), y); + break; + + case B_ALIGN_RIGHT: + parent->MovePenTo(rect.right - kTEXT_MARGIN - font.StringWidth(string), y); + break; + } + parent->DrawString(string); +} + diff --git a/library/libfish/ParBoxRenderer.h b/library/libfish/ParBoxRenderer.h new file mode 100644 index 0000000..6efde1d --- /dev/null +++ b/library/libfish/ParBoxRenderer.h @@ -0,0 +1,28 @@ +#ifndef ParBoxRenderer_H_ +#define ParBoxRenderer_H_ + +#include "BoxRenderer.h" +#include +struct multi_line { + int count; + BList line; +}; + + +class ParBoxRenderer : public BoxRenderer { + + public: + + InstanceBox* CreateInstanceBox(BRect preferredSize,BString txt); + void DrawBox(BView* parent,InstanceBox* ibox); + void InitInstanceBox(InstanceBox* box,ContainerBox*); + void FreeInstanceBox(InstanceBox* box); + + protected: + void DrawString(const char* string, BView* parent, BRect rect,alignment ali); + float StringSize(BFont*,const char* string); + float StringSize(BFont* f,const char* string,int lenght); + +}; +#endif +//-- diff --git a/library/libfish/RVAction.h b/library/libfish/RVAction.h new file mode 100644 index 0000000..4bbeebb --- /dev/null +++ b/library/libfish/RVAction.h @@ -0,0 +1,15 @@ +#ifndef _RVAction_h_ +#define _RVAction_h_ + +class RVAction +{ + public: + + virtual ~RVAction(){}; + + virtual status_t Perform(BString param) = 0; + virtual BString GetDescription() = 0; + +}; + +#endif diff --git a/library/libfish/RVActionGoto.h b/library/libfish/RVActionGoto.h new file mode 100644 index 0000000..994286e --- /dev/null +++ b/library/libfish/RVActionGoto.h @@ -0,0 +1,31 @@ +#ifndef _RVActionGoto_h_ +#define _RVActionGoto_h_ + +#include "RVAction.h" + +#include +#include + + +class RVActionGoto : public RVAction +{ + public: + RVActionGoto(BHandler* h){hand=h;}; + + + virtual status_t Perform(BString param){ + //printf("goto : %s\n",param.String()); + BMessage* msg=new BMessage('goto'); + msg->AddString("goto",param); + BMessenger(hand).SendMessage(msg,hand); + } + virtual BString GetDescription(){ + return "Goto"; + } + + private: + BHandler* hand; + +}; + +#endif diff --git a/library/libfish/RVActionOpenURL.h b/library/libfish/RVActionOpenURL.h new file mode 100644 index 0000000..1afd018 --- /dev/null +++ b/library/libfish/RVActionOpenURL.h @@ -0,0 +1,31 @@ +#ifndef _RVActionOpenURL_h_ +#define _RVActionOpenURL_h_ + +#include "RVAction.h" + +#include +#include + + +class RVActionOpenURL : public RVAction +{ + public: + RVActionOpenURL(BHandler* h){hand=h;}; + void SetHandler(BHandler* h){hand=h;}; + + virtual status_t Perform(BString param){ + BMessage* msg=new BMessage('opur'); + msg->AddString("url",param); + BMessenger(hand).SendMessage(msg,hand); + } + + virtual BString GetDescription(){ + return "OpenURL"; + } + + private: + BHandler* hand; + +}; + +#endif diff --git a/library/libfish/SView.cpp b/library/libfish/SView.cpp new file mode 100644 index 0000000..48db09f --- /dev/null +++ b/library/libfish/SView.cpp @@ -0,0 +1,69 @@ +#include "SView.h" +#include "Application.h" +#include "Bitmap.h" +#include "TranslationUtils.h" + +#include "stdio.h" + +#define DEBUG 0 + +SView::SView(BRect r):BView(r,"",B_FOLLOW_NONE,B_WILL_DRAW){ + fDoc=NULL; + fCompositeRenderer = new CompositeRenderer(); + fMouseDown = false; +} + +void +SView::DisplayDocument(HDoc* doc){ + + fDoc=doc; + if(!fDoc) return; + + ResizeTo(Bounds().Width(),fDoc->GetHeight()); + SetViewColor(fDoc->backColor); + SetHighColor(fDoc->foreColor); + SetLowColor(fDoc->backColor); + Invalidate(); +} + +void +SView::Draw(BRect r) +{ + if(fDoc==NULL) return; + + if(DEBUG) + StrokeRect(BRect(0,0,fDoc->GetWidth(),fDoc->GetHeight())); + + fDoc->renderer->DrawBox(this,fDoc); + //fCompositeRenderer->DrawBox(this,fDoc); +} + +void +SView::RegisterBoxRenderer(int id,BoxRenderer* renderer){ + fRenderers.AddItem(id,renderer); +} + +void +SView::UnregisterBoxRenderer(int id){ + fRenderers.RemoveItemFor(id); +} + +BoxRenderer* +SView::GetRenderer(int id){ + return fRenderers.ValueFor(id); +} + + + +void +SView::GetPreferredSize(float*w,float*h){ + *w=10; + *h=10; +} + +void +SView::AttachedToWindow(){ + SetViewColor(255,0,255,255); +} + +//.. diff --git a/library/libfish/SView.h b/library/libfish/SView.h new file mode 100644 index 0000000..f2b1913 --- /dev/null +++ b/library/libfish/SView.h @@ -0,0 +1,40 @@ +#ifndef SView_H_ +#define SView_H_ + +#include +#include +#include "KeyMap.h" +#include "HDoc.h" + +#include "BoxRenderer.h" +#include "CompositeRenderer.h" + +class SView : public BView +{ + public: + SView(BRect); + void Draw(BRect r); + + void DisplayDocument(HDoc* doc); + HDoc* CurrentDisplayed(){ return fDoc;} + + void RegisterBoxRenderer(int id,BoxRenderer*); + void UnregisterBoxRenderer(int id); + + BoxRenderer* GetRenderer(int); + CompositeRenderer* GetCompositeRenderer(){ return fCompositeRenderer;}; + + virtual void GetPreferredSize(float*,float*); + + void AttachedToWindow(); + + private: + HDoc* fDoc; + CompositeRenderer* fCompositeRenderer; + + KeyMap fRenderers; + bool fMouseDown; +}; + +#endif +//-- diff --git a/library/libfish/TextInstanceBox.h b/library/libfish/TextInstanceBox.h new file mode 100644 index 0000000..767f79a --- /dev/null +++ b/library/libfish/TextInstanceBox.h @@ -0,0 +1,23 @@ +#ifndef TextInstanceBox_H_ +#define TextInstanceBox_H_ + +class BoxRenderer; +#include "Font.h" + +class TextInstanceBox : public InstanceBox { + +public: + + TextInstanceBox(BRect preferredSize,BString txt,BoxRenderer* render): + InstanceBox(preferredSize,txt,render){ + text_font = *be_plain_font; + font_height h; + font_full_height = h.ascent + h.descent + h.leading; + } + + BFont text_font; + float font_full_height; + +}; +#endif +//-- diff --git a/library/libfish/TitleBoxRenderer.cpp b/library/libfish/TitleBoxRenderer.cpp new file mode 100644 index 0000000..81661c9 --- /dev/null +++ b/library/libfish/TitleBoxRenderer.cpp @@ -0,0 +1,23 @@ +#include "TitleBoxRenderer.h" +#include "TextInstanceBox.h" + + +#define kTEXT_MARGIN 0 + +void +TitleBoxRenderer::DrawBox(BView* parent,InstanceBox* ibox) { + TextInstanceBox* t = (TextInstanceBox*)ibox; + parent->SetFont(&t->text_font); + multi_line *ml=(multi_line*)ibox->cookie; + if(!ml) return; + BRect rect(ibox->rect); + rect.bottom = rect.top + t->font_full_height -1; //rect.top + t->text_font.Size() - 1; + for(int i=0;icount;i++){ + BString* str=(BString*)ml->line.ItemAt(i); + BPoint pos(rect.left,rect.bottom + 1); + parent->StrokeLine(pos , pos + BPoint(t->text_font.StringWidth(str->String()),0),B_MIXED_COLORS); + DrawString(str->String(),parent,rect,B_ALIGN_LEFT); + rect.OffsetBy(0, t->font_full_height); + + } +} diff --git a/library/libfish/TitleBoxRenderer.h b/library/libfish/TitleBoxRenderer.h new file mode 100644 index 0000000..8c84945 --- /dev/null +++ b/library/libfish/TitleBoxRenderer.h @@ -0,0 +1,16 @@ +#ifndef TitleBoxRenderer_H_ +#define TitleBoxRenderer_H_ + +#include "ParBoxRenderer.h" + + + +class TitleBoxRenderer : public ParBoxRenderer { + + public: + + void DrawBox(BView* parent,InstanceBox* ibox); + +}; +#endif +//-- diff --git a/library/libfish/VerticalCompositeRenderer.h b/library/libfish/VerticalCompositeRenderer.h new file mode 100644 index 0000000..17027fa --- /dev/null +++ b/library/libfish/VerticalCompositeRenderer.h @@ -0,0 +1,17 @@ +#ifndef VerticalCompositeRenderer_H_ +#define VerticalCompositeRenderer_H_ + + +#include "CompositeRenderer.h" + +class VerticalCompositeRenderer : public CompositeRenderer { + + public: + + void ArrangeBoxPosition(InstanceBox*) = 0; + + + +}; +#endif +//-- diff --git a/library/libfish/VerticalContainerBox.h b/library/libfish/VerticalContainerBox.h new file mode 100644 index 0000000..111e475 --- /dev/null +++ b/library/libfish/VerticalContainerBox.h @@ -0,0 +1,61 @@ +#ifndef VerticalContainerBox_H_ +#define VerticalContainerBox_H_ + +#include "ContainerBox.h" + + +// here only the logic of the vertical stack model + + +class VerticalContainerBox : public ContainerBox { + + public: + + VerticalContainerBox(BRect preferredSize,BString txt,BoxRenderer* render,float par_space): + ContainerBox(preferredSize,txt,render){ + fParSpace = par_space; + //fMargin = margin; + left_margin = top_margin = 5.0; + } + + + void + InitSize(float maxwidth) { + + rect.right = rect.left + maxwidth; + + fStackRect = BRect(0 + left_margin, + 0 + top_margin, + 0 + maxwidth - left_margin - 1, + 0 + top_margin); //0 height box! + //fStackRect.PrintToStream(); + + }; + + void + UpdateSize(InstanceBox* box){ + fStackRect.OffsetTo(fStackRect.left,box->rect.bottom); + SetSize(rect.Width(),fStackRect.bottom + left_margin ); + //rect.PrintToStream(); + fStackRect.top = fStackRect.bottom += fParSpace; + } + + void + ArrangeBoxPosition(InstanceBox* box){ + box->rect.top = fStackRect.bottom; + box->rect.left = fStackRect.left; + box->rect.bottom = box->rect.top; // 0 + box->rect.right = fStackRect.left + fStackRect.right - left_margin; // max size + //box->rect.PrintToStream(); + } + + float MaxWidth(){ return fStackRect.Width();} + + private: + BRect fStackRect; + float fParSpace; + //float fMargin; + +}; +#endif +//-- diff --git a/library/libfish/include/HelpViewer.h b/library/libfish/include/HelpViewer.h new file mode 100644 index 0000000..2776013 --- /dev/null +++ b/library/libfish/include/HelpViewer.h @@ -0,0 +1,60 @@ +#ifndef HelpViewer_H_ +#define HelpViewer_H_ + +#include + +//#include "KeyMap.h" +#include +#include "libxml/tree.h" +#include "libxml/xpath.h" +#include "libxml/xpathInternals.h" +#include "libxml/parserInternals.h" +#include "libxml/debugXML.h" + +class HDoc; + +#define HELPVIEWER_OPEN_URL 'opur' +#define HELPVIEWER_GOTO 'goto' + +class HelpViewer : public BView { + + public: + HelpViewer(BRect r); + virtual ~HelpViewer(); + + void LoadFile(const char* file); + void ParsePage(xmlNodePtr node); + + void SetPage(uint); + int CountPage(); + + void SetForeColor(rgb_color c); + void SetBackColor(rgb_color c); + + void SetOpenUrlHandler(BHandler* hand); + void SetGotoHandler(BHandler* hand); + + void MessageReceived(BMessage* msg); + void SearchSetPage(BString id); + + void AttachedToWindow(); + + private: + + + void RecalcScrollbar(); + void findAttribute(xmlNodePtr node,BMessage*); + + + + //KeyMap fPages; + BObjectList fPages; + int16 Selected; + + rgb_color foreColor; + rgb_color backColor; + BHandler *fGotoHand; + +}; +#endif +// -- diff --git a/library/libfunky/ImageCache.cpp b/library/libfunky/ImageCache.cpp new file mode 100644 index 0000000..2136898 --- /dev/null +++ b/library/libfunky/ImageCache.cpp @@ -0,0 +1,100 @@ +#include "ImageCache.h" + +#include +#include +#include +#include + +// --------------------------------------------------------------------------- +// Class Data Initialization + +ImageCache * +ImageCache::m_instance = NULL; + +// --------------------------------------------------------------------------- +// Constructor/Destructor + +ImageCache::ImageCache() { + +} + +ImageCache::~ImageCache() +{ + while(m_bitmaps.CountItems()) { + BBitmap* bit=m_bitmaps.ValueFor(0); + delete bit; + } +} + +// --------------------------------------------------------------------------- +// Operations + +BBitmap * +ImageCache::GetImage( + BString which, BString name) +{ + if (m_instance == NULL) + m_instance = new ImageCache(); + + /* cerca.. se non c'e' lo carica altrimenti usa quello */ + bool found; + BBitmap *bitmap=m_instance->m_bitmaps.ValueFor(name,&found); + + + if(!found){ + bitmap = LoadImage(which.String(),name.String()); + if(bitmap) m_instance->m_bitmaps.AddItem(name,bitmap); + return bitmap; + } + else { + return bitmap; + } + return NULL; +} + + +void +ImageCache::AddImage(BString name,BBitmap* which){ + + if (m_instance == NULL) + m_instance = new ImageCache(); + + m_instance->m_bitmaps.AddItem(name,which); +} + +void +ImageCache::DeleteImage(BString name){ + + if (m_instance == NULL) + m_instance = new ImageCache(); + + BBitmap* bitmap = m_instance->m_bitmaps.ValueFor(name); + if(bitmap){ + m_instance->m_bitmaps.RemoveItemFor(name); + delete bitmap; + } +} + +void +ImageCache::Release() +{ + if (m_instance != NULL){ + delete m_instance; + m_instance = NULL; + } +} + +BBitmap * +ImageCache::LoadImage( + const char *fullName, const char* shortName) { + BBitmap *bitmap = BTranslationUtils::GetBitmap(fullName); + if(!bitmap){ + bitmap = BTranslationUtils::GetBitmap('PNG ', shortName); + } + + if(!bitmap) + printf("ImageCache: Can't load bitmap! %s\n",fullName); + return bitmap; +} + +// END - ImageCache.cpp diff --git a/library/libfunky/Jamfile b/library/libfunky/Jamfile new file mode 100644 index 0000000..09dc331 --- /dev/null +++ b/library/libfunky/Jamfile @@ -0,0 +1,27 @@ +SubDir TOP libfunky ; + +if $(OSPLAT) = X86 { + C++FLAGS += -Wno-sign-compare -Wno-overloaded-virtual ; +} + +SAVED_DEFINES = $(DEFINES) ; + +DEFINES = $(SAVED_DEFINES) ; + +SubDirSysHdrs /boot/home/config/include ; +SubDirSysHdrs $(TOP)/libfunky/include ; + +LINKFLAGS += -L/boot/home/config/lib ; +LINKFLAGS += -L$(TOP)/libs ; +LINKFLAGS += -L/boot/develop/headers/be ; + +# +StaticLibrary libfunky.a : + PBox.cpp + Setting.cpp + SettingsTextView.cpp + Utils.cpp + ImageCache.cpp + ; +# + diff --git a/library/libfunky/PBox.cpp b/library/libfunky/PBox.cpp new file mode 100644 index 0000000..8d1662a --- /dev/null +++ b/library/libfunky/PBox.cpp @@ -0,0 +1,428 @@ +#include "PBox.h" +#include + +#include +#include +#include +#include +#include +#include + +#include "SettingsTextView.h" + + +#define _T(A) A + +const float kControlOffset = 6.0; +const float kEdgeOffset = 5.0; +const float kDividerWidth = 100; + + + +#define SCROLLBAR 0 + +PBox::PBox(BRect rect, BMessage fT, BMessage fD,const char* settings_name) + : BBox(rect, "Property", B_FOLLOW_ALL,B_WILL_DRAW) +{ + + fSName.SetTo(settings_name); + fTemplate = fT; + fData = fD; + +#if B_BEOS_VERSION > B_BEOS_VERSION_5 + SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + SetHighColor(ui_color(B_PANEL_TEXT_COLOR)); +#else + SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + SetHighColor(0, 0, 0, 0); +#endif + +}; + +void +PBox::AttachedToWindow(){ + + //calc font height (for nice control size) + font_height fontHeight; + be_bold_font->GetHeight(&fontHeight); + fFontHeight = fontHeight.descent + fontHeight.leading + fontHeight.ascent; + + + BRect frame = Bounds(); + frame.InsetBy(5,5); + + BRect temp = frame; + temp.bottom = temp.top + 40; + + SettingsTextView *testo1=new SettingsTextView(temp,"testo",_T("Settings")); + AddChild(testo1); + frame.top +=40; + //BSeparator *sep=new BSeparator(frame,"sep","cippa"); + //sep->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + //AddChild(sep); + + //frame.InsetBy(kEdgeOffset, kEdgeOffset); + //frame.top += fFontHeight; //some space + +#if SCROLLBAR + frame.right -= B_V_SCROLL_BAR_WIDTH + 2; +#endif + + BView *view = new BView(frame, "", B_FOLLOW_ALL_SIDES,B_WILL_DRAW); + +#if B_BEOS_VERSION > B_BEOS_VERSION_5 + view->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + view->SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + view->SetHighColor(ui_color(B_PANEL_TEXT_COLOR)); +#else + view->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + view->SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + view->SetHighColor(0, 0, 0, 0); +#endif + + + float settings_height = BuildGUI(fTemplate, fData, view); + + + view->ResizeTo( view->Bounds().Width(), settings_height); +#if SCROLLBAR + + + BScrollView * scroller = new BScrollView( + "scroller", view, B_FOLLOW_ALL, + 0, false, true + ); + float scroll_height = scroller->Bounds().Height(); + float diff = settings_height - scroll_height; + if ( diff < 0 ) diff = 0; + + scroller->ScrollBar(B_VERTICAL)->SetRange(0, diff); + + view = scroller; +#endif + fPrefView = view; + + AddChild(fPrefView); + + testo1->SetText(fTemplate.FindString("name")); +} + +void +PBox::GetData(BMessage* data){ + + + + BView * panel = fPrefView; + BMessage cur; + + for (int i = 0; fTemplate.FindMessage("setting", i, &cur) == B_OK; i++) { + const char *name = cur.FindString("name"); + int32 type = -1; + + cur.FindInt32("type", &type); + + if ( dynamic_cast(panel->FindView(name))) { +// Free text + BTextControl * ctrl = (BTextControl*)panel->FindView(name); + + switch (type) { + case B_STRING_TYPE: { + data->AddString(name, ctrl->Text() ); + } break; + case B_INT32_TYPE: { + data->AddInt32(name, atoi(ctrl->Text()) ); + } break; + default: { + return; + }; + }; + } else if (dynamic_cast(panel->FindView(name))) { +// Provided option + BMenuField * ctrl = (BMenuField*)panel->FindView(name); + BMenuItem * item = ctrl->Menu()->FindMarked(); + + + if (!item) return; + + switch (type) { + case B_STRING_TYPE: { + data->AddString(name, item->Label() ); + BString index(name); + index << "_index"; + data->AddInt32(index.String(), ctrl->Menu()->IndexOf(item)); //index + } break; + case B_INT32_TYPE: { + data->AddInt32(name, atoi(item->Label()) ); + BString index(name); + index << "_index"; + data->AddInt32(index.String(), ctrl->Menu()->IndexOf(item)); //index + } break; + default: { + return; + }; + } + } else + if (dynamic_cast(panel->FindView(name))) { +// Boolean setting + BCheckBox * box = (BCheckBox*)panel->FindView(name); + + if ( box->Value() == B_CONTROL_ON ) { + data->AddBool(name,true); + } else { + data->AddBool(name,false); + } + } else if (dynamic_cast(panel->FindView(name))) { + BTextView *view = (BTextView *)panel->FindView(name); + data->AddString(name, view->Text()); + }; + + + }; + + +} + +void +PBox::MessageReceived(BMessage *msg) { + switch (msg->what) { + + case 'enab': + { + bool value = (bool)msg->FindInt32("be:value"); + for (int j = 0; msg->FindString("enable_control", j); j++) { + const char* name=msg->FindString("enable_control", j); + BView* viewz=fPrefView->FindView(name); + if(viewz) + ((BControl*)viewz)->SetEnabled(value); + } + } + break; + default: + BBox::MessageReceived(msg); + break; + }; +}; + +float PBox::BuildGUI(BMessage viewTemplate, BMessage settings, BView *view) { + + BMessage curr; + float yOffset = kEdgeOffset + kControlOffset; + float xOffset = 0; + + const float kControlWidth = view->Bounds().Width() - (kEdgeOffset * 2); + + BMessage postAdded; + + for (int i=0; viewTemplate.FindMessage("setting",i,&curr) == B_OK; i++ ) { + char temp[512]; + + // get text etc from template + const char * name = curr.FindString("name"); + const char * desc = curr.FindString("description"); + const char * value = NULL; + int32 type = -1; + bool secret = false; + bool freeText = true; + bool multiLine = false; + BView *control = NULL; + BMenu *menu = NULL; + BMessage* enabling = NULL; + + if ( name != NULL && strcmp(name,"app_sig") == 0 ) { + // skip app-sig setting + continue; + } + + if (curr.FindInt32("type", &type) != B_OK) { + printf("Error getting type for %s, skipping\n", name); + continue; + }; + + switch (type) { + case B_STRING_TYPE: { + if (curr.FindString("valid_value")) { + // It's a "select one of these" setting + + freeText = false; + + menu = new BPopUpMenu(name); +// menu->SetDivider(be_plain_font->StringWidth(name) + 10); + + for (int j = 0; curr.FindString("valid_value", j); j++) { + menu->AddItem(new BMenuItem(curr.FindString("valid_value", j),NULL)); + }; + + value = NULL; + value = curr.FindString("default"); + if (value && menu->FindItem(value)) menu->FindItem(value)->SetMarked(true); + + value = settings.FindString(name); + if (value && menu->FindItem(value)) menu->FindItem(value)->SetMarked(true); + + } else { + // It's a free-text setting + + if (curr.FindBool("multi_line", &multiLine) != B_OK) multiLine = false; + value = settings.FindString(name); + if (!value) value = curr.FindString("default"); + if (curr.FindBool("is_secret",&secret) != B_OK) secret = false; + } + } break; + case B_INT32_TYPE: { + if (curr.FindInt32("valid_value")) { + // It's a "select one of these" setting + + freeText = false; + + menu = new BPopUpMenu(name); + + int32 v = 0; + for ( int j = 0; curr.FindInt32("valid_value",j,&v) == B_OK; j++ ) { + sprintf(temp,"%ld", v); + menu->AddItem(new BMenuItem(temp, NULL)); + }; + + if ( curr.FindInt32("default",&v) == B_OK ) { + sprintf(temp,"%ld",v); + value = temp; + menu->FindItem(value)->SetMarked(true); + } + + if ( settings.FindInt32(name,&v) == B_OK ) { + sprintf(temp,"%ld",v); + value = temp; + menu->FindItem(value)->SetMarked(true); + } + + + } else { + // It's a free-text (but number) setting + int32 v = 0; + if (settings.FindInt32(name,&v) == B_OK) { + sprintf(temp,"%ld",v); + value = temp; + } else if ( curr.FindInt32("default",&v) == B_OK ) { + sprintf(temp,"%ld",v); + value = temp; + } + if (curr.FindBool("is_secret",&secret) != B_OK) secret = false; + } + } break; + case B_BOOL_TYPE: { + bool active; + + if (settings.FindBool(name, &active) != B_OK) { + if (curr.FindBool("default", &active) != B_OK) { + active = false; + }; + }; + + for (int j = 0; curr.FindString("enable_control", j); j++) { + if(!enabling) enabling = new BMessage('enab'); + enabling->AddString("enable_control",curr.FindString("enable_control",j) ); + if(!active) postAdded.AddString("disable",curr.FindString("enable_control", j)); + }; + + control = new BCheckBox(BRect(0, 0, kControlWidth, fFontHeight), + name, _T(desc), enabling); + + if (active) ((BCheckBox*)control)->SetValue(B_CONTROL_ON); + + } break; + default: { + continue; + }; + }; + + if (!value) value = ""; + + if (!control) { + if (freeText) { + if (multiLine == false) { + control = new BTextControl( + BRect(0, 0, kControlWidth, fFontHeight), name, + _T(desc), value, NULL); + if (secret) { + ((BTextControl *)control)->TextView()->HideTyping(true); + ((BTextControl *)control)->SetText(_T(value)); + }; + ((BTextControl *)control)->SetDivider(kDividerWidth); + } else + { + BRect rect; + BRect textRect; + if (desc) //andrea: add description only if available. + { + BRect labelRect(0, 0, kDividerWidth, fFontHeight); + BStringView *label = new BStringView(labelRect, "NA", _T(desc), + B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW); + view->AddChild(label); + label->MoveTo(kEdgeOffset, yOffset); + + rect = BRect(0, 0, kControlWidth - kDividerWidth, fFontHeight * 4); + rect.right -= B_V_SCROLL_BAR_WIDTH + kEdgeOffset + kControlOffset; + xOffset = kEdgeOffset + kDividerWidth; + } + else + { + rect = BRect(0, 0, kControlWidth, fFontHeight * 4); + rect.right -= B_V_SCROLL_BAR_WIDTH + kControlOffset; + xOffset = 0; + } + + textRect = rect; + textRect.InsetBy(kEdgeOffset, kEdgeOffset); + textRect.OffsetTo(1.0, 1.0); + + BTextView *textView = new BTextView(rect, name, textRect, + B_FOLLOW_ALL_SIDES, B_WILL_DRAW); + + control = new BScrollView("NA", textView, B_FOLLOW_ALL_SIDES, + B_WILL_DRAW | B_NAVIGABLE, false, true); + textView->SetText(_T(value)); + }; + } else { + control = new BMenuField(BRect(0, 0, kControlWidth, fFontHeight), + name, _T(desc), menu); + + float size=kDividerWidth; + if(control->StringWidth(_T(desc)) > kDividerWidth) + size=control->StringWidth(_T(desc)) + 20; + + ((BMenuField *)control)->SetDivider(size); + }; + }; + + + view->AddChild(control); + + if(enabling) + ((BCheckBox*)control)->SetTarget(this); + + float h, w = 0; + control->GetPreferredSize(&w, &h); + + if (h < control->Bounds().Height()) + h = control->Bounds().Height(); + + control->MoveTo(kEdgeOffset + xOffset, yOffset); + yOffset += kControlOffset + h ; + xOffset = 0; + }; + + for (int j = 0; postAdded.FindString("disable", j); j++) + { + const char* name=postAdded.FindString("disable", j); + BView* viewz=view->FindView(name); + if(viewz) + ((BControl*)viewz)->SetEnabled(false); + + } + + //if ( yOffset < view->Bounds().Height() ) + // yOffset = view->Bounds().Height(); + + return yOffset;//view->ResizeTo( view->Bounds().Width(), yOffset +} diff --git a/library/libfunky/Setting.cpp b/library/libfunky/Setting.cpp new file mode 100644 index 0000000..9ed86f9 --- /dev/null +++ b/library/libfunky/Setting.cpp @@ -0,0 +1,64 @@ +#include "Setting.h" +#include +#include "Utils.h" + +Setting::Setting(const char* settings_name) { + + if(!settings_name) { + filename.SetTo(GetAppFilename()); + filename << ".conf"; + } + else + filename.SetTo(settings_name); + +} + + +void +Setting::Store(){ + //salvataggio rapido ed indolore dei settaggi! + + BPath xpath; + status_t err; + + find_directory (B_USER_SETTINGS_DIRECTORY, &xpath, true); + xpath.Append (filename.String()); + + BFile *file=new BFile(); + err=file->SetTo(xpath.Path(),B_WRITE_ONLY|B_ERASE_FILE|B_CREATE_FILE); + + if(err != B_OK) { + + //printf ("file error %ld\n",err); + delete file; + return; + } + + Flatten(file); + + delete file; + +} + +void +Setting::Retrive(){ + + + status_t err; + + BFile file; + err=file.SetTo(SettingPath().String(),B_READ_ONLY); + + if(err == B_OK) { + MakeEmpty(); + Unflatten(&file); + } +} + +BString +Setting::SettingPath(){ + BPath xpath; + find_directory (B_USER_SETTINGS_DIRECTORY, &xpath, true); + xpath.Append (filename.String()); + return xpath.Path(); +} diff --git a/library/libfunky/SettingsTextView.cpp b/library/libfunky/SettingsTextView.cpp new file mode 100644 index 0000000..bec0c51 --- /dev/null +++ b/library/libfunky/SettingsTextView.cpp @@ -0,0 +1,27 @@ +#include "SettingsTextView.h" +#include "Utils.h" + +#define COLOR 255,255,255 //240,240,96 + +SettingsTextView::SettingsTextView(BRect rect, char *name,BString testo) + : BView(rect, name, B_FOLLOW_ALL, B_WILL_DRAW){ + + fText=testo; + SetViewColor(COLOR); +} + +void SettingsTextView::AttachedToWindow(){ + SetFontSize(12); +} + + +void SettingsTextView::Draw(BRect updateRect) +{ +// MovePenTo(BPoint(10,25)); + SetHighColor(0,0,0); + SetLowColor(COLOR); + + //Utils.cpp function: + BPDrawString(fText.String(),this,Bounds(),B_ALIGN_CENTER); +// DrawString(fText.String()); +} diff --git a/library/libfunky/Utils.cpp b/library/libfunky/Utils.cpp new file mode 100644 index 0000000..55b16c9 --- /dev/null +++ b/library/libfunky/Utils.cpp @@ -0,0 +1,347 @@ +#include "Utils.h" +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include "ImageCache.h" + + +BString app_relative(""); + +BString +FindAppRelativePath() +{ + app_info theInfo; + BPath thePath; + status_t status = be_app->GetAppInfo(&theInfo); + + if(status != B_OK) return ""; + + thePath.SetTo(&theInfo.ref); + thePath.GetParent(&thePath); + return thePath.Path(); + +} + + +BString +GetAppRelativePath() +{ + if(app_relative=="") + app_relative=FindAppRelativePath(); + + return app_relative; + +} + +BString +GetAppFilename() +{ + app_info theInfo; + status_t status = be_app->GetAppInfo(&theInfo); + if(status != B_OK) return ""; + else + + return theInfo.ref.name; + +} + + +BBitmap* +LoadIcon(const char* name){ + BPath icon_path(GetAppRelativePath().String()); + icon_path.Append("icons"); + icon_path.Append(name); + return ImageCache::GetImage(icon_path.Path(),BString(name)); +} + +void +AddIcon(const char* name,BBitmap* icon){ + ImageCache::AddImage(name,icon); +} + + +bool +CheckMIME(BString mime,BNode* node){ + + size_t len = mime.Length(); + char buffer[B_MIME_TYPE_LENGTH]; + + memset(buffer,0,B_MIME_TYPE_LENGTH); + + size_t r = node->ReadAttr("BEOS:TYPE",B_MIME_TYPE,0,buffer,len); + + if(r!=mime.Length() || mime.Compare(buffer) != 0) return false; + + return true; +} + +status_t +ReadAttributeData(BNode* node,const char *name, char **buffer, int32 *size) { + attr_info info; + status_t ret = node->GetAttrInfo(name, &info); + if (ret == B_OK) { + *buffer = (char *)calloc(info.size, sizeof(char)); + ret = node->ReadAttr(name, info.type, 0, *buffer, info.size); + if (ret > B_OK) { + *size = ret; + ret = B_OK; + + } else { + free(*buffer); + }; + }; + return ret; +} + +status_t +ReadAttributeInt32(BNode* node,const char *name, int32 *dest) { + attr_info info; + status_t ret = node->GetAttrInfo(name, &info); + if (ret == B_OK) { + //*buffer = (char *)calloc(info.size, sizeof(char)); + ret = node->ReadAttr(name, info.type, 0, dest, info.size); + if (ret > B_OK) { + // *size = ret; + ret = B_OK; + + } + }; + return ret; +} + +int32 +ReadAttributeInt32(BNode* node,const char *name){ + int32 ret=0; + if(ReadAttributeInt32(node,name,&ret)==B_OK){ + return ret; + } + return -1; +} + + +status_t +WriteAttributeInt32(BNode* node,const char *name, int32 dest) { + status_t ret = node->WriteAttr(name, B_INT32_TYPE, 0, &dest, sizeof(int32)); + if (ret > B_OK) ret=B_OK; + return ret; +} + +status_t +WriteAttributeString(BNode* node,const char *name, const char* string) { + status_t ret = node->WriteAttr(name, B_STRING_TYPE, 0, string, strlen(string)); + if (ret > B_OK) ret=B_OK; + return ret; +} + + +status_t +ReadAttributeString(BNode* node,const char *name, char **buffer, int32 *size) { + attr_info info; + status_t ret = node->GetAttrInfo(name, &info); + if (ret == B_OK) { + *buffer = (char *)calloc(info.size + 1, sizeof(char)); + memset(*buffer,'\0',info.size+1); + ret = node->ReadAttr(name, info.type, 0, *buffer, info.size); + if (ret > B_OK) { + *size = ret + 1; + ret = B_OK; + } else { + free(*buffer); + }; + }; + return ret; +} + +BString +ReadAttributeString(BNode* node,const char *name){ + char* buffer=NULL; + int32 size=0; + if(ReadAttributeString(node,name, &buffer,&size)==B_OK){ + BString ret(buffer,size); + free(buffer); + return ret; + } + return ""; +} + + +status_t +WriteAttributeMessage(BNode* node,const char* name,BMessage* data){ + BMallocIO malloc; + status_t ret=data->Flatten(&malloc) ; + if( ret == B_OK) { + ret = node->WriteAttr(name,B_ANY_TYPE,0,malloc.Buffer(),malloc.BufferLength()); + if(ret > B_OK) ret=B_OK; + } + return ret; +} + +status_t +ReadAttributeMessage(BNode* node,const char* name,BMessage* data){ + + char *buffer = NULL; + int32 size = 0; + + status_t ret = ReadAttributeData(node,name,&buffer,&size); + + if(size>0 && buffer!=NULL) { + BMemoryIO mem(buffer,size); + ret = data->Unflatten(&mem); + free(buffer); + } + return ret; +} + + +void BPDrawString(const char* string, BView* parent, BRect rect,alignment ali,float kTEXT_MARGIN) +{ + float width = rect.Width() - (2 * kTEXT_MARGIN); + float y; + BFont font; + font_height finfo; + + parent->GetFont(&font); + font.GetHeight(&finfo); + y = rect.top + ((rect.Height() - (finfo.ascent + finfo.descent + finfo.leading)) / 2) + + (finfo.ascent + finfo.descent) - 2; + + switch (ali) + { + case B_ALIGN_LEFT: + parent->MovePenTo(rect.left + kTEXT_MARGIN, y); + break; + + case B_ALIGN_CENTER: + parent->MovePenTo(rect.left + kTEXT_MARGIN + ((width - font.StringWidth(string)) / 2), y); + break; + + case B_ALIGN_RIGHT: + parent->MovePenTo(rect.right - kTEXT_MARGIN - font.StringWidth(string), y); + break; + } + parent->DrawString(string); +} + + +// file size: + const int64 kKB_SIZE = 1024; + const int64 kMB_SIZE = 1048576; + const int64 kGB_SIZE = 1073741824; + const int64 kTB_SIZE = kGB_SIZE * kKB_SIZE; + +BString +ReadableSize(off_t size) { + + if(size>0 ){ + + char str[256]; + if (size < kKB_SIZE) + { + sprintf(str, "%Ld bytes", size); + } + else + { + const char* suffix; + float float_value; + if (size >= kTB_SIZE) + { + suffix = "TB"; + float_value = (float)size / kTB_SIZE; + } + else if (size >= kGB_SIZE) + { + suffix = "GB"; + float_value = (float)size / kGB_SIZE; + } + else if (size >= kMB_SIZE) + { + suffix = "MB"; + float_value = (float)size / kMB_SIZE; + } + else + { + suffix = "KB"; + float_value = (float)size / kKB_SIZE; + } + + sprintf(str, "%.2f %s", float_value, suffix); + // strip off an insignificant zero so we don't get readings + // such as 1.00 + char *period = 0; + char *tmp (NULL); + for (tmp = str; *tmp; tmp++) + { + if (*tmp == '.') + period = tmp; + } + if (period && period[1] && period[2] == '0') + // move the rest of the string over the insignificant zero + for (tmp = &period[2]; *tmp; tmp++) + *tmp = tmp[1]; + } + return BString(str); + } + return ""; +} + +BString +ReadableSpeed(float size) { + + char str[256]; + if (size < kKB_SIZE) + { + sprintf(str, "%Ld b/s", (off_t)size); + } + else + { + const char* suffix; + float float_value; + if (size >= kTB_SIZE) + { + suffix = "TB/s"; + float_value = (float)size / kTB_SIZE; + } + else if (size >= kGB_SIZE) + { + suffix = "GB/s"; + float_value = (float)size / kGB_SIZE; + } + else if (size >= kMB_SIZE) + { + suffix = "MB/s"; + float_value = (float)size / kMB_SIZE; + } + else + { + suffix = "k/s"; + float_value = (float)size / kKB_SIZE; + } + + sprintf(str, "%.2f %s", float_value, suffix); + // strip off an insignificant zero so we don't get readings + // such as 1.00 + char *period = 0; + char *tmp (NULL); + for (tmp = str; *tmp; tmp++) + { + if (*tmp == '.') + period = tmp; + } + if (period && period[1] && period[2] == '0') + // move the rest of the string over the insignificant zero + for (tmp = &period[2]; *tmp; tmp++) + *tmp = tmp[1]; + } + + return BString(str); +} diff --git a/library/libfunky/extra/Action.h b/library/libfunky/extra/Action.h new file mode 100644 index 0000000..87521fa --- /dev/null +++ b/library/libfunky/extra/Action.h @@ -0,0 +1,26 @@ +#ifndef _Action_h_ +#define _Action_h_ + +#include +#include + +#define ActionID bigtime_t + +class Action +{ + public: + Action(){fActionID=0;}; + virtual ~Action(){}; + + virtual status_t Perform(BMessage* errors) = 0; + virtual BString GetDescription() = 0; + + //general purpose ID.. + void SetActionID(ActionID id){ fActionID=id;} + ActionID GetActionID(){ return fActionID;} + + private: + ActionID fActionID; +}; + +#endif diff --git a/library/libfunky/extra/ActionAsync.cpp b/library/libfunky/extra/ActionAsync.cpp new file mode 100644 index 0000000..0a92a64 --- /dev/null +++ b/library/libfunky/extra/ActionAsync.cpp @@ -0,0 +1,8 @@ +#include "ActionAsync.h" + + +ActionAsync::ActionAsync(BTarget *target = NULL ,uint32 msg = 0){ SetTarget(target,msg);}; + + +void +ActionAsync::SetTarget(BTarget *tar,uint32 msg){ SetTarget(tar); SetMessage(new BMessage(msg);}; diff --git a/library/libfunky/extra/ActionAsync.h b/library/libfunky/extra/ActionAsync.h new file mode 100644 index 0000000..621f3c2 --- /dev/null +++ b/library/libfunky/extra/ActionAsync.h @@ -0,0 +1,15 @@ +#ifndef _ActionAsync_h_ +#define _ActionAsync_h_ + +#include "Action.h" +#include + +class ActionAsync : public Action , BInvoker +{ + public: + ActionAsync(BTarget *target = NULL ,uint32 msg = 0); + + void SetTarget(BTarget *tar,uint32 msg); +}; + +#endif diff --git a/library/libfunky/extra/ActionDownload.cpp b/library/libfunky/extra/ActionDownload.cpp new file mode 100644 index 0000000..977e00a --- /dev/null +++ b/library/libfunky/extra/ActionDownload.cpp @@ -0,0 +1,285 @@ +#include "ActionDownload.h" +#include +#include +#include +#include +//#include "Logger.h" + +#include "DownloadManager.h" +extern DownloadManager* download_manager; + + +ActionDownload::ActionDownload(BString URL, entry_ref dest, + bool allowResume, + BLooper *target, + uint32 msg + ):ActionAsync(target,msg), + fUrl(URL), + fDest(dest), + fAllowResume(allowResume) +{ + file = NULL; + curl=NULL; + resuming = 0.0; + SetShouldStop(false); +// LOG("ActionDownload",liDebug,"downloading URL=%s, to %s",URL.String(),BPath(&dest).Path()); +} + + +status_t +ActionDownload::openFile(BMessage* errors){ + + uint32 openMode = 0; + + if(fAllowResume) + openMode = B_WRITE_ONLY | B_CREATE_FILE | B_OPEN_AT_END; + else + openMode = B_WRITE_ONLY | B_CREATE_FILE | B_ERASE_FILE; + + if(file) return B_ERROR; + + file = new BFile(&fDest,openMode); + + if(!file || file->InitCheck()!=B_OK) + { + BString err("Can't open file!"); + errors->AddInt32("status",ERROR_OPENFILE); + errors->AddString("error",err); + return B_ERROR; + } + + + + + return B_OK; +} + + +status_t +ActionDownload::Perform(BMessage* errors){ + + + //is it these the right place? + fillMessage(this,errors); + // + + CURLcode res; + status_t status = B_OK; + + curl = curl_easy_init(); + + if(!curl) { + BString err("Internal error (CURL can't' init)!"); + errors->AddInt32("status",ERROR_CURL_INIT); + errors->AddString("error",err); + return B_ERROR; + } + + curl_easy_setopt(curl, CURLOPT_URL, fUrl.String()); + curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, callback); + curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, this ); + curl_easy_setopt(curl, CURLOPT_NOPROGRESS,FALSE); + + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION,save_file); + curl_easy_setopt(curl, CURLOPT_WRITEDATA,this); + + curl_easy_setopt(curl, CURLOPT_PASSWDFUNCTION,passwd); + curl_easy_setopt(curl, CURLOPT_PASSWDDATA,this); + + curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION , 1); //follow the white link! + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER , FALSE); //https + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST , FALSE); //https + + curl_easy_setopt(curl, CURLOPT_FAILONERROR , 1); + + download_manager->FinishCurl(curl); + + //RESUME + if(fAllowResume){ + BNode stat(&fDest); + // file->Seek(SEEK_END,0); + // size_t resume = (size_t)file->Position(); + off_t size = 0; + stat.GetSize(&size); + + size_t resume = size; + + + if(resume>0){ + curl_easy_setopt(curl, CURLOPT_RESUME_FROM, resume); + resuming = (double)resume; + } + } + + BMessage connect(*errors); + connect.what = Message(); + connect.AddInt32("status",OK_CONNECTING); + Target()->PostMessage(&connect); + + res = curl_easy_perform(curl); + + if(res !=0) + { + BString err("Can't connect!"); + errors->AddInt32("status",ERROR_PERFORMING); + errors->AddString("error",err); + errors->AddInt32("curl_error",res); + errors->AddBool("should_stop",ShouldStop()); + status = B_ERROR; + } + else + { + errors->AddInt32("status",OK_DOWNLOADED); + } + + curl_easy_cleanup(curl); + + errors->AddString("path",GetLocalPath()); + errors->AddRef("entry",&fDest); + + + + BMimeType mime; + + + if(fFileType != "") + + BNodeInfo(file).SetType(fFileType.String()); + + else + { + + status_t guess=BMimeType::GuessMimeType(&fDest,&mime); // :( return B_ERROR.. why???????????? + if(guess==B_OK) + BNodeInfo(file).SetType(mime.Type()); + } + + delete file; + file = NULL; + + if(res == CURLE_BAD_DOWNLOAD_RESUME || res == CURLE_HTTP_RANGE_ERROR) + { + // sarebbe bello chiedere.. va be per ora ci riprova e basta! + fAllowResume = false; + errors->MakeEmpty(); + Perform(errors); + } + + return status; +} + +BString +ActionDownload::GetDescription(){ + return "HTTP File download"; +} + +BString +ActionDownload::GetLocalPath(){ + return BPath(&fDest).Path(); +} + +void +ActionDownload::fillMessage(ActionDownload* ad,BMessage* msg){ + //fill with common fileds + int32 what=msg->what; //preserve original what. + *msg = ad->extraInfo; + + msg->AddInt64("sid",ad->GetActionID()); + msg->AddString("url",ad->fUrl); + + msg->what=what; +} + + + +void +ActionDownload::sendProgressX(ActionDownload* ad,double max,double current){ + BMessage msg(ad->Message()); + + fillMessage(ad,&msg); + + + + msg.AddInt32("status",OK_PROGRESS); + msg.AddFloat("max_progress",max); + msg.AddFloat("current_progress",current); + //perc + float div = (current / max ) * 100; + + msg.AddInt32("percentage_progress",(int32)floor(div)); + + double speed = 0; + if(curl_easy_getinfo(ad->curl,CURLINFO_SPEED_DOWNLOAD,&speed) == CURLE_OK) + msg.AddFloat("download_speed",speed); + + + //TOTALE: + if(curl_easy_getinfo(ad->curl,CURLINFO_CONTENT_LENGTH_DOWNLOAD,&speed) == CURLE_OK) + msg.AddFloat("total_size",speed); + + // ATTUALE: CURLINFO_SIZE_DOWNLOAD + if(curl_easy_getinfo(ad->curl,CURLINFO_SIZE_DOWNLOAD,&speed) == CURLE_OK) + msg.AddFloat("actual_size",speed); + + char *array = NULL; + + + if(curl_easy_getinfo(ad->curl,CURLINFO_EFFECTIVE_URL,&array) == CURLE_OK) + msg.AddString("effective_url",BString(array)); + + if(ad->fFileType == "" && curl_easy_getinfo(ad->curl,CURLINFO_CONTENT_TYPE,&array) == CURLE_OK) { + ad->fFileType.SetTo(array); + BNodeInfo(ad->file).SetType(ad->fFileType.String()); + msg.AddString("filetype",BString(array)); + } + + ad->Target()->PostMessage(&msg); +} + +/* +void +ActionDownload::sendError(BLooper* looper,uint32 amsg,Status st,BString descr){ + BMessage msg(amsg); + msg.AddInt32("status",st); + msg.AddString("error",descr); + looper->PostMessage(&msg); +} +*/ +// + +int +ActionDownload::callback(void *data, + double dltotal, + double dlnow, + double , + double ) +{ + ActionDownload *ad=((ActionDownload*)data); + + //LOG("ActionDownload",liDebug,"callback total %f, now %f", dltotal,dlnow); + + if(ad->Target()) + sendProgressX(ad,ad->resuming+dltotal,ad->resuming+dlnow); + return 0; +} + +size_t +ActionDownload::save_file( void *ptr, size_t size, size_t nmemb, void *data){ + ActionDownload *ad=((ActionDownload*)data); + + if(!ad->file) { + BMessage errors; //how to report these errors?? + if(ad->openFile(&errors) != B_OK) return 0; + } + BFile* file=ad->file; + if(ad->ShouldStop()) return 0; + return file->Write(ptr,size*nmemb); +} + +int +ActionDownload::passwd (void *clientp, const char *prompt, char *buffer, int buflen){ + debugger(prompt); +} + + +//. diff --git a/library/libfunky/extra/ActionDownload.h b/library/libfunky/extra/ActionDownload.h new file mode 100644 index 0000000..f012b44 --- /dev/null +++ b/library/libfunky/extra/ActionDownload.h @@ -0,0 +1,86 @@ +#ifndef _ActionDownload_h_ +#define _ActionDownload_h_ + +#include "ActionAsync.h" +#include +#include + +#include "curl/curl.h" + +class ActionDownload : public ActionAsync +{ + public: + ActionDownload(BString URL, entry_ref dest,bool allowResume,BLooper *target = NULL ,uint32 msg = 0); + ~ActionDownload(){}; + + status_t Perform(BMessage* errors); + BString GetDescription(); + BString GetLocalPath(); + + //void SetLooper(BLooper *loop,uint32 msg){ fTarget=loop; fMsg=msg;}; + + //for compaatibility: + void SetExtraData(BString extra){ + extraInfo.AddString("extra",extra); + } + + void SetKey(BString key, BString data){ + extraInfo.AddString(key.String(),data); + } + + void SetRef(BString key, entry_ref *ref){ + extraInfo.AddRef(key.String(),ref); + } + + status_t GetRef(BString key, entry_ref* ref){ + return extraInfo.FindRef(key.String(),ref); + } + + BString GetKey(BString key){ + BString data; + extraInfo.FindString(key.String(),&data); + return data; + } + + + void SetShouldStop(bool stop){ fShouldStop=stop;} + bool ShouldStop(){ return fShouldStop; } + + enum Status { + ERROR_OPENFILE, // 0 + ERROR_CURL_INIT, // 1 + ERROR_PERFORMING, // 2 + OK_CONNECTING, // 3 + OK_PROGRESS, // 4 + OK_DOWNLOADED // 5 + }; + +private: + + + status_t openFile(BMessage*); + + static void fillMessage(ActionDownload*,BMessage*); + static void sendProgressX(ActionDownload*,double max,double current); + + //curl callbacks: + static size_t save_file ( void *ptr, size_t size, size_t nmemb, void *stream); + static int callback (void *clientp,double dltotal,double dlnow,double , double); + static int passwd (void *clientp, const char *prompt, char *buffer, int buflen); + + + CURL* curl; + BString fUrl; //from. + entry_ref fDest; + //BLooper* fTarget; //target progess + //uint32 fMsg; + BMessage extraInfo; + bool fShouldStop; + BFile* file; + double resuming; + bool fAllowResume; + + BString fFileType; +}; + +#endif diff --git a/library/libfunky/extra/Colors.h b/library/libfunky/extra/Colors.h new file mode 100644 index 0000000..42a582f --- /dev/null +++ b/library/libfunky/extra/Colors.h @@ -0,0 +1,53 @@ +//Useful until be gets around to making these sorts of things +//globals akin to be_plain_font, etc. + + +#ifndef _SGB_COLORS_H_ +#define _SGB_COLORS_H_ + + +//****************************************************************************************************** +//**** SYSTEM HEADER FILES +//****************************************************************************************************** +#include + + +//****************************************************************************************************** +//**** CONSTANT DEFINITIONS +//****************************************************************************************************** +//Be standard UI colors +const rgb_color BeBackgroundGrey = {216,216,216, 255}; +const rgb_color BeInactiveControlGrey = {240,240,240, 255}; +const rgb_color BeFocusBlue = {0, 0, 229, 255}; +const rgb_color BeHighlight = {255,255,255, 255}; +const rgb_color BeShadow = {152,152,152, 255}; +const rgb_color BeDarkShadow = {108,108,108, 255}; +const rgb_color BeLightShadow = {194,194,194, 255}; +const rgb_color BeButtonGrey = {232,232,232, 255}; +const rgb_color BeInactiveGrey = {127,127,127, 255}; +const rgb_color BeListSelectGrey = {178,178,178, 255}; +const rgb_color BeTitleBarYellow = {255,203,0, 255}; + +//Other colors +const rgb_color Black = {0, 0, 0, 255}; +const rgb_color White = {255,255,255, 255}; +const rgb_color Red = {255,0, 0, 255}; +const rgb_color Green = {0, 167,0, 255}; +const rgb_color LightGreen = {90, 240,90, 255}; +const rgb_color Blue = {49, 61, 225, 255}; +const rgb_color LightBlue = {64, 162,255, 255}; +const rgb_color Purple = {144,64, 221, 255}; +const rgb_color LightPurple = {166,74, 255, 255}; +const rgb_color Lavender = {193,122,255, 255}; +const rgb_color Yellow = {255,203,0, 255}; +const rgb_color Orange = {255,163,0, 255}; +const rgb_color Flesh = {255,231,186, 255}; +const rgb_color Tan = {208,182,121, 255}; +const rgb_color Brown = {154,110,45, 255}; +const rgb_color Grey = {200,200,200, 255}; +const rgb_color LightMetallicBlue = {143,166,240, 255}; +const rgb_color MedMetallicBlue = {75, 96, 154, 255}; +const rgb_color DarkMetallicBlue = {78, 89, 126, 255}; + + +#endif diff --git a/library/libfunky/extra/Hashtable.h b/library/libfunky/extra/Hashtable.h new file mode 100644 index 0000000..11e8c01 --- /dev/null +++ b/library/libfunky/extra/Hashtable.h @@ -0,0 +1,1609 @@ +/* This file is Copyright 2005 Level Control Systems. See the included LICENSE.txt file for details. */ + +#ifndef MuscleHashtable_h +#define MuscleHashtable_h + +#include "support/MuscleSupport.h" + +#ifdef _MSC_VER +# pragma warning(disable: 4786) +#endif + +#ifndef MUSCLE_HASHTABLE_DEFAULT_CAPACITY +# define MUSCLE_HASHTABLE_DEFAULT_CAPACITY 7 +#endif + +BEGIN_NAMESPACE(muscle); + +// implementation detail; please ignore this! +static const uint32 MUSCLE_HASHTABLE_INVALID_HASH_CODE = (uint32)-1; + +/** This hashing functor type handles the "easy" cases, where the KeyType is + * something that can be static_cast into a uint32 by the compiler. + * For more complicated key types, you'll need to define your own + * specialization of this functor template. (See util/String.h for an example of this) + */ +template class HashFunctor +{ +public: + /** Default implementation just casts the key to a uint32 to get the hash value. */ + uint32 operator () (const T x) const {return (uint32) x;} +}; + +template class Hashtable; // forward declaration + +/** + * This class is an iterator object, used for iterating over the set + * of keys or values in a Hashtable. Note that the Hashtable + * maintains the ordering of keys and values, unlike many hash table + * implementations. + * + * Given a Hashtable object, you can obtain one or more of these + * iterator objects by calling the Hashtable's GetIterator() method. + * + * This iterator actually contains separate state for two iterations: + * one for iterating over the values in the Hashtable, and one for + * iterating over the keys. These two iterations can be done independently + * of each other. + * + * It is safe to modify or delete a hashtable during a traversal; the active iterators + * will be automatically notified so that they do the right thing. + */ +template > class HashtableIterator +{ +public: + /** + * Default constructor. It's here only so that you can include HashtableIterators + * as member variables, in arrays, etc. HashtableIterators created with this + * constructor are "empty", so they won't be useful until you set them equal to a + * HashtableIterator that was returned by Hashtable::GetIterator(). + */ + HashtableIterator(); + + /** Copy Constructor. */ + HashtableIterator(const HashtableIterator & rhs); + + /** Convenience Constructor -- makes an iterator equivalent to the value returned by table.GetIterator(). */ + HashtableIterator(const Hashtable & table, bool backwards = false); + + /** Convenience Constructor -- makes an iterator equivalent to the value returned by table.GetIteratorAt(). */ + HashtableIterator(const Hashtable & table, const KeyType & startAt, bool backwards); + + /** Destructor */ + ~HashtableIterator(); + + /** Assignment operator. */ + HashtableIterator & operator=(const HashtableIterator & rhs); + + /** Returns true iff there are more keys left in the key traversal. */ + bool HasMoreKeys() const {return (_nextKeyCookie != NULL);} + + /** + * Gets the next key in the key traversal. + * @param setNextKey On success, the next key is copied into this object. + * @return B_NO_ERROR on success, B_ERROR if there are no more keys left. + */ + status_t GetNextKey(KeyType & setNextKey); + + /** + * Gets a pointer to the next key in the key traversal. + * Note that the returned pointer is only guaranteed valid as long as the Hashtable remains unchanged. + * @return A pointer to the next key in the key traversal, or NULL if there are no more keys left. + */ + const KeyType * GetNextKey(); + + /** + * Peek at the next key without modifying the state of the traversal. + * @param setKey On success, the next key is copied into this object. + * @return B_NO_ERROR on success, or B_ERROR if there are no more keys left. + */ + status_t PeekNextKey(KeyType & setKey) const; + + /** + * Peek at the next key without modifying the state of the traversal. + * Note that the returned pointer is only guaranteed valid as long as the Hashtable remains unchanged. + * @return a pointer to the next key in the key traversal, or NULL if there are no keys left. + */ + const KeyType * PeekNextKey() const; + + /** Returns true iff there are more values left in the value traversal. */ + bool HasMoreValues() const {return (_nextValueCookie != NULL);} + + /** + * Get the next value in the values traversal. + * @param setNextValue On success, the next value in the traversal is copied into this object. + * @return B_NO_ERROR on success, B_ERROR if there are no more values left in the value traversal. + */ + status_t GetNextValue(ValueType & setNextValue); + + /** + * Get the next value in the values traversal. + * Note that the returned pointer is only guaranteed valid as long as the Hashtable remains unchanged. + * @return a pointer to the next value in the value traversal, or NULL if there are no values left. + */ + ValueType * GetNextValue(); + + /** + * Peek at the next value without modifying the state of the traversal. + * @param setValue On success, the next value is copied into this object. + * @return B_NO_ERROR on success, or B_ERROR if there are no more values left. + */ + status_t PeekNextValue(ValueType & setValue) const; + + /** + * Peek at the next value without modifying the state of the traversal. + * Note that the returned pointer is only guaranteed valid as long as the Hashtable remains unchanged. + * @return a pointer to the next value in the value traversal, or NULL if there are no values left. + */ + ValueType * PeekNextValue() const; + + /** Convenience method -- equivalent to calling both GetNextKey() and GetNextValue(). + * @param setKey on success, this parameter will contain the next key in the iteration. + * @param setValue on success, this parameter will contain the next value in the iteration. + * @returns B_NO_ERROR if values were written into (setKey) and (setValue), or B_ERROR if the iteration is complete. + */ + status_t GetNextKeyAndValue(KeyType & setKey, ValueType & setValue); + + /** Convenience method -- equivalent to calling both GetNextKey() and GetNextValue(). + * @param setKey on success, this parameter will contain the next key in the iteration. + * @param setValuePtr on success, this pointer will point to the next value in the iteration. + * @returns B_NO_ERROR if values were written into (setKey) and (setValue), or B_ERROR if the iteration is complete. + */ + status_t GetNextKeyAndValue(KeyType & setKey, ValueType * & setValuePtr); + + /** Convenience method -- equivalent to calling both GetNextKey() and GetNextValue(). + * @param setKey on success, this parameter will contain the next key in the iteration. + * @param setValuePtr on success, this pointer will point to the next value in the iteration. + * @returns B_NO_ERROR if values were written into (setKey) and (setValue), or B_ERROR if the iteration is complete. + */ + status_t GetNextKeyAndValue(KeyType & setKey, const ValueType * & setValuePtr); + + /** Convenience method -- equivalent to calling both GetNextKey() and GetNextValue(). + * @param setKeyPtr on success, this pointer will point to the next key in the iteration. + * @param setValue on success, this parameter will contain the next value in the iteration. + * @returns B_NO_ERROR if values were written into (setKey) and (setValue), or B_ERROR if the iteration is complete. + */ + status_t GetNextKeyAndValue(const KeyType * & setKeyPtr, ValueType & setValue); + + /** Convenience method -- equivalent to calling both GetNextKey() and GetNextValue(). + * @param setKeyPtr on success, this pointer will point to the next key in the iteration. + * @param setValuePtr on success, this pointer will point to the next value in the iteration. + * @returns B_NO_ERROR if values were written into (setKey) and (setValue), or B_ERROR if the iteration is complete. + */ + status_t GetNextKeyAndValue(const KeyType * & setKeyPtr, ValueType * & setValuePtr); + + /** Convenience method -- equivalent to calling both GetNextKey() and GetNextValue(). + * @param setKeyPtr on success, this pointer will point to the next key in the iteration. + * @param setValuePtr on success, this pointer will point to the next value in the iteration. + * @returns B_NO_ERROR if values were written into (setKey) and (setValue), or B_ERROR if the iteration is complete. + */ + status_t GetNextKeyAndValue(const KeyType * & setKeyPtr, const ValueType * & setValuePtr); + +private: + void SetOwner(const Hashtable * optTable); + + /** The Hashtable class needs access to our internals to do the iteration operation */ + friend class Hashtable; + + void * _scratchSpace[2]; // ignore this; it's temp scratch space used by EnsureSize(). + + void * _nextKeyCookie; + void * _nextValueCookie; + bool _backwards; + + HashtableIterator * _prevIter; // for the doubly linked list so that the table can notify us if it is modified + HashtableIterator * _nextIter; // for the doubly linked list so that the table can notify us if it is modified + const Hashtable * _owner; // table that we are associated with +}; + +/** + * This is a handy templated Hashtable class, rather similar to Java's java.util.Hashtable, + * but with a number of enhancements. Enhancements include: Iterator objects that are + * safe to use even if the table is modified or deleted during a traversal (not thread-safe though), + * traversal ordering is maintained at all times and may optionally be sorted or auto-sorted, + * and the traversal order may be manually changed as well. + * + * The Hashtable class uses a HashFunctor template argument to specify how the hash code for + * a given KeyType object can be computed. For built-in numeric types (e.g. int, long, etc) + * the default HashFunctor can be used. For more complex types (e.g. class objects), you will + * need to either create your own custom HashFunctor, or add a () operator to your class that + * returns a uint32 HashCode. The best way to do a custom HashFunctor is to specialize the + * default HashFunctor type for your class; check the example in util/String.h for how to do this. + */ +template > class Hashtable +{ +public: + /** This is the signature of the type of callback function that you can pass into the + * SetKeyCompareFunction() and SortByKey() methods. The function should work like strcmp(), + * return a negative value if (key1) is less than (key2), 0 if the two keys are equal, + * or a positive value if (key1) is greater than (key2). + * @param key1 The first key. + * @param key2 The second key. + * @param cookie A user-defined value that was passed in to the Sort() or SetCompareCookie() method. + * @return An integer indicating which key is "larger", as defined above. + */ + typedef int (*KeyCompareFunc)(const KeyType& key1, const KeyType& key2, void * cookie); + + /** This is the signature of the type of callback function that you can pass into the + * SetValueCompareFunction() and SortByValue() methods. The function should work like strcmp(), + * return a negative value if (value1) is less than (value2), 0 if the two values are equal, + * or a positive value if (value1) is greater than (value2). + * @param value1 The first value. + * @param value2 The second value. + * @param cookie A user-defined value that was passed in to the Sort() or SetCompareCookie() method. + * @return An integer indicating which value is "larger", as defined above. + */ + typedef int (*ValueCompareFunc)(const ValueType& key1, const ValueType& key2, void * cookie); + + /** Tokens for the various auto-sort modes we know how to do. */ + enum { + AUTOSORT_DISABLED = 0, + AUTOSORT_BY_KEY, + AUTOSORT_BY_VALUE + }; + + /** This constructor creates a standard, non-sorting Hashtable. + * @param initialCapacity Specifies the number of table slots to initially pre-allocate. Defaults to 7. + */ + Hashtable(uint32 initialCapacity = MUSCLE_HASHTABLE_DEFAULT_CAPACITY); + + /** Copy Constructor. */ + Hashtable(const Hashtable & rhs); + + /** Assignment operator. */ + Hashtable & operator= (const Hashtable & rhs); + + /** Equality operator. Returns true iff both hash tables contains the same set of keys and values. + * Note that the ordering of the keys is NOT taken into account! + */ + bool operator== (const Hashtable & rhs) const; + + /** Returns the opposite of the equality operator. */ + bool operator!= (const Hashtable & rhs) const {return !(*this == rhs);} + + /** Destructor. */ + ~Hashtable(); + + /** Returns the number of items stored in the table. */ + uint32 GetNumItems() const {return _count;} + + /** Convenience method; Returns true iff the table is empty (i.e. if GetNumItems() is zero). */ + bool IsEmpty() const {return _count == 0;} + + /** Returns true iff the table contains a mapping with the given key. (O(1) search time) */ + bool ContainsKey(const KeyType& key) const {return ((_count>0)&&(GetEntry(ComputeHash(key), key) != NULL));} + + /** Returns true iff the table contains a mapping with the given value. (O(n) search time) */ + bool ContainsValue(const ValueType& value) const; + + /** Returns the given key's position in the hashtable's linked list, or -1 if the key wasn't found. O(n) count time (if the key exists, O(1) if it doesn't) */ + int32 IndexOfKey(const KeyType& key) const; + + /** Attempts to retrieve the associated value from the table for a given key. (O(1) lookup time) + * @param key The key to use to look up a value. + * @param setValue On success, the associated value is copied into this object. + * @return B_NO_ERROR on success, B_ERROR if their was no value found for the given key. + */ + status_t GetValue(const KeyType& key, ValueType& setValue) const; + + /** Retrieve a pointer to the associated value object for the given key. (O(1) lookup time) + * @param key The key to use to look up a value. + * @return A pointer to the internally held value object for the given key, + * or NULL of no object was found. Note that this object is only + * guaranteed to remain valid as long as the Hashtable remains unchanged. + */ + ValueType * GetValue(const KeyType & key) const; + + /** Given a lookup key, returns the a copy of the actual key as held by the table. + * This method is only useful in rare situations where the hashing or comparison + * functions are such that lookupKeys and held keys are not guaranteed equivalent. + * @param lookupKey The key used to look up the held key object. + * @param setKey On success, the actual key held in the table is placed here. + * @return B_NO_ERROR on success, or B_ERROR on failure. + */ + status_t GetKey(const KeyType & lookupKey, KeyType & setKey) const; + + /** Given a key, returns a pointer to the actual key object in this table that matches + * that key, or NULL if there is no matching key. This method is only useful in rare + * situations where the hashing or comparison functions are such that lookup keys and + * held keys are not guaranteed equivalent. + * @param lookupKey The key used to look up the key object + * @return A pointer to an internally held key object on success, or NULL on failure. + */ + const KeyType * GetKey(const KeyType & lookupKey) const; + + /** Get an iterator for use with this table. + * @param backwards Set this to true if you want to iterate through the item list backwards. Defaults to false. + * @return an iterator object that can be used to examine the items in the hash table. + */ + HashtableIterator GetIterator(bool backwards = false) const + { + HashtableIterator ret; + InitializeIterator(ret, backwards); + return ret; + } + + /** Get an iterator for use with this table, starting at the given entry. + * @param startAt The key in this table to start the iteration at. + * @param backwards Set this to true if you want to iterate through the item list backwards. Defaults to false. + * @return an iterator object that can be used to examine the items in the hash table, starting at + * the specified key. If the specified key is not in this table, an empty iterator will be returned. + */ + HashtableIterator GetIteratorAt(const KeyType & startAt, bool backwards = false) const + { + HashtableIterator ret; + InitializeIteratorAt(ret, startAt, backwards); + return ret; + } + + /** Returns a pointer to the (index)'th key in this Hashtable. + * (This Hashtable class keeps its entries in a well-defined order) + * Note that this method is an O(N) operation, so for iteration, always use GetIterator() instead. + * @param index Index of the key to return a pointer to. Should be in the range [0, GetNumItems()-1]. + * @returns Pointer to the key at position (index) on success, or NULL on failure (bad index?) + */ + const KeyType * GetKeyAt(uint32 index) const; + + /** Returns the (index)'th key in this Hashtable. + * (This Hashtable class keeps its entries in a well-defined order) + * Note that this method is an O(N) operation, so for iteration, always use GetIterator() instead. + * @param index Index of the key to return a pointer to. Should be in the range [0, GetNumItems()-1]. + * @param retKey On success, the contents of the (index)'th key will be written into this object. + * @return B_NO_ERROR on success, or B_ERROR on failure. + */ + status_t GetKeyAt(uint32 index, KeyType & retKey) const; + + /** Places the given (key, value) mapping into the table. Any previous entry with a key of (key) will be replaced. + * (average O(1) insertion time, unless auto-sorting is enabled, in which case it becomes O(N) insertion time for + * keys that are not already in the table) + * @param key The key that the new value is to be associated with. + * @param value The value to associate with the new key. + * @param setPreviousValue If there was a previously existing value associated with (key), it will be copied into this object. + * @param optSetReplaced If set non-NULL, this boolean will be set to true if (setPreviousValue) was written into, false otherwise. + * @return B_NO_ERROR If the operation succeeded, B_ERROR if it failed (out of memory?) + */ + status_t Put(const KeyType& key, const ValueType& value, ValueType & setPreviousValue, bool * optSetReplaced = NULL) {return (PutAux(ComputeHash(key), key, value, &setPreviousValue, optSetReplaced) != NULL) ? B_NO_ERROR : B_ERROR;} + + /** Places the given (key, value) mapping into the table. Any previous entry with a key of (key) will be replaced. + * (average O(1) insertion time, unless auto-sorting is enabled, in which case it becomes O(N) insertion time for + * keys that are not already in the table) + * @param key The key that the new value is to be associated with. + * @param value The value to associate with the new key. + * @return B_NO_ERROR If the operation succeeded, B_ERROR if it failed (out of memory?) + */ + status_t Put(const KeyType& key, const ValueType& value) {return (PutAux(ComputeHash(key), key, value, NULL, NULL) != NULL) ? B_NO_ERROR : B_ERROR;} + + /** Removes a mapping from the table. (O(1) removal time) + * @param key The key of the key-value mapping to remove. + * @return B_NO_ERROR if a key was found and the mapping removed, or B_ERROR if the key wasn't found. + */ + status_t Remove(const KeyType& key) {return RemoveAux(key, NULL);} + + /** Removes the mapping with the given (key) and places its value into (setRemovedValue). (O(1) removal time) + * @param key The key of the key-value mapping to remove. + * @param setRemovedValue On success, the removed value is copied into this object. + * @return B_NO_ERROR if a key was found and the mapping removed, or B_ERROR if the key wasn't found. + */ + status_t Remove(const KeyType& key, ValueType & setRemovedValue) {return RemoveAux(key, &setRemovedValue);} + + /** Removes all mappings from the hash table. (O(N) clear time) + * @param releaseCachedData If set true, we will immediately free any buffers we may contain. + * Otherwise, we'll keep them around in case they can be re-used later on. + */ + void Clear(bool releaseCachedData = false); + + /** This method can be used to activate or deactivate auto-sorting on this Hashtable. + * If active, auto-sorting ensures that whenever Put() is called, the new/updated item is + * moved to the correct place in the iterator traversal list. Note that using auto-sort + * means that Put() becomes an O(N) operation instead of O(1). + * Default mode is AUTOSORT_DISABLED. + * @param mode Either AUTOSORT_DISABLED, AUTOSORT_BY_KEY, or AUTOSORT_BY_VALUE. + * @param sortNow If true, Sort() will be called to ensure that the table is in a sorted state. + * You can avoid an immediate sort by specifying this parameter as false, but be aware + * that auto-sorting won't sort properly if the contents of the table aren't already in + * in a correctly sorted state--so you may then need to call Sort() before auto-sorting + * will sort properly. + */ + void SetAutoSortMode(int mode, bool sortNow = true) {_autoSortMode = mode; if (sortNow) (void) Sort();} + + /** Returns this hash table's current auto-sort mode. */ + int GetAutoSortMode() const {return _autoSortMode;} + + /** This method can be used to set the "cookie value" that will be passed in to the + * comparison functions specified by SetKeyCompareFunction() and SetValueCompareFunction(). + * This value will be passed along during whenever a user-defined compare function is called implicitely. + * + */ + void SetCompareCookie(void * cookie) {_compareCookie = cookie;} + + /** Returns the current comparison cookie, as previously set by SetCompareCookie(). Default value is NULL. */ + void * GetCompareCookie() const {return _compareCookie;} + + /** You can call this to set a custom function to use to compare keys. By default, the Key class's '==' operator + * is used to compare keys, and no key sorting is done. But for some key types (e.g. const char *'s) '==' is not + * terribly useful, and in any case it doesn't handle sorting properly, so if you like you you can supply your + * own key-comparison-function here. + * @see KeyCompareFunc for a description of the callback function's required semantics. + * @param func The new comparison function to use for this table, or NULL to revert to no key-sorting-function. + */ + void SetKeyCompareFunction(KeyCompareFunc func) {_userKeyCompareFunc = func;} + + /** Returns the current comparison function used for comparing keys. Default value is NULL. */ + KeyCompareFunc GetKeyCompareFunction() const {return _userKeyCompareFunc;} + + /** You can call this to set a custom function to use to compare values. By default, no value sorting is done. + * If you wish to enable auto-sort-by-value, you will need to a value-comparison-function here. + * @see ValueCompareFunc for a description of the callback function's required semantics. + * @param func The new comparison function to use for this table, or NULL to revert to no value-sorting-function. + */ + void SetValueCompareFunction(ValueCompareFunc func) {_userValueCompareFunc = func;} + + /** Returns the current comparison function used for comparing values. Default value is NULL. */ + ValueCompareFunc GetValueCompareFunction() const {return _userValueCompareFunc;} + + /** This method doesn anhefficient zero-copy swap of this hash table's contents with those of (swapMe). + * That is to say, when this method returns, (swapMe) will be identical to the old state of this + * Hashtable, and this Hashtable will be identical to the old state of (swapMe). + * Any active iterators present for either table will swap owners also, becoming associated with the other table. + * @param swapMe The table whose contents and iterators are to be swapped with this table's. + */ + void SwapContents(Hashtable & swapMe); + + /** Moves the given entry to the head of the HashtableIterator traversal sequence. + * Note that calling this method is generally a bad idea of the table is in auto-sort mode, + * as it is likely to unsort the traversal ordering and thus break auto-sorting. However, + * calling Sort() will restore the sort-order and make auto-sorting work again) + * @param moveMe Key of the item to be moved to the front of the sequence. + * @return B_NO_ERROR on success, or B_ERROR if (moveMe) was not found in the table. + */ + status_t MoveToFront(const KeyType & moveMe); + + /** Moves the given entry to the tail of the HashtableIterator traversal sequence. + * Note that calling this method is generally a bad idea of the table is in auto-sort mode, + * as it is likely to unsort the traversal ordering and thus break auto-sorting. However, + * calling Sort() will restore the sort-order and make auto-sorting work again) + * @param moveMe Key of the item to be moved to the end of the sequence. + * @return B_NO_ERROR on success, or B_ERROR if (moveMe) was not found in the table. + */ + status_t MoveToBack(const KeyType & moveMe); + + /** Moves the given entry to the spot just in front of the other specified entry in the + * HashtableIterator traversal sequence. + * Note that calling this method is generally a bad idea of the table is in auto-sort mode, + * as it is likely to unsort the traversal ordering and thus break auto-sorting. However, + * calling Sort() will restore the sort-order and make auto-sorting work again) + * @param moveMe Key of the item to be moved. + * @param toBeforeMe Key of the item that (moveMe) should be placed in front of. + * @return B_NO_ERROR on success, or B_ERROR if (moveMe) was not found in the table, + * or was the same item as (toBeforeMe). + */ + status_t MoveToBefore(const KeyType & moveMe, const KeyType & toBeforeMe); + + /** Moves the given entry to the spot just behind the other specified entry in the + * HashtableIterator traversal sequence. + * Note that calling this method is generally a bad idea of the table is in auto-sort mode, + * as it is likely to unsort the traversal ordering and thus break auto-sorting. However, + * calling Sort() will restore the sort-order and make auto-sorting work again) + * @param moveMe Key of the item to be moved. + * @param toBehindMe Key of the item that (moveMe) should be placed behind. + * @return B_NO_ERROR on success, or B_ERROR if (moveMe) was not found in the table, + * or was the same item as (toBehindMe). + */ + status_t MoveToBehind(const KeyType & moveMe, const KeyType & toBehindMe); + + /** Forcefully sorts the iteration traversal list of this table using the preferred sorting mode. + * The preferred sorting mode will be determined as follows: + *
    + *
  1. If the auto-sort mode is set, the auto-sort mode will be used.
  2. + *
  3. Else if the sort-by-value callback function is set, sort-by-value will be used.
  4. + *
  5. Else if the sort-by-key callback function is set, sort-by-key will be used.
  6. + *
  7. Else we return B_ERROR.
  8. + *
+ * This method uses a very efficient O(log(N)) MergeSort algorithm. + * @return B_NO_ERROR on success, or B_ERROR if no sort method could be determined (as described above) + */ + status_t Sort() {return SortByAux((_autoSortMode != AUTOSORT_BY_VALUE) ? _userKeyCompareFunc : NULL, (_autoSortMode != AUTOSORT_BY_KEY) ? _userValueCompareFunc : NULL, _compareCookie);} + + /** Forcefully sorts the iteration traversal list of this table using the given key comparison function. + * This method uses a very efficient O(log(N)) MergeSort algorithm. + * @param func The key-comparison function to use. (If NULL, this call becomes a no-op) + * @param optCompareCookie Optional cookie to pass to func(). + */ + void SortByKey(KeyCompareFunc func, void * optCompareCookie = NULL) {(void) SortByAux(func, NULL, optCompareCookie);} + + /** Forcefully sorts the iteration traversal list of this table using the given value comparison function. + * This method uses a very efficient O(log(N)) MergeSort algorithm. + * @param func The value-comparison function to use. (If NULL, this call becomes a no-op) + * @param optCompareCookie Optional cookie to func(). + */ + void SortByValue(ValueCompareFunc func, void * optCompareCookie = NULL) {(void) SortByAux(NULL, func, optCompareCookie);} + + /** Synonym for GetValue(), retained for compatibility with old code. + * @deprecated Use GetValue() instead + */ + status_t Get(const KeyType& key, ValueType& setValue) const {return GetValue(key, setValue);} + + /** Synonym for GetValue(), retained for compatibility with old code. + * @deprecated Use GetValue() instead + */ + ValueType * Get(const KeyType & key) const {return GetValue(key);} + + /** Convenience method -- returns a pointer to the value specified by (key), + * or if no such value exists, it will Put() a (key,value) pair in the Hashtable, + * and then return a pointer to the newly-placed value. Returns NULL on + * error only (out of memory?) + * @param key The key to look for a value with + * @param defValue The value to auto-place in the Hashtable if (key) isn't found. + * @returns a Pointer to the retrieved or placed value. + */ + ValueType * GetOrPut(const KeyType & key, const ValueType & defValue = ValueType()) + { + ValueType * ret = Get(key); + if ((ret == NULL)&&(Put(key, defValue) == B_NO_ERROR)) ret = Get(key); + return ret; + } + + /** This method resizes the Hashtable larger if necessary, so that it has at least (newTableSize) + * entries in it. It is not necessary to call this method, but if you know in advance how many + * items you will be adding to the table, you can make the population of the table more efficient + * by calling this method before adding the items. This method will only grow the table, it will + * never shrink it. + * @param newTableSize Number of slots that you with to have in the table (note that this is different + * from the number of actual items in the table) + * @return B_NO_ERROR on success, or B_ERROR on failure (out of memory?) + */ + status_t EnsureSize(uint32 newTableSize); + + /** Returns the number of table-slots that we currently have allocated. Since we often + * pre-allocate slots to avoid unnecessary reallocations, this number will usually be + * greater than the value returned by GetNumItems(). It will never be less than that value. + */ + uint32 GetNumAllocatedSlots() const {return _tableSize;} + +private: + /** Our hashtable iterator class needs access to our internals to register itself with us. */ + friend class HashtableIterator; + + void InitializeIterator(HashtableIterator & iter, bool backwards) const + { + iter.SetOwner(this); + iter._backwards = backwards; + iter._nextKeyCookie = iter._nextValueCookie = (backwards ? _iterTail : _iterHead); + } + + void InitializeIteratorAt(HashtableIterator & iter, const KeyType & startAt, bool backwards) const + { + iter.SetOwner(this); + iter._backwards = backwards; + iter._nextKeyCookie = iter._nextValueCookie = ((_count>0)?GetEntry(ComputeHash(startAt), startAt):NULL); + } + + class HashtableEntry + { + public: + // Note: _bucketPrev and _bucketNext are intentionally not set here + HashtableEntry() : _hash(MUSCLE_HASHTABLE_INVALID_HASH_CODE), _iterPrev(NULL), _iterNext(NULL) +#ifndef _MSC_VER + , _mapTo(this), _mappedFrom(this) // this is slightly more efficient... +#endif + { +#ifdef _MSC_VER + _mapTo = this; // ... but VC++ complains if (this) is in the init list, so for VC++ we do it here + _mappedFrom = this; +#endif + } + + ~HashtableEntry() {/* empty */} + + // Frees up our memory and returns us to the free-list. + void ReturnToFreeList(const KeyType & defaultKey, const ValueType & defaultValue, HashtableEntry ** freeHead) + { + _hash = MUSCLE_HASHTABLE_INVALID_HASH_CODE; + _key = defaultKey; + _value = defaultValue; + + _iterPrev = _iterNext = _bucketPrev = NULL; + _bucketNext = *freeHead; + if (_bucketNext) _bucketNext->_bucketPrev = this; + *freeHead = this; + } + + /** Removes this entry from the free list, so that we are ready for use. + * @param freeHead current head of the free list + * @returns the new head of the free list + */ + HashtableEntry * RemoveFromFreeList(HashtableEntry * freeHead) + { + if (_bucketNext) _bucketNext->_bucketPrev = _bucketPrev; + if (_bucketPrev) _bucketPrev->_bucketNext = _bucketNext; + HashtableEntry * ret = (freeHead == this) ? _bucketNext : freeHead; + _bucketPrev = _bucketNext = NULL; + return ret; + } + + void SwapMaps(HashtableEntry * e) + { + muscleSwap(e->_mapTo, _mapTo); + _mapTo->_mappedFrom = this; + e->_mapTo->_mappedFrom = e; + } + + inline HashtableEntry * GetMapTo() const {return _mapTo;} + inline HashtableEntry * GetMappedFrom() const {return _mappedFrom;} + + static HashtableEntry * CreateEntriesArray(uint32 size) + { + HashtableEntry * ret = newnothrow_array(HashtableEntry,size); + if (ret) + { + HashtableEntry * prev = NULL; + for (uint32 i=0; i_bucketPrev = prev; + if (prev) prev->_bucketNext = cur; + prev = cur; + } + ret[size-1]._bucketNext = NULL; + } + else WARN_OUT_OF_MEMORY; + return ret; + } + + uint32 _hash; // precalculated for efficiency + KeyType _key; // used for '==' checking + ValueType _value; // payload + HashtableEntry* _bucketPrev; // for making linked lists in our bucket + HashtableEntry* _bucketNext; // for making linked lists in our bucket + HashtableEntry* _iterPrev; // for user's table iteration + HashtableEntry* _iterNext; // for user's table iteration + + private: + HashtableEntry* _mapTo; + HashtableEntry* _mappedFrom; + }; + +private: + // Auxilliary methods + HashtableEntry * PutAux(uint32 hash, const KeyType& key, const ValueType& value, ValueType * optSetPreviousValue, bool * optReplacedFlag); + status_t RemoveAux(const KeyType& key, ValueType * setRemovedValue); + status_t SortByAux(KeyCompareFunc optKeyFunc, ValueCompareFunc optValueFunc, void * cookie); + + inline uint32 ComputeHash(const KeyType & key) const + { + uint32 ret = _functor(key); + if (ret == MUSCLE_HASHTABLE_INVALID_HASH_CODE) ret++; // avoid using the guard value as a hash code (unlikely but possible) + return ret; + } + + // Linked list maintainence + void InsertSortedIterationEntry(HashtableEntry * e, KeyCompareFunc optKeyFunc, ValueCompareFunc optValueCompareFunc, void * cookie); + void InsertIterationEntry(HashtableEntry * e, HashtableEntry * optBehindThisOne); + void RemoveIterationEntry(HashtableEntry * e); + HashtableEntry * GetEntry(uint32 hash, const KeyType& key) const; + HashtableEntry * GetEntryAt(uint32 idx) const; + bool IsBucketHead(const HashtableEntry * e) const {return ((e->_hash != MUSCLE_HASHTABLE_INVALID_HASH_CODE)&&(_table[e->_hash%_tableSize].GetMapTo() == e));} + + int CompareEntries(const HashtableEntry & left, const HashtableEntry & right, KeyCompareFunc optKeyFunc, ValueCompareFunc optValueFunc, void * cookie) const; + + // HashtableIterator's private API + void RegisterIterator(HashtableIterator * iter) const + { + // add him to the head of our linked list of iterators + iter->_prevIter = NULL; + iter->_nextIter = _iterList; + if (_iterList) _iterList->_prevIter = iter; + _iterList = iter; + } + + void UnregisterIterator(HashtableIterator * iter) const + { + if (iter->_prevIter) iter->_prevIter->_nextIter = iter->_nextIter; + if (iter->_nextIter) iter->_nextIter->_prevIter = iter->_prevIter; + if (iter == _iterList) _iterList = iter->_nextIter; + iter->_prevIter = iter->_nextIter = NULL; + } + + KeyType * GetKeyFromCookie(void * c) const {return c ? &(((HashtableEntry *)c)->_key) : NULL;} + ValueType * GetValueFromCookie(void * c) const {return c ? &(((HashtableEntry *)c)->_value) : NULL;} + + void IterateCookie(void ** c, bool backwards) const + { + HashtableEntry * entry = *((HashtableEntry **)c); + *c = entry ? (backwards ? entry->_iterPrev : entry->_iterNext) : NULL; + } + + uint32 NextPrime(uint32 start) const; + + const uint32 _initialCapacity; + uint32 _count; // the number of valid elements in the hashtable + uint32 _tableSize; // the number of entries in _table (or the number to allocate if _table is NULL) + + HashtableEntry * _table; // our array of table entries + HashtableEntry * _iterHead; // start of linked list to iterate through + HashtableEntry * _iterTail; // end of linked list to iterate through + + HashtableEntry * _freeHead; // head of the list of unused HashtableEntries in our _table array + + KeyCompareFunc _userKeyCompareFunc; // (optional) used to compare two Keys + ValueCompareFunc _userValueCompareFunc; // (optional) used to compare two Values + int _autoSortMode; // one of the AUTOSORT_BY_* tokens + void * _compareCookie; // (optional) passed to the CompareFuncs + + HashFunctorType _functor; // used to compute hash codes for key objects + + mutable HashtableIterator * _iterList; // list of existing iterators for this table +}; + +//=============================================================== +// Implementation of Hashtable +// Necessary location for appropriate template instantiation. +//=============================================================== +template +Hashtable::Hashtable(uint32 initialCapacity) + : _initialCapacity(initialCapacity), _count(0), _tableSize(initialCapacity), _table(NULL), _iterHead(NULL), _iterTail(NULL), _freeHead(NULL), _userKeyCompareFunc(NULL), _userValueCompareFunc(NULL), _autoSortMode(AUTOSORT_DISABLED), _compareCookie(NULL), _iterList(NULL) +{ + // empty +} + +template +Hashtable:: +Hashtable(const Hashtable & rhs) + : _initialCapacity(rhs._initialCapacity), _count(0), _tableSize(rhs._tableSize), _table(NULL), _iterHead(NULL), _iterTail(NULL), _freeHead(NULL), _userKeyCompareFunc(rhs._userKeyCompareFunc), _userValueCompareFunc(rhs._userValueCompareFunc), _autoSortMode(rhs._autoSortMode), _compareCookie(rhs._compareCookie), _iterList(NULL) +{ + *this = rhs; +} + +template +Hashtable & +Hashtable :: +operator=(const Hashtable & rhs) +{ + if (this != &rhs) + { + Clear(); + if (EnsureSize(rhs.GetNumItems()) == B_NO_ERROR) + { + HashtableIterator iter(rhs); + const KeyType * nextKey; + while((nextKey = iter.GetNextKey()) != NULL) (void) Put(*nextKey, *iter.GetNextValue()); // no good way to handle out-of-mem here? + } + } + return *this; +} + +template +bool +Hashtable :: +operator==(const Hashtable & rhs) const +{ + if (this == &rhs) return true; + if (GetNumItems() != rhs.GetNumItems()) return false; + + HashtableIterator iter(*this); + const KeyType * myNextKey; + const ValueType * myNextValue; + while(iter.GetNextKeyAndValue(myNextKey, myNextValue) == B_NO_ERROR) + { + const ValueType * hisNextValue = rhs.Get(*myNextKey); + if ((hisNextValue == NULL)||(*hisNextValue != *myNextValue)) return false; + } + return true; +} + +template +Hashtable::~Hashtable() +{ + Clear(); + delete [] _table; +} + +template +bool +Hashtable::ContainsValue(const ValueType& value) const +{ + HashtableIterator iter(*this); + ValueType * v; + while((v = iter.GetNextValue()) != NULL) if (*v == value) return true; + return false; +} + +template +int32 +Hashtable::IndexOfKey(const KeyType& key) const +{ + const HashtableEntry * entry = (_count>0)?GetEntry(ComputeHash(key), key):NULL; + int32 count = -1; + if (entry) + { + if (entry == _iterTail) count = GetNumItems()-1; + else + { + while(entry) + { + entry = entry->_iterPrev; + count++; + } + } + } + return count; +} + +template +const KeyType * +Hashtable::GetKeyAt(uint32 index) const +{ + HashtableEntry * e = GetEntryAt(index); + return e ? &e->_key : NULL; +} + +template +status_t +Hashtable::GetKeyAt(uint32 index, KeyType & retKey) const +{ + HashtableEntry * e = GetEntryAt(index); + if (e) + { + retKey = e->_key; + return B_NO_ERROR; + } + return B_ERROR; +} + +template +status_t +Hashtable::GetValue(const KeyType& key, ValueType & setValue) const +{ + ValueType * ptr = GetValue(key); + if (ptr) + { + setValue = *ptr; + return B_NO_ERROR; + } + else return B_ERROR; +} + +template +ValueType * +Hashtable::GetValue(const KeyType& key) const +{ + HashtableEntry * e = (_count>0)?GetEntry(ComputeHash(key), key):NULL; + return e ? &e->_value : NULL; +} + +template +const KeyType * +Hashtable::GetKey(const KeyType& lookupKey) const +{ + HashtableEntry * e = (_count>0)?GetEntry(ComputeHash(lookupKey), lookupKey):NULL; + return e ? &e->_key : NULL; +} + +template +status_t +Hashtable::GetKey(const KeyType& lookupKey, KeyType & setKey) const +{ + const KeyType * ptr = GetKey(lookupKey); + if (ptr) + { + setKey = *ptr; + return B_NO_ERROR; + } + else return B_ERROR; +} + +template +typename Hashtable::HashtableEntry * +Hashtable::GetEntry(uint32 hash, const KeyType& key) const +{ + HashtableEntry * e = _table[hash%_tableSize].GetMapTo(); + if (IsBucketHead(e)) // if the e isn't the start of a bucket, then we know our entry doesn't exist + { + // While loops separated out for efficiency (one less if statement) --jaf + if (_userKeyCompareFunc) + { + while(e) + { + if ((e->_hash == hash)&&(_userKeyCompareFunc(e->_key, key, _compareCookie) == 0)) return e; + e = e->_bucketNext; + } + } + else + { + while(e) + { + if ((e->_hash == hash)&&(e->_key == key)) return e; + e = e->_bucketNext; + } + } + } + return NULL; +} + +template +typename Hashtable::HashtableEntry * +Hashtable::GetEntryAt(uint32 idx) const +{ + HashtableEntry * e = NULL; + if (idx < _count) + { + if (idx < _count/2) + { + e = _iterHead; + while((e)&&(idx--)) e = e->_iterNext; + } + else + { + idx = _count-(idx+1); + e = _iterTail; + while((e)&&(idx--)) e = e->_iterPrev; + } + } + return e; +} + +template +int +Hashtable::CompareEntries(const HashtableEntry & left, const HashtableEntry & right, KeyCompareFunc optKeyFunc, ValueCompareFunc optValueFunc, void * cookie) const +{ + return optValueFunc ? optValueFunc(left._value, right._value, cookie) : (optKeyFunc ? optKeyFunc(left._key, right._key, cookie) : 0); +} + +// Linked-list MergeSort adapted from Simon Tatham's C code at http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.c +template +status_t +Hashtable::SortByAux(KeyCompareFunc optKeyFunc, ValueCompareFunc optValueFunc, void * cookie) +{ + if ((optKeyFunc)||(optValueFunc)) + { + if (_iterHead) + { + for (uint32 mergeSize = 1; /* empty */; mergeSize *= 2) + { + HashtableEntry * p = _iterHead; + _iterHead = _iterTail = NULL; + + uint32 numMerges = 0; /* count number of merges we do in this pass */ + while(p) + { + numMerges++; /* there exists a merge to be done */ + + /* step `mergeSize' places along from p */ + HashtableEntry * q = p; + uint32 psize = 0; + for (uint32 i=0; i_iterNext; + if (!q) break; + } + + /* now we have two lists; merge them */ + for (uint32 qsize=mergeSize; ((psize > 0)||((qsize > 0)&&(q))); /* empty */) + { + HashtableEntry * e; + + /* decide whether next element of the merge comes from p or q */ + if (psize == 0) {e = q; q = q->_iterNext; qsize--;} + else if ((qsize == 0)||(!q)) {e = p; p = p->_iterNext; psize--;} + else if (CompareEntries(*p,*q,optKeyFunc,optValueFunc,cookie) <= 0) {e = p; p = p->_iterNext; psize--;} + else {e = q; q = q->_iterNext; qsize--;} + + /* append to our new more-sorted list */ + if (_iterTail) _iterTail->_iterNext = e; + else _iterHead = e; + e->_iterPrev = _iterTail; + _iterTail = e; + } + + p = q; /* now p has stepped `mergeSize' places along, and q has too */ + } + _iterTail->_iterNext = NULL; + if (numMerges <= 1) return B_NO_ERROR; + } + } + return B_NO_ERROR; // it's easy to sort an empty list :^) + } + return B_ERROR; +} + +template +status_t +Hashtable::EnsureSize(uint32 requestedSize) +{ + if (_tableSize >= requestedSize) return B_NO_ERROR; // no need to do anything if we're already big enough! + // 1. Initialize the scratch space for our active iterators. + { + HashtableIterator * nextIter = _iterList; + while(nextIter) + { + nextIter->_scratchSpace[0] = nextIter->_scratchSpace[1] = NULL; // these will hold our switch-to-on-success values + nextIter = nextIter->_nextIter; + } + } + + // 2. Create a new, bigger table, and fill it with a copy of all of our data. + Hashtable biggerTable(NextPrime(muscleMax(_count, requestedSize))); + biggerTable.SetKeyCompareFunction(_userKeyCompareFunc); + biggerTable.SetValueCompareFunction(_userValueCompareFunc); + biggerTable.SetCompareCookie(_compareCookie); + biggerTable.SetAutoSortMode(_autoSortMode); + { + HashtableEntry * next = _iterHead; + while(next) + { + HashtableEntry * hisClone = biggerTable.PutAux(next->_hash, next->_key, next->_value, NULL, NULL); + if (hisClone) + { + // Mark any iterators that will need to be redirected to point to the new nodes. + HashtableIterator * nextIter = _iterList; + while(nextIter) + { + if (nextIter->_nextKeyCookie == next) nextIter->_scratchSpace[0] = hisClone; + if (nextIter->_nextValueCookie == next) nextIter->_scratchSpace[1] = hisClone; + nextIter = nextIter->_nextIter; + } + } + else return B_ERROR; // oops, out of mem, too bad. + + next = next->_iterNext; + } + } + + // 3. Swap contents with the bigger table, but don't swap iterator lists (we want to keep ours!) + { + HashtableIterator * temp = _iterList; + _iterList = NULL; + SwapContents(biggerTable); + _iterList = temp; + } + + // 4. Lastly, fix up our iterators to point to their new entries. + { + HashtableIterator * nextIter = _iterList; + while(nextIter) + { + nextIter->_nextKeyCookie = nextIter->_scratchSpace[0]; + nextIter->_nextValueCookie = nextIter->_scratchSpace[1]; + nextIter = nextIter->_nextIter; + } + } + + return B_NO_ERROR; +} + +template +void +Hashtable::SwapContents(Hashtable & swapMe) +{ + muscleSwap(_count, swapMe._count); + muscleSwap(_tableSize, swapMe._tableSize); + muscleSwap(_table, swapMe._table); + muscleSwap(_iterHead, swapMe._iterHead); + muscleSwap(_iterTail, swapMe._iterTail); + muscleSwap(_freeHead, swapMe._freeHead); + muscleSwap(_userKeyCompareFunc, swapMe._userKeyCompareFunc); + muscleSwap(_userValueCompareFunc, swapMe._userValueCompareFunc); + muscleSwap(_autoSortMode, swapMe._autoSortMode); + muscleSwap(_compareCookie, swapMe._compareCookie); + muscleSwap(_iterList, swapMe._iterList); + + // Lastly, swap the owners of all iterators, so that they will unregister from the correct table when they die + { + HashtableIterator * next = _iterList; + while(next) + { + next->_owner = &swapMe; + next = next->_nextIter; + } + } + { + HashtableIterator * next = swapMe._iterList; + while(next) + { + next->_owner = this; + next = next->_nextIter; + } + } +} + +template +status_t +Hashtable::MoveToFront(const KeyType & moveMe) +{ + HashtableEntry * e = (_count>0)?GetEntry(ComputeHash(moveMe), moveMe):NULL; + if (e == NULL) return B_ERROR; + if (e->_iterPrev) + { + RemoveIterationEntry(e); + InsertIterationEntry(e, NULL); + } + return B_NO_ERROR; +} + +template +status_t +Hashtable::MoveToBack(const KeyType & moveMe) +{ + HashtableEntry * e = (_count>0)?GetEntry(ComputeHash(moveMe), moveMe):NULL; + if (e == NULL) return B_ERROR; + if (e->_iterNext) + { + RemoveIterationEntry(e); + InsertIterationEntry(e, _iterTail); + } + return B_NO_ERROR; +} + +template +status_t +Hashtable::MoveToBefore(const KeyType & moveMe, const KeyType & toBeforeMe) +{ + if (_count > 0) + { + HashtableEntry * e = GetEntry(ComputeHash(moveMe), moveMe); + HashtableEntry * f = GetEntry(ComputeHash(toBeforeMe), toBeforeMe); + if ((e == NULL)||(f == NULL)||(e == f)) return B_ERROR; + if (e->_iterNext != f) + { + RemoveIterationEntry(e); + InsertIterationEntry(e, f->_iterPrev); + } + return B_NO_ERROR; + } + else return B_ERROR; +} + +template +status_t +Hashtable::MoveToBehind(const KeyType & moveMe, const KeyType & toBehindMe) +{ + if (_count > 0) + { + HashtableEntry * d = GetEntry(ComputeHash(toBehindMe), toBehindMe); + HashtableEntry * e = GetEntry(ComputeHash(moveMe), moveMe); + if ((d == NULL)||(e == NULL)||(d == e)) return B_ERROR; + if (e->_iterPrev != d) + { + RemoveIterationEntry(e); + InsertIterationEntry(e, d); + } + return B_NO_ERROR; + } + else return B_ERROR; +} + +// Adds (e) to the end of our iteration linked list, or to an appropriate location to maintain sorting, if a sorting function is specified. +template +void +Hashtable::InsertSortedIterationEntry(HashtableEntry * e, KeyCompareFunc optKeyFunc, ValueCompareFunc optValueFunc, void * cookie) +{ + HashtableEntry * insertAfter = _iterTail; // default to appending to the end of the list + if ((_iterHead)&&((optKeyFunc)||(optValueFunc))) + { + // We're in sorted mode, so we'll try to place this guy in the correct position. + if (CompareEntries(*e, *_iterHead, optKeyFunc, optValueFunc, cookie) < 0) insertAfter = NULL; // easy; append to the head of the list + else if (CompareEntries(*e, *_iterTail, optKeyFunc, optValueFunc, cookie) < 0) // only iterate through if we're before the tail, otherwise the tail is fine + { + HashtableEntry * prev = _iterHead; + HashtableEntry * next = _iterHead->_iterNext; // more difficult; find where to insert into the middle + while(next) + { + if (CompareEntries(*e, *next, optKeyFunc, optValueFunc, cookie) < 0) + { + insertAfter = prev; + break; + } + else + { + prev = next; + next = next->_iterNext; + } + } + } + } + InsertIterationEntry(e, insertAfter); +} + +// Adds (e) to the our iteration linked list, behind (optBehindThis), or at the head if (optBehindThis) is NULL. +template +void +Hashtable::InsertIterationEntry(HashtableEntry * e, HashtableEntry * optBehindThis) +{ + e->_iterPrev = optBehindThis; + e->_iterNext = optBehindThis ? optBehindThis->_iterNext : _iterHead; + if (e->_iterPrev) e->_iterPrev->_iterNext = e; + else _iterHead = e; + if (e->_iterNext) e->_iterNext->_iterPrev = e; + else _iterTail = e; +} + +// Remove (e) from our iteration linked list +template +void +Hashtable::RemoveIterationEntry(HashtableEntry * e) +{ + // Update any iterators that were pointing at (e), so that they now point to the entry after e. + HashtableIterator * next = _iterList; + while(next) + { + if (next->_nextKeyCookie == e) (void) next->GetNextKey(); + if (next->_nextValueCookie == e) (void) next->GetNextValue(); + next = next->_nextIter; + } + + if (_iterHead == e) _iterHead = e->_iterNext; + if (_iterTail == e) _iterTail = e->_iterPrev; + if (e->_iterPrev) e->_iterPrev->_iterNext = e->_iterNext; + if (e->_iterNext) e->_iterNext->_iterPrev = e->_iterPrev; + e->_iterPrev = e->_iterNext = NULL; +} + +template +typename Hashtable::HashtableEntry * +Hashtable::PutAux(uint32 hash, const KeyType& key, const ValueType& value, ValueType * optSetPreviousValue, bool * optReplacedFlag) +{ + if (optReplacedFlag) *optReplacedFlag = false; + + if (_table == NULL) // demand-allocate this + { + _freeHead = _table = HashtableEntry::CreateEntriesArray(_tableSize); + if (_table == NULL) return NULL; + } + + // If we already have an entry for this key in the table, we can just replace its contents + HashtableEntry * e = GetEntry(hash, key); + if (e) + { + if (optSetPreviousValue) *optSetPreviousValue = e->_value; + if (optReplacedFlag) *optReplacedFlag = true; + e->_value = value; + if ((_autoSortMode == AUTOSORT_BY_VALUE)&&(_userValueCompareFunc)) + { + // If our new value has changed our position in the sort-order, then adjust the traversal list + if ((e->_iterPrev)&&(_userValueCompareFunc(e->_value, e->_iterPrev->_value, _compareCookie) < 0)) + { + const HashtableEntry * moveToBefore = e->_iterPrev; + while((moveToBefore->_iterPrev)&&(_userValueCompareFunc(e->_value, moveToBefore->_iterPrev->_value, _compareCookie) < 0)) moveToBefore = moveToBefore->_iterPrev; + (void) MoveToBefore(e->_key, moveToBefore->_key); + } + else if ((e->_iterNext)&&(_userValueCompareFunc(e->_value, e->_iterNext->_value, _compareCookie) > 0)) + { + const HashtableEntry * moveToBehind = e->_iterNext; + while((moveToBehind->_iterNext)&&(_userValueCompareFunc(e->_value, moveToBehind->_iterNext->_value, _compareCookie) > 0)) moveToBehind = moveToBehind->_iterNext; + (void) MoveToBehind(e->_key, moveToBehind->_key); + } + } + return e; + } + + // Rehash the table if the threshold is exceeded + if (_count == _tableSize) return (EnsureSize(_tableSize*2) == B_NO_ERROR) ? PutAux(hash, key, value, optSetPreviousValue, optReplacedFlag) : NULL; + + HashtableEntry * slot = _table[hash%_tableSize].GetMapTo(); + if (IsBucketHead(slot)) + { + // This slot's chain is already present -- so just create a new entry in the chain's linked list to hold our item + e = _freeHead; + _freeHead = e->RemoveFromFreeList(_freeHead); + e->_hash = hash; + e->_key = key; + e->_value = value; + + // insert e into the list immediately after (slot) + e->_bucketPrev = slot; + e->_bucketNext = slot->_bucketNext; + if (e->_bucketNext) e->_bucketNext->_bucketPrev = e; + slot->_bucketNext = e; + + InsertSortedIterationEntry(e, (_autoSortMode == AUTOSORT_BY_KEY) ? _userKeyCompareFunc : NULL, (_autoSortMode == AUTOSORT_BY_VALUE) ? _userValueCompareFunc : NULL, _compareCookie); + } + else + { + if (slot->_hash != MUSCLE_HASHTABLE_INVALID_HASH_CODE) + { + // Hey, some other bucket is using my starter-slot! + // To get around this, we'll swap my starter-slot for an empty one and use that instead. + slot->GetMappedFrom()->SwapMaps(_freeHead->GetMappedFrom()); + slot = _freeHead; + } + _freeHead = slot->RemoveFromFreeList(_freeHead); + + // First entry in slot; just copy data over + slot->_hash = hash; + slot->_key = key; + slot->_value = value; + + slot->_bucketPrev = slot->_bucketNext = NULL; + e = slot; + InsertSortedIterationEntry(slot, (_autoSortMode == AUTOSORT_BY_KEY) ? _userKeyCompareFunc : NULL, (_autoSortMode == AUTOSORT_BY_VALUE) ? _userValueCompareFunc : NULL, _compareCookie); + } + + _count++; + + return e; +} + +template +status_t +Hashtable::RemoveAux(const KeyType& key, ValueType * optSetValue) +{ + HashtableEntry * e = (_count>0)?GetEntry(ComputeHash(key), key):NULL; + if (e) + { + RemoveIterationEntry(e); + if (optSetValue) *optSetValue = e->_value; + + HashtableEntry * prev = e->_bucketPrev; + HashtableEntry * next = e->_bucketNext; + if (prev) + { + prev->_bucketNext = next; + if (next) next->_bucketPrev = prev; + } + else if (next) + { + next->_bucketPrev = NULL; + e->GetMappedFrom()->SwapMaps(next->GetMappedFrom()); + } + + e->ReturnToFreeList(KeyType(), ValueType(), &_freeHead); + + _count--; + return B_NO_ERROR; + } + return B_ERROR; +} + +template +void +Hashtable::Clear(bool releaseCachedBuffers) +{ + // First go through our list of active iterators, and let them all know they are now invalid + while(_iterList) + { + HashtableIterator * next = _iterList->_nextIter; + _iterList->_owner = NULL; + _iterList->_nextKeyCookie = _iterList-> _nextValueCookie = NULL; + _iterList->_prevIter = _iterList->_nextIter = NULL; + _iterList = next; + } + + if (_count > 0) + { + if (releaseCachedBuffers == false) + { + // Go through our list of valid entries and reset them all to their default state + // This is important since sometimes they may be holding on to large allocated memory buffers, etc + KeyType blankKey = KeyType(); + ValueType blankValue = ValueType(); + while(_iterHead) + { + HashtableEntry * next = _iterHead->_iterNext; // save for later + _iterHead->ReturnToFreeList(blankKey, blankValue, &_freeHead); + _iterHead = next; + } + } + _iterHead = _iterTail = NULL; + _count = 0; + } + if (releaseCachedBuffers) + { + delete [] _table; + _table = NULL; + _freeHead = NULL; + _tableSize = _initialCapacity; + } +} + +template +uint32 +Hashtable::NextPrime(uint32 start) const +{ + if (start % 2 == 0) start++; + uint32 i; + for (; ; start += 2) + { + for (i = 3; i * i <= start; i += 2) if (start % i == 0) break; + if (i * i > start) return start; + } +} + +//=============================================================== +// Implementation of HashtableIterator +//=============================================================== + +template +HashtableIterator::HashtableIterator() : _nextKeyCookie(NULL), _nextValueCookie(NULL), _owner(NULL) +{ + // empty +} + +template +HashtableIterator::HashtableIterator(const HashtableIterator & rhs) : _owner(NULL) +{ + *this = rhs; +} + +template +HashtableIterator::HashtableIterator(const Hashtable & table, bool backwards) : _owner(NULL) +{ + table.InitializeIterator(*this, backwards); +} + +template +HashtableIterator::HashtableIterator(const Hashtable & table, const KeyType & startAt, bool backwards) : _owner(NULL) +{ + table.InitializeIteratorAt(*this, startAt, backwards); +} + +template +HashtableIterator::~HashtableIterator() +{ + if (_owner) _owner->UnregisterIterator(this); +} + +template +void +HashtableIterator::SetOwner(const Hashtable * table) +{ + if (_owner != table) + { + if (_owner) _owner->UnregisterIterator(this); + _owner = table; + if (_owner) _owner->RegisterIterator(this); + } +} + +template +HashtableIterator & +HashtableIterator:: operator=(const HashtableIterator & rhs) +{ + if (this != &rhs) + { + SetOwner(rhs._owner); + _backwards = rhs._backwards; + _nextKeyCookie = rhs._nextKeyCookie; + _nextValueCookie = rhs._nextValueCookie; + } + return *this; +} + + +template +status_t +HashtableIterator::GetNextKey(KeyType& key) +{ + const KeyType * ret = GetNextKey(); + if (ret) + { + key = *ret; + return B_NO_ERROR; + } + else return B_ERROR; +} + +template +status_t +HashtableIterator::GetNextValue(ValueType& val) +{ + ValueType * ret = GetNextValue(); + if (ret) + { + val = *ret; + return B_NO_ERROR; + } + else return B_ERROR; +} + +template +status_t +HashtableIterator::PeekNextKey(KeyType& key) const +{ + const KeyType * ret = PeekNextKey(); + if (ret) + { + key = *ret; + return B_NO_ERROR; + } + else return B_ERROR; +} + +template +status_t +HashtableIterator::PeekNextValue(ValueType& val) const +{ + ValueType * ret = PeekNextValue(); + if (ret) + { + val = *ret; + return B_NO_ERROR; + } + else return B_ERROR; +} + +template +ValueType * +HashtableIterator::GetNextValue() +{ + ValueType * val = PeekNextValue(); + if (val) + { + _owner->IterateCookie(&_nextValueCookie, _backwards); + return val; + } + return NULL; +} + +template +const KeyType * +HashtableIterator::GetNextKey() +{ + const KeyType * ret = PeekNextKey(); + if (ret) + { + _owner->IterateCookie(&_nextKeyCookie, _backwards); + return ret; + } + return NULL; +} + +template +ValueType * +HashtableIterator::PeekNextValue() const +{ + return (_owner) ? _owner->GetValueFromCookie(_nextValueCookie) : NULL; +} + +template +const KeyType * +HashtableIterator::PeekNextKey() const +{ + return (_owner) ? _owner->GetKeyFromCookie(_nextKeyCookie) : NULL; +} + +template +status_t +HashtableIterator::GetNextKeyAndValue(KeyType & setKey, ValueType & setValue) +{ + return (GetNextKey(setKey) == B_NO_ERROR) ? GetNextValue(setValue) : B_ERROR; +} + +template +status_t +HashtableIterator::GetNextKeyAndValue(KeyType & setKey, ValueType * & setValuePtr) +{ + return ((setValuePtr = GetNextValue()) != NULL) ? GetNextKey(setKey) : B_ERROR; +} + +template +status_t +HashtableIterator::GetNextKeyAndValue(KeyType & setKey, const ValueType * & setValuePtr) +{ + return ((setValuePtr = GetNextValue()) != NULL) ? GetNextKey(setKey) : B_ERROR; +} + +template +status_t +HashtableIterator::GetNextKeyAndValue(const KeyType * & setKeyPtr, ValueType & setValue) +{ + return ((setKeyPtr = GetNextKey()) != NULL) ? GetNextValue(setValue) : B_ERROR; +} + +template +status_t +HashtableIterator::GetNextKeyAndValue(const KeyType * & setKeyPtr, ValueType * & setValuePtr) +{ + return (((setKeyPtr = GetNextKey()) != NULL)&&((setValuePtr = GetNextValue()) != NULL)) ? B_NO_ERROR : B_ERROR; +} + +template +status_t +HashtableIterator::GetNextKeyAndValue(const KeyType * & setKeyPtr, const ValueType * & setValuePtr) +{ + return (((setKeyPtr = GetNextKey()) != NULL)&&((setValuePtr = GetNextValue()) != NULL)) ? B_NO_ERROR : B_ERROR; +} + +END_NAMESPACE(muscle); + +#endif diff --git a/library/libfunky/extra/Queue.h b/library/libfunky/extra/Queue.h new file mode 100644 index 0000000..05afc70 --- /dev/null +++ b/library/libfunky/extra/Queue.h @@ -0,0 +1,1058 @@ +/* This file is Copyright 2005 Level Control Systems. See the included LICENSE.txt file for details. */ + +#ifndef MuscleQueue_h +#define MuscleQueue_h + +#include "support/MuscleSupport.h" + +BEGIN_NAMESPACE(muscle); + +#ifndef SMALL_QUEUE_SIZE +# define SMALL_QUEUE_SIZE 3 +#endif + +/** This class implements a templated double-ended queue data structure. + * Adding or removing items from the head or tail of a Queue is (on average) + * an O(1) operation. A Queue also makes for a nice Vector, if that's all you need. + */ +template class Queue +{ +public: + /** Constructor. + * @param initialSlots Specifies how many slots to pre-allocate. Defaults to (SMALL_QUEUE_SIZE). + */ + Queue(uint32 initialSlots = SMALL_QUEUE_SIZE); + + /** Copy constructor. */ + Queue(const Queue& copyMe); + + /** Destructor. */ + virtual ~Queue(); + + /** Assigment operator. */ + Queue &operator=(const Queue &from); + + /** Equality operator. Queues are equal if they are the same length, and + * every nth item in this queue is == to the corresponding item in (rhs). */ + bool operator==(const Queue &rhs) const; + + /** Returns the negation of the equality operator */ + bool operator!=(const Queue &rhs) const {return !(*this == rhs);} + + /** Appends (item) to the end of the queue. Queue size grows by one. + * @param item The item to append. + * @return B_NO_ERROR on success, B_ERROR on failure (out of memory) + */ + status_t AddTail(const ItemType & item = ItemType()); + + /** Appends some or all items in (queue) to the end of our queue. Queue size + * grows by (queue.GetNumItems()). + * For example: + * Queue a; // contains 1, 2, 3, 4 + * Queue b; // contains 5, 6, 7, 8 + * a.AddTail(b); // a now contains 1, 2, 3, 4, 5, 6, 7, 8 + * @param queue The queue to append to our queue. + * @param startIndex Index in (queue) to start adding at. Default to zero. + * @param numItems Number of items to add. If this number is too large, it will be capped appropriately. Default is to add all items. + * @return B_NO_ERROR on success, B_ERROR on failure (out of memory) + */ + status_t AddTail(const Queue & queue, uint32 startIndex = 0, uint32 numItems = (uint32)-1); + + /** Adds the given array of items to the tail of the Queue. Equivalent + * to adding them to the tail of the Queue one at a time, but somewhat + * more efficient. On success, the queue size grows by (numItems). + * @param items Pointer to an array of items to add to the Queue. + * @param numItems Number of items in the array + * @return B_NO_ERROR on success, or B_ERROR on failure (out of memory) + */ + status_t AddTail(const ItemType * items, uint32 numItems); + + /** Prepends (item) to the head of the queue. Queue size grows by one. + * @param item The item to prepend. + * @return B_NO_ERROR on success, B_ERROR on failure (out of memory) + */ + status_t AddHead(const ItemType &item = ItemType()); + + /** Concatenates (queue) to the head of our queue. + * Our queue size grows by (queue.GetNumItems()). + * For example: + * Queue a; // contains 1, 2, 3, 4 + * Queue b; // contains 5, 6, 7, 8 + * a.AddHead(b); // a now contains 5, 6, 7, 8, 1, 2, 3, 4 + * @param queue The queue to prepend to our queue. + * @param startIndex Index in (queue) to start adding at. Default to zero. + * @param numItems Number of items to add. If this number is too large, it will be capped appropriately. Default is to add all items. + * @return B_NO_ERROR on success, B_ERROR on failure (out of memory) + */ + status_t AddHead(const Queue & queue, uint32 startIndex = 0, uint32 numItems = (uint32)-1); + + /** Concatenates the given array of items to the head of the Queue. + * The semantics are the same as for AddHead(const Queue &). + * @param items Pointer to an array of items to add to the Queue. + * @param numItems Number of items in the array + * @return B_NO_ERROR on success, or B_ERROR on failure (out of memory) + */ + status_t AddHead(const ItemType * items, uint32 numItems); + + /** Removes the item at the head of the queue. + * @return B_NO_ERROR on success, B_ERROR if the queue was empty. + */ + status_t RemoveHead(); + + /** Removes the item at the head of the queue and places it into (returnItem). + * @param returnItem On success, the removed item is copied into this object. + * @return B_NO_ERROR on success, B_ERROR if the queue was empty + */ + status_t RemoveHead(ItemType & returnItem); + + /** Removes the item at the tail of the queue. + * @return B_NO_ERROR on success, B_ERROR if the queue was empty. + */ + status_t RemoveTail(); + + /** Removes the item at the tail of the queue and places it into (returnItem). + * @param returnItem On success, the removed item is copied into this object. + * @return B_NO_ERROR on success, B_ERROR if the queue was empty + */ + status_t RemoveTail(ItemType & returnItem); + + /** Removes the item at the (index)'th position in the queue. + * @param index Which item to remove--can range from zero + * (head of the queue) to GetNumItems()-1 (tail of the queue). + * @return B_NO_ERROR on success, B_ERROR on failure (i.e. bad index) + * Note that this method is somewhat inefficient for indices that + * aren't at the head or tail of the queue (i.e. O(n) time) + */ + status_t RemoveItemAt(uint32 index); + + /** Removes the item at the (index)'th position in the queue, and copies it into (returnItem). + * @param index Which item to remove--can range from zero + * (head of the queue) to (GetNumItems()-1) (tail of the queue). + * @param returnItem On success, the removed item is copied into this object. + * @return B_NO_ERROR on success, B_ERROR on failure (i.e. bad index) + */ + status_t RemoveItemAt(uint32 index, ItemType & returnItem); + + /** Copies the (index)'th item into (returnItem). + * @param index Which item to get--can range from zero + * (head of the queue) to (GetNumItems()-1) (tail of the queue). + * @param returnItem On success, the retrieved item is copied into this object. + * @return B_NO_ERROR on success, B_ERROR on failure (e.g. bad index) + */ + status_t GetItemAt(uint32 index, ItemType & returnItem) const; + + /** Returns a pointer to an item in the array (i.e. no copying of the item is done). + * Included for efficiency; be careful with this: modifying the queue can invalidate + * the returned pointer! + * @param index Index of the item to return a pointer to. + * @return a pointer to the internally held item, or NULL if (index) was invalid. + */ + ItemType * GetItemAt(uint32 index) const; + + /** Replaces the (index)'th item in the queue with (newItem). + * @param index Which item to replace--can range from zero + * (head of the queue) to (GetNumItems()-1) (tail of the queue). + * @param newItem The item to place into the queue at the (index)'th position. + * @return B_NO_ERROR on success, B_ERROR on failure (e.g. bad index) + */ + status_t ReplaceItemAt(uint32 index, const ItemType & newItem = ItemType()); + + /** Inserts (item) into the (nth) slot in the array. InsertItemAt(0) + * is the same as AddHead(item), InsertItemAt(GetNumItems()) is the same + * as AddTail(item). Other positions will involve an O(n) shifting of contents. + * @param index The position at which to insert the new item. + * @param newItem The item to insert into the queue. + * @return B_NO_ERROR on success, B_ERROR on failure (i.e. bad index). + */ + status_t InsertItemAt(uint32 index, const ItemType & newItem = ItemType()); + + /** Removes all items from the queue. + * @param releaseCachedBuffers If true, we will immediately free any buffers that we may be holding. Otherwise + * we will keep them around so that they can be re-used in the future. + */ + void Clear(bool releaseCachedBuffers = false); + + /** Returns the number of items in the queue. (This number does not include pre-allocated space) */ + uint32 GetNumItems() const {return _itemCount;} + + /** Returns the number of item-slots we have allocated space for. Note that this is NOT + * the same as the value returned by GetNumItems() -- it is generally larger, since we pre-allocate + * additional slots in advance to cut down on the number of re-allocations we need to do. + */ + uint32 GetNumAllocatedItemSlots() const {return _queueSize;} + + /** Returns true iff their are no items in the queue. */ + bool IsEmpty() const {return (_itemCount == 0);} + + /** Returns a read-only reference the head item in the queue. You must not call this when the queue is empty! */ + const ItemType & Head() const {return *GetItemAt(0);} + + /** Returns a read-only reference the tail item in the queue. You must not call this when the queue is empty! */ + const ItemType & Tail() const {return *GetItemAt(_itemCount-1);} + + /** Returns a writable reference the head item in the queue. You must not call this when the queue is empty! */ + ItemType & Head() {return *GetItemAt(0);} + + /** Returns a writable reference the tail item in the queue. You must not call this when the queue is empty! */ + ItemType & Tail() {return *GetItemAt(_itemCount-1);} + + /** Returns a pointer to the first item in the queue, or NULL if the queue is empty */ + ItemType * HeadPointer() const {return (_itemCount > 0) ? GetItemAt(0) : NULL;} + + /** Returns a pointer to the last item in the queue, or NULL if the queue is empty */ + ItemType * TailPointer() const {return (_itemCount > 0) ? GetItemAt(_itemCount-1) : NULL;} + + /** Convenient read-only array-style operator (be sure to only use valid indices!) */ + const ItemType & operator [](uint32 Index) const; + + /** Convenient read-write array-style operator (be sure to only use valid indices!) */ + ItemType & operator [](uint32 Index); + + /** Deprecated synonym for GetItemAt(). Don't call this method in new code, call GetItemAt() instead! + * @deprecated + */ + ItemType * GetItemPointer(uint32 index) const {return GetItemAt(index);} + + /** Makes sure there is enough space allocated for at least (numSlots) items. + * You only need to call this if you wish to minimize the number of data re-allocations done, + * or wish to add or remove a large number of default items at once (by specifying setNumItems=true). + * @param numSlots the minimum amount of items to pre-allocate space for in the Queue. + * @param setNumItems If true, the length of the Queue will be altered by adding or removing + * items to (from) the tail of the Queue until the Queue is the specified size. + * If false (the default), more slots may be pre-allocated, but the + * number of items officially in the Queue remains the same as before. + * @param extraReallocItems If we have to do an array reallocation, this many extra slots will be + * added to the newly allocated array, above and beyond what is strictly + * necessary. That way the likelihood of another reallocation being necessary + * in the near future is reduced. Default value is zero, indicating that + * no extra slots will be allocated. This argument is ignored if (setNumItems) is true. + * @returns B_NO_ERROR on success, or B_ERROR on failure (out of memory) + */ + status_t EnsureSize(uint32 numSlots, bool setNumItems = false, uint32 extraReallocItems = 0); + + /** Returns the last index of the given (item), or -1 if (item) is + * not found in the list. O(n) search time. + * @param item The item to look for. + * @return The index of (item), or -1 if no such item is present. + */ + int32 IndexOf(const ItemType & item) const; + + /** + * Swaps the values of the two items at the given indices. This operation + * will involve three copies of the held items. + * @param fromIndex First index to swap. + * @param toIndex Second index to swap. + */ + void Swap(uint32 fromIndex, uint32 toIndex); + + /** + * Reverses the ordering of the items in the given subrange. + * (e.g. if the items were A,B,C,D,E, this would change them to E,D,C,B,A) + * @param from Index of the start of the subrange. Defaults to zero. + * @param to Index of the next item after the end of the subrange. If greater than + * the number of items currently in the queue, this value will be clipped + * to be equal to that number. Defaults to the largest possible uint32. + */ + void ReverseItemOrdering(uint32 from=0, uint32 to = ((uint32)-1)); + + /** + * This is the signature of the type of callback function that you must pass + * into the Sort() method. This function should work like strcmp(), returning + * a negative value if (item1) is less than item2, or zero if the items are + * equal, or a positive value if (item1) is greater than item2. + * @param item1 The first item + * @param item2 The second item + * @param cookie A user-defined value that was passed in to the Sort() method. + * @return A value indicating which item is "larger", as defined above. + */ + typedef int (*ItemCompareFunc)(const ItemType & item1, const ItemType & item2, void * cookie); + + /** + * Does an in-place, stable sort on a subrange of the contents of this Queue. + * (The sort algorithm is a smart, in-place merge sort). + * @param compareFunc A function that compares two items in this queue and returns + * a value indicating which is "larger". (negative indicates + * that the second parameter is larger, positive indicate that the + * first is larger, and zero indicates that the two parameters are equal) + * @param from Index of the start of the subrange. Defaults to zero. + * @param to Index of the next item after the end of the subrange. + * If greater than the number of items currently in the queue, + * the subrange will extend to the last item. Defaults to the largest possible uint32. + * @param optCookie A user-defined value that will be passed to the (compareFunc). + */ + void Sort(ItemCompareFunc compareFunc, uint32 from=0, uint32 to = ((uint32)-1), void * optCookie = NULL); + + /** + * Swaps our contents with the contents of (that), in an efficient manner. + * @param that The queue whose contents are to be swapped with our own. + */ + void SwapContents(Queue & that); + + /** + * Goes through the array and removes every item that is equal to (val). + * @param val the item to look for and remove + * @return The number of instances of (val) that were found and removed during this operation. + */ + uint32 RemoveAllInstancesOf(const ItemType & val); + + /** + * Goes through the array and removes the first item that is equal to (val). + * @param val the item to look for and remove + * @return B_NO_ERROR if a matching item was found and removed, or B_ERROR if it wasn't found. + */ + status_t RemoveFirstInstanceOf(const ItemType & val); + + /** + * Goes through the array and removes the last item that is equal to (val). + * @param val the item to look for and remove + * @return B_NO_ERROR if a matching item was found and removed, or B_ERROR if it wasn't found. + */ + status_t RemoveLastInstanceOf(const ItemType & val); + + /** Returns true iff the first item in our queue is equal to (prefix). */ + bool StartsWith(const ItemType & prefix) const {return ((GetNumItems()>0)&&(Head() == prefix));} + + /** Returns true iff the (prefixQueue) is a prefix of this queue. */ + bool StartsWith(const Queue & prefixQueue) const; + + /** Returns true iff the last item in our queue is equal to (suffix). */ + bool EndsWith(const ItemType & suffix) const {return ((GetNumItems()>0)&&(Tail() == suffix));} + + /** Returns true iff the (suffixQueue) is a suffix of this queue. */ + bool EndsWith(const Queue & suffixQueue) const; + + /** + * Returns a pointer to the nth internally-held contiguous-Item-sub-array, to allow efficient + * array-style access to groups of items in this Queue. In the current implementation + * there may be as many as two such sub-arrays present, depending on the internal state of the Queue. + * @param whichArray Index of the internal array to return a pointer to. Typically zero or one. + * @param retLength On success, the number of items in the returned sub-array will be written here. + * @return Pointer to the first item in the sub-array on success, or NULL on failure. + * Note that this array is only guaranteed valid as long as no items are + * added or removed from the Queue. + */ + ItemType * GetArrayPointer(uint32 whichArray, uint32 & retLength) {return const_cast(GetArrayPointerAux(whichArray, retLength));} + + /** Read-only version of the above */ + const ItemType * GetArrayPointer(uint32 whichArray, uint32 & retLength) const {return GetArrayPointerAux(whichArray, retLength);} + +private: + const ItemType * GetArrayPointerAux(uint32 whichArray, uint32 & retLength) const; + void SwapContentsAux(Queue & that); + + inline uint32 NextIndex(uint32 idx) const {return (idx >= _queueSize-1) ? 0 : idx+1;} + inline uint32 PrevIndex(uint32 idx) const {return (idx == 0) ? _queueSize-1 : idx-1;} + + // Translates a user-index into an index into the _queue array. + inline uint32 InternalizeIndex(uint32 idx) const {return (_headIndex + idx) % _queueSize;} + + // Helper methods, used for sorting (stolen from http://www-ihm.lri.fr/~thomas/VisuTri/inplacestablesort.html) + void Merge(ItemCompareFunc compareFunc, uint32 from, uint32 pivot, uint32 to, uint32 len1, uint32 len2, void * cookie); + uint32 Lower(ItemCompareFunc compareFunc, uint32 from, uint32 to, const ItemType & val, void * cookie) const; + uint32 Upper(ItemCompareFunc compareFunc, uint32 from, uint32 to, const ItemType & val, void * cookie) const; + + ItemType _smallQueue[SMALL_QUEUE_SIZE]; // small queues can be stored inline in this array + ItemType * _queue; // points to _smallQueue, or to a dynamically alloc'd array + uint32 _queueSize; // number of slots in the _queue array + uint32 _itemCount; // number of valid items in the array + uint32 _headIndex; // index of the first filled slot (meaningless if _itemCount is zero) + uint32 _tailIndex; // index of the last filled slot (meaningless if _itemCount is zero) + const uint32 _initialSize; // as specified in ctor +}; + +template +Queue::Queue(uint32 initialSize) + : _queue(NULL), _queueSize(0), _itemCount(0), _initialSize(initialSize) +{ + // empty +} + +template +Queue::Queue(const Queue& rhs) + : _queue(NULL), _queueSize(0), _itemCount(0), _initialSize(rhs._initialSize) +{ + *this = rhs; +} + +template +bool +Queue::operator ==(const Queue& rhs) const +{ + if (this == &rhs) return true; + if (GetNumItems() != rhs.GetNumItems()) return false; + + for (int i = GetNumItems()-1; i>=0; i--) if (((*this)[i] == rhs[i]) == false) return false; + + return true; +} + + +template +Queue & +Queue::operator =(const Queue& rhs) +{ + if (this != &rhs) + { + uint32 numItems = rhs.GetNumItems(); + if (EnsureSize(numItems, true) == B_NO_ERROR) for (uint32 i=0; i +ItemType & +Queue::operator[](uint32 i) +{ + MASSERT(i<_itemCount, "Invalid index to Queue::[]"); + return _queue[InternalizeIndex(i)]; +} + +template +const ItemType & +Queue::operator[](uint32 i) const +{ + MASSERT(i<_itemCount, "Invalid index to Queue::[]"); + return _queue[InternalizeIndex(i)]; +} + +template +ItemType * +Queue::GetItemAt(uint32 i) const +{ + return &_queue[InternalizeIndex(i)]; +} + +template +Queue::~Queue() +{ + if (_queue != _smallQueue) delete [] _queue; +} + +template +status_t +Queue:: +AddTail(const ItemType &item) +{ + if (EnsureSize(_itemCount+1, false, _itemCount+1) == B_ERROR) return B_ERROR; + if (_itemCount == 0) _headIndex = _tailIndex = 0; + else _tailIndex = NextIndex(_tailIndex); + _queue[_tailIndex] = item; + _itemCount++; + return B_NO_ERROR; +} + +template +status_t +Queue:: +AddTail(const Queue &queue, uint32 startIndex, uint32 numNewItems) +{ + uint32 hisSize = queue.GetNumItems(); + numNewItems = muscleMin(numNewItems, (startIndex < hisSize) ? (hisSize-startIndex) : 0); + + uint32 mySize = GetNumItems(); + uint32 newSize = mySize+numNewItems; + + if (EnsureSize(newSize, true) != B_NO_ERROR) return B_ERROR; + for (uint32 i=mySize; i +status_t +Queue:: +AddTail(const ItemType * items, uint32 numItems) +{ + uint32 mySize = GetNumItems(); + uint32 newSize = mySize+numItems; + uint32 rhs = 0; + + if (EnsureSize(newSize, true) != B_NO_ERROR) return B_ERROR; + for (uint32 i=mySize; i +status_t +Queue:: +AddHead(const ItemType &item) +{ + if (EnsureSize(_itemCount+1, false, _itemCount+1) == B_ERROR) return B_ERROR; + if (_itemCount == 0) _headIndex = _tailIndex = 0; + else _headIndex = PrevIndex(_headIndex); + _queue[_headIndex] = item; + _itemCount++; + return B_NO_ERROR; +} + +template +status_t +Queue:: +AddHead(const Queue &queue, uint32 startIndex, uint32 numNewItems) +{ + uint32 hisSize = queue.GetNumItems(); + numNewItems = muscleMin(numNewItems, (startIndex < hisSize) ? (hisSize-startIndex) : 0); + + if (EnsureSize(numNewItems+GetNumItems()) != B_NO_ERROR) return B_ERROR; + for (int i=((int)startIndex+numNewItems)-1; i>=(int32)startIndex; i--) if (AddHead(queue[i]) == B_ERROR) return B_ERROR; + return B_NO_ERROR; +} + +template +status_t +Queue:: +AddHead(const ItemType * items, uint32 numItems) +{ + if (EnsureSize(_itemCount+numItems) != B_NO_ERROR) return B_ERROR; + for (int i=((int)numItems)-1; i>=0; i--) if (AddHead(items[i]) == B_ERROR) return B_ERROR; + return B_NO_ERROR; +} + +template +status_t +Queue:: +RemoveHead(ItemType & returnItem) +{ + if (_itemCount == 0) return B_ERROR; + returnItem = _queue[_headIndex]; + return RemoveHead(); +} + +template +status_t +Queue:: +RemoveHead() +{ + if (_itemCount == 0) return B_ERROR; + int oldHeadIndex = _headIndex; + _headIndex = NextIndex(_headIndex); + _itemCount--; + _queue[oldHeadIndex] = ItemType(); // this must be done last, as queue state must be coherent when we do this + return B_NO_ERROR; +} + +template +status_t +Queue:: +RemoveTail(ItemType & returnItem) +{ + if (_itemCount == 0) return B_ERROR; + returnItem = _queue[_tailIndex]; + return RemoveTail(); +} + +template +status_t +Queue:: +RemoveTail() +{ + if (_itemCount == 0) return B_ERROR; + int removedItemIndex = _tailIndex; + _tailIndex = PrevIndex(_tailIndex); + _itemCount--; + _queue[removedItemIndex] = ItemType(); // this must be done last, as queue state must be coherent when we do this + return B_NO_ERROR; +} + +template +status_t +Queue:: +GetItemAt(uint32 index, ItemType & returnItem) const +{ + if (index >= _itemCount) return B_ERROR; + returnItem = _queue[InternalizeIndex(index)]; + return B_NO_ERROR; +} + +template +status_t +Queue:: +RemoveItemAt(uint32 index, ItemType & returnItem) +{ + if (index >= _itemCount) return B_ERROR; + returnItem = _queue[InternalizeIndex(index)]; + return RemoveItemAt(index); +} + +template +status_t +Queue:: +RemoveItemAt(uint32 index) +{ + if (index >= _itemCount) return B_ERROR; + + uint32 internalizedIndex = InternalizeIndex(index); + uint32 indexToClear; + + if (index < _itemCount/2) + { + // item is closer to the head: shift everything forward one, ending at the head + while(internalizedIndex != _headIndex) + { + uint32 prev = PrevIndex(internalizedIndex); + _queue[internalizedIndex] = _queue[prev]; + internalizedIndex = prev; + } + indexToClear = _headIndex; + _headIndex = NextIndex(_headIndex); + } + else + { + // item is closer to the tail: shift everything back one, ending at the tail + while(internalizedIndex != _tailIndex) + { + uint32 next = NextIndex(internalizedIndex); + _queue[internalizedIndex] = _queue[next]; + internalizedIndex = next; + } + indexToClear = _tailIndex; + _tailIndex = PrevIndex(_tailIndex); + } + + _itemCount--; + _queue[indexToClear] = ItemType(); // this must be done last, as queue state must be coherent when we do this + return B_NO_ERROR; +} + +template +status_t +Queue:: +ReplaceItemAt(uint32 index, const ItemType & newItem) +{ + if (index >= _itemCount) return B_ERROR; + _queue[InternalizeIndex(index)] = newItem; + return B_NO_ERROR; +} + +template +status_t +Queue:: +InsertItemAt(uint32 index, const ItemType & newItem) +{ + // Simple cases + if (index > _itemCount) return B_ERROR; + if (index == _itemCount) return AddTail(newItem); + if (index == 0) return AddHead(newItem); + + // Harder case: inserting into the middle of the array + if (index < _itemCount/2) + { + // Add a space at the front, and shift things back + if (AddHead() != B_NO_ERROR) return B_ERROR; // allocate an extra slot + for (uint32 i=0; i((int32)index); i--) ReplaceItemAt(i, *GetItemAt(i-1)); + } + return ReplaceItemAt(index, newItem); +} + +template +void +Queue:: +Clear(bool releaseCachedBuffers) +{ + if ((releaseCachedBuffers)&&(_queue != _smallQueue)) + { + delete [] _queue; + _queue = NULL; + _queueSize = 0; + _itemCount = 0; + } + else while(RemoveTail() == B_NO_ERROR) {/* empty */} +} + +template +status_t +Queue:: +EnsureSize(uint32 size, bool setNumItems, uint32 extraPreallocs) +{ + if ((_queue == NULL)||(_queueSize < size)) + { + const uint32 sqLen = ARRAYITEMS(_smallQueue); + uint32 temp = size + extraPreallocs; + uint32 newQLen = muscleMax(_initialSize, ((setNumItems)||(temp <= sqLen)) ? muscleMax(sqLen,temp) : temp); + + ItemType * newQueue = ((_queue == _smallQueue)||(newQLen > sqLen)) ? newnothrow_array(ItemType,newQLen) : _smallQueue; + if (newQueue == NULL) {WARN_OUT_OF_MEMORY; return B_ERROR;} + if (newQueue == _smallQueue) newQLen = sqLen; + + for (uint32 i=0; i<_itemCount; i++) (void) GetItemAt(i, newQueue[i]); // we know that (_itemCount < size) + if (setNumItems) _itemCount = size; + _headIndex = 0; + _tailIndex = _itemCount-1; + + if (_queue == _smallQueue) + { + ItemType blank = ItemType(); + for (uint32 i=0; i size) (void) RemoveTail(); // Gotta overwrite the "removed" items, so this is a bit slower + } + + return B_NO_ERROR; +} + +template +int32 +Queue:: +IndexOf(const ItemType & item) const +{ + if (_queue) for (int i=((int)GetNumItems())-1; i>=0; i--) if (*GetItemAt(i) == item) return i; + return -1; +} + + +template +void +Queue:: +Swap(uint32 fromIndex, uint32 toIndex) +{ + ItemType temp = *(GetItemAt(fromIndex)); + ReplaceItemAt(fromIndex, *(GetItemAt(toIndex))); + ReplaceItemAt(toIndex, temp); +} + +template +void +Queue:: +Sort(ItemCompareFunc compareFunc, uint32 from, uint32 to, void * cookie) +{ + uint32 size = GetNumItems(); + if (to > size) to = size; + if (to > from) + { + if (to < from+12) + { + // too easy, just do a bubble sort (base case) + if (to > from+1) + { + for (uint32 i=from+1; ifrom; j--) + { + int ret = compareFunc(*(GetItemAt(j)), *(GetItemAt(j-1)), cookie); + if (ret < 0) Swap(j, j-1); + else break; + } + } + } + } + else + { + // Okay, do the real thing + uint32 middle = (from + to)/2; + Sort(compareFunc, from, middle, cookie); + Sort(compareFunc, middle, to, cookie); + Merge(compareFunc, from, middle, to, middle-from, to-middle, cookie); + } + } +} + +template +void +Queue:: +ReverseItemOrdering(uint32 from, uint32 to) +{ + uint32 size = GetNumItems(); + if (size > 0) + { + to--; // make it inclusive + if (to >= size) to = size-1; + while (from < to) Swap(from++, to--); + } +} + +template +status_t +Queue:: +RemoveFirstInstanceOf(const ItemType & val) +{ + uint32 ni = GetNumItems(); + for (uint32 i=0; i +status_t +Queue:: +RemoveLastInstanceOf(const ItemType & val) +{ + for (int32 i=((int32)GetNumItems())-1; i>=0; i--) if ((*this)[i] == val) return RemoveItemAt(i); + return B_ERROR; +} + +template +uint32 +Queue:: +RemoveAllInstancesOf(const ItemType & val) +{ + // Efficiently collapse all non-matching slots up to the top of the list + uint32 ret = 0; + uint32 writeTo = 0; + uint32 origSize = GetNumItems(); + for(uint32 readFrom=0; readFrom writeTo) (*this)[writeTo] = nextRead; + writeTo++; + } + } + + // Now get rid of any now-surplus slots + for (; writeTo +void +Queue:: +Merge(ItemCompareFunc compareFunc, uint32 from, uint32 pivot, uint32 to, uint32 len1, uint32 len2, void * cookie) +{ + if ((len1)&&(len2)) + { + if (len1+len2 == 2) + { + if (compareFunc(*(GetItemAt(pivot)), *(GetItemAt(from)), cookie) < 0) Swap(pivot, from); + } + else + { + uint32 first_cut, second_cut; + uint32 len11, len22; + if (len1 > len2) + { + len11 = len1/2; + first_cut = from + len11; + second_cut = Lower(compareFunc, pivot, to, *GetItemAt(first_cut), cookie); + len22 = second_cut - pivot; + } + else + { + len22 = len2/2; + second_cut = pivot + len22; + first_cut = Upper(compareFunc, from, pivot, *GetItemAt(second_cut), cookie); + len11 = first_cut - from; + } + + // do a rotation + if ((pivot!=first_cut)&&(pivot!=second_cut)) + { + // find the greatest common denominator of (pivot-first_cut) and (second_cut-first_cut) + uint32 n = pivot-first_cut; + { + uint32 m = second_cut-first_cut; + while(n!=0) + { + uint32 t = m % n; + m=n; + n=t; + } + n = m; + } + + while(n--) + { + const ItemType val = *GetItemAt(first_cut+n); + uint32 shift = pivot - first_cut; + uint32 p1 = first_cut+n; + uint32 p2 = p1+shift; + while (p2 != first_cut + n) + { + ReplaceItemAt(p1, *GetItemAt(p2)); + p1 = p2; + if (second_cut - p2 > shift) p2 += shift; + else p2 = first_cut + (shift - (second_cut - p2)); + } + ReplaceItemAt(p1, val); + } + } + + uint32 new_mid = first_cut+len22; + Merge(compareFunc, from, first_cut, new_mid, len11, len22, cookie); + Merge(compareFunc, new_mid, second_cut, to, len1 - len11, len2 - len22, cookie); + } + } +} + + +template +uint32 +Queue:: +Lower(ItemCompareFunc compareFunc, uint32 from, uint32 to, const ItemType & val, void * cookie) const +{ + if (to > from) + { + uint32 len = to - from; + while (len > 0) + { + uint32 half = len/2; + uint32 mid = from + half; + if (compareFunc(*(GetItemAt(mid)), val, cookie) < 0) + { + from = mid+1; + len = len - half - 1; + } + else len = half; + } + } + return from; +} + +template +uint32 +Queue:: +Upper(ItemCompareFunc compareFunc, uint32 from, uint32 to, const ItemType & val, void * cookie) const +{ + if (to > from) + { + uint32 len = to - from; + while (len > 0) + { + uint32 half = len/2; + uint32 mid = from + half; + if (compareFunc(val, *(GetItemAt(mid)), cookie) < 0) len = half; + else + { + from = mid+1; + len = len - half -1; + } + } + } + return from; +} + +template +const ItemType * +Queue :: GetArrayPointerAux(uint32 whichArray, uint32 & retLength) const +{ + if (_itemCount > 0) + { + switch(whichArray) + { + case 0: + retLength = (_headIndex <= _tailIndex) ? (_tailIndex-_headIndex)+1 : (_queueSize-_headIndex); + return &_queue[_headIndex]; + break; + + case 1: + if (_headIndex > _tailIndex) + { + retLength = _tailIndex+1; + return &_queue[0]; + } + break; + } + } + return NULL; +} + +template +void +Queue::SwapContents(Queue & that) +{ + bool thisSmall = (_queue == _smallQueue); + bool thatSmall = (that._queue == that._smallQueue); + + if ((thisSmall)&&(thatSmall)) + { + // First, move any extra items from the longer queue to the shorter one... + uint32 commonSize = muscleMin(GetNumItems(), that.GetNumItems()); + int32 sizeDiff = ((int32)GetNumItems())-((int32)that.GetNumItems()); + Queue & copyTo = (sizeDiff > 0) ? that : *this; + Queue & copyFrom = (sizeDiff > 0) ? *this : that; + (void) copyTo.AddTail(copyFrom, commonSize); // guaranteed not to fail + (void) copyFrom.EnsureSize(commonSize, true); // remove the copied items from (copyFrom) + + // Then just swap the elements that are present in both arrays + for (uint32 i=0; i +void +Queue::SwapContentsAux(Queue & largeThat) +{ + // First, copy over our (small) contents to his static buffer + uint32 ni = GetNumItems(); + for (uint32 i=0; i 0) + { + largeThat._queue = largeThat._smallQueue; + largeThat._queueSize = ARRAYITEMS(largeThat._smallQueue); + largeThat._headIndex = 0; + largeThat._tailIndex = ni-1; + } + else + { + largeThat._queue = NULL; + largeThat._queueSize = 0; + // headIndex and tailIndex are undefined in this case anyway + } + + muscleSwap(_itemCount, largeThat._itemCount); +} + +template +bool +Queue::StartsWith(const Queue & prefixQueue) const +{ + if (prefixQueue.GetNumItems() > GetNumItems()) return false; + uint32 prefixQueueLen = prefixQueue.GetNumItems(); + for (uint32 i=0; i +bool +Queue::EndsWith(const Queue & suffixQueue) const +{ + if (suffixQueue.GetNumItems() > GetNumItems()) return false; + int32 lastToCheck = GetNumItems()-suffixQueue.GetNumItems(); + for (int32 i=GetNumItems()-1; i>=lastToCheck; i--) if (!(suffixQueue[i] == (*this)[i])) return false; + return true; +} + +END_NAMESPACE(muscle); + +#endif + diff --git a/library/libfunky/extra/ReflowingTextView.cpp b/library/libfunky/extra/ReflowingTextView.cpp new file mode 100644 index 0000000..0384f99 --- /dev/null +++ b/library/libfunky/extra/ReflowingTextView.cpp @@ -0,0 +1,255 @@ +#include "ReflowingTextView.h" +#include "ShareConstants.h" + +namespace beshare { + +const bigtime_t RTV_HIDE_DELAY = 1500000; +const bigtime_t RTV_SHOW_DELAY = 750000; + +enum { + RTV_SHOW_TOOLTIP = 0x1000, + RTV_HIDE_TOOLTIP +}; + +ReflowingTextView :: ReflowingTextView(BRect frame, const char *name, BRect textRect, uint32 resizeMask, uint32 flags) : BTextView(frame, name, textRect, resizeMask, flags), _showTipRunner(NULL), _canShow(false), _urlTip(NULL), _currentLinkStart(-1) +{ + // empty +} + +ReflowingTextView :: ~ReflowingTextView() +{ + if ((_urlTip)&&(_urlTip->Lock())) _urlTip->Quit(); + delete _showTipRunner; +} + +void ReflowingTextView :: AttachedToWindow() +{ + BTextView::AttachedToWindow(); + FixTextRect(); +} + +void ReflowingTextView :: FrameResized(float w, float h) +{ + BTextView::FrameResized(w, h); + FixTextRect(); +} + +void ReflowingTextView :: MouseMoved(BPoint where, uint32 code, const BMessage * msg) +{ + const URLLink * link = NULL; + if (code == B_INSIDE_VIEW) + { + link = GetURLAt(where); +#ifdef B_BEOS_VERSION_5 + SetViewCursor((link != NULL) ? B_CURSOR_SYSTEM_DEFAULT : B_CURSOR_I_BEAM); +#else + be_app->SetCursor((link != NULL) ? B_HAND_CURSOR : B_I_BEAM_CURSOR); +#endif + } + + String scratch; + const String * urlString = link ? &link->GetURL() : &scratch; + if ((link)&&(urlString->Length() == 0)) + { + char * buf = new char[link->GetLength()+1]; + GetText(link->GetStart(), link->GetLength(), buf); + buf[link->GetLength()] = '\0'; + scratch = buf; + delete [] buf; + urlString = &scratch; + } + + int32 linkStart = link ? (int32)link->GetStart() : -1; + if (linkStart != _currentLinkStart) + { + _currentLinkStart = linkStart; + _currentURLString = *urlString; + if (linkStart >= 0) + { + if ((_canShow == false)&&((_showTipRunner == NULL)||(_runnerWillHide))) + { + // Schedule unsetting the show flag + delete _showTipRunner; + _runnerWillHide = false; + _showTipRunner = new BMessageRunner(this, new BMessage(RTV_SHOW_TOOLTIP), RTV_SHOW_DELAY, 1); + } + } + else + { + if (_canShow) + { + // schedule a delayed show + delete _showTipRunner; + _runnerWillHide = true; + _showTipRunner = new BMessageRunner(this, new BMessage(RTV_HIDE_TOOLTIP), RTV_HIDE_DELAY, 1); + } + else if ((_showTipRunner)&&(_runnerWillHide == false)) + { + delete _showTipRunner; // cancel the pending show! + _showTipRunner = NULL; + } + } + UpdateToolTip(); + } + BTextView::MouseMoved(where, code, msg); +} + +void ReflowingTextView :: MessageReceived(BMessage * msg) +{ + switch(msg->what) + { + case RTV_SHOW_TOOLTIP: + delete _showTipRunner; _showTipRunner = NULL; + _canShow = true; + UpdateToolTip(); + break; + + case RTV_HIDE_TOOLTIP: + delete _showTipRunner; _showTipRunner = NULL; + _canShow = false; + UpdateToolTip(); + break; + + default: + BTextView::MessageReceived(msg); + break; + } +} + +void ReflowingTextView :: UpdateToolTip() +{ + if ((_canShow)&&(_currentLinkStart >= 0)) + { + if (_urlTip == NULL) + { + _urlTip = new BWindow(BRect(0,0,5,5), NULL, B_NO_BORDER_WINDOW_LOOK, B_FLOATING_ALL_WINDOW_FEEL, B_NOT_MOVABLE|B_NOT_CLOSABLE|B_NOT_ZOOMABLE|B_NOT_MINIMIZABLE|B_AVOID_FOCUS); + BView * blackBorder = new BView(_urlTip->Bounds(), NULL, B_FOLLOW_ALL_SIDES, 0); + const rgb_color black = {0,0,0,255}; + blackBorder->SetViewColor(black); + _urlTip->AddChild(blackBorder); + + const rgb_color hiliteYellow = {255,255,200,255}; + BRect inset = blackBorder->Bounds(); inset.InsetBy(1,1); + BView * yellowInterior = new BView(inset, NULL, B_FOLLOW_ALL_SIDES, 0); + yellowInterior->SetLowColor(hiliteYellow); + yellowInterior->SetViewColor(hiliteYellow); + blackBorder->AddChild(yellowInterior); + + _urlStringView = new BStringView(yellowInterior->Bounds(), NULL, "", B_FOLLOW_ALL_SIDES); + _urlStringView->SetLowColor(hiliteYellow); + _urlStringView->SetViewColor(hiliteYellow); + yellowInterior->AddChild(_urlStringView); + } + if (_urlTip->Lock()) + { + font_height ttfh; _urlStringView->GetFontHeight(&ttfh); + float urlHeight = 20.0f; + BPoint pt = PointAt(_currentLinkStart, &urlHeight); + _urlTip->MoveTo(ConvertToScreen(pt)+BPoint(15.0f, -(ttfh.ascent+ttfh.descent+3.0f))); + + _urlTip->ResizeTo(muscleMin(_urlStringView->StringWidth(_currentURLString())+4.0f, 400.0f), ttfh.ascent+ttfh.descent+2.0f); + _urlStringView->SetText(_currentURLString()); + _urlTip->SetWorkspaces(B_CURRENT_WORKSPACE); + if (_urlTip->IsHidden()) _urlTip->Show(); + _urlTip->Unlock(); + } + } + else if (_urlTip) + { + if (_urlTip->Lock()) + { + if (_urlTip->IsHidden() == false) _urlTip->Hide(); + _urlTip->Unlock(); + } + } +} + +void ReflowingTextView :: MouseDown(BPoint where) +{ + if (IsFocus() == false) MakeFocus(); + const URLLink * url = GetURLAt(where); + if (url) + { + char * allocBuf = NULL; + const char * buf = url->GetURL()(); + if (buf[0] == '\0') + { + buf = allocBuf = new char[url->GetLength()+1]; + GetText(url->GetStart(), url->GetLength(), allocBuf); + allocBuf[url->GetLength()] = '\0'; + } + + if (strncasecmp(buf, "beshare://", 10) == 0) + { + char * argv[] = {(char *) &buf[10]}; + be_roster->Launch(BESHARE_MIME_TYPE, ARRAYITEMS(argv), argv); + } + else if (strncasecmp(buf, "beshare:", 8) == 0) + { + BMessage msg(_queryMessage); + msg.AddString("query", &buf[8]); + _commandTarget.SendMessage(&msg); + } + else if (strncasecmp(buf, "share:", 6) == 0) + { + BMessage msg(_queryMessage); + msg.AddString("query", &buf[6]); + _commandTarget.SendMessage(&msg); + } + else if (strncasecmp(buf, "priv:", 5) == 0) + { + BMessage msg(_privMessage); + msg.AddString("users", &buf[5]); + _commandTarget.SendMessage(&msg); + } + else if (strncasecmp(buf, "audio://", 8) == 0) + { + BMessage msg(B_REFS_RECEIVED); + String temp("http://"); + temp += &buf[8]; + msg.AddString("be:url", temp()); + be_roster->Launch("audio/x-scpls", &msg); + } + else be_roster->Launch(strncasecmp(buf, "mailto:", 7) ? "application/x-vnd.Be.URL.http" : "text/x-email", 1, const_cast(&buf)); + + delete [] allocBuf; + } + BTextView::MouseDown(where); +} + +void ReflowingTextView :: FixTextRect() +{ + BRect t(Frame()); + SetTextRect(t); +} + +void ReflowingTextView :: Clear() +{ + Delete(0, TextLength()-1); + _urls.Clear(); +} + +void ReflowingTextView :: AddURLRegion(uint32 start, uint32 len, const String & optHiddenURL) +{ + _urls.AddTail(URLLink(start, len, optHiddenURL)); +} + +void ReflowingTextView :: SetCommandURLTarget(const BMessenger & target, const BMessage & queryMsg, const BMessage & privMsg) +{ + _commandTarget = target; + _queryMessage = queryMsg; + _privMessage = privMsg; +} + +const ReflowingTextView::URLLink * ReflowingTextView :: GetURLAt(BPoint pt) const +{ + uint32 offset = (uint32) OffsetAt(pt); + for (int i=_urls.GetNumItems()-1; i>=0; i--) + { + const URLLink & url = _urls[i]; + if ((offset >= url.GetStart())&&(offset < url.GetStart() + url.GetLength())) return &url; + } + return NULL; +} + +}; // end namespace beshare diff --git a/library/libfunky/extra/ReflowingTextView.h b/library/libfunky/extra/ReflowingTextView.h new file mode 100644 index 0000000..9f5e7f4 --- /dev/null +++ b/library/libfunky/extra/ReflowingTextView.h @@ -0,0 +1,83 @@ +#ifndef REFLOWING_TEXT_VIEW_H +#define REFLOWING_TEXT_VIEW_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "util/Queue.h" +#include "util/String.h" +#include "BeShareNameSpace.h" + +namespace beshare { + +/* Subsclass of BTextView that automatically reflows the text when it is resized */ +class ReflowingTextView : public BTextView +{ +public: + ReflowingTextView(BRect frame, const char *name, BRect textRect, uint32 resizeMask, uint32 flags = B_WILL_DRAW | B_PULSE_NEEDED); + virtual ~ReflowingTextView(); + + virtual void AttachedToWindow(); + + virtual void FrameResized(float w, float h); + + virtual void MessageReceived(BMessage * msg); + + virtual void MouseMoved(BPoint where, uint32 code, const BMessage * msg); + + virtual void MouseDown(BPoint where); + + void FixTextRect(); + + void Clear(); + + void AddURLRegion(uint32 start, uint32 len, const String & optHiddenURL); + + void SetCommandURLTarget(const BMessenger & target, const BMessage & queryMsg, const BMessage & privMsg); + +private: + void UpdateToolTip(); + + /* A simple little data class that remembers stuff we need to remember about hyperlinks in the text view */ + class URLLink + { + public: + URLLink() : _start(0), _len(0) {/* empty */} + URLLink(uint32 start, uint32 len, const String & optURL) : _start(start), _len(len), _url(optURL) {/* empty */} + + inline uint32 GetStart() const {return _start;} + inline uint32 GetLength() const {return _len;} + const String & GetURL() const {return _url;} + + private: + uint32 _start; + uint32 _len; + String _url; + }; + + const URLLink * GetURLAt(BPoint pt) const; + + Queue _urls; + BMessenger _commandTarget; + BMessage _queryMessage; + BMessage _privMessage; + BMessageRunner * _showTipRunner; + bool _runnerWillHide; // If true, the runner is a hide-runner. + bool _canShow; + BWindow * _urlTip; + BStringView * _urlStringView; + int32 _currentLinkStart; + String _currentURLString; +}; + +}; // end namespace beshare + +#endif diff --git a/library/libfunky/extra/String.cpp b/library/libfunky/extra/String.cpp new file mode 100644 index 0000000..690fda7 --- /dev/null +++ b/library/libfunky/extra/String.cpp @@ -0,0 +1,674 @@ +/* This file is Copyright 2005 Level Control Systems. See the included LICENSE.txt file for details. */ + +#include "util/String.h" +#include "system/GlobalMemoryAllocator.h" +#include + +BEGIN_NAMESPACE(muscle); + +String :: ~String() +{ + if (_buffer != _smallBuffer) muscleFree(_buffer); +} + +status_t +String::SetFromString(const String & s, uint32 firstChar, uint32 afterLastChar) +{ + afterLastChar = muscleMin(afterLastChar, s.Length()); + uint32 len = (afterLastChar > firstChar) ? (afterLastChar-firstChar) : 0; + if (len > 0) + { + if (EnsureBufferSize(len+1, false) != B_NO_ERROR) return B_ERROR; + if (&s == this) memmove(_buffer, s()+firstChar, len); + else memcpy( _buffer, s()+firstChar, len); + _buffer[len] = '\0'; + _length = len; + } + else Clear(); + + return B_NO_ERROR; +} + +status_t +String::SetCstr(const char * str, uint32 maxLen) +{ + // If (str)'s got a NUL byte before maxLen, make (maxLen) smaller. + // We can't call strlen(str) because we don't have any guarantee that the NUL + // byte even exists! Without a NUL byte, strlen() could run off into the weeds... + uint32 sLen = 0; + if (str) {while((sLen 0) + { + if (str[maxLen-1] != '\0') maxLen++; // make room to add the NUL byte if necessary + if (EnsureBufferSize(maxLen, false) != B_NO_ERROR) return B_ERROR; + if (muscleInRange((char *)str, _buffer, &_buffer[_length])) memmove(_buffer, str, maxLen-1); + else memcpy(_buffer, str, maxLen-1); + _buffer[maxLen-1] = '\0'; + _length = maxLen-1; + } + else Clear(); + + return B_NO_ERROR; +} + +String & +String::operator-=(const char aChar) +{ + int idx = LastIndexOf(aChar); + if (idx >= 0) + { + String temp = Substring(idx+1); + (*this) = this->Substring(0, idx); + (*this) += temp; + } + return *this; +} + +String & +String::operator+=(const String &other) +{ + uint32 otherLen = other.Length(); + if ((otherLen > 0)&&(EnsureBufferSize(Length() + otherLen + 1, true) == B_NO_ERROR)) + { + memcpy(&_buffer[_length], other(), other.Length()+1); + _length += otherLen; + } + return *this; +} + +String & +String::operator+=(const char * other) +{ + if (other == NULL) other = ""; + uint32 otherLen = strlen(other); + if (otherLen > 0) + { + if (muscleInRange(other, (const char *)_buffer, (const char *)(_buffer+_length))) return operator+=(String(other)); // avoid self-entanglement + else if (EnsureBufferSize(Length() + otherLen + 1, true) == B_NO_ERROR) + { + memcpy(&_buffer[_length], other, otherLen+1); + _length += otherLen; + } + } + return *this; +} + +String & +String::operator-=(const String &other) +{ + if (*this == other) *this = ""; + else + { + int idx = LastIndexOf(other); + if (idx >= 0) + { + String temp = Substring(idx+other.Length()); + (*this) = Substring(0, idx); + (*this) += temp; + } + } + return *this; +} + +String & +String::operator<<(int rhs) +{ + char buff[64]; + sprintf(buff, "%d", rhs); + return *this << buff; +} + +String & +String::operator<<(float rhs) +{ + char buff[64]; + sprintf(buff, "%.2f", rhs); + return *this << buff; +} + +String & +String::operator<<(bool rhs) +{ + const char* val = rhs ? "true" : "false"; + return *this << val; +} + +void +String::Reverse() +{ + if ((_buffer)&&(Length() > 0)) + { + uint32 from = 0; + uint32 to = Length()-1; + while(from 0) + { + // If we are replacing a shorter string with a longer string, we'll have to do a copy-and-swap + uint32 numInstances = GetNumInstancesOf(replaceMe); + if (numInstances == 0) return 0; // no changes necessary! + if (temp.Prealloc(Length()+(perInstanceDelta*numInstances)) != B_NO_ERROR) return -1; + } + + // This code works for both the in-place and the copy-over modes! + int32 ret = 0; + const char * readPtr = Cstr(); + char * writePtr = (perInstanceDelta > 0) ? temp._buffer : NULL; + while(1) + { + char * nextReplaceMe = strstr((char *) readPtr, (char *) replaceMe()); + if (nextReplaceMe) + { + ret++; + if (writePtr) + { + uint32 numBytes = nextReplaceMe-readPtr; + if (perInstanceDelta != 0) memmove(writePtr, readPtr, numBytes); + writePtr += numBytes; + } + else writePtr = nextReplaceMe; + + memcpy(writePtr, withMe(), withMe.Length()); + readPtr = nextReplaceMe + replaceMe.Length(); + writePtr += withMe.Length(); + } + else + { + if (writePtr) + { + // Finish up + uint32 numBytes = Cstr()+Length()-readPtr; + if (perInstanceDelta != 0) memmove(writePtr, readPtr, numBytes); + writePtr += numBytes; + *writePtr = '\0'; + if (perInstanceDelta > 0) + { + temp._length = writePtr-temp(); + SwapContents(temp); + } + else _length = writePtr-Cstr(); + } + return ret; + } + } + return ret; // just to shut the compiler up; we never actually get here +} + +void +String::SwapContents(String & s) +{ + TCHECKPOINT; + + if (&s != this) + { + bool thisSmall = ( _buffer == _smallBuffer); + bool sSmall = (s._buffer == s._smallBuffer); + + if ((sSmall)&&(thisSmall)) + { + for (int32 i=muscleMax(_length, s._length); i>=0; i--) muscleSwap(_smallBuffer[i], s._smallBuffer[i]); + } + else if (thisSmall) + { + _buffer = s._buffer; + _bufferLen = s._bufferLen; + s._buffer = s._smallBuffer; + s._bufferLen = sizeof(s._smallBuffer); + memcpy(s._smallBuffer, _smallBuffer, _length+1); + } + else if (sSmall) + { + s._buffer = _buffer; + s._bufferLen = _bufferLen; + _buffer = _smallBuffer; + _bufferLen = sizeof(_smallBuffer); + memcpy(_smallBuffer, s._smallBuffer, s._length+1); + } + else + { + muscleSwap(_buffer, s._buffer); + muscleSwap(_bufferLen, s._bufferLen); + } + + muscleSwap(_length, s._length); // always do this + } +} + +int +String::LastIndexOf(const String &s2, uint32 fromIndex) const +{ + TCHECKPOINT; + + if (s2.Length() == 0) return Length()-1; + if (fromIndex >= Length()) return -1; + for (int i=fromIndex; i>=0; i--) if (strncmp(Cstr()+i, s2.Cstr(), s2.Length()) == 0) return i; + return -1; +} + +int +String::LastIndexOf(const char * s2, uint32 fromIndex) const +{ + TCHECKPOINT; + + if (s2 == NULL) s2 = ""; + uint32 s2Len = strlen(s2); + if (s2Len == 0) return Length()-1; + if (fromIndex >= Length()) return -1; + for (int i=fromIndex; i>=0; i--) if (strncmp(Cstr()+i, s2, s2Len) == 0) return i; + return -1; +} + +String +String::ToLowerCase() const +{ + String ret(*this); + if (ret._buffer) for (uint32 i=0; istartIdx; endIdx--) if (!IsSpaceChar(s[endIdx])) break; + return String(*this, (uint32)startIdx, (uint32)(endIdx+1)); +} + +uint32 String :: FlattenedSize() const +{ + return Length()+1; +} + +void String :: Flatten(uint8 *buffer) const +{ + memcpy((char *)buffer, Cstr(), Length()+1); +} + +status_t String :: Unflatten(const uint8 *buf, uint32 size) +{ + return SetCstr((const char *)buf, size); +} + +uint32 String :: GetNumInstancesOf(char ch) const +{ + uint32 ret = 0; + for (const char * s = Cstr(); (*s != '\0'); s++) if (*s == ch) ret++; + return ret; +} + +uint32 String :: GetNumInstancesOf(const String & substring) const +{ + TCHECKPOINT; + + uint32 ret = 0; + if (substring.Length() > 0) + { + uint32 lastIdx = 0; + int32 idx; + while((idx = IndexOf(substring, lastIdx)) >= 0) + { + ret++; + lastIdx = idx + substring.Length(); + } + } + return ret; +} + +uint32 String :: GetNumInstancesOf(const char * substring) const +{ + TCHECKPOINT; + + if (substring == NULL) substring = ""; + uint32 ret = 0; + uint32 substringLength = strlen(substring); + if (substringLength > 0) + { + uint32 lastIdx = 0; + int32 idx; + while((idx = IndexOf(substring, lastIdx)) >= 0) + { + ret++; + lastIdx = idx + substringLength; + } + } + return ret; +} + +String String :: Prepend(const String & str, uint32 count) const +{ + TCHECKPOINT; + + String ret; + uint32 newLen = (count*str.Length())+Length(); + if (ret.Prealloc(newLen) == B_NO_ERROR) + { + char * b = ret._buffer; + + if (str.Length() > 0) + { + for (uint32 i=0; i 0) + { + memcpy(b, Cstr(), Length()); + b += Length(); + } + ret._length = (b-ret._buffer); + ret._buffer[ret._length] = '\0'; // terminate the string + } + return ret; +} + +String String :: Prepend(const char * str, uint32 count) const +{ + TCHECKPOINT; + + if (muscleInRange(str, (const char *)_buffer, (const char *)(_buffer+Length()))) return Prepend(String(str), count); // avoid self-entanglement! + else + { + if (str == NULL) str = ""; + uint32 sLen = strlen(str); + String ret; + uint32 newLen = (count*sLen)+Length(); + if (ret.Prealloc(newLen) == B_NO_ERROR) + { + char * b = ret._buffer; + + if (sLen > 0) + { + for (uint32 i=0; i 0) + { + memcpy(b, Cstr(), Length()); + b += Length(); + } + ret._length = (b-ret._buffer); + ret._buffer[ret._length] = '\0'; // terminate the string + } + return ret; + } +} + +String String :: Append(const String & str, uint32 count) const +{ + TCHECKPOINT; + + String ret; + uint32 newLen = Length()+(count*str.Length()); + if (ret.Prealloc(newLen) == B_NO_ERROR) + { + char * b = ret._buffer; + if (Length() > 0) + { + memcpy(b, Cstr(), Length()); + b += Length(); + } + if (str.Length() > 0) + { + for (uint32 i=0; i 0) + { + memcpy(b, Cstr(), Length()); + b += Length(); + } + if (sLen > 0) + { + for (uint32 i=0; i _bufferLen) + { + if (requestedBufLen <= sizeof(_smallBuffer)) // guaranteed only to be true the very first time we are called! + { + // For small initial requests, we can just set up our buffer pointer to point to our static-buffer area. Cheap! + _buffer = _smallBuffer; + _bufferLen = sizeof(_smallBuffer); + } + else + { + // If we're doing a first-time allocation, allocate exactly the number of the bytes requested. + // If it's a re-allocation, allocate more than requested as it's more likely to happen yet another time... + uint32 newBufLen = (_buffer == NULL) ? requestedBufLen : (requestedBufLen * 2); + if (retainValue) + { + if ((_buffer)&&(_buffer != _smallBuffer)) + { + // We can call muscleRealloc() to hopefully avoid data copying + char * newBuf = (char *)muscleRealloc(_buffer, newBufLen); + if (newBuf) + { + _buffer = newBuf; + _bufferLen = newBufLen; + } + else + { + WARN_OUT_OF_MEMORY; + return B_ERROR; + } + } + else + { + // Oops, muscleRealloc() won't do.... we'll just have to copy the bytes over + char * newBuf = (char *) muscleAlloc(newBufLen); + if (newBuf == NULL) + { + WARN_OUT_OF_MEMORY; + return B_ERROR; + } + if (_buffer) memcpy(newBuf, _buffer, Length()+1); + if (_buffer != _smallBuffer) muscleFree(_buffer); + _buffer = newBuf; + _bufferLen = newBufLen; + } + } + else + { + // If the caller doesn't care about retaining the value, then it's + // probably cheaper just to free our buffer and get a new one. + char * newBuf = (char *) muscleAlloc(newBufLen); + if (newBuf == NULL) + { + WARN_OUT_OF_MEMORY; + return B_ERROR; + } + if (_buffer != _smallBuffer) muscleFree(_buffer); + _buffer = newBuf; + _bufferLen = newBufLen; + } + } + } + return B_NO_ERROR; +} + +String String :: Pad(uint32 minLength, bool padOnRight, char padChar) const +{ + if (Length() < minLength) + { + uint32 padLen = minLength-Length(); + String temp; temp += padChar; + return (padOnRight) ? Append(temp, padLen) : Prepend(temp, padLen); + } + else return *this; +} + +#define ARG_IMPLEMENTATION \ + char buf[256]; \ + sprintf(buf, fmt, value); \ + return ArgAux(buf) + +String String :: Arg(int8 value, const char * fmt) const {ARG_IMPLEMENTATION;} +String String :: Arg(uint8 value, const char * fmt) const {ARG_IMPLEMENTATION;} +String String :: Arg(int16 value, const char * fmt) const {ARG_IMPLEMENTATION;} +String String :: Arg(uint16 value, const char * fmt) const {ARG_IMPLEMENTATION;} +String String :: Arg(int32 value, const char * fmt) const {ARG_IMPLEMENTATION;} +String String :: Arg(uint32 value, const char * fmt) const {ARG_IMPLEMENTATION;} +String String :: Arg(int64 value, const char * fmt) const {ARG_IMPLEMENTATION;} +String String :: Arg(uint64 value, const char * fmt) const {ARG_IMPLEMENTATION;} +String String :: Arg(double value, const char * fmt) const {ARG_IMPLEMENTATION;} +String String :: Arg(const String & value) const {return ArgAux(value());} +String String :: Arg(const char * value) const {return ArgAux(value);} + +String String :: ArgAux(const char * buf) const +{ + TCHECKPOINT; + + int32 lowestArg = -1; + const char * s = Cstr(); + while(*s != '\0') + { + if (*s == '%') + { + s++; + if (muscleInRange(*s, '0', '9')) + { + int32 val = atol(s); + lowestArg = (lowestArg < 0) ? val : muscleMin(val, lowestArg); + while(muscleInRange(*s, '0', '9')) s++; + } + } + else s++; + } + + if (lowestArg >= 0) + { + char token[64]; + sprintf(token, "%%%li", lowestArg); + String ret(*this); + (void) ret.Replace(token, buf); + return ret; + } + else return *this; +} + +const String & GetEmptyString() +{ + static const String _empty; + return _empty; +} + +/*--- ElfHash --------------------------------------------------- + * The published hash algorithm used in the UNIX ELF format + * for object files. Accepts a pointer to a string to be hashed + * and returns an unsigned long. + * jaf: stolen from: http://www.ddj.com/articles/1996/9604/9604b/9604b.htm?topic=algorithms + *-------------------------------------------------------------*/ +uint32 CStringHashFunc(const char * n) +{ + uint32 h = 0, g; + const unsigned char * name = (const unsigned char *) n; + while (*name) + { + h = (h << 4) + *name++; + if ((g = h & 0xF0000000) != 0) h ^= g >> 24; + h &= ~g; + } + return h; +} + +int CStringCompareFunc(const char * const & s1, const char * const & s2, void *) +{ + return strcmp(s1, s2); +} + +int StringCompareFunc(const String & s1, const String & s2, void *) +{ + return muscleCompare(s1, s2); +} + +END_NAMESPACE(muscle); diff --git a/library/libfunky/extra/String.h b/library/libfunky/extra/String.h new file mode 100644 index 0000000..119971e --- /dev/null +++ b/library/libfunky/extra/String.h @@ -0,0 +1,672 @@ +/* This file is Copyright 2005 Level Control Systems. See the included LICENSE.txt file for details. */ +/* This class was derived from the String class written by Michael Olivero (mike95@mike95.com) */ + +/* NOTE TO MACOS/X X-CODE USERS: If you are trying to #include + * and X-Code is "helpfully" pulling in this file instead (because the + * OS/X filesystem is case-insensitive), you can get around that problem + * by adding "USE_HEADERMAP = NO" to your X-Code target settings. + * ref: http://lists.apple.com/archives/xcode-users/2004/Aug/msg00934.html + * --Jeremy + */ + +#ifndef MuscleString_h +#define MuscleString_h + +#include +#include +#include "support/Flattenable.h" + +BEGIN_NAMESPACE(muscle); + +#ifndef SMALL_MUSCLE_STRING_LENGTH +# define SMALL_MUSCLE_STRING_LENGTH 7 // strings shorter than this length can be stored inline, without requiring an extra new[]. +#endif + +/** A nice hashing function for use with (const char *)'s */ +uint32 CStringHashFunc(const char * str); + +/** A character string class. Represents a dynamically resizable NUL-terminated string. */ +class String : public Flattenable { +public: + /** Constructor. + * @param str If non-NULL, the initial value for this String. + * @param maxLen The maximum number of characters to place into + * this String (not including the NUL terminator byte). + * Default is unlimited (i.e. scan the entire string no matter how long it is) + */ + String(const char * str = NULL, uint32 maxLen = ((uint32)-1)) : Flattenable(), _buffer(NULL), _bufferLen(0), _length(0) {if (str) (void) SetCstr(str, maxLen);} + + /** Copy Constructor. + * @param str String to become a copy of. + */ + String(const String & str) : Flattenable(), _buffer(NULL), _bufferLen(0), _length(0) {(void) SetFromString(str);} + + /** This constructor sets this String to be a substring of the specified String. + * @param str String to become a copy of. + * @param beginIndex Index of the first character in (str) to include. + * @param endIndex Index after the last character in (str) to include. + * Defaults to a very large number, so that by default the entire remainder of the string is included. + */ + String(const String & str, uint32 beginIndex, uint32 endIndex=((uint32)-1)) : Flattenable(), _buffer(NULL), _bufferLen(0), _length(0) {(void) SetFromString(str, beginIndex, endIndex);} + + /** Destructor. */ + virtual ~String(); + + /** Assignment Operator. Sets this string to be a one-character string + * @param val The character that should be the sole character in this String. + */ + String & operator = (char val) {(void) SetCstr(&val, 1); return *this;} + + /** Assignment Operator. + * @param val Pointer to the C-style string to copy from. If NULL, this string will become "". + */ + String & operator = (const char * val) {(void) SetCstr(val); return *this;} + + /** Assignment Operator. + * @param rhs String to become a copy of. + */ + String & operator = (const String &rhs) {(void) SetFromString(rhs); return *this;} + + /** Append Operator. + * @param rhs A string to append to this string. + */ + String & operator += (const String &rhs); + + /** Append Operator. + * @param rhs A string to append to this string. If NULL, this operation is a no-op. + */ + String & operator += (const char * rhs); + + /** Append Operator. + * @param ch A character to append to this string. + */ + String & operator += (const char ch) + { + if (EnsureBufferSize(Length()+2, true) == B_NO_ERROR) + { + _buffer[_length++] = ch; + _buffer[_length] = '\0'; + } + return *this; + } + + /** Remove Operator. + * @param rhs A substring to remove from this string; the + * last instance of the substring will be cut out. + * If (rhs) is not found, there is no effect. + */ + String & operator -= (const String &rhs); + + /** Remove Operator. + * @param ch A character to remove from this string; the last + * instance of this char will be cut out. If (ch) is + * not found, there is no effect. + */ + String & operator -= (const char ch); + + /** Append 'Stream' Operator. + * @param rhs A String to append to this string. + * @return a non const String refrence to 'this' so you can chain appends. + */ + String & operator << (const String& rhs) {return (*this += rhs);} + + /** Append 'Stream' Operator. + * @param rhs A const char* to append to this string. + * @return a non const String refrence to 'this' so you can chain appends. + */ + String & operator << (const char* rhs) {return (*this += rhs);} + + /** Append 'Stream' Operator. + * @param rhs An int to append to this string. + * @return a non const String refrence to 'this' so you can chain appends. + */ + String & operator << (int rhs); + + /** Append 'Stream' Operator. + * @param rhs A float to append to this string. Formatting is set at 2 decimals of precision. + * @return a non const String refrence to 'this' so you can chain appends. + */ + String & operator << (float rhs); + + /** Append 'Stream' Operator. + * @param rhs A bool to append to this string. Converts to 'true' and 'false' strings appropriately. + * @return a non const String refrence to 'this' so you can chain appends. + */ + String & operator << (bool rhs); + + /** Comparison Operator. Returns true if the two strings are equal (as determined by strcmp()) + * @param rhs A string to compare ourself with + */ + bool operator == (const String &rhs) const {return ((this == &rhs)||((Length() == rhs.Length())&&(strcmp(Cstr(), rhs.Cstr()) == 0)));} + + /** Comparison Operator. Returns true if the two strings are equal (as determined by strcmp()) + * @param rhs Pointer to a C string to compare with. NULL pointers are considered a synonym for "". + */ + bool operator == (const char * rhs) const {return (strcmp(Cstr(), rhs?rhs:"") == 0);} + + /** Comparison Operator. Returns true if the two strings are not equal (as determined by strcmp()) + * @param rhs A string to compare ourself with + */ + bool operator != (const String &rhs) const {return !(*this == rhs);} + + /** Comparison Operator. Returns true if the two strings are not equal (as determined by strcmp()) + * @param rhs Pointer to a C string to compare to. NULL pointers are considered a synonym for "". + */ + bool operator != (const char * rhs) const {return (strcmp(Cstr(), rhs?rhs:"") != 0);} + + /** Comparison Operator. Returns true if this string comes before (rhs) lexically. + * @param rhs A string to compare ourself with + */ + bool operator < (const String &rhs) const {return (this == &rhs) ? false : (strcmp(Cstr(), rhs.Cstr()) < 0);} + + /** Comparison Operator. Returns true if this string comes before (rhs) lexically. + * @param rhs Pointer to a C string to compare to. NULL pointers are considered a synonym for "". + */ + bool operator < (const char * rhs) const {return (strcmp(Cstr(), rhs?rhs:"") < 0);} + + /** Comparison Operator. Returns true if this string comes after (rhs) lexically. + * @param rhs A string to compare ourself with + */ + bool operator > (const String &rhs) const {return (this == &rhs) ? false : (strcmp(Cstr(), rhs.Cstr()) > 0);} + + /** Comparison Operator. Returns true if this string comes after (rhs) lexically. + * @param rhs Pointer to a C string to compare to. NULL pointers are considered a synonym for "". + */ + bool operator > (const char * rhs) const {return (strcmp(Cstr(), rhs?rhs:"") > 0);} + + /** Comparison Operator. Returns true if the two strings are equal, or this string comes before (rhs) lexically. + * @param rhs A string to compare ourself with + */ + bool operator <= (const String &rhs) const {return (this == &rhs) ? true : (strcmp(Cstr(), rhs.Cstr()) <= 0);} + + /** Comparison Operator. Returns true if the two strings are equal, or this string comes before (rhs) lexically. + * @param rhs Pointer to a C string to compare to. NULL pointers are considered a synonym for "". + */ + bool operator <= (const char * rhs) const {return (strcmp(Cstr(), rhs?rhs:"") <= 0);} + + /** Comparison Operator. Returns true if the two strings are equal, or this string comes after (rhs) lexically. + * @param rhs A string to compare ourself with + */ + bool operator >= (const String &rhs) const {return (this == &rhs) ? true : (strcmp(Cstr(), rhs.Cstr()) >= 0);} + + /** Comparison Operator. Returns true if the two strings are equal, or this string comes after (rhs) lexically. + * @param rhs Pointer to a C string to compare to. NULL pointers are considered a synonym for "". + */ + bool operator >= (const char * rhs) const {return (strcmp(Cstr(), rhs?rhs:"") >= 0);} + + /** Array Operator. Used to get easy access to the characters that make up this string. + * @param index Index of the character to return. Be sure to only use valid indices! + */ + char operator [] (uint32 index) const {VerifyIndex(index); return _buffer[index];} + + /** Array Operator. Used to get easy access to the characters that make up this string. + * @param index Index of the character to set. Be sure to only use valid indices! + */ + char & operator [] (uint32 index) {VerifyIndex(index); return _buffer[index];} + + /** Returns the character at the (index)'th position in the string. + * @param index A value between 0 and (Length()-1), inclusive. + * @return A character value. + */ + char CharAt(uint32 index) const {return operator[](index);} + + /** Compares this string to another string using strcmp() + * @param rhs A string to compare ourself with + */ + int CompareTo(const String & rhs) const {return strcmp(Cstr(), rhs.Cstr());} + + /** Compares this string to a C string using strcmp() + * @param rhs Pointer to a C string to compare to. NULL pointers are considered a synonym for "". + */ + int CompareTo(const char * rhs) const {return strcmp(Cstr(), rhs?rhs:"");} + + /** Returns a read-only C-style pointer to our held character string. */ + const char * Cstr() const {return _buffer ? _buffer : "";} + + /** Convenience synonym for Cstr(). */ + const char * operator()() const {return Cstr();} + + /** Clears this string so that it contains no characters. Equivalent to setting it to "". */ + void Clear() {if (_buffer) _buffer[0] = '\0'; _length = 0;} + + /** Sets our state from the given C-style string. + * @param str The new string to copy from. If maxLen is negative, this may be NULL. + * @param maxLen If set, the number of characters to copy (not including the NUL + * terminator byte). By default, the number of characters is determined + * automatically by scanning the string. + */ + status_t SetCstr(const char * str, uint32 maxLen = ((uint32)-1)); + + /** Sets our state from the given String. This is similar to the copy constructor, except + * that it allows you to optionally specify a maximum length, and it allows you to detect + * out-of-memory errors. + * @param str The new string to copy from. + * @param beginIndex Index of the first character in (str) to include. + * @param endIndex Index after the last character in (str) to include. + * Defaults to a very large number, so that by default the entire remainder of the string is included. + * @returns B_NO_ERROR on success, or B_ERROR on failure (out of memory?) + */ + status_t SetFromString(const String & str, uint32 firstChar = 0, uint32 maxLen = ((uint32)-1)); + + /** Returns true iff this string starts with (prefix) + * @param c a character to check for at the end of this String. + */ + bool EndsWith(char c) const {return (_length > 0)&&(_buffer[_length-1] == c);} + + /** Returns true iff this string ends with (suffix) + * @param suffix a String to check for at the end of this String. + */ + bool EndsWith(const String &suffix) const {return (Length() < suffix.Length()) ? false : (strcmp(Cstr()+(Length()-suffix.Length()), suffix.Cstr()) == 0);} + + /** Returns true iff this string ends with (suffix) + * @param suffix a String to check for at the end of this String. NULL pointers are treated as a synonym for "". + */ + bool EndsWith(const char * suffix) const + { + if (suffix == NULL) suffix = ""; + uint32 suffixLen = strlen(suffix); + return (Length() < suffixLen) ? false : (strcmp(Cstr()+(Length()-suffixLen), suffix) == 0); + } + + /** Returns true iff this string is equal to (string), as determined by strcmp(). + * @param str a String to compare this String with. + */ + bool Equals(const String & str) const {return (*this == str);} + + /** Returns true iff this string is equal to (str), as determined by strcmp(). + * @param str Pointer to a C string to compare to. NULL pointers are considered a synonym for "". + */ + bool Equals(const char * str) const {return (*this == str);} + + /** Returns true iff this string contains a single character (c). + * @param c a character to compare this String with. + */ + bool Equals(char c) const {return (_length == 1)&&(_buffer[0] == c);} + + /** Returns the first index of (ch) in this string starting at or after (fromIndex), or -1 if not found. + * @param ch A character to look for in this string. + * @param fromIndex Index of the first character to start searching at in this String. Defaults to zero (i.e. start from the first character) + */ + int IndexOf(char ch, uint32 fromIndex = 0) const + { + const char * temp = (fromIndex < Length()) ? strchr(Cstr()+fromIndex, ch) : NULL; + return temp ? (temp - Cstr()) : -1; + } + + /** Returns the first index of substring (str) in this string starting at or after (fromIndex), or -1 if not found. + * @param str A String to look for in this string. + * @param fromIndex Index of the first character to start searching at in this String. Defaults to zero (i.e. start from the first character) + */ + int IndexOf(const String &str, uint32 fromIndex = 0) const + { + const char * temp = (fromIndex < Length()) ? strstr(Cstr()+fromIndex, str()) : NULL; + return temp ? (temp - Cstr()) : -1; + } + + /** Returns the first index of substring (str) in this string starting at or after (fromIndex), or -1 if not found. + * @param str Pointer to a C string to compare to. NULL pointers are considered a synonym for "". + * @param fromIndex Index of the first character to start searching at in this String. Defaults to zero (i.e. start from the first character) + */ + int IndexOf(const char * str, uint32 fromIndex = 0) const + { + const char * temp = (fromIndex < Length()) ? strstr(Cstr()+fromIndex, str?str:"") : NULL; + return temp ? (temp - Cstr()) : -1; + } + + /** Returns the last index of (ch) in this string starting at or after (fromIndex), or -1 if not found. + * @param ch A character to look for in this string. + * @param fromIndex Index of the first character to start searching at in this String. Defaults to zero (i.e. start from the first character) + */ + int LastIndexOf(char ch, uint32 fromIndex = 0) const + { + const char * lio = (fromIndex < Length()) ? strrchr(Cstr()+fromIndex, ch) : NULL; + return lio ? (lio - Cstr()) : -1; + } + + /** Returns the last index of substring (str) in this string + * @param str A String to look for in this string. + * @param fromIndex Index of the first character to start searching at in this String. Defaults to zero (i.e. start from the first character) + */ + int LastIndexOf(const String &str) const {return (str.Length() <= Length()) ? LastIndexOf(str, Length()-str.Length()) : -1;} + + /** Returns the last index of substring (str) in this string + * @param str Pointer to a C string to compare to. NULL pointers are considered a synonym for "". + */ + int LastIndexOf(const char * str) const + { + if (str == NULL) str = ""; + uint32 strLen = strlen(str); + return (strLen <= Length()) ? LastIndexOf(str, Length()-strLen) : -1; + } + + /** Returns the last index of substring (str) in this string starting at or after (fromIndex), or -1 if not found. + * @param str A String to look for in this string. + * @param fromIndex Index of the first character to start searching at in this String. Defaults to zero (i.e. start from the first character) + */ + int LastIndexOf(const String &str, uint32 fromIndex) const; + + /** Returns the last index of substring (str) in this string starting at or after (fromIndex), or -1 if not found. + * @param str Pointer to a C string to compare to. NULL pointers are considered a synonym for "". + * @param fromIndex Index of the first character to start searching at in this String. Defaults to zero (i.e. start from the first character) + */ + int LastIndexOf(const char * str, uint32 fromIndex) const; + + /** Returns the number of characters in the string (not including the terminating NUL byte) */ + uint32 Length() const {return _length;} + + /** Returns the number of instances of (c) in this string. */ + uint32 GetNumInstancesOf(char ch) const; + + /** Returns the number of instances of (substring) in this string. */ + uint32 GetNumInstancesOf(const String & substring) const; + + /** Returns the number of instances of (substring) in this string. */ + uint32 GetNumInstancesOf(const char * substring) const; + + /** Returns true iff this string starts with (prefix) */ + bool StartsWith(char c) const {return (_length > 0)&&(_buffer[0] == c);} + + /** Returns true iff this string starts with (prefix) */ + bool StartsWith(const String &str) const {return ((Length() >= str.Length())&&(strncmp(Cstr(), str(), str.Length()) == 0));} + + /** Returns true iff this string starts with (prefix) + * @param str Pointer to a C string to compare to. NULL pointers are considered a synonym for "". + */ + bool StartsWith(const char * prefix) const + { + if (prefix == NULL) prefix = ""; + uint32 prefixLen = strlen(prefix); + return (Length() < prefixLen) ? false : (strncmp(Cstr(), prefix, prefixLen) == 0); + } + + /** Returns true iff this string starts with the first (offset) characters of (prefix) */ + bool StartsWith(const String &prefix, uint32 offset) const {return ((offset+prefix.Length()<=Length())&&(strncmp(Cstr()+offset, prefix.Cstr(), prefix.Length()) == 0));} + + /** Returns true iff this string starts with the first (offset) characters of (prefix) + * @param str Pointer to a C string to compare to. NULL pointers are considered a synonym for "". + */ + bool StartsWith(const char * prefix, uint32 offset) const + { + if (prefix == NULL) prefix = ""; + uint32 prefixLen = strlen(prefix); + return ((offset+prefixLen<=Length())&&(strncmp(Cstr()+offset, prefix, prefixLen) == 0)); + } + + /** Returns a string that consists of (count) copies of (str), followed by this string. */ + String Prepend(const String & str, uint32 count = 1) const; + + /** Returns a string that consists of (count) copies of (str), followed by this string. + * @param str Pointer to a C string to compare to. NULL pointers are considered a synonym for "". + * @param count How many instances of (str) should be prepended to this string. Defaults to 1. + */ + String Prepend(const char * str, uint32 count = 1) const; + + /** Returns a string that consists of this string followed by (count) copies of (str). */ + String Append(const String & str, uint32 count = 1) const; + + /** Returns a string that consists of this string followed by (count) copies of (str). + * @param str Pointer to a C string to compare to. NULL pointers are considered a synonym for "". + * @param count How many instances of (str) should be appended to this string. Defaults to 1. + */ + String Append(const char * str, uint32 count = 1) const; + + /** Returns a string that is like this string, but padded out to the specified minimum length with (padChar). + * @param minLength Minimum length that the returned string should be. + * @param padOnRight If true, (padChar)s will be added to the right; if false (the default), they will be added on the left. + * @param padChar The character to pad out the string with. Defaults to ' '. + * @returns the new, padded String. + */ + String Pad(uint32 minLength, bool padOnRight = false, char padChar = ' ') const; + + /** Returns a string that consists of only the last part of this string, starting with index (beginIndex). Does not modify the string it is called on. */ + String Substring(uint32 beginIndex) const {return String(*this, beginIndex);} + + /** Returns a string that consists of only the characters in this string from range (beginIndex) to (endIndex-1). Does not modify the string it is called on. */ + String Substring(uint32 beginIndex, uint32 endIndex) const {return String(*this, beginIndex, endIndex);} + + /** Returns a string that consists of only the last part of this string, starting with the first character after the last instance of (markerString). + * If (markerString) is not found in the string, then this entire String is returned. + * For example, String("this is a test").Substring("is a") returns " test". + * Does not modify the string it is called on. + */ + String Substring(const String & markerString) const + { + int idx = LastIndexOf(markerString); + return (idx >= 0) ? String(*this, idx+markerString.Length()) : *this; + } + + /** See the Substring(const String &) documentation for details. */ + String Substring(const char * markerString) const + { + int idx = LastIndexOf(markerString); + return (idx >= 0) ? String(*this, idx+strlen(markerString)) : *this; // if (idx >= 0), then we know markerString is non-NULL + } + + /** Returns a string that consists of only the characters in the string from range (beginIndex) until the character just before + * the first character in (markerString). If (markerString) is not found, then the entire substring starting at (beginIndex) is returned. + * For example, String("this is a test").Substring(1, "is a") returns "his ". + * Does not modify the string it is called on. + */ + String Substring(uint32 beginIndex, const String & markerString) const {return String(*this, beginIndex, (uint32) IndexOf(markerString, beginIndex));} + + /** See the Substring(uint32, const String &) documentation for details. */ + String Substring(uint32 beginIndex, const char * markerString) const {return String(*this, beginIndex, (uint32) IndexOf(markerString, beginIndex));} + + /** Returns an all lower-case version of this string. Does not modify the string it is called on. */ + String ToLowerCase() const; + + /** Returns an all upper-case version of this string. Does not modify the string it is called on. */ + String ToUpperCase() const; + + /** Returns an version of this string that has all leading and trailing whitespace removed. Does not modify the string it is called on. */ + String Trim() const; + + /** Swaps the state of this string with (swapWithMe). Very efficient since little or no data copying is required. */ + void SwapContents(String & swapWithMe); + + /** Like CompareTo(), but case insensitive. */ + int CompareToIgnoreCase(const String &s) const {return ToLowerCase().CompareTo(s.ToLowerCase());} + + /** Like EndsWith(), but case insensitive. */ + bool EndsWithIgnoreCase(char c) const {return (_length > 0)&&(tolower(_buffer[_length-1]) == tolower(c));} + + /** Like EndsWith(), but case insensitive. */ + bool EndsWithIgnoreCase(const String &s) const {return ToLowerCase().EndsWith(s.ToLowerCase());} + + /** Like Equals(), but case insensitive. */ + bool EqualsIgnoreCase(const String &s) const {return ToLowerCase().Equals(s.ToLowerCase());} + + /** Like Equals(), but case insensitive. */ + bool EqualsIgnoreCase(char c) const {return (_length==1)&&(tolower(_buffer[0])==tolower(c));} + + /** Like IndexOf(), but case insensitive. */ + int IndexOfIgnoreCase(const String &s) const {return ToLowerCase().IndexOf(s.ToLowerCase());} + + /** Like IndexOf(), but case insensitive. */ + int IndexOfIgnoreCase(const String &s, uint32 f) const {return ToLowerCase().IndexOf(s.ToLowerCase(),f);} + + /** Like IndexOf(), but case insensitive. */ + int IndexOfIgnoreCase(char ch) const {return ToLowerCase().IndexOf((char)tolower(ch));} + + /** Like IndexOf(), but case insensitive. */ + int IndexOfIgnoreCase(char ch, uint32 f) const {return ToLowerCase().IndexOf((char)tolower(ch),f);} + + /** Like LastIndexOf(), but case insensitive. */ + int LastIndexOfIgnoreCase(const String &s) const {return ToLowerCase().LastIndexOf(s.ToLowerCase());} + + /** Like LastIndexOf(), but case insensitive. */ + int LastIndexOfIgnoreCase(const String &s, uint32 f) const {return ToLowerCase().LastIndexOf(s.ToLowerCase(),f);} + + /** Like LastIndexOf(), but case insensitive. */ + int LastIndexOfIgnoreCase(char ch) const {return ToLowerCase().LastIndexOf((char)tolower(ch));} + + /** Like LastIndexOf(), but case insensitive. */ + int LastIndexOfIgnoreCase(char ch, uint32 f) const {return ToLowerCase().LastIndexOf((char)tolower(ch),f);} + + /** Like EndsWith(), but case insensitive. */ + bool StartsWithIgnoreCase(char c) const {return (_length > 0)&&(tolower(_buffer[0]) == tolower(c));} + + /** Like StartsWith(), but case insensitive. */ + bool StartsWithIgnoreCase(const String &s) const {return ToLowerCase().StartsWith(s.ToLowerCase());} + + /** Like StartsWith(), but case insensitive. */ + bool StartsWithIgnoreCase(const String &s, uint32 o) const {return ToLowerCase().StartsWith(s.ToLowerCase(),o);} + + /** Returns a hash code for this string */ + inline uint32 HashCode() const {return CStringHashFunc(Cstr());} + + /** Replaces all instances of (oldChar) in this string with (newChar). + * @param replaceMe The character to search for. + * @param withMe The character to replace all occurrences of (replaceMe) with. + * @returns The number of characters that were successfully replaced. + */ + uint32 Replace(char replaceMe, char withMe); + + /** Replaces all instances of (replaceMe) in this string with (withMe). + * @param replaceMe The substring to search for. + * @param withMe The substring to replace all occurrences of (replaceMe) with. + * @returns The number of substrings that were successfully replaced, or -1 + * if the operation failed (out of memory, or (replaceMe) was of length zero) + */ + int32 Replace(const String & replaceMe, const String & withMe); + + /** Reverses the order of all characters in the string, so that e.g. "string" becomes "gnirts" */ + void Reverse(); + + /** Part of the Flattenable interface. + * @return false + */ + virtual bool IsFixedSize() const {return false;} + + /** Part of the Flattenable interface. + * @return B_STRING_TYPE + */ + virtual uint32 TypeCode() const {return B_STRING_TYPE;} + + /** Part of the Flattenable interface. + * @return Length()+1 (the +1 is for the terminating NUL byte) + */ + virtual uint32 FlattenedSize() const; + + /** Part of the Flattenable interface. Flattens our string into (buffer). + * @param buffer A byte array to receive the flattened version of this string. + * There must be at least FlattenedSize() bytes available in this array. + * The clever secret here is that a flattened String is just a C-style + * null-terminated character array, and can be used interchangably as such. + */ + virtual void Flatten(uint8 *buffer) const; + + /** Unflattens a String from (buf). + * @param buf an array of (size) bytes. + * @param size the number of bytes in (buf). + * @return B_NO_ERROR (never fails!) + */ + virtual status_t Unflatten(const uint8 *buf, uint32 size); + + /** Makes sure that we have pre-allocated enough space for a NUL-terminated string + * at least (numChars) bytes long (not including the NUL byte). + * If not, this method will try to allocate the space. + * @param numChars How much space to pre-allocate, in ASCII characters. + * @returns B_NO_ERROR on success, or B_ERROR on failure (out of memory). + */ + status_t Prealloc(uint32 numChars) {return EnsureBufferSize(numChars+1, true);} + + /** Returns a string like this string, but with the appropriate %# tokens + * replaced with a textual representation of the values passed in as (value). + * For example, String("%1 is a %2").Arg(13).Arg("bakers dozen") would return + * the string "13 is a bakers dozen". + * @param value The value to replace in the string. + * @param fmt The format parameter to pass to sprintf(). Note that if you supply your + * own format string, you'll need to be careful since a badly chosen format + * string could lead to a crash or out-of-bounds memory overwrite. In particular, + * the format string should match the type specified, and should not lead to + * more than 256 bytes being written. + * @returns a new String with the appropriate tokens replaced. + */ + String Arg(int8 value, const char * fmt = "%i") const; + + /** As above, but for uint8 values. */ + String Arg(uint8 value, const char * fmt = "%u") const; + + /** As above, but for int16 values. */ + String Arg(int16 value, const char * fmt = "%i") const; + + /** As above, but for uint16 values. */ + String Arg(uint16 value, const char * fmt = "%u") const; + + /** As above, but for int32 values. */ + String Arg(int32 value, const char * fmt = "%li") const; + + /** As above, but for uint32 values. */ + String Arg(uint32 value, const char * fmt = "%lu") const; + + /** As above, but for int64 values. */ + String Arg(int64 value, const char * fmt = INT64_FORMAT_SPEC) const; + + /** As above, but for uint64 values. */ + String Arg(uint64 value, const char * fmt = UINT64_FORMAT_SPEC) const; + + /** As above, but for double values. */ + String Arg(double value, const char * fmt = "%f") const; + + /** As above, but for string values. */ + String Arg(const String & value) const; + String Arg(const char * value) const; + +private: + bool IsSpaceChar(char c) const {return ((c==' ')||(c=='\t')||(c=='\r')||(c=='\n'));} + status_t EnsureBufferSize(uint32 newBufLen, bool retainValue); + String ArgAux(const char * buf) const; + + char _smallBuffer[SMALL_MUSCLE_STRING_LENGTH+1]; // store very small strings in-line, to avoid dynamic allocation + char * _buffer; // Stores the chars. May point at (_smallBuffer), or a dynamically allocated buffer + uint32 _bufferLen; // Number of bytes pointed to by (_buffer) + uint32 _length; // cached strlen(_buffer) + + void VerifyIndex(uint32 index) const + { +#ifdef MUSCLE_AVOID_ASSERTIONS + (void) index; // avoid compiler warnings +#else + MASSERT(index < _length, "Index Out Of Bounds Exception"); +#endif + } +}; + +/** Convenience method: returns a string with no characters in it (a.k.a. "") */ +const String & GetEmptyString(); + +template class HashFunctor; + +template <> +class HashFunctor +{ +public: + uint32 operator () (const String & x) const {return CStringHashFunc(x());} +}; + +template <> +class HashFunctor +{ +public: + uint32 operator () (const char * x) const {return CStringHashFunc(x);} +}; + +/** A function for comparing (const String &)'s -- calls the String operators */ +int StringCompareFunc(const String &, const String &, void *); + +/** A function for comparing (const char *)'s -- calls strcmp() */ +int CStringCompareFunc(const char * const &, const char * const &, void *); + +inline String operator+(const String & lhs, const String &rhs) {String ret(lhs); ret += rhs; return ret;} +inline String operator+(const String & lhs, const char *rhs) {String ret(lhs); ret += rhs; return ret;} +inline String operator+(const char * lhs, const String & rhs) {String ret(lhs); ret += rhs; return ret;} +inline String operator+(const String & lhs, char rhs) {String ret(lhs); ret += rhs; return ret;} +inline String operator-(const String & lhs, const String &rhs) {String ret(lhs); ret -= rhs; return ret;} +inline String operator-(const String & lhs, const char *rhs) {String ret(lhs); ret -= rhs; return ret;} +inline String operator-(const char *lhs, const String &rhs) {String ret(lhs); ret -= rhs; return ret;} +inline String operator-(const String & lhs, char rhs) {String ret(lhs); ret -= rhs; return ret;} + +END_NAMESPACE(muscle); + +#endif diff --git a/library/libfunky/include/Colors.h b/library/libfunky/include/Colors.h new file mode 100644 index 0000000..42a582f --- /dev/null +++ b/library/libfunky/include/Colors.h @@ -0,0 +1,53 @@ +//Useful until be gets around to making these sorts of things +//globals akin to be_plain_font, etc. + + +#ifndef _SGB_COLORS_H_ +#define _SGB_COLORS_H_ + + +//****************************************************************************************************** +//**** SYSTEM HEADER FILES +//****************************************************************************************************** +#include + + +//****************************************************************************************************** +//**** CONSTANT DEFINITIONS +//****************************************************************************************************** +//Be standard UI colors +const rgb_color BeBackgroundGrey = {216,216,216, 255}; +const rgb_color BeInactiveControlGrey = {240,240,240, 255}; +const rgb_color BeFocusBlue = {0, 0, 229, 255}; +const rgb_color BeHighlight = {255,255,255, 255}; +const rgb_color BeShadow = {152,152,152, 255}; +const rgb_color BeDarkShadow = {108,108,108, 255}; +const rgb_color BeLightShadow = {194,194,194, 255}; +const rgb_color BeButtonGrey = {232,232,232, 255}; +const rgb_color BeInactiveGrey = {127,127,127, 255}; +const rgb_color BeListSelectGrey = {178,178,178, 255}; +const rgb_color BeTitleBarYellow = {255,203,0, 255}; + +//Other colors +const rgb_color Black = {0, 0, 0, 255}; +const rgb_color White = {255,255,255, 255}; +const rgb_color Red = {255,0, 0, 255}; +const rgb_color Green = {0, 167,0, 255}; +const rgb_color LightGreen = {90, 240,90, 255}; +const rgb_color Blue = {49, 61, 225, 255}; +const rgb_color LightBlue = {64, 162,255, 255}; +const rgb_color Purple = {144,64, 221, 255}; +const rgb_color LightPurple = {166,74, 255, 255}; +const rgb_color Lavender = {193,122,255, 255}; +const rgb_color Yellow = {255,203,0, 255}; +const rgb_color Orange = {255,163,0, 255}; +const rgb_color Flesh = {255,231,186, 255}; +const rgb_color Tan = {208,182,121, 255}; +const rgb_color Brown = {154,110,45, 255}; +const rgb_color Grey = {200,200,200, 255}; +const rgb_color LightMetallicBlue = {143,166,240, 255}; +const rgb_color MedMetallicBlue = {75, 96, 154, 255}; +const rgb_color DarkMetallicBlue = {78, 89, 126, 255}; + + +#endif diff --git a/library/libfunky/include/ImageCache.h b/library/libfunky/include/ImageCache.h new file mode 100644 index 0000000..47c28d1 --- /dev/null +++ b/library/libfunky/include/ImageCache.h @@ -0,0 +1,52 @@ +#ifndef ImageCache_H +#define ImageCache_H + + /** + * ImageCache. + * @author Andrea Anzani. + */ + +class BBitmap; + +#include +#include +#include "KeyMap.h" + +class ImageCache +{ + +protected: // Constructor/Destructor + + ImageCache(); + + ~ImageCache(); + +public: // Operations + + /** Returns the image corresponding to the which constant */ + static BBitmap * GetImage( BString which ,BString name); + + + static void AddImage(BString name,BBitmap* which); + static void DeleteImage(BString name); + + /** Frees the singleton instance of the cache; + Call this when app quits + */ + static void Release(); + +private: + + static BBitmap * LoadImage( const char *resourceName,const char *); + // Class Data + + static ImageCache * m_instance; + +private: // Instance Data + + + KeyMap m_bitmaps; + +}; + +#endif /* __C_ImageCache_H__ */ diff --git a/library/libfunky/include/KeyMap.h b/library/libfunky/include/KeyMap.h new file mode 100644 index 0000000..0406536 --- /dev/null +++ b/library/libfunky/include/KeyMap.h @@ -0,0 +1,207 @@ +#ifndef __Keymap_h__ +#define __Keymap_h__ + +#include +#include + +using namespace std; + +template +class KeyMap +{ +public: + + bool AddItem( T1 const & key, T2 const & value); + bool RemoveItemFor( T1 const & key); + + T2 ValueFor(T1 key,bool* found = NULL); + T2 ValueAt(int32 position); + + T1 KeyAt(int32 position); + void RemoveItemAt(int32 position); + + uint32 CountItems(); + + void PrintToStream(); + bool MakeEmpty(); + bool IsEmpty(); + +private: + + bool getValue( T1 const & key, T2 *value); //returns value + bool getIndex( T2 const & value, T1 *key ); //returns key + + bool getFirst( T1 *key, T2 *value ); + bool getNext( T1 *key, T2 *value ); + + typename std::map::iterator begin(); + typename std::map::iterator end(); + + std::map m_Map; + typename std::map::iterator m_pPos; +}; + +template +bool KeyMap::AddItem( T1 const & key, T2 const & value) +{ + + std::pair::iterator,bool> result = m_Map.insert( make_pair(key, value) ); + if (!result.second) { + return false; + } + + return true; +} + +template +bool KeyMap::RemoveItemFor( T1 const & key ) +{ + m_Map.erase( key ); + return true; +} + +template +bool KeyMap::IsEmpty() +{ + return m_Map.empty(); +} + + +template +bool KeyMap::MakeEmpty() +{ + m_Map.clear(); + return true; +} + + + +template +bool KeyMap::getIndex( T2 const & value, T1 *key ) +{ + //do something with all elements having a certain value + typename std::map::iterator pos; + for (pos = m_Map.begin(); pos != m_Map.end(); ++pos) { + if (pos->second == value) { + *key = (pos->first); + return true; + } + } + return false; +} + +template +bool KeyMap::getFirst( T1 *key, T2 *value ) +{ + if (m_Map.empty() ) { + return false; + } + //do something with all elements having a certain value + typename std::map::iterator pos; + m_pPos= m_Map.begin(); + *key = m_pPos->first; + *value= m_pPos->second; + return true; +} + +template +bool KeyMap::getNext( T1 *key, T2 *value ) +{ + if ( m_Map.empty() ) { + return false; + } + if ( ++m_pPos == m_Map.end() ) { + return false; + } + *key = m_pPos->first; + *value= m_pPos->second; + return true; +} + +template +bool KeyMap::getValue(T1 const & key, T2 *value) +{ + typename std::map::iterator pos; + pos = m_Map.find(key); + if (m_Map.end() != pos) { + *value = pos->second; + return true; + } + return false; +} + +template +T2 KeyMap::ValueFor(T1 key, bool* found) +{ + T2 pointer; + if (found) + { + *found = getValue(key, &pointer); + return ((*found) ? pointer : NULL); + } + bool f = getValue(key, &pointer); + return (f ? pointer : NULL); +} + +template +T2 KeyMap::ValueAt(int32 position) +{ + typename std::map::iterator i = begin(); + std::advance(i, position); + if(i == end()) + return NULL; + else + return i->second; +} + +template +T1 KeyMap::KeyAt(int32 position) +{ + typename std::map::iterator i = begin(); + std::advance(i, position); + if(i == end()) + return NULL; + else + return i->first; +} + +template +void KeyMap::RemoveItemAt(int32 position) +{ + typename std::map::iterator i = begin(); + std::advance(i, position); + RemoveItemFor(i->first); +} + + +template +uint32 KeyMap::CountItems() +{ + return m_Map.size(); +} + +template +void KeyMap::PrintToStream() +{ + typename std::map::iterator pos; + cout << std::endl << " -- KeyMap::PrintToStream --" << std::endl; + for (pos = m_Map.begin(); pos != m_Map.end(); ++pos) { + cout << pos->first <<" : " << pos->second << std::endl; + } +} + +template +typename std::map::iterator KeyMap::begin() +{ + m_pPos = m_Map.begin(); + return m_pPos; +} + +template +typename std::map::iterator KeyMap::end() +{ + m_pPos = m_Map.end(); + return m_pPos; +} + +#endif // __Keymap_h__ diff --git a/library/libfunky/include/ObjectList.h b/library/libfunky/include/ObjectList.h new file mode 100644 index 0000000..bfa1832 --- /dev/null +++ b/library/libfunky/include/ObjectList.h @@ -0,0 +1,866 @@ +/* +Open Tracker License + +Terms and Conditions + +Copyright (c) 1991-2000, Be Incorporated. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice applies to all licensees +and shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of Be Incorporated shall not be +used in advertising or otherwise to promote the sale, use or other dealings in +this Software without prior written authorization from Be Incorporated. + +Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks +of Be Incorporated in the United States and other countries. Other brand product +names are registered trademarks or trademarks of their respective holders. +All rights reserved. +*/ + +/**************************************************************************** +** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ** +** ** +** DANGER, WILL ROBINSON! ** +** ** +** The interfaces contained here are part of BeOS's ** +** ** +** >> PRIVATE NOT FOR PUBLIC USE << ** +** ** +** implementation. ** +** ** +** These interfaces WILL CHANGE in future releases. ** +** If you use them, your app WILL BREAK at some future time. ** +** ** +** (And yes, this does mean that binaries built from OpenTracker will not ** +** be compatible with some future releases of the OS. When that happens, ** +** we will provide an updated version of this file to keep compatibility.) ** +** ** +** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ** +****************************************************************************/ + +// +// ObjectList is a wrapper around BList that adds type safety, +// optional object ownership, search, insert operations, etc. +// + +#ifndef __OBJECT_LIST__ +#define __OBJECT_LIST__ + +#ifndef _BE_H +#include +#endif + +#include + + +template class BObjectList; + +template +struct UnaryPredicate { + + virtual int operator()(const T *) const + // virtual could be avoided here if FindBinaryInsertionIndex, + // etc. were member template functions + { return 0; } + +private: + static int _unary_predicate_glue(const void *item, void *context); + +friend class BObjectList; +}; + +template +int +UnaryPredicate::_unary_predicate_glue(const void *item, void *context) +{ + return ((UnaryPredicate *)context)->operator()((const T *)item); +} + + +class _PointerList_ : public BList { +public: + _PointerList_(const _PointerList_ &list); + _PointerList_(int32 itemsPerBlock = 20, bool owning = false); + ~_PointerList_(); + + typedef void *(* GenericEachFunction)(void *, void *); + typedef int (* GenericCompareFunction)(const void *, const void *); + typedef int (* GenericCompareFunctionWithState)(const void *, const void *, + void *); + typedef int (* UnaryPredicateGlue)(const void *, void *); + + void *EachElement(GenericEachFunction, void *); + void SortItems(GenericCompareFunction); + void SortItems(GenericCompareFunctionWithState, void *state); + void HSortItems(GenericCompareFunction); + void HSortItems(GenericCompareFunctionWithState, void *state); + + void *BinarySearch(const void *, GenericCompareFunction) const; + void *BinarySearch(const void *, GenericCompareFunctionWithState, void *state) const; + + int32 BinarySearchIndex(const void *, GenericCompareFunction) const; + int32 BinarySearchIndex(const void *, GenericCompareFunctionWithState, void *state) const; + int32 BinarySearchIndexByPredicate(const void *, UnaryPredicateGlue) const; + + bool Owning() const; + bool ReplaceItem(int32, void *); + +protected: + bool owning; + +}; + +template +class BObjectList : private _PointerList_ { +public: + + // iteration and sorting + typedef T *(* EachFunction)(T *, void *); + typedef const T *(* ConstEachFunction)(const T *, void *); + typedef int (* CompareFunction)(const T *, const T *); + typedef int (* CompareFunctionWithState)(const T *, const T *, void *state); + + BObjectList(int32 itemsPerBlock = 20, bool owning = false); + BObjectList(const BObjectList &list); + // clones list; if list is owning, makes copies of all + // the items + + virtual ~BObjectList(); + + BObjectList &operator=(const BObjectList &list); + // clones list; if list is owning, makes copies of all + // the items + + // adding and removing + // ToDo: + // change Add calls to return const item + bool AddItem(T *); + bool AddItem(T *, int32); + bool AddList(BObjectList *); + bool AddList(BObjectList *, int32); + + bool RemoveItem(T *, bool deleteIfOwning = true); + // if owning, deletes the removed item + T *RemoveItemAt(int32); + // returns the removed item + + void MakeEmpty(bool deleteIfOwning = true); + + // item access + T *ItemAt(int32) const; + + bool ReplaceItem(int32 index, T *); + // if list is owning, deletes the item at first + T *SwapWithItem(int32 index, T *newItem); + // same as ReplaceItem, except does not delete old item at , + // returns it instead + + T *FirstItem() const; + T *LastItem() const; + + // misc. getters + int32 IndexOf(const T *) const; + bool HasItem(const T *) const; + bool IsEmpty() const; + int32 CountItems() const; + + T *EachElement(EachFunction, void *); + const T *EachElement(ConstEachFunction, void *) const; + + void SortItems(CompareFunction); + void SortItems(CompareFunctionWithState, void *state); + void HSortItems(CompareFunction); + void HSortItems(CompareFunctionWithState, void *state); + + // linear search, returns first item that matches predicate + const T *FindIf(const UnaryPredicate &) const; + T *FindIf(const UnaryPredicate &); + + // list must be sorted with CompareFunction for these to work + T *BinarySearch(const T &, CompareFunction) const; + T *BinarySearch(const T &, CompareFunctionWithState, void *state) const; + + template + T *BinarySearchByKey(const Key &key, int (*compare)(const Key *, const T *)) + const; + + template + T *BinarySearchByKey(const Key &key, + int (*compare)(const Key *, const T *, void *), void *state) const; + + int32 BinarySearchIndex(const T &item, CompareFunction compare) const; + int32 BinarySearchIndex(const T &item, CompareFunctionWithState compare, + void *state) const; + + template + int32 BinarySearchIndexByKey(const Key &key, + int (*compare)(const Key *, const T *)) const; + + // Binary insertion - list must be sorted with CompareFunction for + // these to work + + // simple insert + bool BinaryInsert(T *, CompareFunction); + bool BinaryInsert(T *, CompareFunctionWithState, void *state); + bool BinaryInsert(T *, const UnaryPredicate &); + + // unique insert, returns false if item already in list + bool BinaryInsertUnique(T *, CompareFunction); + bool BinaryInsertUnique(T *, CompareFunctionWithState, void *state); + bool BinaryInsertUnique(T *, const UnaryPredicate &); + + // insert a copy of the item, returns new inserted item + T *BinaryInsertCopy(const T ©This, CompareFunction); + T *BinaryInsertCopy(const T ©This, CompareFunctionWithState, void *state); + + // insert a copy of the item if not in list already + // returns new inserted item or existing item in case of a conflict + T *BinaryInsertCopyUnique(const T ©This, CompareFunction); + T *BinaryInsertCopyUnique(const T ©This, CompareFunctionWithState, void *state); + + int32 FindBinaryInsertionIndex(const UnaryPredicate &, bool *alreadyInList = 0) const; + // returns either the index into which a new item should be inserted + // or index of an existing item that matches the predicate + + // deprecated API, will go away + BList *AsBList() + { return this; } + const BList *AsBList() const + { return this; } +private: + void SetItem(int32, T *); +}; + +template +Result +WhileEachListItem(BObjectList *list, Result (Item::*func)(Param1), Param1 p1) +{ + Result result = 0; + int32 count = list->CountItems(); + + for (int32 index = 0; index < count; index++) + if ((result = (list->ItemAt(index)->*func)(p1)) != 0) + break; + + return result; +} + +template +Result +WhileEachListItem(BObjectList *list, Result (*func)(Item *, Param1), Param1 p1) +{ + Result result = 0; + int32 count = list->CountItems(); + + for (int32 index = 0; index < count; index++) + if ((result = (*func)(list->ItemAt(index), p1)) != 0) + break; + + return result; +} + +template +Result +WhileEachListItem(BObjectList *list, Result (Item::*func)(Param1, Param2), + Param1 p1, Param2 p2) +{ + Result result = 0; + int32 count = list->CountItems(); + + for (int32 index = 0; index < count; index++) + if ((result = (list->ItemAt(index)->*func)(p1, p2)) != 0) + break; + + return result; +} + +template +Result +WhileEachListItem(BObjectList *list, Result (*func)(Item *, Param1, Param2), + Param1 p1, Param2 p2) +{ + Result result = 0; + int32 count = list->CountItems(); + + for (int32 index = 0; index < count; index++) + if ((result = (*func)(list->ItemAt(index), p1, p2)) != 0) + break; + + return result; +} + +template +Result +WhileEachListItem(BObjectList *list, Result (*func)(Item *, Param1, Param2, + Param3, Param4), Param1 p1, Param2 p2, Param3 p3, Param4 p4) +{ + Result result = 0; + int32 count = list->CountItems(); + + for (int32 index = 0; index < count; index++) + if ((result = (*func)(list->ItemAt(index), p1, p2, p3, p4)) != 0) + break; + + return result; +} + +template +void +EachListItemIgnoreResult(BObjectList *list, Result (Item::*func)()) +{ + int32 count = list->CountItems(); + for (int32 index = 0; index < count; index++) + (list->ItemAt(index)->*func)(); +} + +template +void +EachListItem(BObjectList *list, void (*func)(Item *, Param1), Param1 p1) +{ + int32 count = list->CountItems(); + for (int32 index = 0; index < count; index++) + (func)(list->ItemAt(index), p1); +} + +template +void +EachListItem(BObjectList *list, void (Item::*func)(Param1, Param2), + Param1 p1, Param2 p2) +{ + int32 count = list->CountItems(); + for (int32 index = 0; index < count; index++) + (list->ItemAt(index)->*func)(p1, p2); +} + +template +void +EachListItem(BObjectList *list, void (*func)(Item *,Param1, Param2), + Param1 p1, Param2 p2) +{ + int32 count = list->CountItems(); + for (int32 index = 0; index < count; index++) + (func)(list->ItemAt(index), p1, p2); +} + +template +void +EachListItem(BObjectList *list, void (*func)(Item *,Param1, Param2, + Param3), Param1 p1, Param2 p2, Param3 p3) +{ + int32 count = list->CountItems(); + for (int32 index = 0; index < count; index++) + (func)(list->ItemAt(index), p1, p2, p3); +} + + +template +void +EachListItem(BObjectList *list, void (*func)(Item *,Param1, Param2, + Param3, Param4), Param1 p1, Param2 p2, Param3 p3, Param4 p4) +{ + int32 count = list->CountItems(); + for (int32 index = 0; index < count; index++) + (func)(list->ItemAt(index), p1, p2, p3, p4); +} + +// inline code + +inline bool +_PointerList_::Owning() const +{ + return owning; +} + +template +BObjectList::BObjectList(int32 itemsPerBlock, bool owning) + : _PointerList_(itemsPerBlock, owning) +{ +} + +template +BObjectList::BObjectList(const BObjectList &list) + : _PointerList_(list) +{ + owning = list.owning; + if (owning) { + // make our own copies in an owning list + int32 count = list.CountItems(); + for (int32 index = 0; index < count; index++) { + T *item = list.ItemAt(index); + if (item) + item = new T(*item); + SetItem(index, item); + } + } +} + +template +BObjectList::~BObjectList() +{ + if (Owning()) + // have to nuke elements first + MakeEmpty(); +} + +template +BObjectList & +BObjectList::operator=(const BObjectList &list) +{ + owning = list.owning; + BObjectList &result = (BObjectList &)_PointerList_::operator=(list); + if (owning) { + // make our own copies in an owning list + int32 count = list.CountItems(); + for (int32 index = 0; index < count; index++) { + T *item = list.ItemAt(index); + if (item) + item = new T(*item); + SetItem(index, item); + } + } + return result; +} + +template +bool +BObjectList::AddItem(T *item) +{ + // need to cast to void * to make T work for const pointers + return _PointerList_::AddItem((void *)item); +} + +template +bool +BObjectList::AddItem(T *item, int32 atIndex) +{ + return _PointerList_::AddItem((void *)item, atIndex); +} + +template +bool +BObjectList::AddList(BObjectList *newItems) +{ + return _PointerList_::AddList(newItems); +} + +template +bool +BObjectList::AddList(BObjectList *newItems, int32 atIndex) +{ + return _PointerList_::AddList(newItems, atIndex); +} + + +template +bool +BObjectList::RemoveItem(T *item, bool deleteIfOwning) +{ + bool result = _PointerList_::RemoveItem((void *)item); + + if (result && Owning() && deleteIfOwning) + delete item; + + return result; +} + +template +T * +BObjectList::RemoveItemAt(int32 index) +{ + return (T *)_PointerList_::RemoveItem(index); +} + +template +inline T * +BObjectList::ItemAt(int32 index) const +{ + return (T *)_PointerList_::ItemAt(index); +} + +template +bool +BObjectList::ReplaceItem(int32 index, T *item) +{ + if (owning) + delete ItemAt(index); + return _PointerList_::ReplaceItem(index, (void *)item); +} + +template +T * +BObjectList::SwapWithItem(int32 index, T *newItem) +{ + T *result = ItemAt(index); + _PointerList_::ReplaceItem(index, (void *)newItem); + return result; +} + +template +void +BObjectList::SetItem(int32 index, T *newItem) +{ + _PointerList_::ReplaceItem(index, (void *)newItem); +} + +template +int32 +BObjectList::IndexOf(const T *item) const +{ + return _PointerList_::IndexOf((void *)item); +} + +template +T * +BObjectList::FirstItem() const +{ + return (T *)_PointerList_::FirstItem(); +} + +template +T * +BObjectList::LastItem() const +{ + return (T *)_PointerList_::LastItem(); +} + +template +bool +BObjectList::HasItem(const T *item) const +{ + return _PointerList_::HasItem((void *)item); +} + +template +bool +BObjectList::IsEmpty() const +{ + return _PointerList_::IsEmpty(); +} + +template +int32 +BObjectList::CountItems() const +{ + return _PointerList_::CountItems(); +} + +template +void +BObjectList::MakeEmpty(bool deleteIfOwning) +{ + if (owning && deleteIfOwning) { + int32 count = CountItems(); + for (int32 index = 0; index < count; index++) + delete ItemAt(index); + } + _PointerList_::MakeEmpty(); +} + +template +T * +BObjectList::EachElement(EachFunction func, void *params) +{ + return (T *)_PointerList_::EachElement((GenericEachFunction)func, params); +} + + +template +const T * +BObjectList::EachElement(ConstEachFunction func, void *params) const +{ + return (const T *) + const_cast *>(this)->_PointerList_::EachElement( + (GenericEachFunction)func, params); +} + +template +const T * +BObjectList::FindIf(const UnaryPredicate &predicate) const +{ + int32 count = CountItems(); + for (int32 index = 0; index < count; index++) + if (predicate.operator()(ItemAt(index)) == 0) + return ItemAt(index); + return 0; +} + +template +T * +BObjectList::FindIf(const UnaryPredicate &predicate) +{ + int32 count = CountItems(); + for (int32 index = 0; index < count; index++) + if (predicate.operator()(ItemAt(index)) == 0) + return ItemAt(index); + return 0; +} + + +template +void +BObjectList::SortItems(CompareFunction function) +{ + _PointerList_::SortItems((GenericCompareFunction)function); +} + +template +void +BObjectList::SortItems(CompareFunctionWithState function, void *state) +{ + _PointerList_::SortItems((GenericCompareFunctionWithState)function, state); +} + +template +void +BObjectList::HSortItems(CompareFunction function) +{ + _PointerList_::HSortItems((GenericCompareFunction)function); +} + +template +void +BObjectList::HSortItems(CompareFunctionWithState function, void *state) +{ + _PointerList_::HSortItems((GenericCompareFunctionWithState)function, state); +} + +template +T * +BObjectList::BinarySearch(const T &key, CompareFunction func) const +{ + return (T*)_PointerList_::BinarySearch(&key, + (GenericCompareFunction)func); +} + +template +T * +BObjectList::BinarySearch(const T &key, CompareFunctionWithState func, void *state) const +{ + return (T*)_PointerList_::BinarySearch(&key, + (GenericCompareFunctionWithState)func, state); +} + + +template +template +T * +BObjectList::BinarySearchByKey(const Key &key, + int (*compare)(const Key *, const T *)) const +{ + return (T*)_PointerList_::BinarySearch(&key, + (GenericCompareFunction)compare); +} + + +template +template +T * +BObjectList::BinarySearchByKey(const Key &key, + int (*compare)(const Key *, const T *, void *), void *state) const +{ + return (T*)_PointerList_::BinarySearch(&key, + (GenericCompareFunctionWithState)compare, state); +} + + +template +int32 +BObjectList::BinarySearchIndex(const T &item, CompareFunction compare) const +{ + return _PointerList_::BinarySearchIndex(&item, + (GenericCompareFunction)compare); +} + + +template +int32 +BObjectList::BinarySearchIndex(const T &item, + CompareFunctionWithState compare, void *state) const +{ + return _PointerList_::BinarySearchIndex(&item, + (GenericCompareFunctionWithState)compare, state); +} + + +template +template +int32 +BObjectList::BinarySearchIndexByKey(const Key &key, + int (*compare)(const Key *, const T *)) const +{ + return _PointerList_::BinarySearchIndex(&key, + (GenericCompareFunction)compare); +} + + +template +bool +BObjectList::BinaryInsert(T *item, CompareFunction func) +{ + int32 index = _PointerList_::BinarySearchIndex(item, + (GenericCompareFunction)func); + if (index >= 0) { + // already in list, add after existing + return AddItem(item, index + 1); + } + + return AddItem(item, -index - 1); +} + +template +bool +BObjectList::BinaryInsert(T *item, CompareFunctionWithState func, void *state) +{ + int32 index = _PointerList_::BinarySearchIndex(item, + (GenericCompareFunctionWithState)func, state); + if (index >= 0) { + // already in list, add after existing + return AddItem(item, index + 1); + } + + return AddItem(item, -index - 1); +} + +template +bool +BObjectList::BinaryInsertUnique(T *item, CompareFunction func) +{ + int32 index = _PointerList_::BinarySearchIndex(item, + (GenericCompareFunction)func); + if (index >= 0) + return false; + + return AddItem(item, -index - 1); +} + +template +bool +BObjectList::BinaryInsertUnique(T *item, CompareFunctionWithState func, void *state) +{ + int32 index = _PointerList_::BinarySearchIndex(item, + (GenericCompareFunctionWithState)func, state); + if (index >= 0) + return false; + + return AddItem(item, -index - 1); +} + + +template +T * +BObjectList::BinaryInsertCopy(const T ©This, CompareFunction func) +{ + int32 index = _PointerList_::BinarySearchIndex(©This, + (GenericCompareFunction)func); + + if (index >= 0) + index++; + else + index = -index - 1; + + T *newItem = new T(copyThis); + AddItem(newItem, index); + return newItem; +} + +template +T * +BObjectList::BinaryInsertCopy(const T ©This, CompareFunctionWithState func, void *state) +{ + int32 index = _PointerList_::BinarySearchIndex(©This, + (GenericCompareFunctionWithState)func, state); + + if (index >= 0) + index++; + else + index = -index - 1; + + T *newItem = new T(copyThis); + AddItem(newItem, index); + return newItem; +} + +template +T * +BObjectList::BinaryInsertCopyUnique(const T ©This, CompareFunction func) +{ + int32 index = _PointerList_::BinarySearchIndex(©This, + (GenericCompareFunction)func); + if (index >= 0) + return ItemAt(index); + + index = -index - 1; + T *newItem = new T(copyThis); + AddItem(newItem, index); + return newItem; +} + +template +T * +BObjectList::BinaryInsertCopyUnique(const T ©This, CompareFunctionWithState func, + void *state) +{ + int32 index = _PointerList_::BinarySearchIndex(©This, + (GenericCompareFunctionWithState)func, state); + if (index >= 0) + return ItemAt(index); + + index = -index - 1; + T *newItem = new T(copyThis); + AddItem(newItem, index); + return newItem; +} + +template +int32 +BObjectList::FindBinaryInsertionIndex(const UnaryPredicate &pred, bool *alreadyInList) + const +{ + int32 index = _PointerList_::BinarySearchIndexByPredicate(&pred, + (UnaryPredicateGlue)&UnaryPredicate::_unary_predicate_glue); + + if (alreadyInList) + *alreadyInList = index >= 0; + + if (index < 0) + index = -index - 1; + + return index; +} + +template +bool +BObjectList::BinaryInsert(T *item, const UnaryPredicate &pred) +{ + return AddItem(item, FindBinaryInsertionIndex(pred)); +} + +template +bool +BObjectList::BinaryInsertUnique(T *item, const UnaryPredicate &pred) +{ + bool alreadyInList; + int32 index = FindBinaryInsertionIndex(pred, &alreadyInList); + if (alreadyInList) + return false; + + AddItem(item, index); + return true; +} + +#endif /* __OBJECT_LIST__ */ diff --git a/library/libfunky/include/PBox.h b/library/libfunky/include/PBox.h new file mode 100644 index 0000000..b5710db --- /dev/null +++ b/library/libfunky/include/PBox.h @@ -0,0 +1,59 @@ +#ifndef PBox_H +#define PBox_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include "ObjectList.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +class BBox; +class BButton; + +class PBox : public BBox { + enum { + LISTCHANGED, + SAVE, + REVERT + }; + + public: + + PBox(BRect rect,BMessage fTemplate, BMessage fData,const char* settings_name); + + void AttachedToWindow(); + virtual void MessageReceived(BMessage *msg); + + void GetData(BMessage* data); + + const char* GetSettingsName(){ return fSName.String();} + private: + + float BuildGUI(BMessage viewTemplate, BMessage settings,BView *view); + + BView *fView; + + BView* fPrefView; + + BMessage fTemplate; + BMessage fData; + float fFontHeight; + BString fSName; + +}; + +#endif diff --git a/library/libfunky/include/Setting.h b/library/libfunky/include/Setting.h new file mode 100644 index 0000000..2debf94 --- /dev/null +++ b/library/libfunky/include/Setting.h @@ -0,0 +1,24 @@ +#ifndef Setting_H_ +#define Setting_H_ + +#include +#include + +class Setting : public BMessage { + + public: + + Setting(const char* name); + + void Store(); + void Retrive(); + + BString SettingPath(); + + private: + BString filename; +}; + +#endif + +//.. diff --git a/library/libfunky/include/SettingsTextView.h b/library/libfunky/include/SettingsTextView.h new file mode 100644 index 0000000..d16b54b --- /dev/null +++ b/library/libfunky/include/SettingsTextView.h @@ -0,0 +1,25 @@ +#ifndef SettingsTextView_H_ +#define SettingsTextView_H_ + +#include +#include +#include + + +class SettingsTextView : public BView +{ + public: + SettingsTextView(BRect frame, char *name, BString testo); + void AttachedToWindow(); + void Draw(BRect updateRect); + void SetText(const char*text){fText.SetTo(text);}; + BString Text(){ return fText; } + private: + BString fText; + + + + +}; + +#endif diff --git a/library/libfunky/include/Utils.h b/library/libfunky/include/Utils.h new file mode 100644 index 0000000..e8fbac0 --- /dev/null +++ b/library/libfunky/include/Utils.h @@ -0,0 +1,39 @@ +#ifndef _Utils_H_ +#define _Utils_H_ + +#include +#include +#include +#include + + +BString GetAppRelativePath(); +BString GetAppFilename(); +bool CheckMIME(BString mime,BNode* node); + +BBitmap* LoadIcon(const char* name); +void AddIcon(const char* name,BBitmap*); + + + +status_t ReadAttributeData(BNode* node,const char *name, char **buffer, int32 *size); + +status_t ReadAttributeString(BNode* node,const char *name, char **buffer, int32 *size); +BString ReadAttributeString(BNode* node,const char *name); + +status_t ReadAttributeInt32(BNode* node,const char *name, int32 *dest); +int32 ReadAttributeInt32(BNode* node,const char *name); + +status_t WriteAttributeInt32(BNode* node,const char *name, int32 dest); +status_t WriteAttributeString(BNode* node,const char *name, const char* string); + +status_t WriteAttributeMessage(BNode* node,const char* name,BMessage*); +status_t ReadAttributeMessage(BNode* node,const char* name,BMessage*); + +BString ReadableSize(off_t bytes); +BString ReadableSpeed(float speed); + +void BPDrawString(const char* string, BView* parent, BRect rect,alignment ali,float kTextMargin = 0.0); + + +#endif diff --git a/library/librunview/Jamfile b/library/librunview/Jamfile new file mode 100644 index 0000000..bb763d6 --- /dev/null +++ b/library/librunview/Jamfile @@ -0,0 +1,30 @@ + +SubDir TOP librunview ; + +if $(OSPLAT) = X86 { + C++FLAGS += -Wno-sign-compare -Wno-overloaded-virtual ; +} + + +SAVED_DEFINES = $(DEFINES) ; + +DEFINES = $(SAVED_DEFINES) ; + +SubDirSysHdrs /boot/home/config/include ; +SubDirSysHdrs $(TOP)/librunview/include ; +SubDirSysHdrs /boot/beos/etc/develop/zeta-r1-gcc2-x86/headers/be/locale ; + + +LINKFLAGS += -L/boot/home/config/lib ; +LINKFLAGS += -L$(TOP)/libs ; +LINKFLAGS += -L/boot/develop/headers/be ; + +# +StaticLibrary librunview.a : + RunView.cpp + Theme.cpp + URLCrunch.cpp + Utilities.cpp + ; +# + diff --git a/library/librunview/NormalTextRender.h b/library/librunview/NormalTextRender.h new file mode 100644 index 0000000..52d92da --- /dev/null +++ b/library/librunview/NormalTextRender.h @@ -0,0 +1,42 @@ +#ifndef _NormalTextRender_H_ +#define _NormalTextRender_H_ + +#include "TextRender.h" +#include +#include + +#include + +class NormalTextRender : public TextRender +{ + public: + + NormalTextRender(BFont f):TextRender(){ + font=f; + } + + ~NormalTextRender() {}; + + void Render(BView *target,const char* txt,int16 num,BPoint pos,BRect drawRect) { + + target->SetFont(&font); + target->DrawString(txt,num,pos); + + + }; + + + float Size(float maxwidth){ return font.Size();} + + void GetHeight(font_height *height){ font.GetHeight(height); }; + + + void GetEscapements(const char charArray[], int32 numChars,float escapementArray[]){ + font.GetEscapements(charArray,numChars,escapementArray); + } + + private: + BFont font; + +}; +#endif diff --git a/library/librunview/ObjectList.h b/library/librunview/ObjectList.h new file mode 100644 index 0000000..bfa1832 --- /dev/null +++ b/library/librunview/ObjectList.h @@ -0,0 +1,866 @@ +/* +Open Tracker License + +Terms and Conditions + +Copyright (c) 1991-2000, Be Incorporated. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice applies to all licensees +and shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of Be Incorporated shall not be +used in advertising or otherwise to promote the sale, use or other dealings in +this Software without prior written authorization from Be Incorporated. + +Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks +of Be Incorporated in the United States and other countries. Other brand product +names are registered trademarks or trademarks of their respective holders. +All rights reserved. +*/ + +/**************************************************************************** +** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ** +** ** +** DANGER, WILL ROBINSON! ** +** ** +** The interfaces contained here are part of BeOS's ** +** ** +** >> PRIVATE NOT FOR PUBLIC USE << ** +** ** +** implementation. ** +** ** +** These interfaces WILL CHANGE in future releases. ** +** If you use them, your app WILL BREAK at some future time. ** +** ** +** (And yes, this does mean that binaries built from OpenTracker will not ** +** be compatible with some future releases of the OS. When that happens, ** +** we will provide an updated version of this file to keep compatibility.) ** +** ** +** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ** +****************************************************************************/ + +// +// ObjectList is a wrapper around BList that adds type safety, +// optional object ownership, search, insert operations, etc. +// + +#ifndef __OBJECT_LIST__ +#define __OBJECT_LIST__ + +#ifndef _BE_H +#include +#endif + +#include + + +template class BObjectList; + +template +struct UnaryPredicate { + + virtual int operator()(const T *) const + // virtual could be avoided here if FindBinaryInsertionIndex, + // etc. were member template functions + { return 0; } + +private: + static int _unary_predicate_glue(const void *item, void *context); + +friend class BObjectList; +}; + +template +int +UnaryPredicate::_unary_predicate_glue(const void *item, void *context) +{ + return ((UnaryPredicate *)context)->operator()((const T *)item); +} + + +class _PointerList_ : public BList { +public: + _PointerList_(const _PointerList_ &list); + _PointerList_(int32 itemsPerBlock = 20, bool owning = false); + ~_PointerList_(); + + typedef void *(* GenericEachFunction)(void *, void *); + typedef int (* GenericCompareFunction)(const void *, const void *); + typedef int (* GenericCompareFunctionWithState)(const void *, const void *, + void *); + typedef int (* UnaryPredicateGlue)(const void *, void *); + + void *EachElement(GenericEachFunction, void *); + void SortItems(GenericCompareFunction); + void SortItems(GenericCompareFunctionWithState, void *state); + void HSortItems(GenericCompareFunction); + void HSortItems(GenericCompareFunctionWithState, void *state); + + void *BinarySearch(const void *, GenericCompareFunction) const; + void *BinarySearch(const void *, GenericCompareFunctionWithState, void *state) const; + + int32 BinarySearchIndex(const void *, GenericCompareFunction) const; + int32 BinarySearchIndex(const void *, GenericCompareFunctionWithState, void *state) const; + int32 BinarySearchIndexByPredicate(const void *, UnaryPredicateGlue) const; + + bool Owning() const; + bool ReplaceItem(int32, void *); + +protected: + bool owning; + +}; + +template +class BObjectList : private _PointerList_ { +public: + + // iteration and sorting + typedef T *(* EachFunction)(T *, void *); + typedef const T *(* ConstEachFunction)(const T *, void *); + typedef int (* CompareFunction)(const T *, const T *); + typedef int (* CompareFunctionWithState)(const T *, const T *, void *state); + + BObjectList(int32 itemsPerBlock = 20, bool owning = false); + BObjectList(const BObjectList &list); + // clones list; if list is owning, makes copies of all + // the items + + virtual ~BObjectList(); + + BObjectList &operator=(const BObjectList &list); + // clones list; if list is owning, makes copies of all + // the items + + // adding and removing + // ToDo: + // change Add calls to return const item + bool AddItem(T *); + bool AddItem(T *, int32); + bool AddList(BObjectList *); + bool AddList(BObjectList *, int32); + + bool RemoveItem(T *, bool deleteIfOwning = true); + // if owning, deletes the removed item + T *RemoveItemAt(int32); + // returns the removed item + + void MakeEmpty(bool deleteIfOwning = true); + + // item access + T *ItemAt(int32) const; + + bool ReplaceItem(int32 index, T *); + // if list is owning, deletes the item at first + T *SwapWithItem(int32 index, T *newItem); + // same as ReplaceItem, except does not delete old item at , + // returns it instead + + T *FirstItem() const; + T *LastItem() const; + + // misc. getters + int32 IndexOf(const T *) const; + bool HasItem(const T *) const; + bool IsEmpty() const; + int32 CountItems() const; + + T *EachElement(EachFunction, void *); + const T *EachElement(ConstEachFunction, void *) const; + + void SortItems(CompareFunction); + void SortItems(CompareFunctionWithState, void *state); + void HSortItems(CompareFunction); + void HSortItems(CompareFunctionWithState, void *state); + + // linear search, returns first item that matches predicate + const T *FindIf(const UnaryPredicate &) const; + T *FindIf(const UnaryPredicate &); + + // list must be sorted with CompareFunction for these to work + T *BinarySearch(const T &, CompareFunction) const; + T *BinarySearch(const T &, CompareFunctionWithState, void *state) const; + + template + T *BinarySearchByKey(const Key &key, int (*compare)(const Key *, const T *)) + const; + + template + T *BinarySearchByKey(const Key &key, + int (*compare)(const Key *, const T *, void *), void *state) const; + + int32 BinarySearchIndex(const T &item, CompareFunction compare) const; + int32 BinarySearchIndex(const T &item, CompareFunctionWithState compare, + void *state) const; + + template + int32 BinarySearchIndexByKey(const Key &key, + int (*compare)(const Key *, const T *)) const; + + // Binary insertion - list must be sorted with CompareFunction for + // these to work + + // simple insert + bool BinaryInsert(T *, CompareFunction); + bool BinaryInsert(T *, CompareFunctionWithState, void *state); + bool BinaryInsert(T *, const UnaryPredicate &); + + // unique insert, returns false if item already in list + bool BinaryInsertUnique(T *, CompareFunction); + bool BinaryInsertUnique(T *, CompareFunctionWithState, void *state); + bool BinaryInsertUnique(T *, const UnaryPredicate &); + + // insert a copy of the item, returns new inserted item + T *BinaryInsertCopy(const T ©This, CompareFunction); + T *BinaryInsertCopy(const T ©This, CompareFunctionWithState, void *state); + + // insert a copy of the item if not in list already + // returns new inserted item or existing item in case of a conflict + T *BinaryInsertCopyUnique(const T ©This, CompareFunction); + T *BinaryInsertCopyUnique(const T ©This, CompareFunctionWithState, void *state); + + int32 FindBinaryInsertionIndex(const UnaryPredicate &, bool *alreadyInList = 0) const; + // returns either the index into which a new item should be inserted + // or index of an existing item that matches the predicate + + // deprecated API, will go away + BList *AsBList() + { return this; } + const BList *AsBList() const + { return this; } +private: + void SetItem(int32, T *); +}; + +template +Result +WhileEachListItem(BObjectList *list, Result (Item::*func)(Param1), Param1 p1) +{ + Result result = 0; + int32 count = list->CountItems(); + + for (int32 index = 0; index < count; index++) + if ((result = (list->ItemAt(index)->*func)(p1)) != 0) + break; + + return result; +} + +template +Result +WhileEachListItem(BObjectList *list, Result (*func)(Item *, Param1), Param1 p1) +{ + Result result = 0; + int32 count = list->CountItems(); + + for (int32 index = 0; index < count; index++) + if ((result = (*func)(list->ItemAt(index), p1)) != 0) + break; + + return result; +} + +template +Result +WhileEachListItem(BObjectList *list, Result (Item::*func)(Param1, Param2), + Param1 p1, Param2 p2) +{ + Result result = 0; + int32 count = list->CountItems(); + + for (int32 index = 0; index < count; index++) + if ((result = (list->ItemAt(index)->*func)(p1, p2)) != 0) + break; + + return result; +} + +template +Result +WhileEachListItem(BObjectList *list, Result (*func)(Item *, Param1, Param2), + Param1 p1, Param2 p2) +{ + Result result = 0; + int32 count = list->CountItems(); + + for (int32 index = 0; index < count; index++) + if ((result = (*func)(list->ItemAt(index), p1, p2)) != 0) + break; + + return result; +} + +template +Result +WhileEachListItem(BObjectList *list, Result (*func)(Item *, Param1, Param2, + Param3, Param4), Param1 p1, Param2 p2, Param3 p3, Param4 p4) +{ + Result result = 0; + int32 count = list->CountItems(); + + for (int32 index = 0; index < count; index++) + if ((result = (*func)(list->ItemAt(index), p1, p2, p3, p4)) != 0) + break; + + return result; +} + +template +void +EachListItemIgnoreResult(BObjectList *list, Result (Item::*func)()) +{ + int32 count = list->CountItems(); + for (int32 index = 0; index < count; index++) + (list->ItemAt(index)->*func)(); +} + +template +void +EachListItem(BObjectList *list, void (*func)(Item *, Param1), Param1 p1) +{ + int32 count = list->CountItems(); + for (int32 index = 0; index < count; index++) + (func)(list->ItemAt(index), p1); +} + +template +void +EachListItem(BObjectList *list, void (Item::*func)(Param1, Param2), + Param1 p1, Param2 p2) +{ + int32 count = list->CountItems(); + for (int32 index = 0; index < count; index++) + (list->ItemAt(index)->*func)(p1, p2); +} + +template +void +EachListItem(BObjectList *list, void (*func)(Item *,Param1, Param2), + Param1 p1, Param2 p2) +{ + int32 count = list->CountItems(); + for (int32 index = 0; index < count; index++) + (func)(list->ItemAt(index), p1, p2); +} + +template +void +EachListItem(BObjectList *list, void (*func)(Item *,Param1, Param2, + Param3), Param1 p1, Param2 p2, Param3 p3) +{ + int32 count = list->CountItems(); + for (int32 index = 0; index < count; index++) + (func)(list->ItemAt(index), p1, p2, p3); +} + + +template +void +EachListItem(BObjectList *list, void (*func)(Item *,Param1, Param2, + Param3, Param4), Param1 p1, Param2 p2, Param3 p3, Param4 p4) +{ + int32 count = list->CountItems(); + for (int32 index = 0; index < count; index++) + (func)(list->ItemAt(index), p1, p2, p3, p4); +} + +// inline code + +inline bool +_PointerList_::Owning() const +{ + return owning; +} + +template +BObjectList::BObjectList(int32 itemsPerBlock, bool owning) + : _PointerList_(itemsPerBlock, owning) +{ +} + +template +BObjectList::BObjectList(const BObjectList &list) + : _PointerList_(list) +{ + owning = list.owning; + if (owning) { + // make our own copies in an owning list + int32 count = list.CountItems(); + for (int32 index = 0; index < count; index++) { + T *item = list.ItemAt(index); + if (item) + item = new T(*item); + SetItem(index, item); + } + } +} + +template +BObjectList::~BObjectList() +{ + if (Owning()) + // have to nuke elements first + MakeEmpty(); +} + +template +BObjectList & +BObjectList::operator=(const BObjectList &list) +{ + owning = list.owning; + BObjectList &result = (BObjectList &)_PointerList_::operator=(list); + if (owning) { + // make our own copies in an owning list + int32 count = list.CountItems(); + for (int32 index = 0; index < count; index++) { + T *item = list.ItemAt(index); + if (item) + item = new T(*item); + SetItem(index, item); + } + } + return result; +} + +template +bool +BObjectList::AddItem(T *item) +{ + // need to cast to void * to make T work for const pointers + return _PointerList_::AddItem((void *)item); +} + +template +bool +BObjectList::AddItem(T *item, int32 atIndex) +{ + return _PointerList_::AddItem((void *)item, atIndex); +} + +template +bool +BObjectList::AddList(BObjectList *newItems) +{ + return _PointerList_::AddList(newItems); +} + +template +bool +BObjectList::AddList(BObjectList *newItems, int32 atIndex) +{ + return _PointerList_::AddList(newItems, atIndex); +} + + +template +bool +BObjectList::RemoveItem(T *item, bool deleteIfOwning) +{ + bool result = _PointerList_::RemoveItem((void *)item); + + if (result && Owning() && deleteIfOwning) + delete item; + + return result; +} + +template +T * +BObjectList::RemoveItemAt(int32 index) +{ + return (T *)_PointerList_::RemoveItem(index); +} + +template +inline T * +BObjectList::ItemAt(int32 index) const +{ + return (T *)_PointerList_::ItemAt(index); +} + +template +bool +BObjectList::ReplaceItem(int32 index, T *item) +{ + if (owning) + delete ItemAt(index); + return _PointerList_::ReplaceItem(index, (void *)item); +} + +template +T * +BObjectList::SwapWithItem(int32 index, T *newItem) +{ + T *result = ItemAt(index); + _PointerList_::ReplaceItem(index, (void *)newItem); + return result; +} + +template +void +BObjectList::SetItem(int32 index, T *newItem) +{ + _PointerList_::ReplaceItem(index, (void *)newItem); +} + +template +int32 +BObjectList::IndexOf(const T *item) const +{ + return _PointerList_::IndexOf((void *)item); +} + +template +T * +BObjectList::FirstItem() const +{ + return (T *)_PointerList_::FirstItem(); +} + +template +T * +BObjectList::LastItem() const +{ + return (T *)_PointerList_::LastItem(); +} + +template +bool +BObjectList::HasItem(const T *item) const +{ + return _PointerList_::HasItem((void *)item); +} + +template +bool +BObjectList::IsEmpty() const +{ + return _PointerList_::IsEmpty(); +} + +template +int32 +BObjectList::CountItems() const +{ + return _PointerList_::CountItems(); +} + +template +void +BObjectList::MakeEmpty(bool deleteIfOwning) +{ + if (owning && deleteIfOwning) { + int32 count = CountItems(); + for (int32 index = 0; index < count; index++) + delete ItemAt(index); + } + _PointerList_::MakeEmpty(); +} + +template +T * +BObjectList::EachElement(EachFunction func, void *params) +{ + return (T *)_PointerList_::EachElement((GenericEachFunction)func, params); +} + + +template +const T * +BObjectList::EachElement(ConstEachFunction func, void *params) const +{ + return (const T *) + const_cast *>(this)->_PointerList_::EachElement( + (GenericEachFunction)func, params); +} + +template +const T * +BObjectList::FindIf(const UnaryPredicate &predicate) const +{ + int32 count = CountItems(); + for (int32 index = 0; index < count; index++) + if (predicate.operator()(ItemAt(index)) == 0) + return ItemAt(index); + return 0; +} + +template +T * +BObjectList::FindIf(const UnaryPredicate &predicate) +{ + int32 count = CountItems(); + for (int32 index = 0; index < count; index++) + if (predicate.operator()(ItemAt(index)) == 0) + return ItemAt(index); + return 0; +} + + +template +void +BObjectList::SortItems(CompareFunction function) +{ + _PointerList_::SortItems((GenericCompareFunction)function); +} + +template +void +BObjectList::SortItems(CompareFunctionWithState function, void *state) +{ + _PointerList_::SortItems((GenericCompareFunctionWithState)function, state); +} + +template +void +BObjectList::HSortItems(CompareFunction function) +{ + _PointerList_::HSortItems((GenericCompareFunction)function); +} + +template +void +BObjectList::HSortItems(CompareFunctionWithState function, void *state) +{ + _PointerList_::HSortItems((GenericCompareFunctionWithState)function, state); +} + +template +T * +BObjectList::BinarySearch(const T &key, CompareFunction func) const +{ + return (T*)_PointerList_::BinarySearch(&key, + (GenericCompareFunction)func); +} + +template +T * +BObjectList::BinarySearch(const T &key, CompareFunctionWithState func, void *state) const +{ + return (T*)_PointerList_::BinarySearch(&key, + (GenericCompareFunctionWithState)func, state); +} + + +template +template +T * +BObjectList::BinarySearchByKey(const Key &key, + int (*compare)(const Key *, const T *)) const +{ + return (T*)_PointerList_::BinarySearch(&key, + (GenericCompareFunction)compare); +} + + +template +template +T * +BObjectList::BinarySearchByKey(const Key &key, + int (*compare)(const Key *, const T *, void *), void *state) const +{ + return (T*)_PointerList_::BinarySearch(&key, + (GenericCompareFunctionWithState)compare, state); +} + + +template +int32 +BObjectList::BinarySearchIndex(const T &item, CompareFunction compare) const +{ + return _PointerList_::BinarySearchIndex(&item, + (GenericCompareFunction)compare); +} + + +template +int32 +BObjectList::BinarySearchIndex(const T &item, + CompareFunctionWithState compare, void *state) const +{ + return _PointerList_::BinarySearchIndex(&item, + (GenericCompareFunctionWithState)compare, state); +} + + +template +template +int32 +BObjectList::BinarySearchIndexByKey(const Key &key, + int (*compare)(const Key *, const T *)) const +{ + return _PointerList_::BinarySearchIndex(&key, + (GenericCompareFunction)compare); +} + + +template +bool +BObjectList::BinaryInsert(T *item, CompareFunction func) +{ + int32 index = _PointerList_::BinarySearchIndex(item, + (GenericCompareFunction)func); + if (index >= 0) { + // already in list, add after existing + return AddItem(item, index + 1); + } + + return AddItem(item, -index - 1); +} + +template +bool +BObjectList::BinaryInsert(T *item, CompareFunctionWithState func, void *state) +{ + int32 index = _PointerList_::BinarySearchIndex(item, + (GenericCompareFunctionWithState)func, state); + if (index >= 0) { + // already in list, add after existing + return AddItem(item, index + 1); + } + + return AddItem(item, -index - 1); +} + +template +bool +BObjectList::BinaryInsertUnique(T *item, CompareFunction func) +{ + int32 index = _PointerList_::BinarySearchIndex(item, + (GenericCompareFunction)func); + if (index >= 0) + return false; + + return AddItem(item, -index - 1); +} + +template +bool +BObjectList::BinaryInsertUnique(T *item, CompareFunctionWithState func, void *state) +{ + int32 index = _PointerList_::BinarySearchIndex(item, + (GenericCompareFunctionWithState)func, state); + if (index >= 0) + return false; + + return AddItem(item, -index - 1); +} + + +template +T * +BObjectList::BinaryInsertCopy(const T ©This, CompareFunction func) +{ + int32 index = _PointerList_::BinarySearchIndex(©This, + (GenericCompareFunction)func); + + if (index >= 0) + index++; + else + index = -index - 1; + + T *newItem = new T(copyThis); + AddItem(newItem, index); + return newItem; +} + +template +T * +BObjectList::BinaryInsertCopy(const T ©This, CompareFunctionWithState func, void *state) +{ + int32 index = _PointerList_::BinarySearchIndex(©This, + (GenericCompareFunctionWithState)func, state); + + if (index >= 0) + index++; + else + index = -index - 1; + + T *newItem = new T(copyThis); + AddItem(newItem, index); + return newItem; +} + +template +T * +BObjectList::BinaryInsertCopyUnique(const T ©This, CompareFunction func) +{ + int32 index = _PointerList_::BinarySearchIndex(©This, + (GenericCompareFunction)func); + if (index >= 0) + return ItemAt(index); + + index = -index - 1; + T *newItem = new T(copyThis); + AddItem(newItem, index); + return newItem; +} + +template +T * +BObjectList::BinaryInsertCopyUnique(const T ©This, CompareFunctionWithState func, + void *state) +{ + int32 index = _PointerList_::BinarySearchIndex(©This, + (GenericCompareFunctionWithState)func, state); + if (index >= 0) + return ItemAt(index); + + index = -index - 1; + T *newItem = new T(copyThis); + AddItem(newItem, index); + return newItem; +} + +template +int32 +BObjectList::FindBinaryInsertionIndex(const UnaryPredicate &pred, bool *alreadyInList) + const +{ + int32 index = _PointerList_::BinarySearchIndexByPredicate(&pred, + (UnaryPredicateGlue)&UnaryPredicate::_unary_predicate_glue); + + if (alreadyInList) + *alreadyInList = index >= 0; + + if (index < 0) + index = -index - 1; + + return index; +} + +template +bool +BObjectList::BinaryInsert(T *item, const UnaryPredicate &pred) +{ + return AddItem(item, FindBinaryInsertionIndex(pred)); +} + +template +bool +BObjectList::BinaryInsertUnique(T *item, const UnaryPredicate &pred) +{ + bool alreadyInList; + int32 index = FindBinaryInsertionIndex(pred, &alreadyInList); + if (alreadyInList) + return false; + + AddItem(item, index); + return true; +} + +#endif /* __OBJECT_LIST__ */ diff --git a/library/librunview/RunView.cpp b/library/librunview/RunView.cpp new file mode 100644 index 0000000..3d9f8b6 --- /dev/null +++ b/library/librunview/RunView.cpp @@ -0,0 +1,2842 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Vision. + * + * The Initial Developer of the Original Code is The Vision Team. + * Portions created by The Vision Team are + * Copyright (C) 1999, 2000, 2001 The Vision Team. All Rights + * Reserved. + * + * Contributor(s): Rene Gollent + * Todd Lair + * Alan Ellis + */ + +#define FORE_WHICH 0 +#define BACK_WHICH 1 +#define FONT_WHICH 2 + +#define MARGIN_WIDTH 10.0 +#define MARGIN_INDENT 10.0 + +#define OFFVIEW_TIMER (10000LL) +#define ABS(x) (x * ((x<0) ? -1 : 1)) +#define SOFTBREAK_STEP 5 + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ObjectList.h" +#include "Theme.h" +#include "RunView.h" +#include "URLCrunch.h" +#include "Utilities.h" +#include "RVAction.h" + +#ifdef ZETA +#include +#else +#define _T(str) (str) +#endif + +// cursor data for hovering over URLs + +static unsigned char URLCursorData[] = {16,1,2,2, + 0,0,0,0,56,0,36,0,36,0,19,224,18,92,9,42, + 8,1,60,33,76,49,66,121,48,125,12,253,2,0,1,0, + 0,0,0,0,56,0,60,0,60,0,31,224,31,252,15,254, + 15,255,63,255,127,255,127,255,63,255,15,255,3,254,1,248 +}; + +struct SoftBreak +{ + int16 fOffset; + float fHeight; + float fAscent; +}; + +struct URL +{ + int32 fOffset; + int32 fLength; + BString fUrl; + + URL (const char *address, int32 off, int32 len) : + fOffset (off), + fLength (len), + fUrl (address) + { } +}; + +typedef BObjectList urllist; + +struct SoftBreakEnd +{ + int16 fOffset; + + SoftBreakEnd (int16 offset) + : fOffset (offset) + { } +}; + +struct FontColor +{ + int16 fOffset; + // G++ is stupid. We only need 2 bits + // for fWhich, but the compiler has a bug + // and warns us against fWhich == 2 + int16 fWhich : 3; + int16 fIndex : 13; +}; + +struct Line +{ + char *fText; + time_t fStamp; + urllist *fUrls; + int16 *fSpaces; + int16 *fEdges; + FontColor *fFcs; + SoftBreak *fSofties; + float fTop; + float fBottom; + + int16 fLength; + int16 fSpace_count; + int16 fEdge_count; + int16 fFc_count; + int16 fSoftie_size; + int16 fSoftie_used; + + Line ( + const char *buffer, + int16 fLength, + float top, + float width, + Theme *fTheme, + const char *fStamp_format, + int16 fore, + int16 back, + int16 font); + + ~Line (void); + + void Append ( + const char *buffer, + int16 len, + float width, + Theme *fTheme, + int16 fore, + int16 back, + int16 font); + + void FigureSpaces (void); + + void FigureFontColors ( + int16 pos, + int16 fore, + int16 back, + int16 font); + + void FigureEdges ( + Theme *fTheme, + float width); + + void SoftBreaks ( + Theme * fTheme, + float width); + + void AddSoftBreak (SoftBreakEnd , float &, + uint16 &, int16 &, float &, float &, Theme *); + + int16 CountChars (int16 pos, int16 len); + size_t SetStamp (const char *, bool); + + void SelectWord (int16 *, int16 *); +}; + +inline int32 +UTF8_CHAR_LEN (uchar c) +{ + return (((0xE5000000 >> (((c) >> 3) & 0x1E)) & 3) + 1); +} + +RunView::RunView ( + BRect frame, + const char *name, + Theme *theme, + uint32 resizingMode, + uint32 flags) + : BView ( + frame, + name, + resizingMode, + flags | B_WILL_DRAW | B_FRAME_EVENTS), + fScroller (NULL), + fTheme (theme), + fWorking (NULL), + fLine_count (0), + fStamp_format (NULL), + fClipping_name (NULL), + fSp_start (0, 0), + fSp_end (0, 0), + fTracking (0), + fTrack_offset (0, 0), + fOff_view_runner (NULL), + fOff_view_time (0), + fResizedirty (false), + fFontsdirty (false), + fMyPopUp (NULL), + fLastClick (0,0), + fLastClickTime (0), + fIndent(false) +{ + Theme::TimestampFore = C_TIMESTAMP_DUMMY; + Theme::TimestampBack = C_TIMESTAMP_DUMMY; + Theme::TimespaceFore = MAX_COLORS; + Theme::TimespaceBack = MAX_COLORS; + Theme::TimespaceFont = MAX_FONTS; + Theme::TimestampFont = F_TIMESTAMP_DUMMY; + Theme::NormalFore = C_TEXT; + Theme::NormalBack = C_TEXT; + Theme::NormalFont = F_TEXT; + Theme::SelectionBack = C_SELECTION; + + + memset (fLines, 0, sizeof (fLines)); + fURLCursor = new BCursor (URLCursorData); + + fTheme->ReadLock(); + + BView::SetViewColor (B_TRANSPARENT_COLOR); + BView::SetLowColor (fTheme->BackgroundAt (Theme::NormalBack)); + BView::SetHighColor (fTheme->ForegroundAt (Theme::NormalFore)); + + fTheme->ReadUnlock(); + + SetDefaultOpenURLAction(NULL); +} + +RunView::~RunView (void) +{ + for (int16 i = 0; i < fLine_count; ++i) + delete fLines[i]; + + delete fWorking; + delete fURLCursor; + delete [] fStamp_format; + delete [] fClipping_name; +} + +void +RunView::AttachedToWindow (void) +{ + BView::AttachedToWindow(); +#if B_BEOS_VERSION_DANO + SetDoubleBuffering (B_UPDATE_INVALIDATED | B_UPDATE_SCROLLED | B_UPDATE_EXPOSED | B_UPDATE_RESIZED); +#endif + RecalcScrollBar (false); + fTheme->WriteLock(); + fTheme->AddView (this); + fTheme->WriteUnlock(); +} + +void +RunView::DetachedFromWindow (void) +{ + fTheme->WriteLock(); + fTheme->RemoveView (this); + fTheme->WriteUnlock(); +} + +void +RunView::FrameResized (float start_width, float height) +{ + BView::FrameResized (start_width, height); + + if (IsHidden()) + { + fResizedirty = true; + return; + } + ResizeRecalc(); +} + +void +RunView::TargetedByScrollView (BScrollView *s) +{ + fScroller = s; + BView::TargetedByScrollView (fScroller); +} + +void +RunView::Show (void) +{ + if (fFontsdirty) + { + FontChangeRecalc(); + // this effectively does the same thing as resize so if both have changed, only + // do the fonts recalculation + fFontsdirty = false; + fResizedirty = false; + } + else if (fResizedirty) + { + ResizeRecalc(); + fResizedirty = false; + } + BView::Show(); +} + + +void +RunView::Draw (BRect frame) +{ + TextRender *tr=NULL; + + Window()->DisableUpdates(); + Window()->BeginViewTransaction(); + + rgb_color low_color, hi_color, view_color, sel_color, sel_fText; + float height (frame.bottom); + BRect bounds (Bounds()); + BRegion clipper; + bool drawSelection (false); + bool checkSelection (fSp_start != fSp_end); + + clipper.Set (frame); + ConstrainClippingRegion (&clipper); + + fTheme->ReadLock(); + view_color = fTheme->BackgroundAt (Theme::NormalBack); + + sel_color = fTheme->BackgroundAt (Theme::SelectionBack); + if (((sel_color.red + sel_color.blue + sel_color.green) / 3) >= 127) + { + sel_fText.red = sel_fText.green = sel_fText.blue = 0; + sel_fText.alpha = 255; + } + else + { + sel_fText.red = sel_fText.green = sel_fText.blue = sel_fText.alpha = 255; + } + BRect remains; + if (fLine_count == 0) + remains = frame; + else if (frame.bottom >= fLines[fLine_count - 1]->fBottom + 1.0) + remains.Set ( + frame.left, + fLines[fLine_count - 1]->fBottom + 1.0, + frame.right, + frame.bottom); + + if (remains.IsValid()) + { + SetLowColor (view_color); + FillRect (remains, B_SOLID_LOW); + } + + for (int16 i = fLine_count - 1; i >= 0; --i) + { + Line *line (fLines[i]); + if (line->fBottom < frame.top) + break; + + BRect r (bounds.left, line->fTop, bounds.right, line->fBottom); + + if (!frame.Intersects (r)) + continue; + + float indent (ceil (MARGIN_WIDTH / 2.0)); + int16 place (0); + + int16 fore (0); + int16 back (0); + int16 font (0); + + height = line->fTop; + + for (int16 sit = 0; sit < line->fSoftie_used; /*++sit*/sit++) + { + int16 last_len (UTF8_CHAR_LEN (line->fText[line->fSofties[sit].fOffset])); + float left (indent); + float start (0.0); + + // Fill indentation + SetLowColor (view_color); + + SetDrawingMode (B_OP_COPY); + r.Set (0.0, height, indent - 1.0, height + line->fSofties[sit].fHeight - 1.0); + FillRect (r, B_SOLID_LOW); + + if (sit) + { + int16 j (place); + + while (--j >= 0) + if ((start = line->fEdges[j]) != 0) + break; + } + + while (place < line->fSofties[sit].fOffset + last_len) + { + // Get current foreground color and set + while (fore < line->fFc_count) + { + if (line->fFcs[fore].fWhich == FORE_WHICH) + { + if (line->fFcs[fore].fOffset > place) + break; + + hi_color = fTheme->ForegroundAt (line->fFcs[fore].fIndex); + } + + ++fore; + } + + // Get current background color and set + while (back < line->fFc_count) + { + if (line->fFcs[back].fWhich == BACK_WHICH) + { + if (line->fFcs[back].fOffset > place) + break; + + + low_color = fTheme->BackgroundAt (line->fFcs[back].fIndex); + } + + ++back; + } + + // Get current font and set + while (font < line->fFc_count) + { + if (line->fFcs[font].fWhich == FONT_WHICH) + { + if (line->fFcs[font].fOffset > place) + break; + + //const BFont &f (fTheme->FontAt (line->fFcs[font].fIndex)); + tr = fTheme->TextRenderAt (line->fFcs[font].fIndex); + //SetFont (&f); + } + + ++font; + } + + int16 fLength (line->fSofties[sit].fOffset - place + last_len); + + if (fore < line->fFc_count + && line->fFcs[fore].fOffset - place < fLength) + fLength = line->fFcs[fore].fOffset - place; + + if (back < line->fFc_count + && line->fFcs[back].fOffset - place < fLength) + fLength = line->fFcs[back].fOffset - place; + + if (font < line->fFc_count + && line->fFcs[font].fOffset - place < fLength) + fLength = line->fFcs[font].fOffset - place; + + if (checkSelection) + { + // case 1: current line marks beginning of selection + if (i == fSp_start.fLine) + { + // if we're just prior to the selection, clip fLength to only + // draw up to the selection start + if (place + fLength >= fSp_start.fOffset && place < fSp_start.fOffset) + { + fLength = fSp_start.fOffset - place; + drawSelection = false; + } + // we're at the selection, switch drawing color mode + else if (place >= fSp_start.fOffset) + { + if (fSp_end.fLine == fSp_start.fLine) + { + if (place < fSp_end.fOffset) + { + drawSelection = true; + if ((fSp_end.fOffset - place) < fLength) + fLength = fSp_end.fOffset - place; + } + else + drawSelection = false; + } + else + drawSelection = true; + } + else + drawSelection = false; + + } + // case 2: line in between beginning and end of selection, + // highlight entire line + else if (i > fSp_start.fLine && i < fSp_end.fLine) + drawSelection = true; + // case 3: last line of selection, with multiple fLines in between + else if (i == fSp_end.fLine && i != fSp_start.fLine) + { + if (place < (fSp_end.fOffset)) + { + if (fSp_end.fOffset - place < fLength) + fLength = (fSp_end.fOffset - place); + drawSelection = true; + } + else + drawSelection = false; + } + else + drawSelection = false; + } + + if (place + fLength == line->fLength) + --fLength; + + int16 k (place + fLength - 1); + while (line->fEdges[k] == 0) + --k; + + r.Set ( + left, + height, + line->fEdges[k] + indent - start, + height + line->fSofties[sit].fHeight - 1.0); + + SetDrawingMode (B_OP_COPY); + if (drawSelection) + SetLowColor (sel_color); + else + SetLowColor (low_color); + SetHighColor (hi_color); + FillRect (r, B_SOLID_LOW); + + if (drawSelection) + SetHighColor (sel_fText); + + SetDrawingMode (B_OP_OVER); + +// if(tr) + if ( sit >= line->fSoftie_used ) + { + printf("bah. sit is %d and fSoftie_used is %d\n", sit, line->fSoftie_used); + } else + { +// printf("ooh. sit is %d and fSoftie_used is %d\n", sit, line->fSoftie_used); + tr->Render(this, + line->fText + place, + min_c (fLength, line->fLength - place - 1), + BPoint (left, height + line->fSofties[sit].fAscent), + r); + //debug: StrokeLine(BPoint (left, height),BPoint (left, height+2)); + } + +/* DrawString ( + line->fText + place, + min_c (fLength, line->fLength - place - 1), + BPoint (left, height + line->fSofties[sit].fAscent)); +*/ + left = line->fEdges[k] + indent - start; + + if ((place += fLength) + 1 >= line->fLength) + ++place; + } + + BRect margin( + left + 1.0, + height, + bounds.right, // - indent, + height + line->fSofties[sit].fHeight - 1.0); + + if(tr!=NULL) { + + tr->MarginAfterTheText(this,view_color,margin); + /*margin.left = bounds.right-indent; + margin.right = bounds.right; + SetDrawingMode (B_OP_COPY); + //SetLowColor (view_color); + SetLowColor (255,0,0); + FillRect (margin,B_SOLID_LOW); + */ + } + else { + // Margin after fText + SetDrawingMode (B_OP_COPY); + SetLowColor (view_color); + FillRect (margin,B_SOLID_LOW); + } + + height += line->fSofties[sit].fHeight; + + if (sit == 0 && fIndent) + indent += (MARGIN_INDENT / 2.0); + } + } + + fTheme->ReadUnlock(); + Window()->EndViewTransaction(); + Window()->EnableUpdates(); + ConstrainClippingRegion (NULL); +} + +void +RunView::SetViewColor (rgb_color color) +{ + assert (memcmp (&color, &B_TRANSPARENT_COLOR, sizeof (rgb_color)) != 0); + BView::SetViewColor (color); +} + +void +RunView::BuildPopUp (BPoint point) +{ + // This function checks certain criteria (fText is selected, + // TextView is editable, etc) to determine fWhich MenuItems + // to enable and disable + + bool enablecopy (true), + enableselectall (true), + enablelookup (false); + BString querystring (""); + + if (fSp_start == fSp_end) + enablecopy = false; // no selection + + if (!fLine_count) + enableselectall = false; + + if (enablecopy) + { + enablelookup = true; // has a selection less than 32 chars long + GetSelectionText(querystring); + } + + fMyPopUp = new BPopUpMenu ("Context Menu", false, false); + + BMenuItem *item; + + BMessage *lookup; + lookup = new BMessage (M_LOOKUP_WEBSTER); + lookup->AddString ("string", querystring); + item = new BMenuItem(_T("Lookup (Dictionary)"), lookup); + item->SetEnabled (enablelookup); + item->SetTarget(this); + fMyPopUp->AddItem (item); + + lookup = new BMessage (M_LOOKUP_GOOGLE); + lookup->AddString ("string", querystring); + item = new BMenuItem(_T("Lookup (Google)"), lookup); + item->SetEnabled (enablelookup); + item->SetTarget(this); + fMyPopUp->AddItem (item); + + lookup = new BMessage (M_LOOKUP_ACRONYM); + lookup->AddString ("string", querystring); + item = new BMenuItem(_T("Lookup (Acronym Finder)"), lookup); + item->SetEnabled (enablelookup); + item->SetTarget(this); + fMyPopUp->AddItem (item); + + fMyPopUp->AddSeparatorItem(); + BString aurl = GetURL(point); + if(aurl != ""){ + BMessage* url = new BMessage ('cour'); + url->AddString("url",aurl); + item = new BMenuItem(_T("Copy URL"), url); + item->SetEnabled (true); + item->SetTarget (this); + fMyPopUp->AddItem (item); + + url = new BMessage ('opur'); + url->AddString("url",aurl); + item = new BMenuItem(_T("Open URL"), url); + item->SetEnabled (true); + item->SetTarget (this); + fMyPopUp->AddItem (item); + + fMyPopUp->AddSeparatorItem(); + } + + item = new BMenuItem(_T("Copy"), new BMessage (B_COPY), 'C'); + item->SetEnabled (enablecopy); + item->SetTarget (this); + fMyPopUp->AddItem (item); + + item = new BMenuItem(_T("Select All"), new BMessage (B_SELECT_ALL), 'A'); + item->SetEnabled (enableselectall); + item->SetTarget (this); + fMyPopUp->AddItem (item); + + /*fMyPopUp->AddSeparatorItem(); + + item = new BMenuItem(_T("Clear"), new BMessage(M_CLEAR)); + item->SetTarget(this); + fMyPopUp->AddItem(item); + */ + + fMyPopUp->SetFont (be_plain_font); +} + +bool +RunView::CheckClickBounds (const SelectPos &s, const BPoint &point) const +{ + return ((point.x <= fLines[s.fLine]->fEdges[fLines[s.fLine]->fLength - 1]) + && (point.y <= fLines[s.fLine]->fBottom)); +} + +void +RunView::MouseDown (BPoint point) +{ + if (!fLine_count) + return; + + MakeFocus(); + + BMessage *msg (Window()->CurrentMessage()); + uint32 buttons; + uint32 mouseModifiers; + bigtime_t sysTime; + msg->FindInt64 ("when", &sysTime); + uint16 clicks = CheckClickCount (point, fLastClick, sysTime, fLastClickTime, fClickCount) % 3; + msg->FindInt32 ("buttons", reinterpret_cast(&buttons)); + msg->FindInt32 ("modifiers", reinterpret_cast(&mouseModifiers)); + + SelectPos s (PositionAt (point)); + bool inBounds (CheckClickBounds (s, point)); + + if (buttons == B_SECONDARY_MOUSE_BUTTON + && (mouseModifiers & B_SHIFT_KEY) == 0 + && (mouseModifiers & B_COMMAND_KEY) == 0 + && (mouseModifiers & B_CONTROL_KEY) == 0 + && (mouseModifiers & B_OPTION_KEY) == 0 + && (mouseModifiers & B_MENU_KEY) == 0) + { + SelectPos start (s), + end (s); + + // select word + if (inBounds && !IntersectSelection (s,s)) + { + fLines[s.fLine]->SelectWord (&start.fOffset, &end.fOffset); + + Select (start, end); + } + + BuildPopUp(point); + fMyPopUp->Go ( + ConvertToScreen (point), + true, + false); + + delete fMyPopUp; + fMyPopUp = 0; + return; + } + + if (buttons == B_PRIMARY_MOUSE_BUTTON + && (mouseModifiers & B_SHIFT_KEY) == 0 + && (mouseModifiers & B_COMMAND_KEY) == 0 + && (mouseModifiers & B_CONTROL_KEY) == 0 + && (mouseModifiers & B_OPTION_KEY) == 0 + && (mouseModifiers & B_MENU_KEY) == 0) + { + SelectPos start (s), + end (s); + + switch (clicks) + { + case 2: + { + if (inBounds) + { + // select word + fLines[s.fLine]->SelectWord (&start.fOffset, &end.fOffset); + + Select (start, end); + return; + } + } + break; + + case 0: + { + if (inBounds) + { + start.fOffset = 0; + end.fOffset = fLines[s.fLine]->fLength - 1; + Select (start, end); + return; + } + } + break; + + default: + { + if (!inBounds || !IntersectSelection (s, s)) + Select (s,s); + SetMouseEventMask (B_POINTER_EVENTS); + fTracking = 1; + fTrack_offset = s; + return; + } + } + } + else if (buttons == B_PRIMARY_MOUSE_BUTTON + && (mouseModifiers & B_SHIFT_KEY) != 0 + && (mouseModifiers & B_COMMAND_KEY) == 0 + && (mouseModifiers & B_CONTROL_KEY) == 0 + && (mouseModifiers & B_OPTION_KEY) == 0 + && (mouseModifiers & B_MENU_KEY) == 0) + { + if (s.fLine < fSp_start.fLine || s.fOffset < fSp_start.fOffset) + { + Select (s, fSp_end); + fTrack_offset = SelectPos (fSp_end.fLine, (fSp_end.fOffset > 0) ? fSp_end.fOffset - 1 : fSp_end.fOffset); + } + else + { + Select (fSp_start, s); + fTrack_offset = fSp_start; + } + + SetMouseEventMask (B_POINTER_EVENTS); + fTracking = 2; + } +} + +bool +RunView::CheckURL(BPoint point) //by xeD +{ + if (!fLine_count) + return false; + + SelectPos s = PositionAt (point); + + if (!fLines[s.fLine]->fUrls) + { + // if there aren't any URLs in the current line, go back to default + return false; + } + Line *curline (fLines[s.fLine]); + + for (int32 i = 0; i < curline->fUrls->CountItems(); i++) + { + URL *current = curline->fUrls->ItemAt(i); + if ((s.fOffset >= current->fOffset) + && (s.fOffset <= current->fOffset + current->fLength)) + { + return true; + } + } + + return false; +} + +BString +RunView::GetURL(BPoint point){ + if (!fLine_count) + return ""; + + SelectPos s = PositionAt (point); + + if (!fLines[s.fLine]->fUrls) + { + // if there aren't any URLs in the current line, go back to default + return ""; + } + Line *curline (fLines[s.fLine]); + + for (int32 i = 0; i < curline->fUrls->CountItems(); i++) + { + URL *current = curline->fUrls->ItemAt(i); + if ((s.fOffset >= current->fOffset) + && (s.fOffset <= current->fOffset + current->fLength)) + { + + return current->fUrl; + + } + } + + return ""; +} + +void +RunView::CheckURLCursor (BPoint point) +{ + if (CheckURL(point)) + SetViewCursor (fURLCursor); // if there aren't any URLs in the current line, go back to default + else + SetViewCursor (B_CURSOR_SYSTEM_DEFAULT); // no URLs found, set back to default + +} + +void +RunView::MouseMoved (BPoint point, uint32 transit, const BMessage *msg) +{ + if (fTracking == 0 + && fLine_count + && (transit == B_ENTERED_VIEW + || transit == B_INSIDE_VIEW)) + CheckURLCursor (point); + + + if (!fLine_count || fTracking == 0) + { + BView::MouseMoved (point, transit, msg); + return; + } + + switch (transit) + { + case B_ENTERED_VIEW: + if (fOff_view_runner) + { + delete fOff_view_runner; + fOff_view_runner = 0; + } + + if (fTracking == 1 || fTracking == 2) + ExtendTrackingSelect (point); + + break; + + case B_EXITED_VIEW: + if (fTracking == 1 || fTracking == 2) + ShiftTrackingSelect (point, true, OFFVIEW_TIMER); + break; + + case B_OUTSIDE_VIEW: + + if (fTracking == 1 || fTracking == 2) + { + bigtime_t now (system_time()); + + ShiftTrackingSelect ( + point, + false, + max_c (0LL, min_c (OFFVIEW_TIMER, OFFVIEW_TIMER - (now - fOff_view_time)))); + } + break; + + case B_INSIDE_VIEW: + + if ((fTracking == 1) && (fSp_start != fSp_end)) + { + BMessage *drag = new BMessage(B_MIME_DATA); + + // Add originator and action + drag->AddPointer("be:originator", this); + drag->AddInt32("be_actions", B_TRASH_TARGET); + + BString fText; + GetSelectionText (fText); + + // add the text + drag->AddData("text/plain", B_MIME_TYPE, fText.String(), + fText.Length()); + + + BRect frame ( + fLines[fSp_start.fLine]->fEdges[fSp_start.fOffset], + fLines[fSp_start.fLine]->fTop, + fLines[fSp_end.fLine]->fEdges[fSp_end.fOffset], + fLines[fSp_end.fLine]->fBottom); + + if (fSp_start.fLine != fSp_end.fLine) + { + frame.left = 0.0; + frame.right = Bounds().right; + } + // selection lies within the bounds of a line, check + // if it fLines on one of the wrapped subfLines and calculate rectangle + // appropriately + else + { + Line *line (fLines[fSp_start.fLine]); + float left (line->fEdges[fSp_start.fOffset]), + top (line->fTop), + right (line->fEdges[fSp_end.fOffset]), + bottom (line->fBottom); + int top_softie (0), bottom_softie (0); + bool start_found (false); + bool end_found (false); + + if (line->fSoftie_used) + { + if (fSp_start.fOffset < line->fSofties[0].fOffset) + start_found = true; + + if (fSp_end.fOffset < line->fSofties[0].fOffset) + end_found = true; + } + + if (!end_found) + for (int16 sit = 1; sit < line->fSoftie_used; ++sit) + { + if (!start_found && fSp_start.fOffset < line->fSofties[sit].fOffset) + { + left = line->fEdges[fSp_start.fOffset] - + line->fEdges[line->fSofties[sit-1].fOffset]; + + top += (sit) * line->fSofties[sit].fHeight; + top_softie = sit; + start_found = true; + } + + if (fSp_end.fOffset < line->fSofties[sit].fOffset) + { + right = line->fEdges[fSp_end.fOffset] - + line->fEdges[line->fSofties[sit-1].fOffset]; + + bottom = top + (sit - top_softie + 1) * line->fSofties[sit].fHeight; + bottom_softie = sit; + end_found = true; + break; + } + } + if (!end_found) + { + int32 soft_count = (line->fSoftie_used >= 2) ? + line->fSoftie_used - 2 : 0; + right = line->fEdges[line->fLength - 1] - + line->fEdges[line->fSofties[soft_count].fOffset]; + bottom_softie = soft_count - 2; + + } + if (right < left || (bottom_softie - top_softie) > 0) + { + left = 0.0; + right = Bounds().right; + } + + frame.Set (left, top, right, bottom); + frame.OffsetBy (MARGIN_WIDTH / 2.0, 0.0); + } + + if (frame.Height() > Bounds().Height()) + frame = Bounds(); + + DragMessage (drag, frame); + + fTracking = 3; + } + else if (fTracking == 1 || fTracking == 2) + ExtendTrackingSelect (point); + break; + } +} + +void +RunView::MouseUp (BPoint point) +{ + SelectPos s (PositionAt (point)); + bool url_handle (false); + + if (!fLine_count) + { + fTracking = 0; + return; + } + + if (fTracking == 1) + { + Line *curline (fLines[s.fLine]); + if (curline->fUrls) + { + for (int32 i = 0; i < curline->fUrls->CountItems(); i++) + { + URL *current = curline->fUrls->ItemAt(i); + if ((s.fOffset >= current->fOffset) + && (s.fOffset <= current->fOffset + current->fLength)) + { + + LoadURL (current->fUrl.String()); + url_handle = true; + break; + } + } + } + if (!url_handle && s == fTrack_offset) + Select (s, s); + } + + if (fOff_view_runner) + { + delete fOff_view_runner; + fOff_view_runner = 0; + } + + fTracking = 0; + +} + +void +RunView::ExtendTrackingSelect (BPoint point) +{ + SelectPos s (PositionAt (point)); + + if (s.fLine < fTrack_offset.fLine || (s.fLine == fTrack_offset.fLine && s.fOffset < fTrack_offset.fOffset)) + { + Select (s, fTrack_offset); + fTracking = 2; + } + else if (s.fLine > fTrack_offset.fLine || (s.fLine == fTrack_offset.fLine && s.fOffset > fTrack_offset.fOffset)) + { + Select (fTrack_offset, s); + fTracking = 2; + } +} + +void +RunView::ShiftTrackingSelect (BPoint point, bool move, bigtime_t timer) +{ + BRect bounds (Bounds()); + + if (fOff_view_runner) + { + delete fOff_view_runner; + fOff_view_runner = 0; + } + + if (point.y < bounds.top) + { + if (bounds.top > 0.0) + { + float delta (bounds.top - point.y); + + if (fOff_view_runner == 0) + { + BMessage *msg (new BMessage (M_OFFVIEW_SELECTION)); + + msg->AddFloat ("delta", delta); + msg->AddBool ("bottom", false); + msg->AddPoint ("point", point); + + fOff_view_runner = new BMessageRunner ( + BMessenger (this), + msg, + timer == 0LL ? OFFVIEW_TIMER : timer); + + } + + if (move || timer == 0) + { + delta = max_c (ABS (ceil (delta / 2.0)), 10.0); + delta = min_c (delta, Bounds().Height()); + + if (bounds.top - delta < 0.0) + delta = bounds.top; + + ScrollBy (0.0, -delta); + fOff_view_time = system_time(); + } + } + + point.x = 0.0; + point.y = Bounds().top; + ExtendTrackingSelect (point); + } + + if (point.y > bounds.bottom) + { + Line *line (fLines[fLine_count-1]); + if (line + && line->fBottom > bounds.bottom) + { + float delta (point.y - bounds.bottom); + + if (fOff_view_runner == 0) + { + BMessage *msg (new BMessage (M_OFFVIEW_SELECTION)); + + msg->AddFloat ("delta", delta); + msg->AddBool ("bottom", true); + msg->AddPoint ("point", point); + + fOff_view_runner = new BMessageRunner ( + BMessenger (this), + msg, + timer == 0LL ? OFFVIEW_TIMER : timer); + + } + + if (move || timer == 0) + { + delta = max_c (ABS (ceil (delta / 2.0)), 10.0); + delta = min_c (delta, Bounds().Height()); + + if (bounds.bottom + delta > line->fBottom) + delta = line->fBottom - bounds.bottom; + + ScrollBy (0.0, delta); + fOff_view_time = system_time(); + } + } + + point.x = Bounds().right; + point.y = Bounds().bottom; + ExtendTrackingSelect (point); + } + else + ExtendTrackingSelect (point); +} + +void +RunView::MessageReceived (BMessage *msg) +{ + switch (msg->what) + { + + case M_THEME_FOREGROUND_CHANGE: + case M_THEME_BACKGROUND_CHANGE: + if (!IsHidden()) + Invalidate (Bounds()); + break; + + case M_THEME_FONT_CHANGE: + { + Theme *save (fTheme); + + fTheme = NULL; + SetTheme (save); + break; + } + + case B_SELECT_ALL: + SelectAll(); + break; + + case B_COPY: + if (fSp_start != fSp_end + && be_clipboard->Lock()) + { + BString fText; + GetSelectionText (fText); + + be_clipboard->Clear(); + + BMessage *msg (be_clipboard->Data()); + msg->AddData ("text/plain", B_MIME_TYPE, fText.String(), fText.Length()); + + be_clipboard->Commit(); + be_clipboard->Unlock(); + } + break; + case 'cour': //Copy URL + if (be_clipboard->Lock()) + { + BString fText; + msg->FindString("url",&fText); + + BString map; + if(urls.FindString(fText.String(),&map) == B_OK) + fText.SetTo(map); + if(fText.IFindFirst("action:") == 0) return; + + be_clipboard->Clear(); + + BMessage *msgD (be_clipboard->Data()); + msgD->AddData ("text/plain", B_MIME_TYPE, fText.String(), fText.Length()); + + be_clipboard->Commit(); + be_clipboard->Unlock(); + } + break; + case 'opur': //Open URL + { + BString url; + if(msg->FindString("url",&url)==B_OK) + LoadURL(url.String()); + + } + break; + case M_OFFVIEW_SELECTION: + { + BPoint point; + float delta; + bool bottom; + + msg->FindPoint ("point", &point); + msg->FindBool ("bottom", &bottom); + msg->FindFloat ("delta", &delta); + + if (bottom) + point.y = Bounds().bottom + delta; + else + point.y = Bounds().top - delta; + + ShiftTrackingSelect (point, true, OFFVIEW_TIMER); + break; + } + + case M_LOOKUP_WEBSTER: + { + BString lookup; + msg->FindString ("string", &lookup); + lookup = StringToURI (lookup.String()); + lookup.Prepend ("http://www.m-w.com/cgi-bin/dictionary?va="); + LoadURL (lookup.String()); + } + break; + + case M_LOOKUP_GOOGLE: + { + BString lookup; + msg->FindString ("string", &lookup); + lookup = StringToURI (lookup.String()); + lookup.Prepend ("http://www.google.com/search?q="); + LoadURL (lookup.String()); + } + break; + + case M_LOOKUP_ACRONYM: + { + BString lookup; + msg->FindString ("string", &lookup); + lookup = StringToURI (lookup.String()); + lookup.Prepend ("http://www.acronymfinder.com/af-query.asp?String=exact&Acronym="); + lookup.Append ("&Find=Find"); + LoadURL (lookup.String()); + } + break; + + case M_CLEAR: + { + Clear(); + } + break; + + default: + BView::MessageReceived (msg); + } +} + +void +RunView::ResizeRecalc (void) +{ + float width (Bounds().Width() - MARGIN_WIDTH); + int16 fSoftie_size (0), fSoftie_used (0); + SoftBreak *fSofties (NULL); + BRect bounds (Bounds()); + BRegion region; + float top (0.0); + + fTheme->ReadLock(); + for (int16 i = 0; i < fLine_count; ++i) + { + float old_top (fLines[i]->fTop), old_bottom (fLines[i]->fBottom); + if (fSoftie_size < fLines[i]->fSoftie_used) + { + delete [] fSofties; + fSofties = new SoftBreak [fSoftie_size = fLines[i]->fSoftie_size]; + } + + fSoftie_used = fLines[i]->fSoftie_used; + memcpy (fSofties, fLines[i]->fSofties, (fSoftie_used * sizeof (SoftBreak))); + + fLines[i]->fTop = top; + fLines[i]->SoftBreaks (fTheme, width); + top = fLines[i]->fBottom + 1.0; + + BRect r (0.0, fLines[i]->fTop, bounds.right, fLines[i]->fBottom); + + if (bounds.Intersects (r) + && (old_top != fLines[i]->fTop + || old_bottom != fLines[i]->fBottom + || fSoftie_used != fLines[i]->fSoftie_used + || memcmp (fSofties, fLines[i]->fSofties, fSoftie_used * sizeof (SoftBreak)))) + region.Include (r); + } + + fTheme->ReadUnlock(); + + + if (Window()) + { + if (RecalcScrollBar (true)) + Invalidate (Bounds()); + else + { + int32 count (region.CountRects()), j; + + for (j = 0; j < count; ++j) + Invalidate (region.RectAt (j)); + + if (top <= bounds.bottom) + { + BRect r (bounds); + + r.top = top; + Invalidate (r); + } + } + + Window()->Sync(); + } + + if (fWorking) fWorking->fTop = top; + delete [] fSofties; +} + +void +RunView::FontChangeRecalc (void) +{ + float width (Bounds().Width() - MARGIN_WIDTH); + float top (0.0); + + for (int16 i = 0; i < fLine_count; ++i) + { + fLines[i]->fTop = top; + + fLines[i]->FigureSpaces(); + fLines[i]->FigureEdges (fTheme, width); + + top = fLines[i]->fBottom + 1.0; + } + + if (fWorking) + fWorking->fTop = top; + + RecalcScrollBar (false); + if (!IsHidden()) + Invalidate (Bounds()); + if (Window()) Window()->UpdateIfNeeded(); +} + +bool +RunView::RecalcScrollBar (bool constrain) +{ + BScrollBar *bar; + + if (fScroller == NULL + || (bar = fScroller->ScrollBar (B_VERTICAL)) == NULL) + return false; + + float value (bar->Value()); + BRect bounds (Bounds()); + bool changed (false); + float bottom (0.0); + float scrollMin, scrollMax; + + + bar->GetRange (&scrollMin, &scrollMax); + + if (fLine_count) + TextResized(BRect(0,value,0,fLines[fLine_count - 1]->fBottom)); + else + TextResized(BRect(0,0,0,0)); + + + if (fLine_count + && (bounds.Contains (BPoint (0.0, 0.0)) == false + || bounds.Contains (BPoint (0.0, fLines[fLine_count - 1]->fBottom + ExtraTextSize() )) == false)) + { + + bottom = fLines[fLine_count - 1]->fBottom + ExtraTextSize() + 5.0; + bar->SetProportion (bounds.Height() / bottom); + bar->SetSteps (10.0, bounds.Height()); + + bottom -= bounds.Height(); + } + + // We don't want the bar to cause a draw/copybits, so we restrict the + // clipping region to nothing + + if (constrain) + { + BRegion region; + ConstrainClippingRegion (®ion); + } + + if (scrollMax != bottom) + { + bar->SetRange (0.0, bottom); + + if (value == scrollMax || scrollMin == scrollMax) + { + bar->SetValue (bottom); + changed = true; + } + } + + if (constrain) + ConstrainClippingRegion (NULL); + + return changed; +} + +void +RunView::Append ( + const char *buffer, + int16 fore, + int16 back, + int16 font) +{ + Append (buffer, strlen (buffer), fore, back, font); +} + +void +RunView::AppendURL(const char * text,const char *url,int16 font){ + urls.AddString(text,url); + Append(text,C_URL,C_URL,font); +} + +void +RunView::AppendURL(const char * text,const char * url,int16 back,int16 font){ + urls.AddString(text,url); + Append(text,C_URL,back,font); +} + +void +RunView::Append ( + const char *buffer, + int32 len, + int16 fore, + int16 back, + int16 font) +{ + if (buffer == NULL) + return; + float width (Bounds().Width() - 10); + int32 place (0); + + assert (fore != Theme::TimestampFore); + assert (back != Theme::TimestampBack); + assert (font != Theme::TimestampFont); + assert (fore != Theme::TimespaceFore); + assert (back != Theme::TimespaceBack); + assert (font != Theme::TimespaceFont); + assert (back != Theme::SelectionBack); + + fTheme->ReadLock(); + + while (place < len) + { + int32 end (place); + + while (end < len && buffer[end] != '\n') + ++end; + + if (end < len) ++end; + + if (fWorking) + { + + URLCrunch crunch (buffer + place, end - place); + BString temp; + int32 url_offset (0), + last_offset (0); + + + while ((url_offset = crunch.Crunch (&temp)) != B_ERROR) + { + fWorking->Append (buffer + place, + (url_offset - last_offset), + width, + fTheme, + fore, + back, + font); + + fWorking->Append (temp.String(), + temp.Length(), + width, + fTheme, + C_URL, + back, + F_URL); + + place += (url_offset - last_offset) + temp.Length(); + last_offset = url_offset + temp.Length(); + } + + if (place < end) + fWorking->Append ( + buffer + place, + end - place, + width, + fTheme, + fore, + back, + font); + } + else + { + float top (0.0); + + if (fLine_count > 0) + top = fLines[fLine_count - 1]->fBottom + 1.0; + + + fWorking = new Line ( + buffer + place, + 0, + top, + width, + fTheme, + fStamp_format, + fore, + back, + font); + + URLCrunch crunch (buffer + place, end - place); + BString temp; + int32 url_offset (0), + last_offset (0); + + while ((url_offset = crunch.Crunch (&temp)) != B_ERROR) + { + fWorking->Append (buffer + place, + (url_offset - last_offset), + width, + fTheme, + fore, + back, + font); + fWorking->Append (temp.String(), + temp.Length(), + width, + fTheme, + C_URL, + back, + F_URL); + + place += (url_offset - last_offset) + temp.Length(); + last_offset = url_offset + temp.Length(); + } + + if (place < end) + fWorking->Append (buffer + place, + end - place, + width, + fTheme, + fore, + back, + font); + } + + if (fWorking->fLength + && fWorking->fText[fWorking->fLength - 1] == '\n') + { + bool chopped; + + if (Window()) Window()->DisableUpdates(); + + if ((chopped = (fLine_count == LINE_COUNT))) + { + Line *first (fLines[0]); + float shift (first->fBottom + 1); + + for (int16 i = 1; i < LINE_COUNT; ++i) + { + fLines[i]->fTop -= shift; + fLines[i]->fBottom -= shift; + + fLines[i - 1] = fLines[i]; + } + + fWorking->fTop -= shift; + fWorking->fBottom -= shift; + + delete first; + + if (fSp_start.fLine > 0) + fSp_start.fLine--; + else + fSp_start.fOffset = 0; + + if (fSp_end.fLine > 0) + fSp_end.fLine--; + else + fSp_end.fOffset = 0; + + // Recalc the scrollbar so that we have clean drawing + // after the line has been removed + --fLine_count; + RecalcScrollBar (true); + } + + fLines[fLine_count++] = fWorking; + RecalcScrollBar (true); + + Invalidate (Bounds()); + + if (Window()) + { + Window()->EnableUpdates(); + Window()->UpdateIfNeeded(); + } + + fWorking = NULL; + } + + place = end; + } + + fTheme->ReadUnlock(); +} + +void +RunView::Clear (void) +{ + for (int16 i = 0; i < fLine_count; ++i) + delete fLines[i]; + + fLine_count = 0; + RecalcScrollBar (true); + Invalidate(); + + fSp_start.fLine = 0; + fSp_start.fOffset = 0; + fSp_end = fSp_start; + + if (fWorking) + fWorking->fTop = 0.0; + + urls.MakeEmpty(); +} + +int16 +RunView::LineCount (void) const +{ + return fLine_count; +} + +const char * +RunView::LineAt (int16 which) const +{ + if (which < 0 || which >= fLine_count) + return NULL; + + return fLines[which]->fText; +} + +void +RunView::SetTimeStampFormat (const char *format) +{ + if ((format == NULL + && fStamp_format == NULL) + || (format != NULL + && fStamp_format != NULL + && strcmp (format, fStamp_format) == 0)) + return; + + bool was_on (false); + + if (fStamp_format) + { + delete [] fStamp_format; + fStamp_format = NULL; + was_on = true; + } + + if (format) + fStamp_format = strcpy (new char [strlen (format) + 1], format); + + float width (Bounds().Width() - MARGIN_WIDTH); + float top (0.0); + + fTheme->ReadLock(); + for (int16 i = 0; i < fLine_count; ++i) + { + fLines[i]->fTop = top; + + fLines[i]->SetStamp (fStamp_format, was_on); + fLines[i]->FigureSpaces(); + fLines[i]->FigureEdges(fTheme, width); + + top = fLines[i]->fBottom + 1.0; + } + fTheme->ReadUnlock(); + + if (fWorking) + { + fWorking->fTop = top; + fWorking->SetStamp (fStamp_format, was_on); + } + + RecalcScrollBar (false); + Invalidate (Bounds()); + if (Window()) Window()->UpdateIfNeeded(); +} + +void +RunView::SetTheme (Theme *t) +{ + if (t == NULL || fTheme == t) + return; + + fTheme = t; + + if (IsHidden()) + { + fFontsdirty = true; + return; + } + FontChangeRecalc(); +} + +SelectPos +RunView::PositionAt (BPoint point) const +{ + int16 i, lfIndex (0); + SelectPos pos (-1, 0); + + if (fLine_count == 0) + return pos; + + // find the line + for (i = 0; i < fLine_count; ++i) + { + if (fLines[i]->fTop > point.y) + break; + lfIndex = i; + } + + // check to make sure we actually did find a line and not just run into fLine_count + if (fLines[lfIndex]->fBottom < point.y) + { + pos.fLine = fLine_count - 1; + pos.fOffset = fLines[fLine_count - 1]->fLength; + return pos; + } + + float height (fLines[lfIndex]->fTop); + int16 sfIndex (0); + + for (i = 0; i < fLines[lfIndex]->fSoftie_used; ++i) + { + if (height > point.y) + break; + + sfIndex = i; + height += fLines[lfIndex]->fSofties[i].fHeight; + } + + float margin (MARGIN_WIDTH / 2.0); + float width (0); + int16 start (0); + + if (sfIndex) + { + int16 offset (fLines[lfIndex]->fSofties[sfIndex - 1].fOffset); + + width = fLines[lfIndex]->fEdges[offset]; + start = offset + UTF8_CHAR_LEN (fLines[lfIndex]->fText[offset]); + } + + for (i = start; i <= fLines[lfIndex]->fSofties[sfIndex].fOffset; ++i) + if (fLines[lfIndex]->fEdges[i] + margin - width >= point.x) + break; + + pos.fLine = lfIndex; + pos.fOffset = min_c (i, fLines[lfIndex]->fSofties[sfIndex].fOffset); + if (pos.fOffset > 0) pos.fOffset += UTF8_CHAR_LEN (fLines[pos.fLine]->fText[pos.fOffset]); + + return pos; +} + +BPoint +RunView::PointAt (SelectPos s) const +{ + return BPoint(fLines[s.fLine]->fTop + fLines[s.fLine]->fBottom / 2.0, fLines[s.fLine]->fEdges[s.fOffset]); +} + +void +RunView::GetSelectionText (BString &string) const +{ + /* + for (int32 i = 0; i < curline->fUrls->CountItems(); i++) + { + URL *current = curline->fUrls->ItemAt(i); + if ((s.fOffset >= current->fOffset) + && (s.fOffset <= current->fOffset + current->fLength)) + { + SetViewCursor (fURLCursor); + return; + } + } + */ + if (fSp_start == fSp_end) + return; + + if (fSp_start.fLine == fSp_end.fLine) + { + const char *line (LineAt (fSp_start.fLine)); + string.Append (line + fSp_start.fOffset, fSp_end.fOffset - fSp_start.fOffset); + return; + } + + for (int32 i = fSp_start.fLine; i <= fSp_end.fLine; i++) + { + const char *line (LineAt (i)); + if (i == fSp_start.fLine) + { + line += fSp_start.fOffset; + string.Append (line); + } + else if (i == fSp_end.fLine) + { + string.Append (line, fSp_end.fOffset); + break; + } + else + string.Append (line); + } +} + +bool +RunView::IntersectSelection (const SelectPos &start, const SelectPos &end) const +{ + if (fSp_start.fLine == fSp_end.fLine) + { + if (start.fLine == fSp_start.fLine && start.fOffset >= fSp_start.fOffset && start.fOffset < fSp_end.fOffset) + return true; + if (end.fLine == fSp_start.fLine && end.fOffset >= fSp_start.fOffset && end.fOffset < fSp_end.fOffset) + return true; + } + else + { + if (start.fLine > fSp_start.fLine && start.fLine < fSp_end.fLine) + return true; + if (end.fLine > fSp_start.fLine && end.fLine < fSp_end.fLine) + return true; + if (start.fLine == fSp_start.fLine && start.fOffset >= fSp_start.fOffset) + return true; + if (end.fLine == fSp_start.fLine && end.fOffset >= fSp_start.fOffset) + return true; + if (start.fLine == fSp_end.fLine && start.fOffset < fSp_end.fOffset) + return true; + if (end.fLine == fSp_end.fLine && end.fOffset < fSp_end.fOffset) + return true; + } + + return false; +} + +BRect +RunView::GetTextFrame(const SelectPos &start, const SelectPos &end) const +{ + return BRect (0.0, fLines[(start.fLine > 0) ? (start.fLine - 1) : 0]->fTop, + Bounds().Width(), fLines[end.fLine]->fBottom); +} + +void +RunView::Select (const SelectPos &start, const SelectPos &end) +{ + if (fSp_start != fSp_end) + { + if (start == end || !IntersectSelection (start, end)) + { + BRect frame (GetTextFrame (fSp_start, fSp_end)); + + fSp_start = start; + fSp_end = start; + Invalidate (frame); + } + else + { + if (fSp_start.fLine < start.fLine || (fSp_start.fLine == start.fLine && fSp_start.fOffset < start.fOffset)) + { + BRect frame (GetTextFrame (fSp_start, start)); + + fSp_start = start; + Invalidate (frame); + } + + if (end.fLine < fSp_end.fLine || (fSp_end.fLine == end.fLine && end.fOffset < fSp_end.fOffset)) + { + BRect frame (GetTextFrame (end, fSp_end)); + + fSp_end = end; + Invalidate (frame); + } + } + } + + if (fSp_start == fSp_end) + { + fSp_start = start; + fSp_end = end; + + if (fSp_start != fSp_end) + { + BRect frame (GetTextFrame (start, end)); + + Invalidate (frame); + } + } + else // extension + { + if (start.fLine < fSp_start.fLine || (start.fLine == fSp_start.fLine && start.fOffset < fSp_start.fOffset)) + { + BRect frame (GetTextFrame (start, fSp_start)); + + fSp_start = start; + Invalidate (frame); + } + + if (end.fLine > fSp_end.fLine || (end.fLine == fSp_end.fLine && end.fOffset > fSp_end.fOffset)) + { + BRect frame (GetTextFrame (fSp_end, end)); + + fSp_end = end; + Invalidate (frame); + } + } +} + +void +RunView::SelectAll (void) +{ + if (fLine_count) + { + fSp_start = SelectPos (0, 0); + fSp_end = SelectPos (fLine_count-1, fLines[fLine_count-1]->fLength); + Invalidate(Bounds()); + } +} + +void +RunView::SetClippingName (const char *name) +{ + delete [] fClipping_name; + fClipping_name = new char[strlen(name) + 1]; + memcpy (fClipping_name, name, strlen(name)); + fClipping_name[strlen(name)] = '\0'; +} + +Line::Line ( + const char *buffer, + int16 len, + float top, + float width, + Theme *theme, + const char *stamp_format, + int16 fore, + int16 back, + int16 font) + : fText (NULL), + fStamp (time(NULL)), + fUrls (NULL), + fSpaces (NULL), + fEdges (NULL), + fFcs (NULL), + fSofties (NULL), + fTop (top), + fBottom (0.0), + fLength (len), + fSpace_count (0), + fEdge_count (0), + fFc_count (0), + fSoftie_size (0), + fSoftie_used (0) +{ + // Very important to call SetStamp before Append, It would look real funny otherwise! + SetStamp( stamp_format, false ); + + Append( buffer, len, width, theme, fore, back, font ); +} + +Line::~Line (void) +{ + delete [] fSpaces; + delete [] fEdges; + delete [] fFcs; + delete [] fText; + delete [] fSofties; + + if (fUrls) + { + while (fUrls->CountItems() > 0) + delete fUrls->RemoveItemAt(0L); + delete fUrls; + } +} + +void +Line::Append ( + const char *buffer, + int16 len, + float width, + Theme *theme, + int16 fore, + int16 back, + int16 font) +{ + int16 save (fLength); + char *new_fText; + + new_fText = new char [fLength + len + 1]; + + if (fText != NULL) + { + memcpy (new_fText, fText, fLength); + delete [] fText; + } + + memcpy (new_fText + fLength, buffer, len); + fLength += len; + new_fText[fLength] = '\0'; + + // replace Tab chars with spaces. + // todo: This should be temp until RunView can properly + // display tabs. + for( char* pos = new_fText + save; *pos; ++pos ) + { + if( '\t' == *pos ) + { + *pos = ' '; + } + } + + fText = new_fText; + + FigureFontColors (save, fore, back, font); + + if (fore == C_URL) + { + if (!fUrls) + fUrls = new urllist; + fUrls->AddItem (new URL (buffer, save, len)); + } + + if (fText[fLength - 1] == '\n') + { + FigureSpaces(); + FigureEdges (theme, width); + } +} + +void +Line::FigureSpaces (void) +{ + const char spacers[] = " \t\n-\\/"; + const char *buffer (fText); + size_t offset (0), n; + int16 count (0); + + delete [] fSpaces; + fSpace_count = 0; + while ((n = strcspn (buffer + offset, spacers)) < fLength - offset) + { + ++count; + offset += n + 1; + } + + fSpaces = new int16 [count]; + + offset = 0; + while ((n = strcspn (buffer + offset, spacers)) < fLength - offset) + { + fSpaces[fSpace_count++] = n + offset; + offset += n + 1; + } +} + +void +Line::FigureFontColors ( + int16 pos, + int16 fore, + int16 back, + int16 font) +{ + if (fFc_count) + { + int16 last_fore = -1; + int16 last_back = -1; + int16 last_font = -1; + int16 i; + + // we have fFcs, so we backtrack for last of each fWhich + for (i = fFc_count - 1; i >= 0; --i) + { + if (last_fore < 0 + && fFcs[i].fWhich == FORE_WHICH) + last_fore = i; + else if (last_back < 0 + && fFcs[i].fWhich == BACK_WHICH) + last_back = i; + else if (last_font < 0 + && fFcs[i].fWhich == FONT_WHICH) + last_font = i; + + if (last_fore >= 0 + && last_back >= 0 + && last_font >= 0) + break; + } + + // now figure out how many more we need + int16 count = 0; + if (fFcs[last_fore].fIndex != fore) + ++count; + if (fFcs[last_back].fIndex != back) + ++count; + if (fFcs[last_font].fIndex != font) + ++count; + + if (count) + { + FontColor *new_fFcs; + new_fFcs = new FontColor [fFc_count + count]; + memcpy (new_fFcs, fFcs, fFc_count * sizeof (FontColor)); + delete [] fFcs; + fFcs = new_fFcs; + + if (fFcs[last_fore].fIndex != fore) + { + fFcs[fFc_count].fWhich = FORE_WHICH; + fFcs[fFc_count].fOffset = pos; + fFcs[fFc_count].fIndex = fore; + ++fFc_count; + } + + if (fFcs[last_back].fIndex != back) + { + fFcs[fFc_count].fWhich = BACK_WHICH; + fFcs[fFc_count].fOffset = pos; + fFcs[fFc_count].fIndex = back; + ++fFc_count; + } + + if (fFcs[last_font].fIndex != font) + { + fFcs[fFc_count].fWhich = FONT_WHICH; + fFcs[fFc_count].fOffset = pos; + fFcs[fFc_count].fIndex = font; + ++fFc_count; + } + } + } + else + { + fFcs = new FontColor [fFc_count = 3]; + fFcs[0].fWhich = FORE_WHICH; + fFcs[0].fOffset = 0; + fFcs[0].fIndex = fore; + fFcs[1].fWhich = BACK_WHICH; + fFcs[1].fOffset = 0; + fFcs[1].fIndex = back; + fFcs[2].fWhich = FONT_WHICH; + fFcs[2].fOffset = 0; + fFcs[2].fIndex = font; + } +} + +void +Line::FigureEdges ( + Theme *theme, + float width) +{ + delete [] fEdges; + fEdges = new int16 [fLength]; + + int16 cur_fFcs (0), next_fFcs (0), cur_font (0); + + fEdge_count = 0; + while (cur_fFcs < fFc_count) + { + if (fFcs[cur_fFcs].fWhich == FONT_WHICH) + { + cur_font = cur_fFcs; + break; + } + + ++cur_fFcs; + } + + while (cur_fFcs < fFc_count) + { + int16 last_offset (fFcs[cur_fFcs].fOffset); + next_fFcs = cur_fFcs + 1; + + while (next_fFcs < fFc_count) + { + // We want to break at every difference + // but, we want to break on a font if available + if (fFcs[next_fFcs].fOffset > last_offset) + { + while (next_fFcs < fFc_count + && fFcs[next_fFcs].fWhich != FONT_WHICH + && next_fFcs + 1 < fFc_count + && fFcs[next_fFcs + 1].fOffset == fFcs[next_fFcs].fOffset) + ++next_fFcs; + + break; + } + ++next_fFcs; + } + + if (fFcs[cur_fFcs].fWhich == FONT_WHICH) + cur_font = cur_fFcs; + + int16 ccount; + int16 seglen; + + if (next_fFcs == fFc_count) + { + ccount = CountChars (fFcs[cur_fFcs].fOffset, fLength - fFcs[cur_fFcs].fOffset); + seglen = fLength - fFcs[cur_fFcs].fOffset; + } + else + { + ccount = CountChars ( + fFcs[cur_fFcs].fOffset, + fFcs[next_fFcs].fOffset - fFcs[cur_fFcs].fOffset); + seglen = fFcs[next_fFcs].fOffset - fFcs[cur_fFcs].fOffset; + } + + // const BFont &f (theme->FontAt (fFcs[cur_font].fIndex)); + TextRender *tr=theme->TextRenderAt (fFcs[cur_font].fIndex); + +#ifdef __INTEL__ + float eshift[ccount]; +#else + float *eshift = new float[ccount]; +#endif + + /* f.GetEscapements ( + fText + fFcs[cur_fFcs].fOffset, + ccount, + eshift);*/ + +// if(tr) + tr->GetEscapements ( + fText + fFcs[cur_fFcs].fOffset, + ccount, + eshift); + + // This is not perfect, because we are including the left edge, + // but BFont::GetEdges doesn't seem to work as we'd like + + int16 i; + float size=0; + +// if(tr) + size=tr->Size(width); + + + float incrementor = (fEdge_count > 0) ? fEdges[fEdge_count - 1] : 0; + + for (i = 0; i < ccount; ++i) + { + incrementor += eshift[i] * size; + + fEdges[fEdge_count+i] = (int16) incrementor; + + // this little backfTracking routine is necessary in the case where an fFcs change + // comes immediately after a UTF8-char, since all but the first edge will be 0 + // and thus the new edge's starting position will be thrown off if we don't + // backtrack to the beginning of the char + if ((fEdge_count + i > 0) && fEdges[fEdge_count + i - 1] == 0) + { + int32 temp = fEdge_count + i - 1; + while (fEdges[--temp] == 0); + fEdges[fEdge_count + i] += fEdges[temp]; + } + } + + for (i = fFcs[cur_fFcs].fOffset; i < fFcs[cur_fFcs].fOffset + seglen;) + { + int32 len (UTF8_CHAR_LEN (fText[i]) - 1); + + if (len) + { + int16 k; + for (k = fEdge_count + ccount - 1; k > i; --k) + fEdges[k + len] = fEdges[k]; + + for (k = 1; k <= len; ++k) + fEdges[i + k] = 0; + + ccount += len; + } + + i += len + 1; + } + + cur_fFcs = next_fFcs; + fEdge_count += ccount; +#ifndef __INTEL__ + delete [] eshift; +#endif + } + + SoftBreaks (theme, width); +} + + +void +Line::AddSoftBreak (SoftBreakEnd sbe, float &start, uint16 &fText_place, + int16 &font, float &width, float &start_width, Theme *theme) +{ + fText_place = sbe.fOffset; + + if (fSoftie_size < fSoftie_used + 1) + { + SoftBreak *new_softies; + + new_softies = new SoftBreak [fSoftie_size += SOFTBREAK_STEP]; + + if (fSofties) + { + memcpy (new_softies, fSofties, sizeof (SoftBreak) * fSoftie_used); + delete [] fSofties; + } + + fSofties = new_softies; + } + + // consume whitespace + while (fText_place + 1 < fLength + && isspace (fText[fText_place + 1])) + ++fText_place; + + fSofties[fSoftie_used].fOffset = fText_place; + fSofties[fSoftie_used].fHeight = 0.0; + fSofties[fSoftie_used].fAscent = 0.0; + + int16 last (font); + while (font < fFc_count) + { + //const BFont &f (theme->FontAt (fFcs[font].fIndex)); + TextRender *tr=theme->TextRenderAt (fFcs[font].fIndex); + + font_height fh; + float height; + + tr->GetHeight (&fh); + + height = ceil (fh.ascent + fh.descent + fh.leading); + if (fSofties[fSoftie_used].fHeight < height) + fSofties[fSoftie_used].fHeight = height; + if (fSofties[fSoftie_used].fAscent < fh.ascent) + fSofties[fSoftie_used].fAscent = fh.ascent; + + // now try and find next + while (++font < fFc_count) + if (fFcs[font].fWhich == FONT_WHICH) + break; + + if (font == fFc_count + || fFcs[font].fOffset > fText_place) + { + font = last; + break; + } + + last = font; + } + + if (fText_place < fLength) + start = fEdges[fText_place]; + + fBottom += fSofties[fSoftie_used++].fHeight; + fText_place += UTF8_CHAR_LEN (fText[fText_place]); + width = start_width - MARGIN_INDENT; +} + +void +Line::SoftBreaks (Theme *theme, float start_width) +{ + float margin (ceil (MARGIN_WIDTH / 2.0)); + float width (start_width); + float start (0.0); + uint16 fText_place (0); + int16 space_place (0); + int16 font (0); + + fSoftie_used = 0; + fBottom = fTop; + + // find first font + while (font < fFc_count && fFcs[font].fWhich != FONT_WHICH) + ++font; + + while (fText_place < fLength) + { + while (space_place < fSpace_count) + { + if (fEdges[fSpaces[space_place]] - start > width) + break; + + ++space_place; + } + + // we've reached the end of the line (but it might not all fit) + // or we only have one space, so we check if we need to split the word + if (space_place == fSpace_count + || space_place == 0 + || fSpaces[space_place - 1] < fText_place) + { + // everything fits.. how wonderful (but we want at least one softbreak) + if (fEdge_count == 0) + { + AddSoftBreak (SoftBreakEnd(fLength - 1), start, fText_place, font, width, start_width, theme); + break; + } + + int16 i (fEdge_count - 1); + + while (fEdges[i] == 0) + --i; + + if (fEdges[i] - start <= width) + { + AddSoftBreak (SoftBreakEnd(fLength - 1), start, fText_place, font, width, start_width, theme); + continue; + } + + // we force at least one character + // your font may be a little too large for your window! + fText_place += UTF8_CHAR_LEN (fText[fText_place]); + while (fText_place < fLength) + { + if (fEdges[fText_place] - start > width - margin) + break; + + fText_place += UTF8_CHAR_LEN (fText[fText_place]); + } + AddSoftBreak (SoftBreakEnd(fText_place), start, fText_place, font, width, start_width, theme); + continue; + } + + // we encountered more than one space, so we rule out having to + // split the word, if the current word will fit within the bounds + int16 ccount1, ccount2; + --space_place; + + ccount1 = fSpaces[space_place]; + ccount2 = fSpaces[space_place+1] - ccount1; + + int16 i (ccount1 - 1); + while (fEdges[i] == 0) + --i; + + if (fEdges[ccount1 + ccount2] - fEdges[i] < width - margin) + { + AddSoftBreak (SoftBreakEnd(fSpaces[space_place]), start, fText_place, font, width, start_width, theme); + continue; + } + + // We need to break up the really long word + fText_place = fSpaces[space_place]; + while (fText_place < fEdge_count) + { + if ((fEdges[fText_place] - start) > width) + break; + + fText_place += UTF8_CHAR_LEN (fText[fText_place]); + } + } + + fBottom -= 1.0; +} + +int16 +Line::CountChars (int16 pos, int16 len) +{ + int16 ccount (0); + + if (pos >= fLength) + return ccount; + + if (pos + len > fLength) + len = fLength - pos; + + register int16 i = pos; + while (i < pos + len) + { + i += UTF8_CHAR_LEN(fText[i]); + ++ccount; + } + + return ccount; +} + +size_t +Line::SetStamp (const char *format, bool was_on) +{ + size_t size (0); + int32 i (0); + + if (was_on) + { + int16 offset (fFcs[4].fOffset + 1); + + if (fUrls) + { + for (i = 0; i < fUrls->CountItems(); i++) + fUrls->ItemAt(i)->fOffset -= offset; + } + memmove (fText, fText + offset, fLength - offset); + fText[fLength -= offset] = '\0'; + + for (i = 6; i < fFc_count; ++i) + { + fFcs[i].fOffset -= offset; + fFcs[i - 6] = fFcs[i]; + } + + fFc_count -= 6; + } + + if (format) + { + char buffer[1024]; + struct tm curTime; + + localtime_r (&fStamp, &curTime); + size = strftime (buffer, 1023, format, &curTime); + if (fUrls) + { + for (i = 0; i < fUrls->CountItems(); i++) + fUrls->ItemAt(i)->fOffset += size; + } + + char *new_fText; + + new_fText = new char [fLength + size + 2]; + memcpy (new_fText, buffer, size); + new_fText[size++] = ' '; + new_fText[size] = '\0'; + + if (fText) + { + memcpy (new_fText + size, fText, fLength); + delete [] fText; + } + + fText = new_fText; + fText[fLength += size] = '\0'; + + FontColor *new_fFcs; + new_fFcs = new FontColor [fFc_count + 6]; + + if (fFcs) + { + memcpy ( + new_fFcs + 6, + fFcs, + fFc_count * sizeof (FontColor)); + delete [] fFcs; + } + fFcs = new_fFcs; + fFc_count += 6; + + fFcs[0].fWhich = FORE_WHICH; + fFcs[0].fIndex = Theme::TimestampFore; + fFcs[0].fOffset = 0; + fFcs[1].fWhich = BACK_WHICH; + fFcs[1].fIndex = Theme::TimestampBack; + fFcs[1].fOffset = 0; + fFcs[2].fWhich = FONT_WHICH; + fFcs[2].fIndex = Theme::TimestampFont; + fFcs[2].fOffset = 0; + + fFcs[3].fWhich = FORE_WHICH; + fFcs[3].fIndex = Theme::TimespaceFore; + fFcs[3].fOffset = size - 1; + fFcs[4].fWhich = BACK_WHICH; + fFcs[4].fIndex = Theme::TimespaceBack; + fFcs[4].fOffset = size - 1; + fFcs[5].fWhich = FONT_WHICH; + fFcs[5].fIndex = Theme::TimespaceFont; + fFcs[5].fOffset = size - 1; + + for (i = 6; i < fFc_count; ++i) + fFcs[i].fOffset += size; + } + + return size; +} + +void +Line::SelectWord (int16 *start, int16 *end) +{ + int16 start_tmp (*start), end_tmp (*end); + + while(start_tmp > 0 && fText[start_tmp-1] != ' ') + start_tmp--; + + while ((end_tmp - 1) < fLength && fText[end_tmp] != ' ') + end_tmp++; + + while (end_tmp >= fLength) + --end_tmp; + + *start = start_tmp; + *end = end_tmp; +} + +bool +RunView::FindText(const char *text) +{ + bool result (false); + if (text != NULL) + { + for (int32 i = 0; i < fLine_count; i++) + { + char *offset (NULL); + if ((offset = strstr((const char *)fLines[i], text)) != NULL) + { + SelectPos start (i, offset - text), + end (i, (offset - text) + strlen(text)); + Select(start, end); + ScrollTo(0.0, fLines[i]->fTop); + result = true; + break; + } + } + } + return result; +} + +void RunView::LoadURL(const char *url) { + BString argument (url); + + if (argument.FindFirst ("://") == B_ERROR) + { + + if (argument.IFindFirst ("www") == 0) + argument.Prepend ("http://"); + + else if (argument.IFindFirst ("ftp") == 0) + argument.Prepend ("ftp://"); + + else + { //by xeD + BString map; + if(urls.FindString(url,&map) == B_OK) + argument.SetTo(map); + + } + + } + + const char *args[] = { argument.String(), 0 }; + + if (argument.IFindFirst ("file:") == 0) + { + // The URL is guaranteed to be at least "file:/" + BString file(argument.String() + 5); + + // todo: Should probably see if the file exists before going through + // all this, but, oh well... ;) + file.Prepend("/boot/beos/system/Tracker "); + file += " &"; // just in case + + system(file.String()); + } + else if (argument.IFindFirst ("mailto:") == 0) + { + be_roster->Launch ("text/x-email", 1, const_cast(args)); + } + else //by xeD + if (argument.IFindFirst ("action:") == 0) + { + InvokeAction(argument.String()); + } + else + if(fDefaultURLAction){ + //printf("fDefaultURLAction\n"); + fDefaultURLAction->Perform(BString(argument.String())); + } + else{ + //printf("no fDefaultURLAction!\n"); + be_roster->Launch ("text/html", 1, const_cast(args)); + } +} + +void RunView::ScrollToBottom(void) { + if (fLine_count != 0) { + BScrollBar *scroll = fScroller->ScrollBar(B_VERTICAL); + if (scroll != NULL) scroll->SetValue(fLines[fLine_count - 1]->fBottom); + ScrollTo(0.0, fLines[fLine_count - 1]->fBottom); + }; +}; + +void RunView::ScrollToSelection(void) { + if (fLine_count == 0) return; + + if (fSp_start != fSp_end) + ScrollTo(0.0, fLines[fSp_start.fLine]->fTop); + +}; + +//by xed +void +RunView::ClearActions(){ + actions.MakeEmpty(); +} + +void +RunView::AddAction(const char* symbolicName,RVAction* action){ + actions.AddPointer(symbolicName,(void*)action); +} + +void +RunView::SetDefaultOpenURLAction(RVAction* action){ + fDefaultURLAction=action; +} + +RVAction* +RunView::FindAction(const char* symbolicName){ + RVAction* action=NULL; + actions.FindPointer(symbolicName,(void**)&action); + return action; +} + +//should be private.. +void +RunView::InvokeAction(BString mangledName){ + mangledName.RemoveFirst("action://"); + int from = mangledName.FindFirst("("); + + BString actionName; + actionName.SetTo(mangledName,from); + + mangledName.Remove(0,from+1); + int to = mangledName.FindFirst(")"); + + BString param; + param.SetTo(mangledName,to); + + RVAction* action=FindAction(actionName.String()); + if(action) + action->Perform(param); + else + debugger(actionName.String()); +} + +//-- diff --git a/library/librunview/SmileTextRender.h b/library/librunview/SmileTextRender.h new file mode 100644 index 0000000..9e83173 --- /dev/null +++ b/library/librunview/SmileTextRender.h @@ -0,0 +1,66 @@ +#ifndef _SmileTextRender_H_ +#define _SmileTextRender_H_ + +#include "TextRender.h" +#include +#include + +#include +#include +#include +#include + +#include "Emoticor.h" + +extern float gEmoticonSize; + +class SmileTextRender : public TextRender +{ + public: + SmileTextRender():TextRender(){}; + + virtual ~SmileTextRender() {}; + + virtual void Render(BView *target,const char* txt,int16 num,BPoint pos) { + + BBitmap *pointer=NULL; + BString f(txt,num); + + if(emoticor->config->FindPointer(f.String(),(void**)&pointer)==B_OK) + { + target->SetDrawingMode( B_OP_ALPHA ); + target->DrawBitmapAsync( pointer,BPoint(pos.x, pos.y- (gEmoticonSize/2)) ); + target->SetDrawingMode( B_OP_OVER ); + +/* BRect r = pointer->Bounds(); + r.OffsetTo(pos); + r.OffsetBy(0, - (gEmoticonSize/2 + 2) ); + r.InsetBy(-1,-1); + + rgb_color oldCol = target->HighColor(); + target->SetHighColor( 255,0,0 ); + target->StrokeRect( r ); + target->SetHighColor( oldCol ); +*/ + } + }; + + + virtual float Size(){ return gEmoticonSize;} + + virtual void GetHeight(font_height *h) + { + h->ascent=gEmoticonSize/2; + h->descent=gEmoticonSize/2; + h->leading=0; + }; + + virtual void + GetEscapements(const char * /*charArray*/, int32 numChars,float escapementArray[]) + { + //font.GetEscapements(charArray,numChars,escapementArray); + escapementArray[0]=1; + for(int i=1;i +#include +#include +#include +#include +#include + +#include "Theme.h" +#include "NormalTextRender.h" + +int16 Theme::TimestampFore = 0; +int16 Theme::TimestampBack = 0; +int16 Theme::TimestampFont = 0; +int16 Theme::TimespaceFore = 1; +int16 Theme::TimespaceBack = 1; +int16 Theme::TimespaceFont = 1; +int16 Theme::NormalFore = 2; +int16 Theme::NormalBack = 2; +int16 Theme::NormalFont = 2; +int16 Theme::SelectionBack = 3; + +//at least we use a 'normal' text render + + +Theme::Theme ( + const char *n, + int16 foreCount, + int16 backCount, + int16 renderCount) + : name (NULL), + fores (NULL), + backs (NULL), + text_renders (NULL), + fore_count (max_c (foreCount, 4)), + back_count (max_c (backCount, 4)), + render_count (max_c (renderCount, 4)) +{ + name = strcpy (new char [strlen (n) + 1], n); + + fores = new rgb_color [fore_count]; + backs = new rgb_color [back_count]; + + normal_textrender = new NormalTextRender(be_plain_font); + + text_renders = (TextRender**)malloc(render_count*sizeof(TextRender*)); + for ( int i=0; i= fore_count || which < 0) + return color; + + return fores[which]; +} + +const rgb_color +Theme::BackgroundAt (int16 which) const +{ + rgb_color color = {255, 255, 255, 255}; + + if (which >= back_count || which < 0) + return color; + + return backs[which]; +} +/* +const BFont & +Theme::FontAt (int16 which) const +{ + if (which >= font_count || which < 0) + return *be_plain_font; + + return fonts[which]; +} +*/ + +TextRender* +Theme::TextRenderAt (int16 which) +{ + if ( which < 0 ){ + //printf("Theme::TextRenderAt(): which < 0 (%d)\n", which); + return normal_textrender; + } + if ( which >= render_count ){ + //printf("Theme::TextRenderAt(): which >= render_count (%d, %d)\n", which, render_count); + return normal_textrender; + } + + return text_renders[which]; +} + +bool +Theme::SetForeground (int16 which, const rgb_color color) +{ + if (which >= fore_count || which < 0) + return false; + + fores[which] = color; + return true; +} + +bool +Theme::SetBackground (int16 which, const rgb_color color) +{ + if (which >= back_count || which < 0) + return false; + + backs[which] = color; + return true; +} + + +bool +Theme::SetTextRender(int16 which,TextRender *trender) +{ + + + if (which >= render_count || which < 0 || !trender) + return false; + + text_renders[which] = trender; + return true; +} + +void +Theme::AddView (BView *view) +{ + list.AddItem (view); +} + +void +Theme::RemoveView (BView *view) +{ + list.RemoveItem (view); +} + diff --git a/library/librunview/URLCrunch.cpp b/library/librunview/URLCrunch.cpp new file mode 100644 index 0000000..c8aaf7e --- /dev/null +++ b/library/librunview/URLCrunch.cpp @@ -0,0 +1,99 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Vision. + * + * The Initial Developer of the Original Code is The Vision Team. + * Portions created by The Vision Team are + * Copyright (C) 1999, 2000, 2001 The Vision Team. All Rights + * Reserved. + * + * Contributor(s): Rene Gollent + * Todd Lair + */ + +#include + +#include "URLCrunch.h" + +URLCrunch::URLCrunch (const char *data, int32 len) + : buffer (""), + current_pos (0) +{ + buffer.Append (data, len); +} + +URLCrunch::~URLCrunch (void) +{ +} + +int32 +URLCrunch::Crunch (BString *url) +{ + if (current_pos >= buffer.Length()) + return B_ERROR; + + const int32 tagNum = 7; + const char *tags[tagNum] = + { + "http://", + "https://", + "www.", + "ftp://", + "ftp.", + "file:/", + "mailto:" + }; + + int32 marker (buffer.Length()); + int32 pos (current_pos); + int32 url_length (0); + int32 markers[tagNum]; + int32 i(0); + + for (i = 0; i < tagNum; ++i) + markers[i] = buffer.IFindFirst (tags[i], pos); + + for (i = 0; i < tagNum; ++i) + + if (markers[i] != B_ERROR + && markers[i] < marker) + { + url_length = markers[i] + strlen(tags[i]); + + url_length += strcspn (buffer.String() + url_length, " \t\n|\\<>\")(][}{;'*^"); + + + int len (strlen (tags[i])); + + if (url_length - markers[i] > len + && (isdigit (buffer[markers[i] + len]) + || isalpha (buffer[markers[i] + len]))) + { + marker = markers[i]; + pos = url_length + 1; + url_length -= marker; + } + else + pos = markers[i] + 1; + } + + if (marker < buffer.Length()) + { + *url = ""; + + url->Append (buffer.String() + marker, url_length); + } + + current_pos = pos; + + return marker < buffer.Length() ? marker : B_ERROR; +} diff --git a/library/librunview/URLCrunch.h b/library/librunview/URLCrunch.h new file mode 100644 index 0000000..e410e16 --- /dev/null +++ b/library/librunview/URLCrunch.h @@ -0,0 +1,40 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Vision. + * + * The Initial Developer of the Original Code is The Vision Team. + * Portions created by The Vision Team are + * Copyright (C) 1999, 2000, 2001 The Vision Team. All Rights + * Reserved. + * + * Contributor(s): Todd Lair + * + */ + +#ifndef URLCRUNCH_H_ +#define URLCRUNCH_H_ + +#include + +class URLCrunch +{ + BString buffer; + int32 current_pos; + + public: + + URLCrunch (const char *, int32); + ~URLCrunch (void); + int32 Crunch (BString *); +}; + +#endif diff --git a/library/librunview/Utilities.cpp b/library/librunview/Utilities.cpp new file mode 100644 index 0000000..18e6394 --- /dev/null +++ b/library/librunview/Utilities.cpp @@ -0,0 +1,378 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Vision. + * + * The Initial Developer of the Original Code is The Vision Team. + * Portions created by The Vision Team are + * Copyright (C) 1999, 2000, 2001 The Vision Team. All Rights + * Reserved. + * + * Contributor(s): Wade Majors + * Todd Lair + * Andrew Bazan + */ + +#include +#include + +#include +#include +#include +#include +#include + +const float doubleClickThresh = 6; + +BString +GetWord (const char *cData, int32 wordNeeded) +{ + /* + * Function purpose: Get word number {wordNeeded} from {cData} + * (space delimited) + */ + + BString data (cData); + BString buffer ("-9z99"); + int32 wordAt (1), place (0); + + while (wordAt != wordNeeded && place != B_ERROR) + { + if ((place = data.FindFirst ('\x20', place)) != B_ERROR) + if (++place < data.Length() + && data[place] != '\x20') + ++wordAt; + } + + if (wordAt == wordNeeded + && place != B_ERROR + && place < data.Length()) + { + int32 end (data.FindFirst ('\x20', place)); + + if (end == B_ERROR) + end = data.Length(); + + data.CopyInto (buffer, place, end - place); + } + + return buffer; +} + +BString +GetWordColon (const char *cData, int32 wordNeeded) +{ + /* + * Function purpose: Get word number {wordNeeded} from {cData} + * (colon delimited) + */ + + BString data (cData); + BString buffer ("-9z99"); + int32 wordAt (1), place (0); + + while (wordAt != wordNeeded && place != B_ERROR) + { + if ((place = data.FindFirst (':', place)) != B_ERROR) + if (++place < data.Length() + && data[place] != ':') + ++wordAt; + } + + if (wordAt == wordNeeded + && place != B_ERROR + && place < data.Length()) + { + int32 end (data.FindFirst (':', place)); + + if (end == B_ERROR) + end = data.Length(); + + data.CopyInto (buffer, place, end - place); + } + + return buffer; +} + +BString +RestOfString (const char *cData, int32 wordStart) +{ + /* + * Function purpose: Get word number {wordStart} from {cData} + * append the rest of the string after {wordStart} + * (space delimited) + */ + + BString data (cData); + int32 wordAt (1), place (0); + BString buffer ("-9z99"); + + while (wordAt != wordStart && place != B_ERROR) + { + if ((place = data.FindFirst ('\x20', place)) != B_ERROR) + if (++place < data.Length() + && data[place] != '\x20') + ++wordAt; + } + + if (wordAt == wordStart + && place != B_ERROR + && place < data.Length()) + data.CopyInto (buffer, place, data.Length() - place); + + return buffer; +} + +BString +GetNick (const char *cData) +{ + /* + * Function purpose: Get nickname from {cData} + * + * Expected format: nickname!user@host.name + */ + + BString data (cData); + BString theNick; + + for (int32 i = 1; i < data.Length() && data[i] != '!' && data[i] != '\x20'; ++i) + theNick += data[i]; + + return theNick; +} + +BString +GetIdent (const char *cData) +{ + /* + * Function purpose: Get identname/username from {cData} + * + * Expected format: nickname!user@host.name + */ + + BString data (GetWord(cData, 1)); + BString theIdent; + int32 place[2]; + + if ((place[0] = data.FindFirst ('!')) != B_ERROR + && (place[1] = data.FindFirst ('@')) != B_ERROR) + { + ++(place[0]); + data.CopyInto (theIdent, place[0], place[1] - place[0]); + } + + return theIdent; +} + +BString +GetAddress (const char *cData) +{ + /* + * Function purpose: Get address/hostname from {cData} + * + * Expected format: nickname!user@host.name + */ + + BString data (GetWord(cData, 1)); + BString address; + int32 place; + + if ((place = data.FindFirst ('@')) != B_ERROR) + { + int32 length (data.FindFirst ('\x20', place)); + + if (length == B_ERROR) + length = data.Length(); + + ++place; + data.CopyInto (address, place, length - place); + } + + return address; +} + +BString +TimeStamp() +{ + /* + * Function purpose: Return the timestamp string + * + */ + +// if(!vision_app->GetBool ("timestamp")) +// return ""; + +// const char *ts_format (vision_app->GetString ("timestamp_format")); + const char *ts_format = "[%H:%M]"; + + time_t myTime (time (0)); + tm curTime; + localtime_r (&myTime, &curTime); + + char tempTime[32]; + tempTime[strftime (tempTime, 31, ts_format, &curTime)] = '\0'; + + return BString (tempTime).Append('\x20', 1); +} + + +BString +ExpandKeyed ( + const char *incoming, + const char *keys, + const char **expansions) +{ + BString buffer; + + while (incoming && *incoming) + { + if (*incoming == '$') + { + const char *place; + + ++incoming; + + if ((place = strchr (keys, *incoming)) != 0) + buffer += expansions[place - keys]; + else + buffer += *incoming; + } + else + buffer += *incoming; + + ++incoming; + } + + buffer += "\n"; + + return buffer; +} + +BString +StringToURI (const char *string) +{ + /* + * Function purpose: Converts {string} to a URI safe format + * + */ + + BString buffer (string); + buffer.ToLower(); + buffer.ReplaceAll ("%", "%25"); // do this first! + buffer.ReplaceAll ("\n", "%20"); + buffer.ReplaceAll (" ", "%20"); + buffer.ReplaceAll ("\"", "%22"); + buffer.ReplaceAll ("#", "%23"); + buffer.ReplaceAll ("@", "%40"); + buffer.ReplaceAll ("`", "%60"); + buffer.ReplaceAll (":", "%3A"); + buffer.ReplaceAll ("<", "%3C"); + buffer.ReplaceAll (">", "%3E"); + buffer.ReplaceAll ("[", "%5B"); + buffer.ReplaceAll ("\\", "%5C"); + buffer.ReplaceAll ("]", "%5D"); + buffer.ReplaceAll ("^", "%5E"); + buffer.ReplaceAll ("{", "%7B"); + buffer.ReplaceAll ("|", "%7C"); + buffer.ReplaceAll ("}", "%7D"); + buffer.ReplaceAll ("~", "%7E"); + return buffer; +} + +BString +DurationString (int64 value) +{ + /* + * Function purpose: Return a duration string based on {value} + * + */ + + BString duration; + bigtime_t micro = value; + bigtime_t milli = micro/1000; + bigtime_t sec = milli/1000; + bigtime_t min = sec/60; + bigtime_t hours = min/60; + bigtime_t days = hours/24; + + char message[512] = ""; + if (days) + sprintf(message, "%Ld day%s ",days,days!=1?"s":""); + + if (hours%24) + sprintf(message, "%s%Ld hr%s ",message, hours%24,(hours%24)!=1?"s":""); + + if (min%60) + sprintf(message, "%s%Ld min%s ",message, min%60, (min%60)!=1?"s":""); + + sprintf(message, "%s%Ld.%Ld sec%s",message, sec%60, (milli%1000), (sec%60)!=1?"s":""); + + duration += message; + + return duration; +} + + +const char * +RelToAbsPath (const char *append_) +{ + app_info ai; + be_app->GetAppInfo (&ai); + + BEntry entry (&ai.ref); + BPath path; + entry.GetPath (&path); + path.GetParent (&path); + path.Append (append_); + + return path.Path(); +} + + +int32 +Get440Len (const char *cData) +{ + BString data (cData); + + if (data.Length() < 440) + return data.Length(); + else + { + int32 place (data.FindLast ('\x20', 440)); + if (place == B_ERROR) + return 440; + return place; + } +} + +uint16 +CheckClickCount(BPoint point, BPoint &lastClick, bigtime_t sysTime, bigtime_t &lastClickTime, int16 &clickCount) +{ + // check time and proximity + BPoint delta = point - lastClick; + + bigtime_t timeDelta = sysTime - lastClickTime; + + bigtime_t doubleClickSpeed; + get_click_speed(&doubleClickSpeed); + + lastClickTime = sysTime; + + if (timeDelta < doubleClickSpeed + && fabs(delta.x) < doubleClickThresh + && fabs(delta.y) < doubleClickThresh) + return (++clickCount); + + lastClick = point; + clickCount = 1; + return clickCount; +} + diff --git a/library/librunview/Utilities.h b/library/librunview/Utilities.h new file mode 100644 index 0000000..80af0ca --- /dev/null +++ b/library/librunview/Utilities.h @@ -0,0 +1,70 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Vision. + * + * The Initial Developer of the Original Code is The Vision Team. + * Portions created by The Vision Team are + * Copyright (C) 1999, 2000, 2001 The Vision Team. All Rights + * Reserved. + * + * Contributor(s): Wade Majors + * Todd Lair + * Andrew Bazan + */ + +#ifndef _UTILITIES_H +#define _UTILITIES_H_ + +#include + +template class AutoDestructor { + public: + AutoDestructor(T *t) + { + fObject = t; + } + + virtual ~AutoDestructor(void) + { + delete fObject; + } + + void SetTo(T *t) + { + delete fObject; + fObject = t; + } + + private: + T *fObject; +}; + + +class BMessage; +class BPoint; + +BString GetWord (const char *, int32); +BString RestOfString (const char *, int32); +BString GetNick (const char *); +BString GetIdent (const char *); +BString GetAddress (const char *); +BString TimeStamp (void); +BString ExpandKeyed (const char *, const char *, const char **); +BString DurationString (int64); +BString StringToURI (const char *); +const char *RelToAbsPath (const char *); +BString GetWordColon (const char *, int32); +int32 Get440Len (const char *); +uint16 CheckClickCount(BPoint, BPoint &, bigtime_t, bigtime_t &, int16 &); + + +#endif diff --git a/library/librunview/include/RVAction.h b/library/librunview/include/RVAction.h new file mode 100644 index 0000000..4bbeebb --- /dev/null +++ b/library/librunview/include/RVAction.h @@ -0,0 +1,15 @@ +#ifndef _RVAction_h_ +#define _RVAction_h_ + +class RVAction +{ + public: + + virtual ~RVAction(){}; + + virtual status_t Perform(BString param) = 0; + virtual BString GetDescription() = 0; + +}; + +#endif diff --git a/library/librunview/include/RunView.h b/library/librunview/include/RunView.h new file mode 100644 index 0000000..8cb55d6 --- /dev/null +++ b/library/librunview/include/RunView.h @@ -0,0 +1,249 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Vision. + * + * The Initial Developer of the Original Code is The Vision Team. + * Portions created by The Vision Team are + * Copyright (C) 1999, 2000, 2001 The Vision Team. All Rights + * Reserved. + * + * Contributor(s): Rene Gollent + * Todd Lair + */ + +#ifndef RUNVIEW_H_ +#define RUNVIEW_H_ + +#define LINE_COUNT 1000 + +#include + + +//#include "main.h" + +struct Line; +class RVAction; //by xeD +class Theme; +class RunView; +class BScrollView; +class BCursor; +class BMessageRunner; +class BPopUpMenu; + + +const uint32 kResizeMessage = 'irsz'; +const uint32 M_LOOKUP_WEBSTER = 'rvlw'; +const uint32 M_LOOKUP_GOOGLE = 'rvlg'; +const uint32 M_LOOKUP_ACRONYM = 'rvla'; +const uint32 M_CLEAR = 'rvcl'; + +const uint32 M_OFFVIEW_SELECTION = 'rvos'; +const uint32 M_THEME_FOREGROUND_CHANGE = 'rvtf'; +const uint32 M_THEME_BACKGROUND_CHANGE = 'rvtb'; +const uint32 M_THEME_FONT_CHANGE = 'rvto'; + +#define C_URL 0 +#define C_TIMESTAMP 1 +#define C_TEXT 2 +#define C_OWNNICK 3 +#define C_OTHERNICK 4 +#define C_ACTION 5 +#define C_SELECTION 6 +#define C_TIMESTAMP_DUMMY 7 // Needed to fake a TS +#define MAX_COLORS 8 + +/* +#define F_URL 0 +#define F_TEXT 1 +#define F_TIMESTAMP 2 +#define F_ACTION 3 +#define F_EMOTICON 4 // new style by xeD ;) +#define F_STYLE_0 4 // new style by xeD ;) +#define F_TIMESTAMP_DUMMY 5 // Needed to fake TS +#define MAX_FONTS 6 +*/ + +enum { + F_URL = 0, + F_TEXT, + F_TIMESTAMP, + F_ACTION, + F_EMOTICON, + F_STYLE_0, + F_STYLE_1, + F_STYLE_2, + F_TIMESTAMP_DUMMY, //DON'T TOUCH NOT USE + MAX_FONTS //DON'T TOUCH NOT USE +}; + +class SelectPos +{ + public: + + int16 fLine; + int16 fOffset; + + SelectPos ( + int16 selLine = 0, + int16 selOffset = 0) + : fLine (selLine), + fOffset (selOffset) + { } + + SelectPos (const SelectPos &pos) + : fLine (pos.fLine), + fOffset (pos.fOffset) + { } + + ~SelectPos (void) + { } + + SelectPos &operator = (const SelectPos &pos) + { + fLine = pos.fLine; + fOffset = pos.fOffset; + + return *this; + } + + inline int operator == (const SelectPos &rhs) const + { + return ((fLine == rhs.fLine) && (fOffset == rhs.fOffset)); + } + + inline int operator != (const SelectPos &rhs) const + { + return (!(*this == rhs)); + } + + +}; + +class RunView : public BView +{ + BScrollView *fScroller; + BCursor *fURLCursor; + Theme *fTheme; + + Line *fWorking; + Line *fLines[LINE_COUNT]; + int16 fLine_count, + fClickCount; + + char *fStamp_format; + char *fClipping_name; + + SelectPos fSp_start, fSp_end; + + int32 fTracking; + SelectPos fTrack_offset; + BMessageRunner *fOff_view_runner; + bigtime_t fOff_view_time; + + bool fResizedirty; + bool fFontsdirty; + BPopUpMenu *fMyPopUp; + BPoint fLastClick; + bigtime_t fLastClickTime; + + BMessage urls; //by xeD + BMessage actions; //by xeD + + bool fIndent; //by xeD + + RVAction* fDefaultURLAction; //by xeD + + RVAction* FindAction(const char* symbolicName); //by xeD + void InvokeAction(BString mangledName); //by xeD + + bool RecalcScrollBar (bool constrain); + void ResizeRecalc (void); + void FontChangeRecalc (void); + void ExtendTrackingSelect (BPoint); + void ShiftTrackingSelect (BPoint, bool, bigtime_t); + void CheckURLCursor (BPoint); + bool CheckURL(BPoint); //by xeD + BString GetURL(BPoint); + + void BuildPopUp (BPoint point); + + bool CheckClickBounds (const SelectPos &, const BPoint &) const; + void LoadURL(const char *url); + + public: + + RunView ( + BRect, + const char *, + Theme *, + uint32 = B_FOLLOW_LEFT | B_FOLLOW_TOP, + uint32 = 0UL); + virtual ~RunView (void); + + virtual void AttachedToWindow (void); + virtual void DetachedFromWindow (void); + virtual void FrameResized (float, float); + + virtual void TextResized(BRect /*r*/){}; //by xeD Callback when text bounds changed. + virtual float ExtraTextSize(){ return 0;}; //by xeD does we use more Vert space than the text? + + virtual void TargetedByScrollView (BScrollView *); + virtual void Show (); + virtual void Draw (BRect); + virtual void MessageReceived (BMessage *); + + virtual void SetViewColor (rgb_color); + void SetViewColor (uchar red, uchar green, uchar blue, uchar alpha = 255) + { rgb_color color = {red, green, blue, alpha}; SetViewColor (color); } + + + virtual void MouseDown (BPoint); + virtual void MouseMoved (BPoint, uint32, const BMessage *); + virtual void MouseUp (BPoint); + + //by xeD + void SetIndentWrappedLine(bool val){ fIndent = val;} + + void Append (const char *, int32, int16, int16, int16); + void Append (const char *, int16, int16, int16); + void AppendURL(const char *,const char *,int16 font); + void AppendURL(const char *,const char *,int16 back,int16 font); + + void ClearActions(); //by xeD + void AddAction(const char* symbolicName,RVAction*); //by xeD + void SetDefaultOpenURLAction(RVAction*); //by xeD + + void Clear (void); + + int16 LineCount (void) const; + const char *LineAt (int16) const; + + void SetTimeStampFormat (const char *); + void SetTheme (Theme *); + + SelectPos PositionAt (BPoint) const; + BPoint PointAt (SelectPos) const; + + BRect GetTextFrame (const SelectPos &, const SelectPos &) const; + bool IntersectSelection (const SelectPos &, const SelectPos &) const; + void GetSelectionText (BString &) const; + void Select (const SelectPos &, const SelectPos &); + void SelectAll (void); + void SetClippingName (const char *); + bool FindText(const char *); + + void ScrollToBottom(void); + void ScrollToSelection(void); + +}; + +#endif diff --git a/library/librunview/include/TextRender.h b/library/librunview/include/TextRender.h new file mode 100644 index 0000000..700fcc3 --- /dev/null +++ b/library/librunview/include/TextRender.h @@ -0,0 +1,25 @@ +#ifndef _TextRender_H_ +#define _TextRender_H_ + +class TextRender +{ + public: + TextRender(){}; + virtual ~TextRender() {}; + + virtual void Render(BView *target,const char*,int16 num,BPoint pos,BRect drawRect) = 0; + + virtual void GetHeight(font_height *height) = 0; + virtual void GetEscapements(const char charArray[], int32 numChars,float escapementArray[])=0; + virtual float Size(float maxwidth) = 0; + + virtual void MarginAfterTheText(BView *target,rgb_color view_color, BRect rect){ + // Margin after fText + target->SetDrawingMode (B_OP_COPY); + target->SetLowColor (view_color); + target->FillRect (rect, B_SOLID_LOW); + } + // + +}; +#endif diff --git a/library/librunview/include/Theme.h b/library/librunview/include/Theme.h new file mode 100644 index 0000000..762be7d --- /dev/null +++ b/library/librunview/include/Theme.h @@ -0,0 +1,109 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Vision. + * + * The Initial Developer of the Original Code is The Vision Team. + * Portions created by The Vision Team are + * Copyright (C) 1999, 2000, 2001 The Vision Team. All Rights + * Reserved. + * + * Contributor(s): Rene Gollent + * Todd Lair + */ + +#ifndef THEME_H_ +#define THEME_H_ + +#include +#include +#include + +#include "TextRender.h" + +class BView; +class NormalTextRender; + +class Theme +{ + char *name; + rgb_color *fores; + rgb_color *backs; + //BFont *fonts; + TextRender **text_renders; //FIX!! + + int16 fore_count; + int16 back_count; + int16 render_count; + + BList list; + sem_id sid; + + public: + + static int16 TimestampFore; + static int16 TimestampBack; + static int16 TimestampFont; + static int16 TimespaceFore; + static int16 TimespaceBack; + static int16 TimespaceFont; + static int16 NormalFore; + static int16 NormalBack; + static int16 NormalFont; + static int16 SelectionBack; + + Theme ( + const char *, + int16, + int16, + int16); + virtual ~Theme (void); + + const char *Name (void) const + { return name; } + + void ReadLock (void); + void ReadUnlock (void); + void WriteLock (void); + void WriteUnlock (void); + + int16 CountForegrounds (void) const; + int16 CountBackgrounds (void) const; +// int16 CountFonts (void) const; + int16 CountTextRenders (void) const; + + const rgb_color ForegroundAt (int16) const; + const rgb_color BackgroundAt (int16) const; + + //const BFont &FontAt (int16) const; + + TextRender* TextRenderAt(int16); + + bool SetForeground (int16, const rgb_color); + bool SetForeground (int16 w, uchar r, uchar g, uchar b, uchar a = 255) + { rgb_color color = {r, g, b, a}; return SetForeground (w, color); } + bool SetBackground (int16, const rgb_color); + bool SetBackground (int16 w, uchar r, uchar g, uchar b, uchar a = 255) + { rgb_color color = {r, g, b, a}; return SetBackground (w, color); } + + //bool SetFont (int16, const BFont &); + bool SetTextRender(int16, TextRender *); + + + + + void AddView (BView *); + void RemoveView (BView *); + + NormalTextRender *normal_textrender; +}; + +#endif diff --git a/release/Language/Dictionaries/BePodder.blBY b/release/Language/Dictionaries/BePodder.blBY new file mode 100644 index 0000000..296dac8 --- /dev/null +++ b/release/Language/Dictionaries/BePodder.blBY @@ -0,0 +1,604 @@ + +# Locale file for BePodder. +# Modified: 4/18/2006 +# Author: BePodderTeam +# E-mail: bepodder.team@gmail.com + + +# Attention: don't remove empty space or \n + + +### SHAREWARE POPUPS ----------------------------------- + +"Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" "Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" + +"This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" "This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" + +"Web Site" "Web Site" + +"Can't connect!" "Can't connect!" +"Http port failed!" "Http port failed!" +"Can't resolve host!" "Can't resolve host!" +"Not found!" "Not found!" +"Bad resume!" "Bad resume!" +"Aborted by Callback!" "Aborted by Callback!" +"Can't resume! (range error)" "Can't resume! (range error)" +"Access Denied!" "Access Denied!" +"User or Password Incorrect!" "User or Password Incorrect!" +"Other error (cUrl code: " "Other error (cUrl code: " +"cUrl init error!" "cUrl init error!" +"Can't open file!" "Can't open file!" +"Other error (status code: " "Other error (status code: " +"Downloading" "Downloading" + + +### MENUBAR ----------------------------------- + +"File" "File" +"About..." "About..." +"Close!" "Close!" +"Quit" "Quit" + +"Settings" "Settings" +"Preferences..." "Preferences..." + +"Subscriptions" "Subscriptions" + +"Episodes" "Episodes" + +"Lists" "Lists" +"Podcast List" "Podcast List" +"Podcast directory list" "Podcast directory list" +"Videoblog List" "Videoblog List" +"Videoblog directory list" "Videoblog directory list" +"Imagefeeds List" "Imagefeeds List" +"Imagefeeds directory list" "Imagefeeds directory list" +"Newsfeeds List" "Newsfeeds List" +"Newsfeeds directory list" "Newsfeeds directory list" +"BitTorrentfeeds List" "BitTorrentfeeds List" +"BitTorrentfeeds directory list" "BitTorrentfeeds directory list" +"Internationalfeeds List" "Internationalfeeds List" +"Internationalfeeds directory list" "Internationalfeeds directory list" + +"View" "View" +"Full Screen" "Full Screen" +"Toolbar" "Toolbar" +"Subscriptions View" "Subscriptions View" +"Small Items" "Small Items" +"Big Items" "Big Items" +"Move BePodder on workspace:" "Move BePodder on workspace:" + +"Help" "Help" +"Getting Started" "Getting Started" +"Keyboard Shortcuts" "Keyboard Shortcuts" +"Tutorials" "Tutorials" +"Online Support" "Online Support" + + + + +### BUTTONS ----------------------------------- + +# Buttons add feed window +"Insert the rss feed url!" "Insert the rss feed url!" +"Add" "Add" +"Paste" "Paste" + +# Buttons directory list window +"Collapse All" "Collapse All" +"Preview" "Preview" +"Subscribe" "Subscribe" + + +# Buttons help window +"Next" "Next" +"Prev" "Prev" +"Close" "Close" +"Index" "Index" + + +# Buttons remove windows +"Cancel" "Cancel" +"Delete" "Delete" +"Archive" "Archive" + + + +### TOOLTIPS ----------------------------------- + +# Tooltips toolbar buttons + +"Add the podcast to the Subscriptions list" "Add the podcast to the Subscriptions list" +"Delete the podcast from the Subscriptions list" "Delete the podcast from the Subscriptions list" +"Check the selected podcast for new items" "Check the selected podcast for new items" +"Show the podcast homepage" "Show the podcast homepage" + +"Delete the item and the enclosure" "Delete the item and the enclosure" +"Stop the item download" "Stop the item download" +"Download the selected episode" "Download the selected episode" +"Play the selected episode" "Play the selected episode" + +"Submit bug and idea" "Submit bug and idea" + + +# Tooltips directory window buttons + +"Collapse all categories in the directory list" "Collapse all categories in the directory list" +"Add the selected podcast to the Subscription list" "Add the selected podcast to the Subscription list" +"Checkout a podcast before downloading it" "Checkout a podcast before downloading it" + + +### INFO PANEL ----------------------------------- + +"Show channel Image" "Show Channel Image" +"XML Feed Link" "XML Feed Link" + +"Show Episode info" "Show Episode info" +"Show Subscription info" "Show Subscription info" +"Show Downloads info" "Show Downloads info" + +"Enclosure: " "Enclosure: " + +"Lookup (Dictionary)" "Lookup (Dictionary)" +"Lookup (Google)" "Lookup (Google)" +"Lookup (Acronym Finder)" "Lookup (Acronym Finder)" +"Copy" "Copy" +"Select All" "Select All" +"Copy URL" "Copy URL" +"Open URL" "Open URL" +"Subscription" "Subscription" + + +### PREFERENCES ----------------------------------- + +"Preferences" "Preferences" + +"Proxy" "Proxy" +"Enable Proxy" "Enable Proxy" +"Address" "Address" +"Port" "Port" +"Username" "Username" +"Password" "Password" + +"Max Downloads" "Max Downloads" + +"FileType" "FileType" +"Browser" "Browser" +"Player" "Player" + +"Channels" "Channels" +"Check all channels on startup" "Check all channels on startup" +"Check the channel every" "Check the channel every" + +"never" "never" +"5 minutes" "5 minutes" +"15 minutes" "15 minutes" +"30 minutes" "30 minutes" +"1 hour" "1 hour" +"2 hour" "2 hour" + + + + +### COLUMLISTVIEW ----------------------------------- + + +"1 new item" "1 new item" +"%d new items" "%d new items" +"new" "new" +"error" "error" +"not down" "not down" +"enquequed" "enquequed" +"downloading" "downloading" +"downloaded" "downloaded" +"connecting" "connecting" +"not found" "not found" +"stopped" "stopped" +"can't connect" "can't connect" +"invalid format" "invalid format" + +"Icon" "Icon" +"Title" "Title" +"Date" "Date" +"Size" "Size" +"Status" "Status" +"Download" "Download" + + + +### CONTEXT MENU ----------------------------------- + +"Add Channel" "Add Channel" +"Remove Channel" "Remove Channel" +"Check Channel" "Check Channel" +"Open Homepage" "Open Homepage" + +"Open Web Page" "Open Web Page" +"Open Enclosures folder" "Open Enclosures folder" +"Check All Channels" "Check All Channels" + +"Show Channel Image" "Show Channel Image" + +"Play enclosure" "Play enclosure" +"(Re)start download" "(Re)start download" +"Stop download" "Stop download" +"Remove Item" "Remove Item" + +"Find this Item" "Find this Item" +"Remove from this list" "Remove from this list" + + + +### ALERT ----------------------------------- + +"\nRemoving.." "\nRemoving.." +"\nAn error occured while removing!" "\nAn error occured while removing!" +"Check all the podcasts for new items" "Check all the podcasts for new items" + +"You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" "You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" + + +"Can't open the selected file with:\n\n" "Can't open the selected file with:\n\n" +"\n\nPlease check if the application is installed in the right way.\n" "\n\nPlease check if the application is installed in the right way.\n" +"Download it!" "Download it!" + +# multi line text... please translate only the text after _value= and don't remove empty space + +_key="alert1" + _value=" +You are going to remove the selected item. + +Are you sure? +(you will lost the enclosure file if any)" + + +_key="alert2a" + _value=" +You are going to remove the channel: + +" + +_key="alert2b" + _value=" + +Would you like just to archive this +channel (keeping all the files and +enclosures downloaded so far) or +do you want to DELETE the whole + channel from you computer?" + +_key="alert3" + _value=" +Parsing archive.." + +_key="alert_3gp" + _value=" +3GP is a multimedia container format defined by the Third Generation Partnership Project (3GPP) for use on 3G mobile phones. It stores video streams as MPEG-4 or H.263, and audio streams as AMR-NB or AAC-LC. + +VideoLAN still doesn't support the audio AMR (3GPP)" + +_key="alert_swf" + _value=" +SWF is a proprietary vector graphics file format produced by the Flash software from Adobe (formerly Macromedia). + +Currently Flash support in BeOS/Haiku/Zeta is limited to the old standalone Flash player version 4.1015, there isn't a modern Flash player" + + + + +### HELP & SHORTCUTS ----------------------------------- + + +"Introduction" "Introduction" +"The User Interface" "The User Interface" +"Menu Bar" "Menu Bar" +"Toolbar Buttons" "Toolbar Buttons" +"First time with BePodder" "First time with BePodder" +"Download Podcast's enclosure files" "Download Podcast's enclosure files" +"Settings Overview" "Settings Overview" +"Directory lists" "Directory lists" +"Loading Help..." "Loading Help..." +"Register your copy" "Register your copy" +"Starting point" "Starting point" + + + + +# multi line text... please translate only the text after _value= and don't remove empty space + + +_key="help1-0" + _value="Welcome to the BePodder Getting Started Guide." + +_key="help1-1" + _value="If you are already familiar with podcasts and RSS/Atom feeds you can immediately go to BePodder by closing this window." + +_key="help1-2" +_value="If not, this is a short introduction providing you everything you'll need to know on how to get started with BePodder. Use the buttons below to navigate through this tutorial." + + +_key="help2-0" +_value="Podcasting is a method for publishing audio and video broadcasts via the Internet; links to free audio and video files are enclosed in RSS and Atom feeds." + +_key="help2-1" +_value="Therefore Podcasting is simply a type of online media delivery; users can subscribe to a podcast using a feed (such as RSS 'Really Simple Syndication' or Atom)." + +_key="help2-2" +_value="An aggregator (or podcatcher) like BePodder, is a piece of software that allows you to subscribe to a RSS feed and periodically check for and download new content; with BePodder you can check for new Podcast items (Episodes) of your subscribed Channels. Any item can contain an enclosure, just like an Email can contain an attachment." + + + +_key="help3-0" +_value="BePodder has an easy to use yet powerful Graphical User Interface. The main window is split into tree panels:" + +_key="help3-1" +_value="1) The Subscription list (the panel with the number 1 in the screenshot) with the list of the podcasts that you have subscribed to. When you click on a Channel you can see in the panel 2 the list of the channel's items." + +_key="help3-2" +_value="2) The Episodes list with all the items available." + +_key="help3-3" +_value="3) The Info panel show: episode info, channel info or Downloads info; you can select an info panel by clicking one of the below three buttons." + + + +_key="help4-0" +_value="At the very top of the BePodder main window is the menubar with seven menus available: File, Settings, Subscriptions, Episodes, Lists, View and Help. Some menu commands are followed by a right pointing arrow that indicates a submenu of related commands. As you explore each menu, be sure to take a look at the submenus as well. Click on a menus to show its commands:" + +_key="help4-1" +_value="File: contains commands to close the application and to show information about BePodder" + +_key="help4-2" +_value="Settings: contains command to open the Preferences window that allows you to customize various BePodder settings." + +_key="help4-3" +_value="Subscriptions: contains commands that perform actions on the selected channel of your subscriptions list." + +_key="help4-4" +_value="Episodes: contains commands that perform actions on the selected item (episode) of the channel's episode list." + +_key="help4-5" +_value="Lists: contains commands to open BePodder's OPML directories." + +_key="help4-6" +_value="View: contains commands and controls for the BePodder window." + +_key="help4-7" +_value="Help: contains commands to open BePodder's 'Getting Started Guide' and the 'Keyboard Shortcuts List'." + + + +_key="help5-0" + _value="Add Button: opens the Add Window to add a feed url (e.g. http://www.newpodcast.com/rss.xml) usually given on the podcast homepage; looks for text or graphic link that says something like 'XML', 'RSS' or 'Podcast Feed' on it." + +_key="help5-1" + _value="Channel Remove Button: opens a window in which you can select how remove the channel: just archive the select channel (keeping all the files and eclosure downloaded so far) or delete the whole channel from your computer." + +_key="help5-2" + _value="Check Button: checks the selected channel and updates the list of the available items for that podcast adding the new items." + +_key="help5-3" + _value="Web Button: shows the channel homepage in the browser. To select your favorite browser open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select your favorite browser." + +_key="help5-4" + _value="Play Button: with this button you can view or listen the file enclosure of the selected item(episode). To select your favorite player open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select you favorite player." + +_key="help5-5" + _value="Download Button: downloads the file enclosure of the selected item (episode); you can see the download info by clicking on the third button over the info panel." + +_key="help5-6" + _value="Stop Button: stops to download the file enclosure of the selected item (episode); to resume the download double-click the item (episode) or select the item and click the Download Button" + +_key="help5-7" + _value="Item Remove Button: deletes the selected item (you will loose the enclosure file)." + + + +_key="help6-0" + _value="Getting started with BePodder is easy." + +_key="help6-1" + _value="On the left of the main window you can see the 'Subscription List' with all your feed subscriptions. We have added some subscriptions for you, and you can always add your own in two ways:" + +_key="help6-2" + _value="1) click the Add Button, then insert the feed url (example: http://www.newpodcast.com/rss.xml) and click add." + +_key="help6-3" + _value="2) in the menubar select 'Directory' and then 'Podcast list' or another list, choose a podcast and click 'Subscribe'." + +_key="help6-4" + _value="If you select a Podcast in the subscriptions list and use the check button, BePodder adds the new items to the 'Episodes list' (below on the right); you can check all your podcasts by right-clicking and selecting 'Check All Channels' in the context menu." + +_key="help6-5" + _value="Look at the screenshot above, there are 3 new items indicated by a black dot in the first column of the 'Episodes list'." + +_key="help6-6" + _value="In the second column there are icons that indicate the state of the item:" + +_key="help6-7" + _value="- the Episode 4 has an icon that indicates an error" + +_key="help6-8" + _value="- the Episode 3 has an icon that indicates that the item's enclosure download request is enquequed" + +_key="help6-9" + _value="- the Episode 2 has an icon that indicates that BePodder is downloading the item's enclosure file" + +_key="help6-10" + _value="- the Episode 1 have an icon that indicates that BePodder have just downloaded the item's enclosure file" + + + +_key="help7-0" + _value="Select an item in the 'Episodes list' and then double-click on it (or click the Download Button) to start downloading the enclosed file; you can always stop the download by clicking on the Stop Button." + +_key="help7-1" + _value="When you click on the Subscribed Podcasts in the 'Subscriptions List' the software shows you, in the 'List of episodes', all the items available in that Subscription. Select an item and then click play (Play Button) to view or listen to the file." + +_key="help7-2" + _value="You can access the Enclosures Folder by clicking on the folder icon in the Info Pannel or by right-clicking your mouse on an item and select 'Open Enclosures Folder' in the context menu." + + + +_key="help8-0" + _value="Preferences can be accessed by clicking in the menu-bar Settings>Preferences. You can select a category from the left list of the preferences dialog: FileType, Channels, Download and Proxy." + +_key="help8-1" + _value="- FileType: to specify the default browser and player. " + +_key="help8-2" + _value="- Channels: to specify preferences that control the operation to check channels new items; you can choose to Check all channels on startup or check the channel every desired minutes." + +_key="help8-3" + _value="- Download: to specify the max number of item's files to download at the same time," + +_key="help8-4" + _value="- Proxy: to set up a proxy server to work with BePodder; a proxy server acts as a security barrier between your internal network and the Internet, keeping others on the Internet from accessing information on your internal network." + + + +_key="help9-0" + _value="BePodder has built-in podcast, videoblog, imagefeeds, newsfeeds, bittorrentfeeds and internationalfeeds OPML directories with thousands of feeds grouped by category." + +_key="help9-1" + _value="OPML (Outline Processor Markup Language) is an XML-based format that allows exchange of outline-structured information between applications." + +_key="help9-2" + _value="OPML directory can be accessed by clicking in the menu-bar 'Lists' and thenselecting a list. To browse the opml directory for a feed, expand the list by clicking the arrow of the category that you are interested in (see image); using this method, you can expand the opml directory until you find the desired feed. Once you have selected it, you can add it to the subscription list by clicking the button 'Subscribe', you can also collapse all categories in the directory list by clicking the button 'Collapse All'." + +_key="help_shortcut1" +_value="This page describes the keyboard shortcuts that can be used in BePodder. The shortcuts are grouped here by function." + +_key="help_shortcut2" +_value="means that you can use either alt or control (es. Alt+Q or Ctrl+Q Quit the application), which way you have set it in the Deskbar menu preferences under Keyboard (the default shortcut key is Alt)." + +_key="help_shortcut3" + _value="General shortcuts" + +_key="help_shortcut4" + _value="Quit the application" + +_key="help_shortcut5" + _value="Shows the Preferences window" + +_key="help_shortcut6" + _value="Shows the Podcast directory list" + +_key="help_shortcut7" + _value="Shows the Videoblog directory list" + +_key="help_shortcut8" + _value="Shows the Imagefeeds directory list" + +_key="help_shortcut9" + _value="Shows the Newsfeeds directory list" + +_key="help_shortcut9b" + _value="Shows the BitTorrentfeeds directory list" + +_key="help_shortcut9c" + _value="Shows the Internationalfeeds directory list" + +_key="help_shortcut10" + _value="Fullscreen" + +_key="help_shortcut11" + _value="Shows/Hides the toolbar" + +_key="help_shortcut12" + _value="Shows the Getting Started Help" + +_key="help_shortcut13" + _value="Shows this keyboard shortcuts page" + +_key="help_shortcut14" + _value="Channels shortcuts" + +_key="help_shortcut15" + _value="Add a podcast to the subscriptions list" + +_key="help_shortcut16" + _value="Delete the selected podcast from the subscriptions list" + +_key="help_shortcut17" + _value="Check the selected podcast for new episodes (items)" + +_key="help_shortcut18" + _value="Check all podcasts for new episodes (items)" + +_key="help_shortcut19" + _value="Shows the podcast homepage" + +_key="help_shortcut20" + _value="Open enclosures folder" + +_key="help_shortcut21" + _value="Episodes shortcuts" + +_key="help_shortcut22" + _value="Play enclosure" + +_key="help_shortcut23" + _value="(Re)start download the selected episodes (items)" + +_key="help_shortcut24" + _value="Stop the episode (item) download" + +_key="help_shortcut25" + _value="Delete the selected episode (item)" + +_key="help_shortcut26" + _value="Shows the podcast episode (item) page " + +_key="help_shortcut27" + _value="Open enclosures folder" + +_key="help_buy1" + _value="BePodder Light is the basic version (free download and no time limited), the registered version adds some more nice features: unlimited number of channels, small Channel view, proxy support, automatic channels check, up to 5 enclosure downloads at the same time (multithreading)." + +_key="help_buy2" + _value="Please pay the shareware fee, it's only 15 euro (Kagi add tax in some countries), BePodder licence can be purchased online from Kagi." + +_key="help_buy3" + _value="Buy at www.funkyideasoft.com" + +_key="help_buy4" + _value="After purchasing, an email will be sent to you with a keyfile and instruction on how to install it. It's just a matter of unzipping a file and moving it to a certain directory." + +_key="help_buy5" + _value="There is no problem updating BePodder when a new version becomes available. The keyfile will unlock all downloadable packages unless otherwise notified." + + +### USELESS ######## + +"Opml Editor" "Opml Editor" +"name:" "name:" +"Add a category" "Add a category" +"Add a new Broadcast" "Add a new Broadcast" +"feed:" "feed:" +"url:" "url:" +"Test podcast" "Test podcast" +"Del a category" "Del a category" +"Add a category" "Add a category" +"Select the podcast category:" "Select the podcast category:" +"Check all" "Check all" +"Check" "Check" +"Refresh the list" "Refresh the list" +"Load" "Load" +"Load the list" "Load the list" +"Save" "Save" +"Save the list" "Save the list" +"Revert" "Revert" +"Apply" "Apply" + + + + + + + + + + + + diff --git a/release/Language/Dictionaries/BePodder.czCZ b/release/Language/Dictionaries/BePodder.czCZ new file mode 100644 index 0000000..296dac8 --- /dev/null +++ b/release/Language/Dictionaries/BePodder.czCZ @@ -0,0 +1,604 @@ + +# Locale file for BePodder. +# Modified: 4/18/2006 +# Author: BePodderTeam +# E-mail: bepodder.team@gmail.com + + +# Attention: don't remove empty space or \n + + +### SHAREWARE POPUPS ----------------------------------- + +"Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" "Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" + +"This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" "This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" + +"Web Site" "Web Site" + +"Can't connect!" "Can't connect!" +"Http port failed!" "Http port failed!" +"Can't resolve host!" "Can't resolve host!" +"Not found!" "Not found!" +"Bad resume!" "Bad resume!" +"Aborted by Callback!" "Aborted by Callback!" +"Can't resume! (range error)" "Can't resume! (range error)" +"Access Denied!" "Access Denied!" +"User or Password Incorrect!" "User or Password Incorrect!" +"Other error (cUrl code: " "Other error (cUrl code: " +"cUrl init error!" "cUrl init error!" +"Can't open file!" "Can't open file!" +"Other error (status code: " "Other error (status code: " +"Downloading" "Downloading" + + +### MENUBAR ----------------------------------- + +"File" "File" +"About..." "About..." +"Close!" "Close!" +"Quit" "Quit" + +"Settings" "Settings" +"Preferences..." "Preferences..." + +"Subscriptions" "Subscriptions" + +"Episodes" "Episodes" + +"Lists" "Lists" +"Podcast List" "Podcast List" +"Podcast directory list" "Podcast directory list" +"Videoblog List" "Videoblog List" +"Videoblog directory list" "Videoblog directory list" +"Imagefeeds List" "Imagefeeds List" +"Imagefeeds directory list" "Imagefeeds directory list" +"Newsfeeds List" "Newsfeeds List" +"Newsfeeds directory list" "Newsfeeds directory list" +"BitTorrentfeeds List" "BitTorrentfeeds List" +"BitTorrentfeeds directory list" "BitTorrentfeeds directory list" +"Internationalfeeds List" "Internationalfeeds List" +"Internationalfeeds directory list" "Internationalfeeds directory list" + +"View" "View" +"Full Screen" "Full Screen" +"Toolbar" "Toolbar" +"Subscriptions View" "Subscriptions View" +"Small Items" "Small Items" +"Big Items" "Big Items" +"Move BePodder on workspace:" "Move BePodder on workspace:" + +"Help" "Help" +"Getting Started" "Getting Started" +"Keyboard Shortcuts" "Keyboard Shortcuts" +"Tutorials" "Tutorials" +"Online Support" "Online Support" + + + + +### BUTTONS ----------------------------------- + +# Buttons add feed window +"Insert the rss feed url!" "Insert the rss feed url!" +"Add" "Add" +"Paste" "Paste" + +# Buttons directory list window +"Collapse All" "Collapse All" +"Preview" "Preview" +"Subscribe" "Subscribe" + + +# Buttons help window +"Next" "Next" +"Prev" "Prev" +"Close" "Close" +"Index" "Index" + + +# Buttons remove windows +"Cancel" "Cancel" +"Delete" "Delete" +"Archive" "Archive" + + + +### TOOLTIPS ----------------------------------- + +# Tooltips toolbar buttons + +"Add the podcast to the Subscriptions list" "Add the podcast to the Subscriptions list" +"Delete the podcast from the Subscriptions list" "Delete the podcast from the Subscriptions list" +"Check the selected podcast for new items" "Check the selected podcast for new items" +"Show the podcast homepage" "Show the podcast homepage" + +"Delete the item and the enclosure" "Delete the item and the enclosure" +"Stop the item download" "Stop the item download" +"Download the selected episode" "Download the selected episode" +"Play the selected episode" "Play the selected episode" + +"Submit bug and idea" "Submit bug and idea" + + +# Tooltips directory window buttons + +"Collapse all categories in the directory list" "Collapse all categories in the directory list" +"Add the selected podcast to the Subscription list" "Add the selected podcast to the Subscription list" +"Checkout a podcast before downloading it" "Checkout a podcast before downloading it" + + +### INFO PANEL ----------------------------------- + +"Show channel Image" "Show Channel Image" +"XML Feed Link" "XML Feed Link" + +"Show Episode info" "Show Episode info" +"Show Subscription info" "Show Subscription info" +"Show Downloads info" "Show Downloads info" + +"Enclosure: " "Enclosure: " + +"Lookup (Dictionary)" "Lookup (Dictionary)" +"Lookup (Google)" "Lookup (Google)" +"Lookup (Acronym Finder)" "Lookup (Acronym Finder)" +"Copy" "Copy" +"Select All" "Select All" +"Copy URL" "Copy URL" +"Open URL" "Open URL" +"Subscription" "Subscription" + + +### PREFERENCES ----------------------------------- + +"Preferences" "Preferences" + +"Proxy" "Proxy" +"Enable Proxy" "Enable Proxy" +"Address" "Address" +"Port" "Port" +"Username" "Username" +"Password" "Password" + +"Max Downloads" "Max Downloads" + +"FileType" "FileType" +"Browser" "Browser" +"Player" "Player" + +"Channels" "Channels" +"Check all channels on startup" "Check all channels on startup" +"Check the channel every" "Check the channel every" + +"never" "never" +"5 minutes" "5 minutes" +"15 minutes" "15 minutes" +"30 minutes" "30 minutes" +"1 hour" "1 hour" +"2 hour" "2 hour" + + + + +### COLUMLISTVIEW ----------------------------------- + + +"1 new item" "1 new item" +"%d new items" "%d new items" +"new" "new" +"error" "error" +"not down" "not down" +"enquequed" "enquequed" +"downloading" "downloading" +"downloaded" "downloaded" +"connecting" "connecting" +"not found" "not found" +"stopped" "stopped" +"can't connect" "can't connect" +"invalid format" "invalid format" + +"Icon" "Icon" +"Title" "Title" +"Date" "Date" +"Size" "Size" +"Status" "Status" +"Download" "Download" + + + +### CONTEXT MENU ----------------------------------- + +"Add Channel" "Add Channel" +"Remove Channel" "Remove Channel" +"Check Channel" "Check Channel" +"Open Homepage" "Open Homepage" + +"Open Web Page" "Open Web Page" +"Open Enclosures folder" "Open Enclosures folder" +"Check All Channels" "Check All Channels" + +"Show Channel Image" "Show Channel Image" + +"Play enclosure" "Play enclosure" +"(Re)start download" "(Re)start download" +"Stop download" "Stop download" +"Remove Item" "Remove Item" + +"Find this Item" "Find this Item" +"Remove from this list" "Remove from this list" + + + +### ALERT ----------------------------------- + +"\nRemoving.." "\nRemoving.." +"\nAn error occured while removing!" "\nAn error occured while removing!" +"Check all the podcasts for new items" "Check all the podcasts for new items" + +"You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" "You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" + + +"Can't open the selected file with:\n\n" "Can't open the selected file with:\n\n" +"\n\nPlease check if the application is installed in the right way.\n" "\n\nPlease check if the application is installed in the right way.\n" +"Download it!" "Download it!" + +# multi line text... please translate only the text after _value= and don't remove empty space + +_key="alert1" + _value=" +You are going to remove the selected item. + +Are you sure? +(you will lost the enclosure file if any)" + + +_key="alert2a" + _value=" +You are going to remove the channel: + +" + +_key="alert2b" + _value=" + +Would you like just to archive this +channel (keeping all the files and +enclosures downloaded so far) or +do you want to DELETE the whole + channel from you computer?" + +_key="alert3" + _value=" +Parsing archive.." + +_key="alert_3gp" + _value=" +3GP is a multimedia container format defined by the Third Generation Partnership Project (3GPP) for use on 3G mobile phones. It stores video streams as MPEG-4 or H.263, and audio streams as AMR-NB or AAC-LC. + +VideoLAN still doesn't support the audio AMR (3GPP)" + +_key="alert_swf" + _value=" +SWF is a proprietary vector graphics file format produced by the Flash software from Adobe (formerly Macromedia). + +Currently Flash support in BeOS/Haiku/Zeta is limited to the old standalone Flash player version 4.1015, there isn't a modern Flash player" + + + + +### HELP & SHORTCUTS ----------------------------------- + + +"Introduction" "Introduction" +"The User Interface" "The User Interface" +"Menu Bar" "Menu Bar" +"Toolbar Buttons" "Toolbar Buttons" +"First time with BePodder" "First time with BePodder" +"Download Podcast's enclosure files" "Download Podcast's enclosure files" +"Settings Overview" "Settings Overview" +"Directory lists" "Directory lists" +"Loading Help..." "Loading Help..." +"Register your copy" "Register your copy" +"Starting point" "Starting point" + + + + +# multi line text... please translate only the text after _value= and don't remove empty space + + +_key="help1-0" + _value="Welcome to the BePodder Getting Started Guide." + +_key="help1-1" + _value="If you are already familiar with podcasts and RSS/Atom feeds you can immediately go to BePodder by closing this window." + +_key="help1-2" +_value="If not, this is a short introduction providing you everything you'll need to know on how to get started with BePodder. Use the buttons below to navigate through this tutorial." + + +_key="help2-0" +_value="Podcasting is a method for publishing audio and video broadcasts via the Internet; links to free audio and video files are enclosed in RSS and Atom feeds." + +_key="help2-1" +_value="Therefore Podcasting is simply a type of online media delivery; users can subscribe to a podcast using a feed (such as RSS 'Really Simple Syndication' or Atom)." + +_key="help2-2" +_value="An aggregator (or podcatcher) like BePodder, is a piece of software that allows you to subscribe to a RSS feed and periodically check for and download new content; with BePodder you can check for new Podcast items (Episodes) of your subscribed Channels. Any item can contain an enclosure, just like an Email can contain an attachment." + + + +_key="help3-0" +_value="BePodder has an easy to use yet powerful Graphical User Interface. The main window is split into tree panels:" + +_key="help3-1" +_value="1) The Subscription list (the panel with the number 1 in the screenshot) with the list of the podcasts that you have subscribed to. When you click on a Channel you can see in the panel 2 the list of the channel's items." + +_key="help3-2" +_value="2) The Episodes list with all the items available." + +_key="help3-3" +_value="3) The Info panel show: episode info, channel info or Downloads info; you can select an info panel by clicking one of the below three buttons." + + + +_key="help4-0" +_value="At the very top of the BePodder main window is the menubar with seven menus available: File, Settings, Subscriptions, Episodes, Lists, View and Help. Some menu commands are followed by a right pointing arrow that indicates a submenu of related commands. As you explore each menu, be sure to take a look at the submenus as well. Click on a menus to show its commands:" + +_key="help4-1" +_value="File: contains commands to close the application and to show information about BePodder" + +_key="help4-2" +_value="Settings: contains command to open the Preferences window that allows you to customize various BePodder settings." + +_key="help4-3" +_value="Subscriptions: contains commands that perform actions on the selected channel of your subscriptions list." + +_key="help4-4" +_value="Episodes: contains commands that perform actions on the selected item (episode) of the channel's episode list." + +_key="help4-5" +_value="Lists: contains commands to open BePodder's OPML directories." + +_key="help4-6" +_value="View: contains commands and controls for the BePodder window." + +_key="help4-7" +_value="Help: contains commands to open BePodder's 'Getting Started Guide' and the 'Keyboard Shortcuts List'." + + + +_key="help5-0" + _value="Add Button: opens the Add Window to add a feed url (e.g. http://www.newpodcast.com/rss.xml) usually given on the podcast homepage; looks for text or graphic link that says something like 'XML', 'RSS' or 'Podcast Feed' on it." + +_key="help5-1" + _value="Channel Remove Button: opens a window in which you can select how remove the channel: just archive the select channel (keeping all the files and eclosure downloaded so far) or delete the whole channel from your computer." + +_key="help5-2" + _value="Check Button: checks the selected channel and updates the list of the available items for that podcast adding the new items." + +_key="help5-3" + _value="Web Button: shows the channel homepage in the browser. To select your favorite browser open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select your favorite browser." + +_key="help5-4" + _value="Play Button: with this button you can view or listen the file enclosure of the selected item(episode). To select your favorite player open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select you favorite player." + +_key="help5-5" + _value="Download Button: downloads the file enclosure of the selected item (episode); you can see the download info by clicking on the third button over the info panel." + +_key="help5-6" + _value="Stop Button: stops to download the file enclosure of the selected item (episode); to resume the download double-click the item (episode) or select the item and click the Download Button" + +_key="help5-7" + _value="Item Remove Button: deletes the selected item (you will loose the enclosure file)." + + + +_key="help6-0" + _value="Getting started with BePodder is easy." + +_key="help6-1" + _value="On the left of the main window you can see the 'Subscription List' with all your feed subscriptions. We have added some subscriptions for you, and you can always add your own in two ways:" + +_key="help6-2" + _value="1) click the Add Button, then insert the feed url (example: http://www.newpodcast.com/rss.xml) and click add." + +_key="help6-3" + _value="2) in the menubar select 'Directory' and then 'Podcast list' or another list, choose a podcast and click 'Subscribe'." + +_key="help6-4" + _value="If you select a Podcast in the subscriptions list and use the check button, BePodder adds the new items to the 'Episodes list' (below on the right); you can check all your podcasts by right-clicking and selecting 'Check All Channels' in the context menu." + +_key="help6-5" + _value="Look at the screenshot above, there are 3 new items indicated by a black dot in the first column of the 'Episodes list'." + +_key="help6-6" + _value="In the second column there are icons that indicate the state of the item:" + +_key="help6-7" + _value="- the Episode 4 has an icon that indicates an error" + +_key="help6-8" + _value="- the Episode 3 has an icon that indicates that the item's enclosure download request is enquequed" + +_key="help6-9" + _value="- the Episode 2 has an icon that indicates that BePodder is downloading the item's enclosure file" + +_key="help6-10" + _value="- the Episode 1 have an icon that indicates that BePodder have just downloaded the item's enclosure file" + + + +_key="help7-0" + _value="Select an item in the 'Episodes list' and then double-click on it (or click the Download Button) to start downloading the enclosed file; you can always stop the download by clicking on the Stop Button." + +_key="help7-1" + _value="When you click on the Subscribed Podcasts in the 'Subscriptions List' the software shows you, in the 'List of episodes', all the items available in that Subscription. Select an item and then click play (Play Button) to view or listen to the file." + +_key="help7-2" + _value="You can access the Enclosures Folder by clicking on the folder icon in the Info Pannel or by right-clicking your mouse on an item and select 'Open Enclosures Folder' in the context menu." + + + +_key="help8-0" + _value="Preferences can be accessed by clicking in the menu-bar Settings>Preferences. You can select a category from the left list of the preferences dialog: FileType, Channels, Download and Proxy." + +_key="help8-1" + _value="- FileType: to specify the default browser and player. " + +_key="help8-2" + _value="- Channels: to specify preferences that control the operation to check channels new items; you can choose to Check all channels on startup or check the channel every desired minutes." + +_key="help8-3" + _value="- Download: to specify the max number of item's files to download at the same time," + +_key="help8-4" + _value="- Proxy: to set up a proxy server to work with BePodder; a proxy server acts as a security barrier between your internal network and the Internet, keeping others on the Internet from accessing information on your internal network." + + + +_key="help9-0" + _value="BePodder has built-in podcast, videoblog, imagefeeds, newsfeeds, bittorrentfeeds and internationalfeeds OPML directories with thousands of feeds grouped by category." + +_key="help9-1" + _value="OPML (Outline Processor Markup Language) is an XML-based format that allows exchange of outline-structured information between applications." + +_key="help9-2" + _value="OPML directory can be accessed by clicking in the menu-bar 'Lists' and thenselecting a list. To browse the opml directory for a feed, expand the list by clicking the arrow of the category that you are interested in (see image); using this method, you can expand the opml directory until you find the desired feed. Once you have selected it, you can add it to the subscription list by clicking the button 'Subscribe', you can also collapse all categories in the directory list by clicking the button 'Collapse All'." + +_key="help_shortcut1" +_value="This page describes the keyboard shortcuts that can be used in BePodder. The shortcuts are grouped here by function." + +_key="help_shortcut2" +_value="means that you can use either alt or control (es. Alt+Q or Ctrl+Q Quit the application), which way you have set it in the Deskbar menu preferences under Keyboard (the default shortcut key is Alt)." + +_key="help_shortcut3" + _value="General shortcuts" + +_key="help_shortcut4" + _value="Quit the application" + +_key="help_shortcut5" + _value="Shows the Preferences window" + +_key="help_shortcut6" + _value="Shows the Podcast directory list" + +_key="help_shortcut7" + _value="Shows the Videoblog directory list" + +_key="help_shortcut8" + _value="Shows the Imagefeeds directory list" + +_key="help_shortcut9" + _value="Shows the Newsfeeds directory list" + +_key="help_shortcut9b" + _value="Shows the BitTorrentfeeds directory list" + +_key="help_shortcut9c" + _value="Shows the Internationalfeeds directory list" + +_key="help_shortcut10" + _value="Fullscreen" + +_key="help_shortcut11" + _value="Shows/Hides the toolbar" + +_key="help_shortcut12" + _value="Shows the Getting Started Help" + +_key="help_shortcut13" + _value="Shows this keyboard shortcuts page" + +_key="help_shortcut14" + _value="Channels shortcuts" + +_key="help_shortcut15" + _value="Add a podcast to the subscriptions list" + +_key="help_shortcut16" + _value="Delete the selected podcast from the subscriptions list" + +_key="help_shortcut17" + _value="Check the selected podcast for new episodes (items)" + +_key="help_shortcut18" + _value="Check all podcasts for new episodes (items)" + +_key="help_shortcut19" + _value="Shows the podcast homepage" + +_key="help_shortcut20" + _value="Open enclosures folder" + +_key="help_shortcut21" + _value="Episodes shortcuts" + +_key="help_shortcut22" + _value="Play enclosure" + +_key="help_shortcut23" + _value="(Re)start download the selected episodes (items)" + +_key="help_shortcut24" + _value="Stop the episode (item) download" + +_key="help_shortcut25" + _value="Delete the selected episode (item)" + +_key="help_shortcut26" + _value="Shows the podcast episode (item) page " + +_key="help_shortcut27" + _value="Open enclosures folder" + +_key="help_buy1" + _value="BePodder Light is the basic version (free download and no time limited), the registered version adds some more nice features: unlimited number of channels, small Channel view, proxy support, automatic channels check, up to 5 enclosure downloads at the same time (multithreading)." + +_key="help_buy2" + _value="Please pay the shareware fee, it's only 15 euro (Kagi add tax in some countries), BePodder licence can be purchased online from Kagi." + +_key="help_buy3" + _value="Buy at www.funkyideasoft.com" + +_key="help_buy4" + _value="After purchasing, an email will be sent to you with a keyfile and instruction on how to install it. It's just a matter of unzipping a file and moving it to a certain directory." + +_key="help_buy5" + _value="There is no problem updating BePodder when a new version becomes available. The keyfile will unlock all downloadable packages unless otherwise notified." + + +### USELESS ######## + +"Opml Editor" "Opml Editor" +"name:" "name:" +"Add a category" "Add a category" +"Add a new Broadcast" "Add a new Broadcast" +"feed:" "feed:" +"url:" "url:" +"Test podcast" "Test podcast" +"Del a category" "Del a category" +"Add a category" "Add a category" +"Select the podcast category:" "Select the podcast category:" +"Check all" "Check all" +"Check" "Check" +"Refresh the list" "Refresh the list" +"Load" "Load" +"Load the list" "Load the list" +"Save" "Save" +"Save the list" "Save the list" +"Revert" "Revert" +"Apply" "Apply" + + + + + + + + + + + + diff --git a/release/Language/Dictionaries/BePodder.daDK b/release/Language/Dictionaries/BePodder.daDK new file mode 100644 index 0000000..296dac8 --- /dev/null +++ b/release/Language/Dictionaries/BePodder.daDK @@ -0,0 +1,604 @@ + +# Locale file for BePodder. +# Modified: 4/18/2006 +# Author: BePodderTeam +# E-mail: bepodder.team@gmail.com + + +# Attention: don't remove empty space or \n + + +### SHAREWARE POPUPS ----------------------------------- + +"Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" "Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" + +"This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" "This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" + +"Web Site" "Web Site" + +"Can't connect!" "Can't connect!" +"Http port failed!" "Http port failed!" +"Can't resolve host!" "Can't resolve host!" +"Not found!" "Not found!" +"Bad resume!" "Bad resume!" +"Aborted by Callback!" "Aborted by Callback!" +"Can't resume! (range error)" "Can't resume! (range error)" +"Access Denied!" "Access Denied!" +"User or Password Incorrect!" "User or Password Incorrect!" +"Other error (cUrl code: " "Other error (cUrl code: " +"cUrl init error!" "cUrl init error!" +"Can't open file!" "Can't open file!" +"Other error (status code: " "Other error (status code: " +"Downloading" "Downloading" + + +### MENUBAR ----------------------------------- + +"File" "File" +"About..." "About..." +"Close!" "Close!" +"Quit" "Quit" + +"Settings" "Settings" +"Preferences..." "Preferences..." + +"Subscriptions" "Subscriptions" + +"Episodes" "Episodes" + +"Lists" "Lists" +"Podcast List" "Podcast List" +"Podcast directory list" "Podcast directory list" +"Videoblog List" "Videoblog List" +"Videoblog directory list" "Videoblog directory list" +"Imagefeeds List" "Imagefeeds List" +"Imagefeeds directory list" "Imagefeeds directory list" +"Newsfeeds List" "Newsfeeds List" +"Newsfeeds directory list" "Newsfeeds directory list" +"BitTorrentfeeds List" "BitTorrentfeeds List" +"BitTorrentfeeds directory list" "BitTorrentfeeds directory list" +"Internationalfeeds List" "Internationalfeeds List" +"Internationalfeeds directory list" "Internationalfeeds directory list" + +"View" "View" +"Full Screen" "Full Screen" +"Toolbar" "Toolbar" +"Subscriptions View" "Subscriptions View" +"Small Items" "Small Items" +"Big Items" "Big Items" +"Move BePodder on workspace:" "Move BePodder on workspace:" + +"Help" "Help" +"Getting Started" "Getting Started" +"Keyboard Shortcuts" "Keyboard Shortcuts" +"Tutorials" "Tutorials" +"Online Support" "Online Support" + + + + +### BUTTONS ----------------------------------- + +# Buttons add feed window +"Insert the rss feed url!" "Insert the rss feed url!" +"Add" "Add" +"Paste" "Paste" + +# Buttons directory list window +"Collapse All" "Collapse All" +"Preview" "Preview" +"Subscribe" "Subscribe" + + +# Buttons help window +"Next" "Next" +"Prev" "Prev" +"Close" "Close" +"Index" "Index" + + +# Buttons remove windows +"Cancel" "Cancel" +"Delete" "Delete" +"Archive" "Archive" + + + +### TOOLTIPS ----------------------------------- + +# Tooltips toolbar buttons + +"Add the podcast to the Subscriptions list" "Add the podcast to the Subscriptions list" +"Delete the podcast from the Subscriptions list" "Delete the podcast from the Subscriptions list" +"Check the selected podcast for new items" "Check the selected podcast for new items" +"Show the podcast homepage" "Show the podcast homepage" + +"Delete the item and the enclosure" "Delete the item and the enclosure" +"Stop the item download" "Stop the item download" +"Download the selected episode" "Download the selected episode" +"Play the selected episode" "Play the selected episode" + +"Submit bug and idea" "Submit bug and idea" + + +# Tooltips directory window buttons + +"Collapse all categories in the directory list" "Collapse all categories in the directory list" +"Add the selected podcast to the Subscription list" "Add the selected podcast to the Subscription list" +"Checkout a podcast before downloading it" "Checkout a podcast before downloading it" + + +### INFO PANEL ----------------------------------- + +"Show channel Image" "Show Channel Image" +"XML Feed Link" "XML Feed Link" + +"Show Episode info" "Show Episode info" +"Show Subscription info" "Show Subscription info" +"Show Downloads info" "Show Downloads info" + +"Enclosure: " "Enclosure: " + +"Lookup (Dictionary)" "Lookup (Dictionary)" +"Lookup (Google)" "Lookup (Google)" +"Lookup (Acronym Finder)" "Lookup (Acronym Finder)" +"Copy" "Copy" +"Select All" "Select All" +"Copy URL" "Copy URL" +"Open URL" "Open URL" +"Subscription" "Subscription" + + +### PREFERENCES ----------------------------------- + +"Preferences" "Preferences" + +"Proxy" "Proxy" +"Enable Proxy" "Enable Proxy" +"Address" "Address" +"Port" "Port" +"Username" "Username" +"Password" "Password" + +"Max Downloads" "Max Downloads" + +"FileType" "FileType" +"Browser" "Browser" +"Player" "Player" + +"Channels" "Channels" +"Check all channels on startup" "Check all channels on startup" +"Check the channel every" "Check the channel every" + +"never" "never" +"5 minutes" "5 minutes" +"15 minutes" "15 minutes" +"30 minutes" "30 minutes" +"1 hour" "1 hour" +"2 hour" "2 hour" + + + + +### COLUMLISTVIEW ----------------------------------- + + +"1 new item" "1 new item" +"%d new items" "%d new items" +"new" "new" +"error" "error" +"not down" "not down" +"enquequed" "enquequed" +"downloading" "downloading" +"downloaded" "downloaded" +"connecting" "connecting" +"not found" "not found" +"stopped" "stopped" +"can't connect" "can't connect" +"invalid format" "invalid format" + +"Icon" "Icon" +"Title" "Title" +"Date" "Date" +"Size" "Size" +"Status" "Status" +"Download" "Download" + + + +### CONTEXT MENU ----------------------------------- + +"Add Channel" "Add Channel" +"Remove Channel" "Remove Channel" +"Check Channel" "Check Channel" +"Open Homepage" "Open Homepage" + +"Open Web Page" "Open Web Page" +"Open Enclosures folder" "Open Enclosures folder" +"Check All Channels" "Check All Channels" + +"Show Channel Image" "Show Channel Image" + +"Play enclosure" "Play enclosure" +"(Re)start download" "(Re)start download" +"Stop download" "Stop download" +"Remove Item" "Remove Item" + +"Find this Item" "Find this Item" +"Remove from this list" "Remove from this list" + + + +### ALERT ----------------------------------- + +"\nRemoving.." "\nRemoving.." +"\nAn error occured while removing!" "\nAn error occured while removing!" +"Check all the podcasts for new items" "Check all the podcasts for new items" + +"You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" "You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" + + +"Can't open the selected file with:\n\n" "Can't open the selected file with:\n\n" +"\n\nPlease check if the application is installed in the right way.\n" "\n\nPlease check if the application is installed in the right way.\n" +"Download it!" "Download it!" + +# multi line text... please translate only the text after _value= and don't remove empty space + +_key="alert1" + _value=" +You are going to remove the selected item. + +Are you sure? +(you will lost the enclosure file if any)" + + +_key="alert2a" + _value=" +You are going to remove the channel: + +" + +_key="alert2b" + _value=" + +Would you like just to archive this +channel (keeping all the files and +enclosures downloaded so far) or +do you want to DELETE the whole + channel from you computer?" + +_key="alert3" + _value=" +Parsing archive.." + +_key="alert_3gp" + _value=" +3GP is a multimedia container format defined by the Third Generation Partnership Project (3GPP) for use on 3G mobile phones. It stores video streams as MPEG-4 or H.263, and audio streams as AMR-NB or AAC-LC. + +VideoLAN still doesn't support the audio AMR (3GPP)" + +_key="alert_swf" + _value=" +SWF is a proprietary vector graphics file format produced by the Flash software from Adobe (formerly Macromedia). + +Currently Flash support in BeOS/Haiku/Zeta is limited to the old standalone Flash player version 4.1015, there isn't a modern Flash player" + + + + +### HELP & SHORTCUTS ----------------------------------- + + +"Introduction" "Introduction" +"The User Interface" "The User Interface" +"Menu Bar" "Menu Bar" +"Toolbar Buttons" "Toolbar Buttons" +"First time with BePodder" "First time with BePodder" +"Download Podcast's enclosure files" "Download Podcast's enclosure files" +"Settings Overview" "Settings Overview" +"Directory lists" "Directory lists" +"Loading Help..." "Loading Help..." +"Register your copy" "Register your copy" +"Starting point" "Starting point" + + + + +# multi line text... please translate only the text after _value= and don't remove empty space + + +_key="help1-0" + _value="Welcome to the BePodder Getting Started Guide." + +_key="help1-1" + _value="If you are already familiar with podcasts and RSS/Atom feeds you can immediately go to BePodder by closing this window." + +_key="help1-2" +_value="If not, this is a short introduction providing you everything you'll need to know on how to get started with BePodder. Use the buttons below to navigate through this tutorial." + + +_key="help2-0" +_value="Podcasting is a method for publishing audio and video broadcasts via the Internet; links to free audio and video files are enclosed in RSS and Atom feeds." + +_key="help2-1" +_value="Therefore Podcasting is simply a type of online media delivery; users can subscribe to a podcast using a feed (such as RSS 'Really Simple Syndication' or Atom)." + +_key="help2-2" +_value="An aggregator (or podcatcher) like BePodder, is a piece of software that allows you to subscribe to a RSS feed and periodically check for and download new content; with BePodder you can check for new Podcast items (Episodes) of your subscribed Channels. Any item can contain an enclosure, just like an Email can contain an attachment." + + + +_key="help3-0" +_value="BePodder has an easy to use yet powerful Graphical User Interface. The main window is split into tree panels:" + +_key="help3-1" +_value="1) The Subscription list (the panel with the number 1 in the screenshot) with the list of the podcasts that you have subscribed to. When you click on a Channel you can see in the panel 2 the list of the channel's items." + +_key="help3-2" +_value="2) The Episodes list with all the items available." + +_key="help3-3" +_value="3) The Info panel show: episode info, channel info or Downloads info; you can select an info panel by clicking one of the below three buttons." + + + +_key="help4-0" +_value="At the very top of the BePodder main window is the menubar with seven menus available: File, Settings, Subscriptions, Episodes, Lists, View and Help. Some menu commands are followed by a right pointing arrow that indicates a submenu of related commands. As you explore each menu, be sure to take a look at the submenus as well. Click on a menus to show its commands:" + +_key="help4-1" +_value="File: contains commands to close the application and to show information about BePodder" + +_key="help4-2" +_value="Settings: contains command to open the Preferences window that allows you to customize various BePodder settings." + +_key="help4-3" +_value="Subscriptions: contains commands that perform actions on the selected channel of your subscriptions list." + +_key="help4-4" +_value="Episodes: contains commands that perform actions on the selected item (episode) of the channel's episode list." + +_key="help4-5" +_value="Lists: contains commands to open BePodder's OPML directories." + +_key="help4-6" +_value="View: contains commands and controls for the BePodder window." + +_key="help4-7" +_value="Help: contains commands to open BePodder's 'Getting Started Guide' and the 'Keyboard Shortcuts List'." + + + +_key="help5-0" + _value="Add Button: opens the Add Window to add a feed url (e.g. http://www.newpodcast.com/rss.xml) usually given on the podcast homepage; looks for text or graphic link that says something like 'XML', 'RSS' or 'Podcast Feed' on it." + +_key="help5-1" + _value="Channel Remove Button: opens a window in which you can select how remove the channel: just archive the select channel (keeping all the files and eclosure downloaded so far) or delete the whole channel from your computer." + +_key="help5-2" + _value="Check Button: checks the selected channel and updates the list of the available items for that podcast adding the new items." + +_key="help5-3" + _value="Web Button: shows the channel homepage in the browser. To select your favorite browser open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select your favorite browser." + +_key="help5-4" + _value="Play Button: with this button you can view or listen the file enclosure of the selected item(episode). To select your favorite player open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select you favorite player." + +_key="help5-5" + _value="Download Button: downloads the file enclosure of the selected item (episode); you can see the download info by clicking on the third button over the info panel." + +_key="help5-6" + _value="Stop Button: stops to download the file enclosure of the selected item (episode); to resume the download double-click the item (episode) or select the item and click the Download Button" + +_key="help5-7" + _value="Item Remove Button: deletes the selected item (you will loose the enclosure file)." + + + +_key="help6-0" + _value="Getting started with BePodder is easy." + +_key="help6-1" + _value="On the left of the main window you can see the 'Subscription List' with all your feed subscriptions. We have added some subscriptions for you, and you can always add your own in two ways:" + +_key="help6-2" + _value="1) click the Add Button, then insert the feed url (example: http://www.newpodcast.com/rss.xml) and click add." + +_key="help6-3" + _value="2) in the menubar select 'Directory' and then 'Podcast list' or another list, choose a podcast and click 'Subscribe'." + +_key="help6-4" + _value="If you select a Podcast in the subscriptions list and use the check button, BePodder adds the new items to the 'Episodes list' (below on the right); you can check all your podcasts by right-clicking and selecting 'Check All Channels' in the context menu." + +_key="help6-5" + _value="Look at the screenshot above, there are 3 new items indicated by a black dot in the first column of the 'Episodes list'." + +_key="help6-6" + _value="In the second column there are icons that indicate the state of the item:" + +_key="help6-7" + _value="- the Episode 4 has an icon that indicates an error" + +_key="help6-8" + _value="- the Episode 3 has an icon that indicates that the item's enclosure download request is enquequed" + +_key="help6-9" + _value="- the Episode 2 has an icon that indicates that BePodder is downloading the item's enclosure file" + +_key="help6-10" + _value="- the Episode 1 have an icon that indicates that BePodder have just downloaded the item's enclosure file" + + + +_key="help7-0" + _value="Select an item in the 'Episodes list' and then double-click on it (or click the Download Button) to start downloading the enclosed file; you can always stop the download by clicking on the Stop Button." + +_key="help7-1" + _value="When you click on the Subscribed Podcasts in the 'Subscriptions List' the software shows you, in the 'List of episodes', all the items available in that Subscription. Select an item and then click play (Play Button) to view or listen to the file." + +_key="help7-2" + _value="You can access the Enclosures Folder by clicking on the folder icon in the Info Pannel or by right-clicking your mouse on an item and select 'Open Enclosures Folder' in the context menu." + + + +_key="help8-0" + _value="Preferences can be accessed by clicking in the menu-bar Settings>Preferences. You can select a category from the left list of the preferences dialog: FileType, Channels, Download and Proxy." + +_key="help8-1" + _value="- FileType: to specify the default browser and player. " + +_key="help8-2" + _value="- Channels: to specify preferences that control the operation to check channels new items; you can choose to Check all channels on startup or check the channel every desired minutes." + +_key="help8-3" + _value="- Download: to specify the max number of item's files to download at the same time," + +_key="help8-4" + _value="- Proxy: to set up a proxy server to work with BePodder; a proxy server acts as a security barrier between your internal network and the Internet, keeping others on the Internet from accessing information on your internal network." + + + +_key="help9-0" + _value="BePodder has built-in podcast, videoblog, imagefeeds, newsfeeds, bittorrentfeeds and internationalfeeds OPML directories with thousands of feeds grouped by category." + +_key="help9-1" + _value="OPML (Outline Processor Markup Language) is an XML-based format that allows exchange of outline-structured information between applications." + +_key="help9-2" + _value="OPML directory can be accessed by clicking in the menu-bar 'Lists' and thenselecting a list. To browse the opml directory for a feed, expand the list by clicking the arrow of the category that you are interested in (see image); using this method, you can expand the opml directory until you find the desired feed. Once you have selected it, you can add it to the subscription list by clicking the button 'Subscribe', you can also collapse all categories in the directory list by clicking the button 'Collapse All'." + +_key="help_shortcut1" +_value="This page describes the keyboard shortcuts that can be used in BePodder. The shortcuts are grouped here by function." + +_key="help_shortcut2" +_value="means that you can use either alt or control (es. Alt+Q or Ctrl+Q Quit the application), which way you have set it in the Deskbar menu preferences under Keyboard (the default shortcut key is Alt)." + +_key="help_shortcut3" + _value="General shortcuts" + +_key="help_shortcut4" + _value="Quit the application" + +_key="help_shortcut5" + _value="Shows the Preferences window" + +_key="help_shortcut6" + _value="Shows the Podcast directory list" + +_key="help_shortcut7" + _value="Shows the Videoblog directory list" + +_key="help_shortcut8" + _value="Shows the Imagefeeds directory list" + +_key="help_shortcut9" + _value="Shows the Newsfeeds directory list" + +_key="help_shortcut9b" + _value="Shows the BitTorrentfeeds directory list" + +_key="help_shortcut9c" + _value="Shows the Internationalfeeds directory list" + +_key="help_shortcut10" + _value="Fullscreen" + +_key="help_shortcut11" + _value="Shows/Hides the toolbar" + +_key="help_shortcut12" + _value="Shows the Getting Started Help" + +_key="help_shortcut13" + _value="Shows this keyboard shortcuts page" + +_key="help_shortcut14" + _value="Channels shortcuts" + +_key="help_shortcut15" + _value="Add a podcast to the subscriptions list" + +_key="help_shortcut16" + _value="Delete the selected podcast from the subscriptions list" + +_key="help_shortcut17" + _value="Check the selected podcast for new episodes (items)" + +_key="help_shortcut18" + _value="Check all podcasts for new episodes (items)" + +_key="help_shortcut19" + _value="Shows the podcast homepage" + +_key="help_shortcut20" + _value="Open enclosures folder" + +_key="help_shortcut21" + _value="Episodes shortcuts" + +_key="help_shortcut22" + _value="Play enclosure" + +_key="help_shortcut23" + _value="(Re)start download the selected episodes (items)" + +_key="help_shortcut24" + _value="Stop the episode (item) download" + +_key="help_shortcut25" + _value="Delete the selected episode (item)" + +_key="help_shortcut26" + _value="Shows the podcast episode (item) page " + +_key="help_shortcut27" + _value="Open enclosures folder" + +_key="help_buy1" + _value="BePodder Light is the basic version (free download and no time limited), the registered version adds some more nice features: unlimited number of channels, small Channel view, proxy support, automatic channels check, up to 5 enclosure downloads at the same time (multithreading)." + +_key="help_buy2" + _value="Please pay the shareware fee, it's only 15 euro (Kagi add tax in some countries), BePodder licence can be purchased online from Kagi." + +_key="help_buy3" + _value="Buy at www.funkyideasoft.com" + +_key="help_buy4" + _value="After purchasing, an email will be sent to you with a keyfile and instruction on how to install it. It's just a matter of unzipping a file and moving it to a certain directory." + +_key="help_buy5" + _value="There is no problem updating BePodder when a new version becomes available. The keyfile will unlock all downloadable packages unless otherwise notified." + + +### USELESS ######## + +"Opml Editor" "Opml Editor" +"name:" "name:" +"Add a category" "Add a category" +"Add a new Broadcast" "Add a new Broadcast" +"feed:" "feed:" +"url:" "url:" +"Test podcast" "Test podcast" +"Del a category" "Del a category" +"Add a category" "Add a category" +"Select the podcast category:" "Select the podcast category:" +"Check all" "Check all" +"Check" "Check" +"Refresh the list" "Refresh the list" +"Load" "Load" +"Load the list" "Load the list" +"Save" "Save" +"Save the list" "Save the list" +"Revert" "Revert" +"Apply" "Apply" + + + + + + + + + + + + diff --git a/release/Language/Dictionaries/BePodder.deDE b/release/Language/Dictionaries/BePodder.deDE new file mode 100644 index 0000000..c6e1c59 --- /dev/null +++ b/release/Language/Dictionaries/BePodder.deDE @@ -0,0 +1,603 @@ + +# Locale file for BePodder. +# Modified: 12/23/2005 +# Author: Maurice Kalinowski +# E-mail: maurice.kalinowski@yellowtab.com + + +# Attention: don't remove empty space or \n + + +### SHAREWARE POPUPS ----------------------------------- + +"Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" "Shareware Anwendung!\n\nBitte unterstütze uns!\n\nKaufe eine Software Lizenz\nMehr Informationen auf unserer Webseite\n" + +"This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" "Diese BePodder Kopie ist abgelaufen!\nBitte kaufe die Schlüsseldatei und unterstütze uns.\n" + +"Web Site" "Webseite" + +"Can't connect!" "Can't connect!" +"Http port failed!" "Http port failed!" +"Can't resolve host!" "Can't resolve host!" +"Not found!" "Not found!" +"Bad resume!" "Bad resume!" +"Aborted by Callback!" "Aborted by Callback!" +"Can't resume! (range error)" "Can't resume! (range error)" +"Access Denied!" "Access Denied!" +"User or Password Incorrect!" "User or Password Incorrect!" +"Other error (cUrl code: " "Other error (cUrl code: " +"cUrl init error!" "cUrl init error!" +"Can't open file!" "Can't open file!" +"Other error (status code: " "Other error (status code: " +"Downloading" "Downloading" + + +### MENUBAR ----------------------------------- + +"File" "Datei" +"About..." "Über..." +"Close!" "Schließen!" +"Quit" "Beenden" + +"Settings" "Einstellungen" +"Preferences..." "Präferenzen..." + +"Subscriptions" "Bestellungen" + +"Episodes" "Folgen" + +"Lists" "Listen" +"Podcast List" "Podcast Liste" +"Podcast directory list" "Verzeichnisliste der Podcasts" +"Videoblog List" "Videoblog Liste" +"Videoblog directory list" "Verzeichnisliste der Videoblogs" +"Imagefeeds List" "Bildeinspeisungsliste" +"Imagefeeds directory list" "Verzeichnisliste der Bildeinspeisungen" +"Newsfeeds List" "Nachrichteneinspeisungsliste" +"Newsfeeds directory list" "Verzeichnisliste der Nachrichteneinspeisungen" +"BitTorrentfeeds List" "BitTorrentfeeds Liste" +"BitTorrentfeeds directory list" "Verzeichnisliste der BitTorrentfeeds" +"Internationalfeeds List" "Internationalfeeds Liste" +"Internationalfeeds directory list" "Verzeichnisliste der Internationalfeeds" + +"View" "Ansicht" +"Full Screen" "Vollbild" +"Toolbar" "Werkzeugleiste" +"Subscriptions View" "Bestellübersicht" +"Small Items" "Kleine Einträge" +"Big Items" "Große Einträge" +"Move BePodder on workspace:" "Verschiebe BePodder auf dem Arbeitsplatz:" + +"Help" "Hilfe" +"Getting Started" "Einführung" +"Keyboard Shortcuts" "Tastaturkürzel" +"Online Support" "Online Hilfe" + + + + +### BUTTONS ----------------------------------- + +# Buttons add feed window +"Insert the rss feed url!" "RSS URL einspeisen!" +"Add" "Hinzufügen" +"Paste" "Einfügen" + +# Buttons directory list window +"Collapse All" "Collapse All" +"Preview" "Vorschau" +"Subscribe" "Bestellen" + + +# Buttons help window +"Next" "Weiter" +"Prev" "Zurück" +"Close" "Schließen" +"Index" "Index" + + +# Buttons remove windows +"Cancel" "Abbruch" +"Delete" "Löschen" +"Archive" "Ablegen" + + + +### TOOLTIPS ----------------------------------- + +# Tooltips toolbar buttons + +"Add the podcast to the Subscriptions list" "Füge Podcast zur Anmeldungsliste hinzu" +"Delete the podcast from the Subscriptions list" "Entferne Podcast von der Anmeldeliste" +"Check the selected podcast for new items" "Prüfe ausgewählten Podcast nach neuen Einträgen" +"Show the podcast homepage" "Zeige die Podcast Homepage" + +"Delete the item and the enclosure" "Delete the item and the enclosure" +"Stop the item download" "Unterbreche den Download des Eintrages" +"Download the selected episode" "Lade die ausgewählte Folge herunter" +"Play the selected episode" "Spiele die ausgewählte Folge ab" + +"Submit bug and idea" "Teile Vorschläge und Fehler mit" + + + +# Tooltips directory window buttons + +"Collapse all categories in the directory list" "Collapse all categories in the directory list" +"Add the selected podcast to the Subscription list" "Füge ausgewählten Podcast zur Anmeldeliste hinzu" +"Checkout a podcast before downloading it" "Überprüfe den Podcast vor dem Download" + + +### INFO PANEL ----------------------------------- + +"Show channel Image" "Zeige Kanal Abbild" +"XML Feed Link" "Link zur XML Einspeisung" + +"Show Episode info" "Zeige Inhalt der Folge" +"Show Subscription info" "Zeige Bestellinformation" +"Show Downloads info" "Zeige Download Informationen" + +"Enclosure: " "Anlage: " + +"Lookup (Dictionary)" "Suche (Wörterbuch)" +"Lookup (Google)" "Suche (Google)" +"Lookup (Acronym Finder)" "Suche (Kurzwort Finder)" +"Copy" "Kopieren" +"Select All" "Alle auswählen" +"Copy URL" "Kopiere URL" +"Open URL" "Öffne URL" +"Subscription" "Bestellung" + + + +### PREFERENCES ----------------------------------- + +"Preferences" "Einstellungen" + +"Proxy" "Proxy" +"Enable Proxy" "Aktiviere Proxy" +"Address" "Addresse" +"Port" "Port" +"Username" "Benutzername" +"Password" "Passwort" + +"Max Downloads" "Maximale Downloads" + +"FileType" "Dateitypen" +"Browser" "Browser" +"Player" "Player" + +"Channels" "Kanäle" +"Check all channels on startup" "Überprüfe alle Kanäle beim Start" +"Check the channel every" "Überprüfe die Kanäle jedesmal" + +"never" "Niemals" +"5 minutes" "5 Minuten" +"15 minutes" "15 Minuten" +"30 minutes" "30 Minuten" +"1 hour" "1 Stunde" +"2 hour" "2 Stunden" + + + + +### COLUMLISTVIEW ----------------------------------- + + +"1 new item" "1 neuer Eintrag" +"%d new items" "%d neue Einträge" +"new" "Neu" +"error" "Fehler" +"not down" "Nicht heruntergeladen" +"enquequed" "In Warteschlange" +"downloading" "Herunterladen" +"downloaded" "Heruntergeladen" +"connecting" "Verbinde" +"not found" "Nicht gefunden" +"stopped" "Angehalten" +"can't connect" "Keine Verbindung möglich" +"invalid format" "Ungültiges Format" + +"Icon" "Icon" +"Title" "Titel" +"Date" "Datum" +"Size" "Größe" +"Status" "Status" +"Download" "Download" + + + +### CONTEXT MENU ----------------------------------- + +"Add Channel" "Füge Kanal hinzu" +"Remove Channel" "Entferne Kanal" +"Check Channel" "Prüfe Kanal" +"Open Homepage" "Öffne Homepage" + +"Open Web Page" "Öffne Webseite" +"Open Enclosures folder" "Öffne Anlagenordner" +"Check All Channels" "Prüfe alle Kanäle" + +"Show Channel Image" "Zeige Kanal Abbild" + +"Play enclosure" "Spiele Anlage ab" +"(Re)start download" "Starte Download (neu)" +"Stop download" "Unterbreche Download" +"Remove Item" "Entferne Eintrag" + +"Find this Item" "Find this Item" +"Remove from this list" "Remove from this list" + + + + +### ALERT ----------------------------------- + +"You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" "You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" + +"Can't open the selected file with:\n\n" "Can't open the selected file with:\n\n" +"\n\nPlease check if the application is installed in the right way.\n" "\n\nPlease check if the application is installed in the right way.\n" +"Download it!" "Download it!" + +"\nRemoving.." "\nLösche.." +"\nAn error occured while removing!" "\nEin Fehler trat während des Löschens auf!" +"Check all the podcasts for new items" "Prüfe alle Podcasts nach neuen Einträgen" + +# multi line text... please translate only the text after _value= and don't remove empty space + +_key="alert1" + _value=" +Sie sind im Begriff, den ausgewählten Eintrag zu löschen. + +Sind Sie sicher? +(Sie werden evtl. eingebundene Dateien verlieren)" + + +_key="alert2a" + _value=" +Sie sind im Begriff, folgenden Kanal zu löschen: + +" + +_key="alert2b" + _value=" + +Wünschen Sie diesen Kanal zu archivieren +(alle Dateien und Anhänge werden behalten) +or möchten Sie den kompletten Kanal LÖSCHEN?" + +_key="alert3" + _value=" +Durchsuche Archiv" + +_key="alert_3gp" + _value=" +3GP is a multimedia container format defined by the Third Generation Partnership Project (3GPP) for use on 3G mobile phones. It stores video streams as MPEG-4 or H.263, and audio streams as AMR-NB or AAC-LC. + +VideoLAN still doesn't support the audio AMR (3GPP)" + +_key="alert_swf" + _value=" +SWF is a proprietary vector graphics file format produced by the Flash software from Adobe (formerly Macromedia). + +Currently Flash support in BeOS/Haiku/Zeta is limited to the old standalone Flash player version 4.1015, there isn't a modern Flash player" + + +### HELP & SHORTCUTS ----------------------------------- + + +"Introduction" "Einführung" +"The User Interface" "Die Benutzeroberfläche" +"Menu Bar" "Menüleiste" +"Toolbar Buttons" "Werkzeugleiste" +"First time with BePodder" "Das erste Mal mit BePodder" +"Download Podcast's enclosure files" "Lade Podcast Anlagen herunter" +"Settings Overview" "Einstellungen überblicken" +"Directory lists" "Verzeichnis Listen" +"Loading Help..." "Ladehilfe..." +"Register your copy" "Registriere deine Kopie" +"Starting point" "Ausgangspunkt" +"First time with BePodder" "Das erste Mal mit BePodder" + + + +# multi line text... please translate only the text after _value= and don't remove empty space + + +_key="help1-0" + _value="Willkommen zur BePodder Starthilfe." + +_key="help1-1" + _value="Sollten Sie schon Erfahrungen bzgl. Podcasts und RSS Feeds besitzen, können Sie +direkt zu BePodder durch Schließen dieses Fensters wechseln." + +_key="help1-2" +_value="Falls nicht, erhalten Sie hier eine kurze Einführung, die Ihnen alles zeigt, was sie wissen müssen, um mit BePodder arbeiten zu können. Benutzen Sie die unteren Tasten für diese Einführung." + + +_key="help2-0" + _value="Podcasting beschreibt eine Methode, Audio und Video Sendungen über das Internet zu verbreiten. Links zu freien Audio und Video Dateien werden in RSS und Atom Feeds eingefügt." + +_key="help2-1" +_value="Dadurch ist Podcasting einfach eine Art der Online Medien Übertragung. Benutzer tragen sich in einen Podcast durch Verwenden des Feeds (Einspeisung) ein. Solche wie RSS 'Really Simple Syndication' oder Atom." + +_key="help2-2" +_value=" +Ein Aggregrat (oder Podfänger) wie BePodder ist eine Software, die es Ihnen ermöglicht, sich in eine RSS Einspeisung einzutragen und regelmäßig nach neuen Inhalten zu suchen. Mit BePodder können die nach neuen Podcasts, Einträgen und Folgen Ihrer eingetragenen Kanäle suchen. Ein Eintrag kann eine Anlage beinhalten, so wie Emails einen solchen besitzen können." + + +_key="help3-0" +_value="BePodder hat eine einfache, dennoch mächtige Benutzeroberfläche. Das Hauptfenster ist in drei Felder aufgeteilt:" + +_key="help3-1" +_value="1) The Subscription list (the panel with the number 1 in the screenshot) with the list of the podcasts that you have subscribed to. When you click on a Channel you can see in the panel 2 the list of the channel's items." + +_key="help3-2" +_value="2) Die Folge Liste mit allen verfügbaren Einträgen." + +_key="help3-3" +_value="3) Das Informationsfeld zeigt: Inhalt der Folgen, Kanal Informationen oder Download Informationen; Sie können ein Informationsfeld wählen, indem Sie eine der drei unteren Tasten anklicken." + + + +_key="help4-0" +_value="At the very top of the BePodder main window is the menubar with seven menus available: File, Settings, Subscriptions, Episodes, Lists, View and Help. Some menu commands are followed by a right pointing arrow that indicates a submenu of related commands. As you explore each menu, be sure to take a look at the submenus as well. Click on a menus to show its commands:" + +_key="help4-1" +_value="Datei: Enthält Befehle, die Anwendung zu schließen und Informationen über BePodder zu zeigen." + +_key="help4-2" +_value="Einstellungen: Enthält Befehle, das Präferenzen Fenster zu öffnen, das Ihnen erlaubt, verschiedene BePodder Einstellungen bevozugt anzufertigen." + +_key="help4-3" +_value="Bestellungen: Enthält Befehle, die Tätigkeiten für die gewählten Kanäle Ihrer Bestellliste durchführen." + +_key="help4-4" +_value="Folgen: Enthält Befehle, die Tätigkeiten für dem gewählten Eintrag (Folge) aus der Kanal Liste durchführen." + +_key="help4-5" +_value="Listen: Enthält Befehle, um OPML Verzeichnisse von BePodder zu öffnen." + +_key="help4-6" +_value="Ansicht: Enthält Befehle und Kontrollen für das BePodder Fenster." + +_key="help4-7" +_value="Hilfe: Enthält Befehle, um die BePodder Starthilfe und die Tastaturkürzel Übersicht zu öffnen." + + + +_key="help5-0" + _value="Add Button: opens the Add Window to add a feed url (e.g. http://www.newpodcast.com/rss.xml) usually given on the podcast homepage; looks for text or graphic link that says something like 'XML', 'RSS' or 'Podcast Feed' on it." + +_key="help5-1" + _value="Channel Remove Button: opens a window in which you can select how remove the channel: just archive the select channel (keeping all the files and eclosure downloaded so far) or delete the whole channel from your computer." + +_key="help5-2" + _value="Überprüfen Taste: überprüft den vorgewählten Kanal und aktualisiert die Liste der vorhandenen Einträge für den Podcast, indem die neuen Einträge hinzugefügt werden." + +_key="help5-3" + _value="Web Button: shows the channel homepage in the browser. To select your favorite browser open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select your favorite browser." + +_key="help5-4" + _value="Play Button: with this button you can view or listen the file enclosure of the selected item(episode). To select your favorite player open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select you favorite player." + +_key="help5-5" + _value="Herunterladen Taste: Läd die Anlage des gewählten Eintrages (Folge); Sie können die Downloadinformation sehen, indem Sie auf die dritte Taste über der Informatiosfeld klicken." + +_key="help5-6" + _value="Unterbrechen Taste: Unterbricht das Herunterladen der Anlage des gewählten Eintrages (Folge). Die Wiederaufnahme funktioniert mit einem Doppelklick oder über Betätigung der 'Herunterladen' Taste." + +_key="help5-7" + _value="Item Remove Button: deletes the selected item (you will loose the enclosure file)." + + + +_key="help6-0" + _value="Starten mit BePodder ist einfach." + +_key="help6-1" + _value="Auf der linken Seite sehen Sie Ihre Feed Einträge. Wir haben bereits ein paar Einträge für Sie übernommen und sie können eigene auf zwei Arten hinzufügen:" + +_key="help6-2" + _value="1) Klicken Sie die 'Hinzufügen' Taste, geben Sie die URL der Einspeisung ( Beispiel: http://www.newpodcast.com/rss.xml) ein und klicken Sie auf 'Hinzufügen'." + +_key="help6-3" + _value="2) Wählen Sie 'Verzeichnis' im Menu und anschließend 'Podcast Liste' oder 'Videoblog Liste' aus, suchen sie einen Podcast und klicken sie 'Anmelden'." + +_key="help6-4" + _value="Wenn Sie einen Podcast in Ihrer Liste auswählen und die 'Überprüfen' Taste auswählen, wird BePodder neue Einträge zu der 'Folgen Liste' rechts hinzufügen; Sie können alle Ihre Podcasts überprüfen, indem Sie einen Rechtsklick tätigen und 'Prüfe Alle Kanäle' auswählen." + +_key="help6-5" + _value="Look at the screenshot above, there are 3 new items indicated by a black dot in the first column of the 'Episodes list'." + +_key="help6-6" + _value="In the second column there are icons that indicate the state of the item:" + +_key="help6-7" + _value="- the Episode 4 has an icon that indicates an error" + +_key="help6-8" + _value="- the Episode 3 has an icon that indicates that the item's enclosure download request is enquequed" + +_key="help6-9" + _value="- the Episode 2 has an icon that indicates that BePodder is downloading the item's enclosure file" + +_key="help6-10" + _value="- the Episode 1 has an icon that indicates that BePodder have just downloaded the item's enclosure file" + + + +_key="help7-0" + _value="Wählen Sie einen Eintrag aus der Liste der Folgen aus, klicken diesen doppelt oder wählen Sie die Download Taste. Sie können einen Download immer durch Betätigen der Stop Taste anhalten." + +_key="help7-1" + _value="Wenn Sie einen Podcast aus der Eintrag Liste auswählen, zeigt Ihnen die Software eine Liste an Folgen mit allen Einträgen, die bzgl. dieser Anmeldung zur Verfügung stehen. +Wählen Sie einen Eintrag aus und klicken Sie auf den Abspielbutton um die Datei zu sehen/hören." + +_key="help7-2" + _value="Sie können auf das Anlage Verzeichnis zugreifen, wenn Sie das Verzeichnis Icon im Info Feld auswählen, oder durch einen Rechtsclick mit Ihrer Maus und Auswahl von 'Öffne Inhaltsordner'." + + +_key="help8-0" + _value="Preferences can be accessed by clicking in the menu-bar Settings>Preferences. You can select a category from the left list of the preferences dialog: FileType, Channels, Download and Proxy." + +_key="help8-1" + _value="- FileType: to specify the default browser and player. " + +_key="help8-2" + _value="- Channels: to specify preferences that control the operation to check channels new items; you can choose to Check all channels on startup or check the channel every desired minutes." + +_key="help8-3" + _value="- Download: to specify the max number of item's files to download at the same time," + +_key="help8-4" + _value="- Proxy: to set up a proxy server to work with BePodder; a proxy server acts as a security barrier between your internal network and the Internet, keeping others on the Internet from accessing information on your internal network." + + + +_key="help9-0" + _value="BePodder has built-in podcast, videoblog, imagefeeds, newsfeeds, bittorrentfeeds and internationalfeeds OPML directories with thousands of feeds grouped by category." + +_key="help9-1" + _value="OPML (Outline Processor Markup Language) is an XML-based format that allows exchange of outline-structured information between applications." + +_key="help9-2" + _value="OPML directory can be accessed by clicking in the menu-bar 'Lists' and thenselecting a list. To browse the opml directory for a feed, expand the list by clicking the arrow of the category that you are interested in (see image); using this method, you can expand the opml directory until you find the desired feed. Once you have selected it, you can add it to the subscription list by clicking the button 'Subscribe', you can also collapse all categories in the directory list by clicking the button 'Collapse All'." + + +_key="help_shortcut1" +_value="Diese Seite beschreibt die Tastaturkürzel, die in BePodder benutzt werden können. Die Abkürzungen werden nach Funktion gruppiert." + +_key="help_shortcut2" +_value="Das bedeutet, daß Sie entweder Alt oder Steuerung verwenden. In Abhängigkeit zu Ihren Tastatur Einstellungen in den Deskbar Präferenzen. (Beispiel Alt+Q oder Ctrl+Q für Beenden der Anwendung)" + +_key="help_shortcut3" + _value="Allgemeine Kürzel" + +_key="help_shortcut4" + _value="Beendet das Programm" + +_key="help_shortcut5" + _value="Zeigt die bevorzugten Einstellungen" + +_key="help_shortcut6" + _value="Zeigt die Verzeichnisliste der Podcasts" + +_key="help_shortcut7" + _value="Zeigt die Verzeichnisliste der Videoblogs" + +_key="help_shortcut8" + _value="Zeigt die Verzeichnisliste der Bildeinspeisungen" + +_key="help_shortcut9" + _value="Zeigt die Verzeichnisliste der Nachrichteneinspeisungen" + +_key="help_shortcut9b" + _value="Zeigt die Verzeichnisliste der BitTorrentfeeds" + +_key="help_shortcut9c" + _value="Zeigt die Verzeichnisliste der Internationalfeeds" + +_key="help_shortcut10" + _value="Vollbild" + +_key="help_shortcut11" + _value="Zeigt/Versteckt die Werkzeugleiste" + +_key="help_shortcut12" + _value="Zeigt die Starthilfe" + +_key="help_shortcut13" + _value="Zeigt die Übersicht der Tastatur Kürzel" + +_key="help_shortcut14" + _value="Kanal Kürzel" + +_key="help_shortcut15" + _value="Fügt einen Podcast der Bestellliste hinzu" + +_key="help_shortcut16" + _value="Löscht den ausgewählten Podcast von der Bestellliste" + +_key="help_shortcut17" + _value="Überprüft den ausgewählten Podcast nach neuen Folgen (Einträgen)" + +_key="help_shortcut18" + _value="Überprüft alle ausgewählten Podcast nach neuen Folgen (Einträgen)" + +_key="help_shortcut19" + _value="Zeigt die Podcast Homepage" + +_key="help_shortcut20" + _value="Öffnet den Anlagenordner" + +_key="help_shortcut21" + _value="Folgen Kürzel" + +_key="help_shortcut22" + _value="Spielt Anlagen ab" + +_key="help_shortcut23" + _value="Startet Download der ausgewählten Folge (Eintrag) neu" + +_key="help_shortcut24" + _value="Unterbricht den Download der Folge (Eintrag)" + +_key="help_shortcut25" + _value="Löscht die ausgewählte Folge (Eintrag)" + +_key="help_shortcut26" + _value="Zeigt die Podcast Folge (Eintrag) Seite" + +_key="help_shortcut27" + _value="Öffnet den Anlagenordner" + +_key="help_buy1" + _value="BePodder Light is the basic version (free download and no time limited), the registered version adds some more nice features: unlimited number of channels, small Channel view, proxy support, automatic channels check, up to 5 enclosure downloads at the same time (multithreading)." + +_key="help_buy2" + _value="Bitte bezahlen Sie die Shareware Gebühr. Es sind nur 15 Euro (Kagi fügt in einigen Ländern Steuern hinzu), Die BePodder Lizenz kann online von Kagi gekauft werden." + +_key="help_buy3" + _value="Kaufe über www.funkyideasoft.com" + +_key="help_buy4" + _value="Nach dem Kauf wird Ihnen eine E-Mail mit der Schlüsseldatei und einer Anweisung zugesandt, wie die Schlüsseldatei zu installieren ist. Es ist nur ein kleiner Schritt, die Datei zu entpacken und sie in ein bestimmtes Verzeichnis zu bewegen." + +_key="help_buy5" + _value="Es gibt keine Schwierigkeiten, BePodder zu aktualisieren, wenn eine neue Version verfügbar ist. Die Schlüsseldatei wird alle heruntergeladenen Pakete aufschließen, wenn nichts anderes vereinbart wird." + + +### USELESS ######## + +"Opml Editor" "Opml Editor" +"name:" "Name:" +"Add a categorie" "Kategorie hinzufügen" +"Add a new Broadcast" "Ausstrahlung hinzufügen" +"feed:" "Einspeisung:" +"url:" "URL:" +"Test podcast" "Podcast testen" +"Del a categorie" "Eine Kategorie löschen" +"Add a categorie" "Eine Kategorie hinzufügen" +"Select the podcast categorie:" "Podcast Kategorie auswählen:" +"Check all" "Prüfe alle" +"Check" "Prüfe" +"Refresh the list" "Liste erneuern" +"Load" "Laden" +"Load the list" "Liste laden" +"Save" "Speichern" +"Save the list" "Liste speichern" +"Revert" "Zurückkehren" +"Apply" "Anwenden" + + + + + + + + + + + + diff --git a/release/Language/Dictionaries/BePodder.enUK b/release/Language/Dictionaries/BePodder.enUK new file mode 100644 index 0000000..296dac8 --- /dev/null +++ b/release/Language/Dictionaries/BePodder.enUK @@ -0,0 +1,604 @@ + +# Locale file for BePodder. +# Modified: 4/18/2006 +# Author: BePodderTeam +# E-mail: bepodder.team@gmail.com + + +# Attention: don't remove empty space or \n + + +### SHAREWARE POPUPS ----------------------------------- + +"Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" "Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" + +"This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" "This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" + +"Web Site" "Web Site" + +"Can't connect!" "Can't connect!" +"Http port failed!" "Http port failed!" +"Can't resolve host!" "Can't resolve host!" +"Not found!" "Not found!" +"Bad resume!" "Bad resume!" +"Aborted by Callback!" "Aborted by Callback!" +"Can't resume! (range error)" "Can't resume! (range error)" +"Access Denied!" "Access Denied!" +"User or Password Incorrect!" "User or Password Incorrect!" +"Other error (cUrl code: " "Other error (cUrl code: " +"cUrl init error!" "cUrl init error!" +"Can't open file!" "Can't open file!" +"Other error (status code: " "Other error (status code: " +"Downloading" "Downloading" + + +### MENUBAR ----------------------------------- + +"File" "File" +"About..." "About..." +"Close!" "Close!" +"Quit" "Quit" + +"Settings" "Settings" +"Preferences..." "Preferences..." + +"Subscriptions" "Subscriptions" + +"Episodes" "Episodes" + +"Lists" "Lists" +"Podcast List" "Podcast List" +"Podcast directory list" "Podcast directory list" +"Videoblog List" "Videoblog List" +"Videoblog directory list" "Videoblog directory list" +"Imagefeeds List" "Imagefeeds List" +"Imagefeeds directory list" "Imagefeeds directory list" +"Newsfeeds List" "Newsfeeds List" +"Newsfeeds directory list" "Newsfeeds directory list" +"BitTorrentfeeds List" "BitTorrentfeeds List" +"BitTorrentfeeds directory list" "BitTorrentfeeds directory list" +"Internationalfeeds List" "Internationalfeeds List" +"Internationalfeeds directory list" "Internationalfeeds directory list" + +"View" "View" +"Full Screen" "Full Screen" +"Toolbar" "Toolbar" +"Subscriptions View" "Subscriptions View" +"Small Items" "Small Items" +"Big Items" "Big Items" +"Move BePodder on workspace:" "Move BePodder on workspace:" + +"Help" "Help" +"Getting Started" "Getting Started" +"Keyboard Shortcuts" "Keyboard Shortcuts" +"Tutorials" "Tutorials" +"Online Support" "Online Support" + + + + +### BUTTONS ----------------------------------- + +# Buttons add feed window +"Insert the rss feed url!" "Insert the rss feed url!" +"Add" "Add" +"Paste" "Paste" + +# Buttons directory list window +"Collapse All" "Collapse All" +"Preview" "Preview" +"Subscribe" "Subscribe" + + +# Buttons help window +"Next" "Next" +"Prev" "Prev" +"Close" "Close" +"Index" "Index" + + +# Buttons remove windows +"Cancel" "Cancel" +"Delete" "Delete" +"Archive" "Archive" + + + +### TOOLTIPS ----------------------------------- + +# Tooltips toolbar buttons + +"Add the podcast to the Subscriptions list" "Add the podcast to the Subscriptions list" +"Delete the podcast from the Subscriptions list" "Delete the podcast from the Subscriptions list" +"Check the selected podcast for new items" "Check the selected podcast for new items" +"Show the podcast homepage" "Show the podcast homepage" + +"Delete the item and the enclosure" "Delete the item and the enclosure" +"Stop the item download" "Stop the item download" +"Download the selected episode" "Download the selected episode" +"Play the selected episode" "Play the selected episode" + +"Submit bug and idea" "Submit bug and idea" + + +# Tooltips directory window buttons + +"Collapse all categories in the directory list" "Collapse all categories in the directory list" +"Add the selected podcast to the Subscription list" "Add the selected podcast to the Subscription list" +"Checkout a podcast before downloading it" "Checkout a podcast before downloading it" + + +### INFO PANEL ----------------------------------- + +"Show channel Image" "Show Channel Image" +"XML Feed Link" "XML Feed Link" + +"Show Episode info" "Show Episode info" +"Show Subscription info" "Show Subscription info" +"Show Downloads info" "Show Downloads info" + +"Enclosure: " "Enclosure: " + +"Lookup (Dictionary)" "Lookup (Dictionary)" +"Lookup (Google)" "Lookup (Google)" +"Lookup (Acronym Finder)" "Lookup (Acronym Finder)" +"Copy" "Copy" +"Select All" "Select All" +"Copy URL" "Copy URL" +"Open URL" "Open URL" +"Subscription" "Subscription" + + +### PREFERENCES ----------------------------------- + +"Preferences" "Preferences" + +"Proxy" "Proxy" +"Enable Proxy" "Enable Proxy" +"Address" "Address" +"Port" "Port" +"Username" "Username" +"Password" "Password" + +"Max Downloads" "Max Downloads" + +"FileType" "FileType" +"Browser" "Browser" +"Player" "Player" + +"Channels" "Channels" +"Check all channels on startup" "Check all channels on startup" +"Check the channel every" "Check the channel every" + +"never" "never" +"5 minutes" "5 minutes" +"15 minutes" "15 minutes" +"30 minutes" "30 minutes" +"1 hour" "1 hour" +"2 hour" "2 hour" + + + + +### COLUMLISTVIEW ----------------------------------- + + +"1 new item" "1 new item" +"%d new items" "%d new items" +"new" "new" +"error" "error" +"not down" "not down" +"enquequed" "enquequed" +"downloading" "downloading" +"downloaded" "downloaded" +"connecting" "connecting" +"not found" "not found" +"stopped" "stopped" +"can't connect" "can't connect" +"invalid format" "invalid format" + +"Icon" "Icon" +"Title" "Title" +"Date" "Date" +"Size" "Size" +"Status" "Status" +"Download" "Download" + + + +### CONTEXT MENU ----------------------------------- + +"Add Channel" "Add Channel" +"Remove Channel" "Remove Channel" +"Check Channel" "Check Channel" +"Open Homepage" "Open Homepage" + +"Open Web Page" "Open Web Page" +"Open Enclosures folder" "Open Enclosures folder" +"Check All Channels" "Check All Channels" + +"Show Channel Image" "Show Channel Image" + +"Play enclosure" "Play enclosure" +"(Re)start download" "(Re)start download" +"Stop download" "Stop download" +"Remove Item" "Remove Item" + +"Find this Item" "Find this Item" +"Remove from this list" "Remove from this list" + + + +### ALERT ----------------------------------- + +"\nRemoving.." "\nRemoving.." +"\nAn error occured while removing!" "\nAn error occured while removing!" +"Check all the podcasts for new items" "Check all the podcasts for new items" + +"You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" "You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" + + +"Can't open the selected file with:\n\n" "Can't open the selected file with:\n\n" +"\n\nPlease check if the application is installed in the right way.\n" "\n\nPlease check if the application is installed in the right way.\n" +"Download it!" "Download it!" + +# multi line text... please translate only the text after _value= and don't remove empty space + +_key="alert1" + _value=" +You are going to remove the selected item. + +Are you sure? +(you will lost the enclosure file if any)" + + +_key="alert2a" + _value=" +You are going to remove the channel: + +" + +_key="alert2b" + _value=" + +Would you like just to archive this +channel (keeping all the files and +enclosures downloaded so far) or +do you want to DELETE the whole + channel from you computer?" + +_key="alert3" + _value=" +Parsing archive.." + +_key="alert_3gp" + _value=" +3GP is a multimedia container format defined by the Third Generation Partnership Project (3GPP) for use on 3G mobile phones. It stores video streams as MPEG-4 or H.263, and audio streams as AMR-NB or AAC-LC. + +VideoLAN still doesn't support the audio AMR (3GPP)" + +_key="alert_swf" + _value=" +SWF is a proprietary vector graphics file format produced by the Flash software from Adobe (formerly Macromedia). + +Currently Flash support in BeOS/Haiku/Zeta is limited to the old standalone Flash player version 4.1015, there isn't a modern Flash player" + + + + +### HELP & SHORTCUTS ----------------------------------- + + +"Introduction" "Introduction" +"The User Interface" "The User Interface" +"Menu Bar" "Menu Bar" +"Toolbar Buttons" "Toolbar Buttons" +"First time with BePodder" "First time with BePodder" +"Download Podcast's enclosure files" "Download Podcast's enclosure files" +"Settings Overview" "Settings Overview" +"Directory lists" "Directory lists" +"Loading Help..." "Loading Help..." +"Register your copy" "Register your copy" +"Starting point" "Starting point" + + + + +# multi line text... please translate only the text after _value= and don't remove empty space + + +_key="help1-0" + _value="Welcome to the BePodder Getting Started Guide." + +_key="help1-1" + _value="If you are already familiar with podcasts and RSS/Atom feeds you can immediately go to BePodder by closing this window." + +_key="help1-2" +_value="If not, this is a short introduction providing you everything you'll need to know on how to get started with BePodder. Use the buttons below to navigate through this tutorial." + + +_key="help2-0" +_value="Podcasting is a method for publishing audio and video broadcasts via the Internet; links to free audio and video files are enclosed in RSS and Atom feeds." + +_key="help2-1" +_value="Therefore Podcasting is simply a type of online media delivery; users can subscribe to a podcast using a feed (such as RSS 'Really Simple Syndication' or Atom)." + +_key="help2-2" +_value="An aggregator (or podcatcher) like BePodder, is a piece of software that allows you to subscribe to a RSS feed and periodically check for and download new content; with BePodder you can check for new Podcast items (Episodes) of your subscribed Channels. Any item can contain an enclosure, just like an Email can contain an attachment." + + + +_key="help3-0" +_value="BePodder has an easy to use yet powerful Graphical User Interface. The main window is split into tree panels:" + +_key="help3-1" +_value="1) The Subscription list (the panel with the number 1 in the screenshot) with the list of the podcasts that you have subscribed to. When you click on a Channel you can see in the panel 2 the list of the channel's items." + +_key="help3-2" +_value="2) The Episodes list with all the items available." + +_key="help3-3" +_value="3) The Info panel show: episode info, channel info or Downloads info; you can select an info panel by clicking one of the below three buttons." + + + +_key="help4-0" +_value="At the very top of the BePodder main window is the menubar with seven menus available: File, Settings, Subscriptions, Episodes, Lists, View and Help. Some menu commands are followed by a right pointing arrow that indicates a submenu of related commands. As you explore each menu, be sure to take a look at the submenus as well. Click on a menus to show its commands:" + +_key="help4-1" +_value="File: contains commands to close the application and to show information about BePodder" + +_key="help4-2" +_value="Settings: contains command to open the Preferences window that allows you to customize various BePodder settings." + +_key="help4-3" +_value="Subscriptions: contains commands that perform actions on the selected channel of your subscriptions list." + +_key="help4-4" +_value="Episodes: contains commands that perform actions on the selected item (episode) of the channel's episode list." + +_key="help4-5" +_value="Lists: contains commands to open BePodder's OPML directories." + +_key="help4-6" +_value="View: contains commands and controls for the BePodder window." + +_key="help4-7" +_value="Help: contains commands to open BePodder's 'Getting Started Guide' and the 'Keyboard Shortcuts List'." + + + +_key="help5-0" + _value="Add Button: opens the Add Window to add a feed url (e.g. http://www.newpodcast.com/rss.xml) usually given on the podcast homepage; looks for text or graphic link that says something like 'XML', 'RSS' or 'Podcast Feed' on it." + +_key="help5-1" + _value="Channel Remove Button: opens a window in which you can select how remove the channel: just archive the select channel (keeping all the files and eclosure downloaded so far) or delete the whole channel from your computer." + +_key="help5-2" + _value="Check Button: checks the selected channel and updates the list of the available items for that podcast adding the new items." + +_key="help5-3" + _value="Web Button: shows the channel homepage in the browser. To select your favorite browser open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select your favorite browser." + +_key="help5-4" + _value="Play Button: with this button you can view or listen the file enclosure of the selected item(episode). To select your favorite player open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select you favorite player." + +_key="help5-5" + _value="Download Button: downloads the file enclosure of the selected item (episode); you can see the download info by clicking on the third button over the info panel." + +_key="help5-6" + _value="Stop Button: stops to download the file enclosure of the selected item (episode); to resume the download double-click the item (episode) or select the item and click the Download Button" + +_key="help5-7" + _value="Item Remove Button: deletes the selected item (you will loose the enclosure file)." + + + +_key="help6-0" + _value="Getting started with BePodder is easy." + +_key="help6-1" + _value="On the left of the main window you can see the 'Subscription List' with all your feed subscriptions. We have added some subscriptions for you, and you can always add your own in two ways:" + +_key="help6-2" + _value="1) click the Add Button, then insert the feed url (example: http://www.newpodcast.com/rss.xml) and click add." + +_key="help6-3" + _value="2) in the menubar select 'Directory' and then 'Podcast list' or another list, choose a podcast and click 'Subscribe'." + +_key="help6-4" + _value="If you select a Podcast in the subscriptions list and use the check button, BePodder adds the new items to the 'Episodes list' (below on the right); you can check all your podcasts by right-clicking and selecting 'Check All Channels' in the context menu." + +_key="help6-5" + _value="Look at the screenshot above, there are 3 new items indicated by a black dot in the first column of the 'Episodes list'." + +_key="help6-6" + _value="In the second column there are icons that indicate the state of the item:" + +_key="help6-7" + _value="- the Episode 4 has an icon that indicates an error" + +_key="help6-8" + _value="- the Episode 3 has an icon that indicates that the item's enclosure download request is enquequed" + +_key="help6-9" + _value="- the Episode 2 has an icon that indicates that BePodder is downloading the item's enclosure file" + +_key="help6-10" + _value="- the Episode 1 have an icon that indicates that BePodder have just downloaded the item's enclosure file" + + + +_key="help7-0" + _value="Select an item in the 'Episodes list' and then double-click on it (or click the Download Button) to start downloading the enclosed file; you can always stop the download by clicking on the Stop Button." + +_key="help7-1" + _value="When you click on the Subscribed Podcasts in the 'Subscriptions List' the software shows you, in the 'List of episodes', all the items available in that Subscription. Select an item and then click play (Play Button) to view or listen to the file." + +_key="help7-2" + _value="You can access the Enclosures Folder by clicking on the folder icon in the Info Pannel or by right-clicking your mouse on an item and select 'Open Enclosures Folder' in the context menu." + + + +_key="help8-0" + _value="Preferences can be accessed by clicking in the menu-bar Settings>Preferences. You can select a category from the left list of the preferences dialog: FileType, Channels, Download and Proxy." + +_key="help8-1" + _value="- FileType: to specify the default browser and player. " + +_key="help8-2" + _value="- Channels: to specify preferences that control the operation to check channels new items; you can choose to Check all channels on startup or check the channel every desired minutes." + +_key="help8-3" + _value="- Download: to specify the max number of item's files to download at the same time," + +_key="help8-4" + _value="- Proxy: to set up a proxy server to work with BePodder; a proxy server acts as a security barrier between your internal network and the Internet, keeping others on the Internet from accessing information on your internal network." + + + +_key="help9-0" + _value="BePodder has built-in podcast, videoblog, imagefeeds, newsfeeds, bittorrentfeeds and internationalfeeds OPML directories with thousands of feeds grouped by category." + +_key="help9-1" + _value="OPML (Outline Processor Markup Language) is an XML-based format that allows exchange of outline-structured information between applications." + +_key="help9-2" + _value="OPML directory can be accessed by clicking in the menu-bar 'Lists' and thenselecting a list. To browse the opml directory for a feed, expand the list by clicking the arrow of the category that you are interested in (see image); using this method, you can expand the opml directory until you find the desired feed. Once you have selected it, you can add it to the subscription list by clicking the button 'Subscribe', you can also collapse all categories in the directory list by clicking the button 'Collapse All'." + +_key="help_shortcut1" +_value="This page describes the keyboard shortcuts that can be used in BePodder. The shortcuts are grouped here by function." + +_key="help_shortcut2" +_value="means that you can use either alt or control (es. Alt+Q or Ctrl+Q Quit the application), which way you have set it in the Deskbar menu preferences under Keyboard (the default shortcut key is Alt)." + +_key="help_shortcut3" + _value="General shortcuts" + +_key="help_shortcut4" + _value="Quit the application" + +_key="help_shortcut5" + _value="Shows the Preferences window" + +_key="help_shortcut6" + _value="Shows the Podcast directory list" + +_key="help_shortcut7" + _value="Shows the Videoblog directory list" + +_key="help_shortcut8" + _value="Shows the Imagefeeds directory list" + +_key="help_shortcut9" + _value="Shows the Newsfeeds directory list" + +_key="help_shortcut9b" + _value="Shows the BitTorrentfeeds directory list" + +_key="help_shortcut9c" + _value="Shows the Internationalfeeds directory list" + +_key="help_shortcut10" + _value="Fullscreen" + +_key="help_shortcut11" + _value="Shows/Hides the toolbar" + +_key="help_shortcut12" + _value="Shows the Getting Started Help" + +_key="help_shortcut13" + _value="Shows this keyboard shortcuts page" + +_key="help_shortcut14" + _value="Channels shortcuts" + +_key="help_shortcut15" + _value="Add a podcast to the subscriptions list" + +_key="help_shortcut16" + _value="Delete the selected podcast from the subscriptions list" + +_key="help_shortcut17" + _value="Check the selected podcast for new episodes (items)" + +_key="help_shortcut18" + _value="Check all podcasts for new episodes (items)" + +_key="help_shortcut19" + _value="Shows the podcast homepage" + +_key="help_shortcut20" + _value="Open enclosures folder" + +_key="help_shortcut21" + _value="Episodes shortcuts" + +_key="help_shortcut22" + _value="Play enclosure" + +_key="help_shortcut23" + _value="(Re)start download the selected episodes (items)" + +_key="help_shortcut24" + _value="Stop the episode (item) download" + +_key="help_shortcut25" + _value="Delete the selected episode (item)" + +_key="help_shortcut26" + _value="Shows the podcast episode (item) page " + +_key="help_shortcut27" + _value="Open enclosures folder" + +_key="help_buy1" + _value="BePodder Light is the basic version (free download and no time limited), the registered version adds some more nice features: unlimited number of channels, small Channel view, proxy support, automatic channels check, up to 5 enclosure downloads at the same time (multithreading)." + +_key="help_buy2" + _value="Please pay the shareware fee, it's only 15 euro (Kagi add tax in some countries), BePodder licence can be purchased online from Kagi." + +_key="help_buy3" + _value="Buy at www.funkyideasoft.com" + +_key="help_buy4" + _value="After purchasing, an email will be sent to you with a keyfile and instruction on how to install it. It's just a matter of unzipping a file and moving it to a certain directory." + +_key="help_buy5" + _value="There is no problem updating BePodder when a new version becomes available. The keyfile will unlock all downloadable packages unless otherwise notified." + + +### USELESS ######## + +"Opml Editor" "Opml Editor" +"name:" "name:" +"Add a category" "Add a category" +"Add a new Broadcast" "Add a new Broadcast" +"feed:" "feed:" +"url:" "url:" +"Test podcast" "Test podcast" +"Del a category" "Del a category" +"Add a category" "Add a category" +"Select the podcast category:" "Select the podcast category:" +"Check all" "Check all" +"Check" "Check" +"Refresh the list" "Refresh the list" +"Load" "Load" +"Load the list" "Load the list" +"Save" "Save" +"Save the list" "Save the list" +"Revert" "Revert" +"Apply" "Apply" + + + + + + + + + + + + diff --git a/release/Language/Dictionaries/BePodder.enUS b/release/Language/Dictionaries/BePodder.enUS new file mode 100644 index 0000000..5e3a268 --- /dev/null +++ b/release/Language/Dictionaries/BePodder.enUS @@ -0,0 +1,605 @@ + +# Locale file for BePodder. +# Modified: 4/18/2006 +# Author: BePodderTeam +# E-mail: bepodder.team@gmail.com + + +# Attention: don't remove empty space or \n + + +### SHAREWARE POPUPS ----------------------------------- + +"Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" "Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" + +"This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" "This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" + +"Web Site" "Web Site" + +"Can't connect!" "Can't connect!" +"Http port failed!" "Http port failed!" +"Can't resolve host!" "Can't resolve host!" +"Not found!" "Not found!" +"Bad resume!" "Bad resume!" +"Aborted by Callback!" "Aborted by Callback!" +"Can't resume! (range error)" "Can't resume! (range error)" +"Access Denied!" "Access Denied!" +"User or Password Incorrect!" "User or Password Incorrect!" +"Other error (cUrl code: " "Other error (cUrl code: " +"cUrl init error!" "cUrl init error!" +"Can't open file!" "Can't open file!" +"Other error (status code: " "Other error (status code: " +"Downloading" "Downloading" + + +### MENUBAR ----------------------------------- + +"File" "File" +"About..." "About..." +"Close!" "Close!" +"Quit" "Quit" + +"Settings" "Settings" +"Preferences..." "Preferences..." + +"Subscriptions" "Subscriptions" + +"Episodes" "Episodes" + +"Lists" "Lists" +"Podcast List" "Podcast List" +"Podcast directory list" "Podcast directory list" +"Videoblog List" "Videoblog List" +"Videoblog directory list" "Videoblog directory list" +"Imagefeeds List" "Imagefeeds List" +"Imagefeeds directory list" "Imagefeeds directory list" +"Newsfeeds List" "Newsfeeds List" +"Newsfeeds directory list" "Newsfeeds directory list" +"BitTorrentfeeds List" "BitTorrentfeeds List" +"BitTorrentfeeds directory list" "BitTorrentfeeds directory list" +"Internationalfeeds List" "Internationalfeeds List" +"Internationalfeeds directory list" "Internationalfeeds directory list" + +"View" "View" +"Full Screen" "Full Screen" +"Toolbar" "Toolbar" +"Subscriptions View" "Subscriptions View" +"Small Items" "Small Items" +"Big Items" "Big Items" +"Move BePodder on workspace:" "Move BePodder on workspace:" + +"Help" "Help" +"Getting Started" "Getting Started" +"Keyboard Shortcuts" "Keyboard Shortcuts" +"Tutorials" "Tutorials" +"Online Support" "Online Support" + + + + +### BUTTONS ----------------------------------- + +# Buttons add feed window +"Insert the rss feed url!" "Insert the rss feed url!" +"Add" "Add" +"Paste" "Paste" + +# Buttons directory list window +"Collapse All" "Collapse All" +"Preview" "Preview" +"Subscribe" "Subscribe" + + +# Buttons help window +"Next" "Next" +"Prev" "Prev" +"Close" "Close" +"Index" "Index" + + +# Buttons remove windows +"Cancel" "Cancel" +"Delete" "Delete" +"Archive" "Archive" + + + +### TOOLTIPS ----------------------------------- + +# Tooltips toolbar buttons + +"Add the podcast to the Subscriptions list" "Add the podcast to the Subscriptions list" +"Delete the podcast from the Subscriptions list" "Delete the podcast from the Subscriptions list" +"Check the selected podcast for new items" "Check the selected podcast for new items" +"Show the podcast homepage" "Show the podcast homepage" + +"Delete the item and the enclosure" "Delete the item and the enclosure" +"Stop the item download" "Stop the item download" +"Download the selected episode" "Download the selected episode" +"Play the selected episode" "Play the selected episode" + +"Submit bug and idea" "Submit bug and idea" +"Collapse all categories in the directory list" "Collapse all categories in the directory list" + + +# Tooltips directory window buttons + +"Collapse all categories in the directory list" "Collapse all categories in the directory list" +"Add the selected podcast to the Subscription list" "Add the selected podcast to the Subscription list" +"Checkout a podcast before downloading it" "Checkout a podcast before downloading it" + + +### INFO PANEL ----------------------------------- + +"Show channel Image" "Show Channel Image" +"XML Feed Link" "XML Feed Link" + +"Show Episode info" "Show Episode info" +"Show Subscription info" "Show Subscription info" +"Show Downloads info" "Show Downloads info" + +"Enclosure: " "Enclosure: " + +"Lookup (Dictionary)" "Lookup (Dictionary)" +"Lookup (Google)" "Lookup (Google)" +"Lookup (Acronym Finder)" "Lookup (Acronym Finder)" +"Copy" "Copy" +"Select All" "Select All" +"Copy URL" "Copy URL" +"Open URL" "Open URL" +"Subscription" "Subscription" + + +### PREFERENCES ----------------------------------- + +"Preferences" "Preferences" + +"Proxy" "Proxy" +"Enable Proxy" "Enable Proxy" +"Address" "Address" +"Port" "Port" +"Username" "Username" +"Password" "Password" + +"Max Downloads" "Max Downloads" + +"FileType" "FileType" +"Browser" "Browser" +"Player" "Player" + +"Channels" "Channels" +"Check all channels on startup" "Check all channels on startup" +"Check the channel every" "Check the channel every" + +"never" "never" +"5 minutes" "5 minutes" +"15 minutes" "15 minutes" +"30 minutes" "30 minutes" +"1 hour" "1 hour" +"2 hour" "2 hour" + + + + +### COLUMLISTVIEW ----------------------------------- + + +"1 new item" "1 new item" +"%d new items" "%d new items" +"new" "new" +"error" "error" +"not down" "not down" +"enquequed" "enquequed" +"downloading" "downloading" +"downloaded" "downloaded" +"connecting" "connecting" +"not found" "not found" +"stopped" "stopped" +"can't connect" "can't connect" +"invalid format" "invalid format" + +"Icon" "Icon" +"Title" "Title" +"Date" "Date" +"Size" "Size" +"Status" "Status" +"Download" "Download" + + + +### CONTEXT MENU ----------------------------------- + +"Add Channel" "Add Channel" +"Remove Channel" "Remove Channel" +"Check Channel" "Check Channel" +"Open Homepage" "Open Homepage" + +"Open Web Page" "Open Web Page" +"Open Enclosures folder" "Open Enclosures folder" +"Check All Channels" "Check All Channels" + +"Show Channel Image" "Show Channel Image" + +"Play enclosure" "Play enclosure" +"(Re)start download" "(Re)start download" +"Stop download" "Stop download" +"Remove Item" "Remove Item" + +"Find this Item" "Find this Item" +"Remove from this list" "Remove from this list" + + + +### ALERT ----------------------------------- + +"\nRemoving.." "\nRemoving.." +"\nAn error occured while removing!" "\nAn error occured while removing!" +"Check all the podcasts for new items" "Check all the podcasts for new items" + +"You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" "You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" + +"Can't open the selected file with:\n\n" "Can't open the selected file with:\n\n" +"\n\nPlease check if the application is installed in the right way.\n" "\n\nPlease check if the application is installed in the right way.\n" +"Download it!" "Download it!" + +# multi line text... please translate only the text after _value= and don't remove empty space + +_key="alert1" + _value=" +You are going to remove the selected item. + +Are you sure? +(you will lost the enclosure file if any)" + + +_key="alert2a" + _value=" +You are going to remove the channel: + +" + +_key="alert2b" + _value=" + +Would you like just to archive this +channel (keeping all the files and +enclosures downloaded so far) or +do you want to DELETE the whole + channel from you computer?" + +_key="alert3" + _value=" +Parsing archive.." + +_key="alert_3gp" + _value=" +3GP is a multimedia container format defined by the Third Generation Partnership Project (3GPP) for use on 3G mobile phones. It stores video streams as MPEG-4 or H.263, and audio streams as AMR-NB or AAC-LC. + +VideoLAN still doesn't support the audio AMR (3GPP)" + +_key="alert_swf" + _value=" +SWF is a proprietary vector graphics file format produced by the Flash software from Adobe (formerly Macromedia). + +Currently Flash support in BeOS/Haiku/Zeta is limited to the old standalone Flash player version 4.1015, there isn't a modern Flash player" + + + +### HELP & SHORTCUTS ----------------------------------- + + +"Introduction" "Introduction" +"The User Interface" "The User Interface" +"Menu Bar" "Menu Bar" +"Toolbar Buttons" "Toolbar Buttons" +"First time with BePodder" "First time with BePodder" +"Download Podcast's enclosure files" "Download Podcast's enclosure files" +"Settings Overview" "Settings Overview" +"Directory lists" "Directory lists" +"Loading Help..." "Loading Help..." +"Register your copy" "Register your copy" +"Starting point" "Starting point" + + + + +# multi line text... please translate only the text after _value= and don't remove empty space + + +_key="help1-0" + _value="Welcome to the BePodder Getting Started Guide." + +_key="help1-1" + _value="If you are already familiar with podcasts and RSS/Atom feeds you can immediately go to BePodder by closing this window." + +_key="help1-2" +_value="If not, this is a short introduction providing you everything you'll need to know on how to get started with BePodder. Use the buttons below to navigate through this tutorial." + + + +_key="help2-0" +_value="Podcasting is a method for publishing audio and video broadcasts via the Internet; links to free audio and video files are enclosed in RSS and Atom feeds." + +_key="help2-1" +_value="Therefore Podcasting is simply a type of online media delivery; users can subscribe to a podcast using a feed (such as RSS 'Really Simple Syndication' or Atom)." + +_key="help2-2" +_value="An aggregator (or podcatcher) like BePodder, is a piece of software that allows you to subscribe to a RSS feed and periodically check for and download new content; with BePodder you can check for new Podcast items (Episodes) of your subscribed Channels. Any item can contain an enclosure, just like an Email can contain an attachment." + + + +_key="help3-0" +_value="BePodder has an easy to use yet powerful Graphical User Interface. The main window is split into tree panels:" + +_key="help3-1" +_value="1) The Subscription list (the panel with the number 1 in the screenshot) with the list of the podcasts that you have subscribed to. When you click on a Channel you can see in the panel 2 the list of the channel's items." + +_key="help3-2" +_value="2) The Episodes list with all the items available." + +_key="help3-3" +_value="3) The Info panel show: episode info, channel info or Downloads info; you can select an info panel by clicking one of the below three buttons." + + + +_key="help4-0" +_value="At the very top of the BePodder main window is the menubar with seven menus available: File, Settings, Subscriptions, Episodes, Lists, View and Help. Some menu commands are followed by a right pointing arrow that indicates a submenu of related commands. As you explore each menu, be sure to take a look at the submenus as well. Click on a menus to show its commands:" + +_key="help4-1" +_value="File: contains commands to close the application and to show information about BePodder" + +_key="help4-2" +_value="Settings: contains command to open the Preferences window that allows you to customize various BePodder settings." + +_key="help4-3" +_value="Subscriptions: contains commands that perform actions on the selected channel of your subscriptions list." + +_key="help4-4" +_value="Episodes: contains commands that perform actions on the selected item (episode) of the channel's episode list." + +_key="help4-5" +_value="Lists: contains commands to open BePodder's OPML directories." + +_key="help4-6" +_value="View: contains commands and controls for the BePodder window." + +_key="help4-7" +_value="Help: contains commands to open BePodder's 'Getting Started Guide' and the 'Keyboard Shortcuts List'." + + + +_key="help5-0" + _value="Add Button: opens the Add Window to add a feed url (e.g. http://www.newpodcast.com/rss.xml) usually given on the podcast homepage; looks for text or graphic link that says something like 'XML', 'RSS' or 'Podcast Feed' on it." + +_key="help5-1" + _value="Channel Remove Button: opens a window in which you can select how remove the channel: just archive the select channel (keeping all the files and eclosure downloaded so far) or delete the whole channel from your computer." + +_key="help5-2" + _value="Check Button: checks the selected channel and updates the list of the available items for that podcast adding the new items." + +_key="help5-3" + _value="Web Button: shows the channel homepage in the browser. To select your favorite browser open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select your favorite browser." + +_key="help5-4" + _value="Play Button: with this button you can view or listen the file enclosure of the selected item(episode). To select your favorite player open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select you favorite player." + +_key="help5-5" + _value="Download Button: downloads the file enclosure of the selected item (episode); you can see the download info by clicking on the third button over the info panel." + +_key="help5-6" + _value="Stop Button: stops to download the file enclosure of the selected item (episode); to resume the download double-click the item (episode) or select the item and click the Download Button" + +_key="help5-7" + _value="Item Remove Button: deletes the selected item (you will loose the enclosure file)." + + + +_key="help6-0" + _value="Getting started with BePodder is easy." + +_key="help6-1" + _value="On the left of the main window you can see the 'Subscription List' with all your feed subscriptions. We have added some subscriptions for you, and you can always add your own in two ways:" + +_key="help6-2" + _value="1) click the Add Button, then insert the feed url (example: http://www.newpodcast.com/rss.xml) and click add." + +_key="help6-3" + _value="2) in the menubar select 'Directory' and then 'Podcast list' or another list, choose a podcast and click 'Subscribe'." + +_key="help6-4" + _value="If you select a Podcast in the subscriptions list and use the check button, BePodder adds the new items to the 'Episodes list' (below on the right); you can check all your podcasts by right-clicking and selecting 'Check All Channels' in the context menu." + +_key="help6-5" + _value="Look at the screenshot above, there are 3 new items indicated by a black dot in the first column of the 'Episodes list'." + +_key="help6-6" + _value="In the second column there are icons that indicate the state of the item:" + +_key="help6-7" + _value="- the Episode 4 has an icon that indicates an error" + +_key="help6-8" + _value="- the Episode 3 has an icon that indicates that the item's enclosure download request is enquequed" + +_key="help6-9" + _value="- the Episode 2 has an icon that indicates that BePodder is downloading the item's enclosure file" + +_key="help6-10" + _value="- the Episode 1 have an icon that indicates that BePodder have just downloaded the item's enclosure file" + + + +_key="help7-0" + _value="Select an item in the 'Episodes list' and then double-click on it (or click the Download Button) to start downloading the enclosed file; you can always stop the download by clicking on the Stop Button." + +_key="help7-1" + _value="When you click on the Subscribed Podcasts in the 'Subscriptions List' the software shows you, in the 'List of episodes', all the items available in that Subscription. Select an item and then click play (Play Button) to view or listen to the file." + +_key="help7-2" + _value="You can access the Enclosures Folder by clicking on the folder icon in the Info Pannel or by right-clicking your mouse on an item and select 'Open Enclosures Folder' in the context menu." + + + +_key="help8-0" + _value="Preferences can be accessed by clicking in the menu-bar Settings>Preferences. You can select a category from the left list of the preferences dialog: FileType, Channels, Download and Proxy." + +_key="help8-1" + _value="- FileType: to specify the default browser and player. " + +_key="help8-2" + _value="- Channels: to specify preferences that control the operation to check channels new items; you can choose to Check all channels on startup or check the channel every desired minutes." + +_key="help8-3" + _value="- Download: to specify the max number of item's files to download at the same time," + +_key="help8-4" + _value="- Proxy: to set up a proxy server to work with BePodder; a proxy server acts as a security barrier between your internal network and the Internet, keeping others on the Internet from accessing information on your internal network." + + + +_key="help9-0" + _value="BePodder has built-in podcast, videoblog, imagefeeds, newsfeeds, bittorrentfeeds and internationalfeeds OPML directories with thousands of feeds grouped by category." + +_key="help9-1" + _value="OPML (Outline Processor Markup Language) is an XML-based format that allows exchange of outline-structured information between applications." + +_key="help9-2" + _value="OPML directory can be accessed by clicking in the menu-bar 'Lists' and thenselecting a list. To browse the opml directory for a feed, expand the list by clicking the arrow of the category that you are interested in (see image); using this method, you can expand the opml directory until you find the desired feed. Once you have selected it, you can add it to the subscription list by clicking the button 'Subscribe', you can also collapse all categories in the directory list by clicking the button 'Collapse All'." + + +_key="help_shortcut1" +_value="This page describes the keyboard shortcuts that can be used in BePodder. The shortcuts are grouped here by function." + +_key="help_shortcut2" +_value="means that you can use either alt or control (es. Alt+Q or Ctrl+Q Quit the application), which way you have set it in the Deskbar menu preferences under Keyboard (the default shortcut key is Alt)." + +_key="help_shortcut3" + _value="General shortcuts" + +_key="help_shortcut4" + _value="Quit the application" + +_key="help_shortcut5" + _value="Shows the Preferences window" + +_key="help_shortcut6" + _value="Shows the Podcast directory list" + +_key="help_shortcut7" + _value="Shows the Videoblog directory list" + +_key="help_shortcut8" + _value="Shows the Imagefeeds directory list" + +_key="help_shortcut9" + _value="Shows the Newsfeeds directory list" + +_key="help_shortcut9b" + _value="Shows the BitTorrentfeeds directory list" + +_key="help_shortcut9c" + _value="Shows the Internationalfeeds directory list" + +_key="help_shortcut10" + _value="Fullscreen" + +_key="help_shortcut11" + _value="Shows/Hides the toolbar" + +_key="help_shortcut12" + _value="Shows the Getting Started Help" + +_key="help_shortcut13" + _value="Shows this keyboard shortcuts page" + +_key="help_shortcut14" + _value="Channels shortcuts" + +_key="help_shortcut15" + _value="Add a podcast to the subscriptions list" + +_key="help_shortcut16" + _value="Delete the selected podcast from the subscriptions list" + +_key="help_shortcut17" + _value="Check the selected podcast for new episodes (items)" + +_key="help_shortcut18" + _value="Check all podcasts for new episodes (items)" + +_key="help_shortcut19" + _value="Shows the podcast homepage" + +_key="help_shortcut20" + _value="Open enclosures folder" + +_key="help_shortcut21" + _value="Episodes shortcuts" + +_key="help_shortcut22" + _value="Play enclosure" + +_key="help_shortcut23" + _value="(Re)start download the selected episodes (items)" + +_key="help_shortcut24" + _value="Stop the episode (item) download" + +_key="help_shortcut25" + _value="Delete the selected episode (item)" + +_key="help_shortcut26" + _value="Shows the podcast episode (item) page " + +_key="help_shortcut27" + _value="Open enclosures folder" + +_key="help_buy1" + _value="BePodder Light is the basic version (free download and no time limited), the registered version adds some more nice features: unlimited number of channels, small Channel view, proxy support, automatic channels check, up to 5 enclosure downloads at the same time (multithreading)." + +_key="help_buy2" + _value="Please pay the shareware fee, it's only 15 euro (Kagi add tax in some countries), BePodder licence can be purchased online from Kagi." + +_key="help_buy3" + _value="Buy at www.funkyideasoft.com" + +_key="help_buy4" + _value="After purchasing, an email will be sent to you with a keyfile and instruction on how to install it. It's just a matter of unzipping a file and moving it to a certain directory." + +_key="help_buy5" + _value="There is no problem updating BePodder when a new version becomes available. The keyfile will unlock all downloadable packages unless otherwise notified." + + +### USELESS ######## + +"Opml Editor" "Opml Editor" +"name:" "name:" +"Add a category" "Add a category" +"Add a new Broadcast" "Add a new Broadcast" +"feed:" "feed:" +"url:" "url:" +"Test podcast" "Test podcast" +"Del a category" "Del a category" +"Add a category" "Add a category" +"Select the podcast category:" "Select the podcast category:" +"Check all" "Check all" +"Check" "Check" +"Refresh the list" "Refresh the list" +"Load" "Load" +"Load the list" "Load the list" +"Save" "Save" +"Save the list" "Save the list" +"Revert" "Revert" +"Apply" "Apply" + + + + + + + + + + + + diff --git a/release/Language/Dictionaries/BePodder.esAR b/release/Language/Dictionaries/BePodder.esAR new file mode 100644 index 0000000..83874e9 --- /dev/null +++ b/release/Language/Dictionaries/BePodder.esAR @@ -0,0 +1,603 @@ + +# Locale file for BePodder. +# Modified: 4/18/2006 +# Author: BePodderTeam +# E-mail: bepodder.team@gmail.com + + +# Attention: don't remove empty space or \n + + +### SHAREWARE POPUPS ----------------------------------- + +"Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" "Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" + +"This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" "This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" + +"Web Site" "Web Site" + +"Can't connect!" "Can't connect!" +"Http port failed!" "Http port failed!" +"Can't resolve host!" "Can't resolve host!" +"Not found!" "Not found!" +"Bad resume!" "Bad resume!" +"Aborted by Callback!" "Aborted by Callback!" +"Can't resume! (range error)" "Can't resume! (range error)" +"Access Denied!" "Access Denied!" +"User or Password Incorrect!" "User or Password Incorrect!" +"Other error (cUrl code: " "Other error (cUrl code: " +"cUrl init error!" "cUrl init error!" +"Can't open file!" "Can't open file!" +"Other error (status code: " "Other error (status code: " +"Downloading" "Downloading" + + +### MENUBAR ----------------------------------- + +"File" "File" +"About..." "About..." +"Close!" "Close!" +"Quit" "Quit" + +"Settings" "Settings" +"Preferences..." "Preferences..." + +"Subscriptions" "Subscriptions" + +"Episodes" "Episodes" + +"Lists" "Lists" +"Podcast List" "Podcast List" +"Podcast directory list" "Podcast directory list" +"Videoblog List" "Videoblog List" +"Videoblog directory list" "Videoblog directory list" +"Imagefeeds List" "Imagefeeds List" +"Imagefeeds directory list" "Imagefeeds directory list" +"Newsfeeds List" "Newsfeeds List" +"Newsfeeds directory list" "Newsfeeds directory list" +"BitTorrentfeeds List" "BitTorrentfeeds List" +"BitTorrentfeeds directory list" "BitTorrentfeeds directory list" +"Internationalfeeds List" "Internationalfeeds List" +"Internationalfeeds directory list" "Internationalfeeds directory list" + +"View" "View" +"Full Screen" "Full Screen" +"Toolbar" "Toolbar" +"Subscriptions View" "Subscriptions View" +"Small Items" "Small Items" +"Big Items" "Big Items" +"Move BePodder on workspace:" "Move BePodder on workspace:" + +"Help" "Help" +"Getting Started" "Getting Started" +"Keyboard Shortcuts" "Keyboard Shortcuts" +"Tutorials" "Tutorials" +"Online Support" "Online Support" + + + + +### BUTTONS ----------------------------------- + +# Buttons add feed window +"Insert the rss feed url!" "Insert the rss feed url!" +"Add" "Add" +"Paste" "Paste" + +# Buttons directory list window +"Collapse All" "Collapse All" +"Preview" "Preview" +"Subscribe" "Subscribe" + + +# Buttons help window +"Next" "Next" +"Prev" "Prev" +"Close" "Close" +"Index" "Index" + + +# Buttons remove windows +"Cancel" "Cancel" +"Delete" "Delete" +"Archive" "Archive" + + + +### TOOLTIPS ----------------------------------- + +# Tooltips toolbar buttons + +"Add the podcast to the Subscriptions list" "Add the podcast to the Subscriptions list" +"Delete the podcast from the Subscriptions list" "Delete the podcast from the Subscriptions list" +"Check the selected podcast for new items" "Check the selected podcast for new items" +"Show the podcast homepage" "Show the podcast homepage" + +"Delete the item and the enclosure" "Delete the item and the enclosure" +"Stop the item download" "Stop the item download" +"Download the selected episode" "Download the selected episode" +"Play the selected episode" "Play the selected episode" + +"Submit bug and idea" "Submit bug and idea" + + +# Tooltips directory window buttons + +"Collapse all categories in the directory list" "Collapse all categories in the directory list" +"Add the selected podcast to the Subscription list" "Add the selected podcast to the Subscription list" +"Checkout a podcast before downloading it" "Checkout a podcast before downloading it" + + +### INFO PANEL ----------------------------------- + +"Show channel Image" "Show Channel Image" +"XML Feed Link" "XML Feed Link" + +"Show Episode info" "Show Episode info" +"Show Subscription info" "Show Subscription info" +"Show Downloads info" "Show Downloads info" + +"Enclosure: " "Enclosure: " + +"Lookup (Dictionary)" "Lookup (Dictionary)" +"Lookup (Google)" "Lookup (Google)" +"Lookup (Acronym Finder)" "Lookup (Acronym Finder)" +"Copy" "Copy" +"Select All" "Select All" +"Copy URL" "Copy URL" +"Open URL" "Open URL" +"Subscription" "Subscription" + + +### PREFERENCES ----------------------------------- + +"Preferences" "Preferences" + +"Proxy" "Proxy" +"Enable Proxy" "Enable Proxy" +"Address" "Address" +"Port" "Port" +"Username" "Username" +"Password" "Password" + +"Max Downloads" "Max Downloads" + +"FileType" "FileType" +"Browser" "Browser" +"Player" "Player" + +"Channels" "Channels" +"Check all channels on startup" "Check all channels on startup" +"Check the channel every" "Check the channel every" + +"never" "never" +"5 minutes" "5 minutes" +"15 minutes" "15 minutes" +"30 minutes" "30 minutes" +"1 hour" "1 hour" +"2 hour" "2 hour" + + + + +### COLUMLISTVIEW ----------------------------------- + + +"1 new item" "1 new item" +"%d new items" "%d new items" +"new" "new" +"error" "error" +"not down" "not down" +"enquequed" "enquequed" +"downloading" "downloading" +"downloaded" "downloaded" +"connecting" "connecting" +"not found" "not found" +"stopped" "stopped" +"can't connect" "can't connect" +"invalid format" "invalid format" + +"Icon" "Icon" +"Title" "Title" +"Date" "Date" +"Size" "Size" +"Status" "Status" +"Download" "Download" + + + +### CONTEXT MENU ----------------------------------- + +"Add Channel" "Add Channel" +"Remove Channel" "Remove Channel" +"Check Channel" "Check Channel" +"Open Homepage" "Open Homepage" + +"Open Web Page" "Open Web Page" +"Open Enclosures folder" "Open Enclosures folder" +"Check All Channels" "Check All Channels" + +"Show Channel Image" "Show Channel Image" + +"Play enclosure" "Play enclosure" +"(Re)start download" "(Re)start download" +"Stop download" "Stop download" +"Remove Item" "Remove Item" + +"Find this Item" "Find this Item" +"Remove from this list" "Remove from this list" + + + +### ALERT ----------------------------------- + +"\nRemoving.." "\nRemoving.." +"\nAn error occured while removing!" "\nAn error occured while removing!" +"Check all the podcasts for new items" "Check all the podcasts for new items" + +"You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" "You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" + +"Can't open the selected file with:\n\n" "Can't open the selected file with:\n\n" +"\n\nPlease check if the application is installed in the right way.\n" "\n\nPlease check if the application is installed in the right way.\n" +"Download it!" "Download it!" + +# multi line text... please translate only the text after _value= and don't remove empty space + +_key="alert1" + _value=" +You are going to remove the selected item. + +Are you sure? +(you will lost the enclosure file if any)" + + +_key="alert2a" + _value=" +You are going to remove the channel: + +" + +_key="alert2b" + _value=" + +Would you like just to archive this +channel (keeping all the files and +enclosures downloaded so far) or +do you want to DELETE the whole + channel from you computer?" + +_key="alert3" + _value=" +Parsing archive.." + +_key="alert_3gp" + _value=" +3GP is a multimedia container format defined by the Third Generation Partnership Project (3GPP) for use on 3G mobile phones. It stores video streams as MPEG-4 or H.263, and audio streams as AMR-NB or AAC-LC. + +VideoLAN still doesn't support the audio AMR (3GPP)" + +_key="alert_swf" + _value=" +SWF is a proprietary vector graphics file format produced by the Flash software from Adobe (formerly Macromedia). + +Currently Flash support in BeOS/Haiku/Zeta is limited to the old standalone Flash player version 4.1015, there isn't a modern Flash player" + + + + +### HELP & SHORTCUTS ----------------------------------- + + +"Introduction" "Introduction" +"The User Interface" "The User Interface" +"Menu Bar" "Menu Bar" +"Toolbar Buttons" "Toolbar Buttons" +"First time with BePodder" "First time with BePodder" +"Download Podcast's enclosure files" "Download Podcast's enclosure files" +"Settings Overview" "Settings Overview" +"Directory lists" "Directory lists" +"Loading Help..." "Loading Help..." +"Register your copy" "Register your copy" +"Starting point" "Starting point" + + + + +# multi line text... please translate only the text after _value= and don't remove empty space + + +_key="help1-0" + _value="Welcome to the BePodder Getting Started Guide." + +_key="help1-1" + _value="If you are already familiar with podcasts and RSS/Atom feeds you can immediately go to BePodder by closing this window." + +_key="help1-2" +_value="If not, this is a short introduction providing you everything you'll need to know on how to get started with BePodder. Use the buttons below to navigate through this tutorial." + + +_key="help2-0" +_value="Podcasting is a method for publishing audio and video broadcasts via the Internet; links to free audio and video files are enclosed in RSS and Atom feeds." + +_key="help2-1" +_value="Therefore Podcasting is simply a type of online media delivery; users can subscribe to a podcast using a feed (such as RSS 'Really Simple Syndication' or Atom)." + +_key="help2-2" +_value="An aggregator (or podcatcher) like BePodder, is a piece of software that allows you to subscribe to a RSS feed and periodically check for and download new content; with BePodder you can check for new Podcast items (Episodes) of your subscribed Channels. Any item can contain an enclosure, just like an Email can contain an attachment." + + + +_key="help3-0" +_value="BePodder has an easy to use yet powerful Graphical User Interface. The main window is split into tree panels:" + +_key="help3-1" +_value="1) The Subscription list (the panel with the number 1 in the screenshot) with the list of the podcasts that you have subscribed to. When you click on a Channel you can see in the panel 2 the list of the channel's items." + +_key="help3-2" +_value="2) The Episodes list with all the items available." + +_key="help3-3" +_value="3) The Info panel show: episode info, channel info or Downloads info; you can select an info panel by clicking one of the below three buttons." + + + +_key="help4-0" +_value="At the very top of the BePodder main window is the menubar with seven menus available: File, Settings, Subscriptions, Episodes, Lists, View and Help. Some menu commands are followed by a right pointing arrow that indicates a submenu of related commands. As you explore each menu, be sure to take a look at the submenus as well. Click on a menus to show its commands:" + +_key="help4-1" +_value="File: contains commands to close the application and to show information about BePodder" + +_key="help4-2" +_value="Settings: contains command to open the Preferences window that allows you to customize various BePodder settings." + +_key="help4-3" +_value="Subscriptions: contains commands that perform actions on the selected channel of your subscriptions list." + +_key="help4-4" +_value="Episodes: contains commands that perform actions on the selected item (episode) of the channel's episode list." + +_key="help4-5" +_value="Lists: contains commands to open BePodder's OPML directories." + +_key="help4-6" +_value="View: contains commands and controls for the BePodder window." + +_key="help4-7" +_value="Help: contains commands to open BePodder's 'Getting Started Guide' and the 'Keyboard Shortcuts List'." + + + +_key="help5-0" + _value="Add Button: opens the Add Window to add a feed url (e.g. http://www.newpodcast.com/rss.xml) usually given on the podcast homepage; looks for text or graphic link that says something like 'XML', 'RSS' or 'Podcast Feed' on it." + +_key="help5-1" + _value="Channel Remove Button: opens a window in which you can select how remove the channel: just archive the select channel (keeping all the files and eclosure downloaded so far) or delete the whole channel from your computer." + +_key="help5-2" + _value="Check Button: checks the selected channel and updates the list of the available items for that podcast adding the new items." + +_key="help5-3" + _value="Web Button: shows the channel homepage in the browser. To select your favorite browser open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select your favorite browser." + +_key="help5-4" + _value="Play Button: with this button you can view or listen the file enclosure of the selected item(episode). To select your favorite player open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select you favorite player." + +_key="help5-5" + _value="Download Button: downloads the file enclosure of the selected item (episode); you can see the download info by clicking on the third button over the info panel." + +_key="help5-6" + _value="Stop Button: stops to download the file enclosure of the selected item (episode); to resume the download double-click the item (episode) or select the item and click the Download Button" + +_key="help5-7" + _value="Item Remove Button: deletes the selected item (you will loose the enclosure file)." + + + +_key="help6-0" + _value="Getting started with BePodder is easy." + +_key="help6-1" + _value="On the left of the main window you can see the 'Subscription List' with all your feed subscriptions. We have added some subscriptions for you, and you can always add your own in two ways:" + +_key="help6-2" + _value="1) click the Add Button, then insert the feed url (example: http://www.newpodcast.com/rss.xml) and click add." + +_key="help6-3" + _value="2) in the menubar select 'Directory' and then 'Podcast list' or another list, choose a podcast and click 'Subscribe'." + +_key="help6-4" + _value="If you select a Podcast in the subscriptions list and use the check button, BePodder adds the new items to the 'Episodes list' (below on the right); you can check all your podcasts by right-clicking and selecting 'Check All Channels' in the context menu." + +_key="help6-5" + _value="Look at the screenshot above, there are 3 new items indicated by a black dot in the first column of the 'Episodes list'." + +_key="help6-6" + _value="In the second column there are icons that indicate the state of the item:" + +_key="help6-7" + _value="- the Episode 4 has an icon that indicates an error" + +_key="help6-8" + _value="- the Episode 3 has an icon that indicates that the item's enclosure download request is enquequed" + +_key="help6-9" + _value="- the Episode 2 has an icon that indicates that BePodder is downloading the item's enclosure file" + +_key="help6-10" + _value="- the Episode 1 have an icon that indicates that BePodder have just downloaded the item's enclosure file" + + + +_key="help7-0" + _value="Select an item in the 'Episodes list' and then double-click on it (or click the Download Button) to start downloading the enclosed file; you can always stop the download by clicking on the Stop Button." + +_key="help7-1" + _value="When you click on the Subscribed Podcasts in the 'Subscriptions List' the software shows you, in the 'List of episodes', all the items available in that Subscription. Select an item and then click play (Play Button) to view or listen to the file." + +_key="help7-2" + _value="You can access the Enclosures Folder by clicking on the folder icon in the Info Pannel or by right-clicking your mouse on an item and select 'Open Enclosures Folder' in the context menu." + + + +_key="help8-0" + _value="Preferences can be accessed by clicking in the menu-bar Settings>Preferences. You can select a category from the left list of the preferences dialog: FileType, Channels, Download and Proxy." + +_key="help8-1" + _value="- FileType: to specify the default browser and player. " + +_key="help8-2" + _value="- Channels: to specify preferences that control the operation to check channels new items; you can choose to Check all channels on startup or check the channel every desired minutes." + +_key="help8-3" + _value="- Download: to specify the max number of item's files to download at the same time," + +_key="help8-4" + _value="- Proxy: to set up a proxy server to work with BePodder; a proxy server acts as a security barrier between your internal network and the Internet, keeping others on the Internet from accessing information on your internal network." + + + +_key="help9-0" + _value="BePodder has built-in podcast, videoblog, imagefeeds, newsfeeds, bittorrentfeeds and internationalfeeds OPML directories with thousands of feeds grouped by category." + +_key="help9-1" + _value="OPML (Outline Processor Markup Language) is an XML-based format that allows exchange of outline-structured information between applications." + +_key="help9-2" + _value="OPML directory can be accessed by clicking in the menu-bar 'Lists' and thenselecting a list. To browse the opml directory for a feed, expand the list by clicking the arrow of the category that you are interested in (see image); using this method, you can expand the opml directory until you find the desired feed. Once you have selected it, you can add it to the subscription list by clicking the button 'Subscribe', you can also collapse all categories in the directory list by clicking the button 'Collapse All'." + +_key="help_shortcut1" +_value="This page describes the keyboard shortcuts that can be used in BePodder. The shortcuts are grouped here by function." + +_key="help_shortcut2" +_value="means that you can use either alt or control (es. Alt+Q or Ctrl+Q Quit the application), which way you have set it in the Deskbar menu preferences under Keyboard (the default shortcut key is Alt)." + +_key="help_shortcut3" + _value="General shortcuts" + +_key="help_shortcut4" + _value="Quit the application" + +_key="help_shortcut5" + _value="Shows the Preferences window" + +_key="help_shortcut6" + _value="Shows the Podcast directory list" + +_key="help_shortcut7" + _value="Shows the Videoblog directory list" + +_key="help_shortcut8" + _value="Shows the Imagefeeds directory list" + +_key="help_shortcut9" + _value="Shows the Newsfeeds directory list" + +_key="help_shortcut9b" + _value="Shows the BitTorrentfeeds directory list" + +_key="help_shortcut9c" + _value="Shows the Internationalfeeds directory list" + +_key="help_shortcut10" + _value="Fullscreen" + +_key="help_shortcut11" + _value="Shows/Hides the toolbar" + +_key="help_shortcut12" + _value="Shows the Getting Started Help" + +_key="help_shortcut13" + _value="Shows this keyboard shortcuts page" + +_key="help_shortcut14" + _value="Channels shortcuts" + +_key="help_shortcut15" + _value="Add a podcast to the subscriptions list" + +_key="help_shortcut16" + _value="Delete the selected podcast from the subscriptions list" + +_key="help_shortcut17" + _value="Check the selected podcast for new episodes (items)" + +_key="help_shortcut18" + _value="Check all podcasts for new episodes (items)" + +_key="help_shortcut19" + _value="Shows the podcast homepage" + +_key="help_shortcut20" + _value="Open enclosures folder" + +_key="help_shortcut21" + _value="Episodes shortcuts" + +_key="help_shortcut22" + _value="Play enclosure" + +_key="help_shortcut23" + _value="(Re)start download the selected episodes (items)" + +_key="help_shortcut24" + _value="Stop the episode (item) download" + +_key="help_shortcut25" + _value="Delete the selected episode (item)" + +_key="help_shortcut26" + _value="Shows the podcast episode (item) page " + +_key="help_shortcut27" + _value="Open enclosures folder" + +_key="help_buy1" + _value="BePodder Light is the basic version (free download and no time limited), the registered version adds some more nice features: unlimited number of channels, small Channel view, proxy support, automatic channels check, up to 5 enclosure downloads at the same time (multithreading)." + +_key="help_buy2" + _value="Please pay the shareware fee, it's only 15 euro (Kagi add tax in some countries), BePodder licence can be purchased online from Kagi." + +_key="help_buy3" + _value="Buy at www.funkyideasoft.com" + +_key="help_buy4" + _value="After purchasing, an email will be sent to you with a keyfile and instruction on how to install it. It's just a matter of unzipping a file and moving it to a certain directory." + +_key="help_buy5" + _value="There is no problem updating BePodder when a new version becomes available. The keyfile will unlock all downloadable packages unless otherwise notified." + + +### USELESS ######## + +"Opml Editor" "Opml Editor" +"name:" "name:" +"Add a category" "Add a category" +"Add a new Broadcast" "Add a new Broadcast" +"feed:" "feed:" +"url:" "url:" +"Test podcast" "Test podcast" +"Del a category" "Del a category" +"Add a category" "Add a category" +"Select the podcast category:" "Select the podcast category:" +"Check all" "Check all" +"Check" "Check" +"Refresh the list" "Refresh the list" +"Load" "Load" +"Load the list" "Load the list" +"Save" "Save" +"Save the list" "Save the list" +"Revert" "Revert" +"Apply" "Apply" + + + + + + + + + + + + diff --git a/release/Language/Dictionaries/BePodder.esES b/release/Language/Dictionaries/BePodder.esES new file mode 100644 index 0000000..83874e9 --- /dev/null +++ b/release/Language/Dictionaries/BePodder.esES @@ -0,0 +1,603 @@ + +# Locale file for BePodder. +# Modified: 4/18/2006 +# Author: BePodderTeam +# E-mail: bepodder.team@gmail.com + + +# Attention: don't remove empty space or \n + + +### SHAREWARE POPUPS ----------------------------------- + +"Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" "Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" + +"This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" "This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" + +"Web Site" "Web Site" + +"Can't connect!" "Can't connect!" +"Http port failed!" "Http port failed!" +"Can't resolve host!" "Can't resolve host!" +"Not found!" "Not found!" +"Bad resume!" "Bad resume!" +"Aborted by Callback!" "Aborted by Callback!" +"Can't resume! (range error)" "Can't resume! (range error)" +"Access Denied!" "Access Denied!" +"User or Password Incorrect!" "User or Password Incorrect!" +"Other error (cUrl code: " "Other error (cUrl code: " +"cUrl init error!" "cUrl init error!" +"Can't open file!" "Can't open file!" +"Other error (status code: " "Other error (status code: " +"Downloading" "Downloading" + + +### MENUBAR ----------------------------------- + +"File" "File" +"About..." "About..." +"Close!" "Close!" +"Quit" "Quit" + +"Settings" "Settings" +"Preferences..." "Preferences..." + +"Subscriptions" "Subscriptions" + +"Episodes" "Episodes" + +"Lists" "Lists" +"Podcast List" "Podcast List" +"Podcast directory list" "Podcast directory list" +"Videoblog List" "Videoblog List" +"Videoblog directory list" "Videoblog directory list" +"Imagefeeds List" "Imagefeeds List" +"Imagefeeds directory list" "Imagefeeds directory list" +"Newsfeeds List" "Newsfeeds List" +"Newsfeeds directory list" "Newsfeeds directory list" +"BitTorrentfeeds List" "BitTorrentfeeds List" +"BitTorrentfeeds directory list" "BitTorrentfeeds directory list" +"Internationalfeeds List" "Internationalfeeds List" +"Internationalfeeds directory list" "Internationalfeeds directory list" + +"View" "View" +"Full Screen" "Full Screen" +"Toolbar" "Toolbar" +"Subscriptions View" "Subscriptions View" +"Small Items" "Small Items" +"Big Items" "Big Items" +"Move BePodder on workspace:" "Move BePodder on workspace:" + +"Help" "Help" +"Getting Started" "Getting Started" +"Keyboard Shortcuts" "Keyboard Shortcuts" +"Tutorials" "Tutorials" +"Online Support" "Online Support" + + + + +### BUTTONS ----------------------------------- + +# Buttons add feed window +"Insert the rss feed url!" "Insert the rss feed url!" +"Add" "Add" +"Paste" "Paste" + +# Buttons directory list window +"Collapse All" "Collapse All" +"Preview" "Preview" +"Subscribe" "Subscribe" + + +# Buttons help window +"Next" "Next" +"Prev" "Prev" +"Close" "Close" +"Index" "Index" + + +# Buttons remove windows +"Cancel" "Cancel" +"Delete" "Delete" +"Archive" "Archive" + + + +### TOOLTIPS ----------------------------------- + +# Tooltips toolbar buttons + +"Add the podcast to the Subscriptions list" "Add the podcast to the Subscriptions list" +"Delete the podcast from the Subscriptions list" "Delete the podcast from the Subscriptions list" +"Check the selected podcast for new items" "Check the selected podcast for new items" +"Show the podcast homepage" "Show the podcast homepage" + +"Delete the item and the enclosure" "Delete the item and the enclosure" +"Stop the item download" "Stop the item download" +"Download the selected episode" "Download the selected episode" +"Play the selected episode" "Play the selected episode" + +"Submit bug and idea" "Submit bug and idea" + + +# Tooltips directory window buttons + +"Collapse all categories in the directory list" "Collapse all categories in the directory list" +"Add the selected podcast to the Subscription list" "Add the selected podcast to the Subscription list" +"Checkout a podcast before downloading it" "Checkout a podcast before downloading it" + + +### INFO PANEL ----------------------------------- + +"Show channel Image" "Show Channel Image" +"XML Feed Link" "XML Feed Link" + +"Show Episode info" "Show Episode info" +"Show Subscription info" "Show Subscription info" +"Show Downloads info" "Show Downloads info" + +"Enclosure: " "Enclosure: " + +"Lookup (Dictionary)" "Lookup (Dictionary)" +"Lookup (Google)" "Lookup (Google)" +"Lookup (Acronym Finder)" "Lookup (Acronym Finder)" +"Copy" "Copy" +"Select All" "Select All" +"Copy URL" "Copy URL" +"Open URL" "Open URL" +"Subscription" "Subscription" + + +### PREFERENCES ----------------------------------- + +"Preferences" "Preferences" + +"Proxy" "Proxy" +"Enable Proxy" "Enable Proxy" +"Address" "Address" +"Port" "Port" +"Username" "Username" +"Password" "Password" + +"Max Downloads" "Max Downloads" + +"FileType" "FileType" +"Browser" "Browser" +"Player" "Player" + +"Channels" "Channels" +"Check all channels on startup" "Check all channels on startup" +"Check the channel every" "Check the channel every" + +"never" "never" +"5 minutes" "5 minutes" +"15 minutes" "15 minutes" +"30 minutes" "30 minutes" +"1 hour" "1 hour" +"2 hour" "2 hour" + + + + +### COLUMLISTVIEW ----------------------------------- + + +"1 new item" "1 new item" +"%d new items" "%d new items" +"new" "new" +"error" "error" +"not down" "not down" +"enquequed" "enquequed" +"downloading" "downloading" +"downloaded" "downloaded" +"connecting" "connecting" +"not found" "not found" +"stopped" "stopped" +"can't connect" "can't connect" +"invalid format" "invalid format" + +"Icon" "Icon" +"Title" "Title" +"Date" "Date" +"Size" "Size" +"Status" "Status" +"Download" "Download" + + + +### CONTEXT MENU ----------------------------------- + +"Add Channel" "Add Channel" +"Remove Channel" "Remove Channel" +"Check Channel" "Check Channel" +"Open Homepage" "Open Homepage" + +"Open Web Page" "Open Web Page" +"Open Enclosures folder" "Open Enclosures folder" +"Check All Channels" "Check All Channels" + +"Show Channel Image" "Show Channel Image" + +"Play enclosure" "Play enclosure" +"(Re)start download" "(Re)start download" +"Stop download" "Stop download" +"Remove Item" "Remove Item" + +"Find this Item" "Find this Item" +"Remove from this list" "Remove from this list" + + + +### ALERT ----------------------------------- + +"\nRemoving.." "\nRemoving.." +"\nAn error occured while removing!" "\nAn error occured while removing!" +"Check all the podcasts for new items" "Check all the podcasts for new items" + +"You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" "You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" + +"Can't open the selected file with:\n\n" "Can't open the selected file with:\n\n" +"\n\nPlease check if the application is installed in the right way.\n" "\n\nPlease check if the application is installed in the right way.\n" +"Download it!" "Download it!" + +# multi line text... please translate only the text after _value= and don't remove empty space + +_key="alert1" + _value=" +You are going to remove the selected item. + +Are you sure? +(you will lost the enclosure file if any)" + + +_key="alert2a" + _value=" +You are going to remove the channel: + +" + +_key="alert2b" + _value=" + +Would you like just to archive this +channel (keeping all the files and +enclosures downloaded so far) or +do you want to DELETE the whole + channel from you computer?" + +_key="alert3" + _value=" +Parsing archive.." + +_key="alert_3gp" + _value=" +3GP is a multimedia container format defined by the Third Generation Partnership Project (3GPP) for use on 3G mobile phones. It stores video streams as MPEG-4 or H.263, and audio streams as AMR-NB or AAC-LC. + +VideoLAN still doesn't support the audio AMR (3GPP)" + +_key="alert_swf" + _value=" +SWF is a proprietary vector graphics file format produced by the Flash software from Adobe (formerly Macromedia). + +Currently Flash support in BeOS/Haiku/Zeta is limited to the old standalone Flash player version 4.1015, there isn't a modern Flash player" + + + + +### HELP & SHORTCUTS ----------------------------------- + + +"Introduction" "Introduction" +"The User Interface" "The User Interface" +"Menu Bar" "Menu Bar" +"Toolbar Buttons" "Toolbar Buttons" +"First time with BePodder" "First time with BePodder" +"Download Podcast's enclosure files" "Download Podcast's enclosure files" +"Settings Overview" "Settings Overview" +"Directory lists" "Directory lists" +"Loading Help..." "Loading Help..." +"Register your copy" "Register your copy" +"Starting point" "Starting point" + + + + +# multi line text... please translate only the text after _value= and don't remove empty space + + +_key="help1-0" + _value="Welcome to the BePodder Getting Started Guide." + +_key="help1-1" + _value="If you are already familiar with podcasts and RSS/Atom feeds you can immediately go to BePodder by closing this window." + +_key="help1-2" +_value="If not, this is a short introduction providing you everything you'll need to know on how to get started with BePodder. Use the buttons below to navigate through this tutorial." + + +_key="help2-0" +_value="Podcasting is a method for publishing audio and video broadcasts via the Internet; links to free audio and video files are enclosed in RSS and Atom feeds." + +_key="help2-1" +_value="Therefore Podcasting is simply a type of online media delivery; users can subscribe to a podcast using a feed (such as RSS 'Really Simple Syndication' or Atom)." + +_key="help2-2" +_value="An aggregator (or podcatcher) like BePodder, is a piece of software that allows you to subscribe to a RSS feed and periodically check for and download new content; with BePodder you can check for new Podcast items (Episodes) of your subscribed Channels. Any item can contain an enclosure, just like an Email can contain an attachment." + + + +_key="help3-0" +_value="BePodder has an easy to use yet powerful Graphical User Interface. The main window is split into tree panels:" + +_key="help3-1" +_value="1) The Subscription list (the panel with the number 1 in the screenshot) with the list of the podcasts that you have subscribed to. When you click on a Channel you can see in the panel 2 the list of the channel's items." + +_key="help3-2" +_value="2) The Episodes list with all the items available." + +_key="help3-3" +_value="3) The Info panel show: episode info, channel info or Downloads info; you can select an info panel by clicking one of the below three buttons." + + + +_key="help4-0" +_value="At the very top of the BePodder main window is the menubar with seven menus available: File, Settings, Subscriptions, Episodes, Lists, View and Help. Some menu commands are followed by a right pointing arrow that indicates a submenu of related commands. As you explore each menu, be sure to take a look at the submenus as well. Click on a menus to show its commands:" + +_key="help4-1" +_value="File: contains commands to close the application and to show information about BePodder" + +_key="help4-2" +_value="Settings: contains command to open the Preferences window that allows you to customize various BePodder settings." + +_key="help4-3" +_value="Subscriptions: contains commands that perform actions on the selected channel of your subscriptions list." + +_key="help4-4" +_value="Episodes: contains commands that perform actions on the selected item (episode) of the channel's episode list." + +_key="help4-5" +_value="Lists: contains commands to open BePodder's OPML directories." + +_key="help4-6" +_value="View: contains commands and controls for the BePodder window." + +_key="help4-7" +_value="Help: contains commands to open BePodder's 'Getting Started Guide' and the 'Keyboard Shortcuts List'." + + + +_key="help5-0" + _value="Add Button: opens the Add Window to add a feed url (e.g. http://www.newpodcast.com/rss.xml) usually given on the podcast homepage; looks for text or graphic link that says something like 'XML', 'RSS' or 'Podcast Feed' on it." + +_key="help5-1" + _value="Channel Remove Button: opens a window in which you can select how remove the channel: just archive the select channel (keeping all the files and eclosure downloaded so far) or delete the whole channel from your computer." + +_key="help5-2" + _value="Check Button: checks the selected channel and updates the list of the available items for that podcast adding the new items." + +_key="help5-3" + _value="Web Button: shows the channel homepage in the browser. To select your favorite browser open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select your favorite browser." + +_key="help5-4" + _value="Play Button: with this button you can view or listen the file enclosure of the selected item(episode). To select your favorite player open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select you favorite player." + +_key="help5-5" + _value="Download Button: downloads the file enclosure of the selected item (episode); you can see the download info by clicking on the third button over the info panel." + +_key="help5-6" + _value="Stop Button: stops to download the file enclosure of the selected item (episode); to resume the download double-click the item (episode) or select the item and click the Download Button" + +_key="help5-7" + _value="Item Remove Button: deletes the selected item (you will loose the enclosure file)." + + + +_key="help6-0" + _value="Getting started with BePodder is easy." + +_key="help6-1" + _value="On the left of the main window you can see the 'Subscription List' with all your feed subscriptions. We have added some subscriptions for you, and you can always add your own in two ways:" + +_key="help6-2" + _value="1) click the Add Button, then insert the feed url (example: http://www.newpodcast.com/rss.xml) and click add." + +_key="help6-3" + _value="2) in the menubar select 'Directory' and then 'Podcast list' or another list, choose a podcast and click 'Subscribe'." + +_key="help6-4" + _value="If you select a Podcast in the subscriptions list and use the check button, BePodder adds the new items to the 'Episodes list' (below on the right); you can check all your podcasts by right-clicking and selecting 'Check All Channels' in the context menu." + +_key="help6-5" + _value="Look at the screenshot above, there are 3 new items indicated by a black dot in the first column of the 'Episodes list'." + +_key="help6-6" + _value="In the second column there are icons that indicate the state of the item:" + +_key="help6-7" + _value="- the Episode 4 has an icon that indicates an error" + +_key="help6-8" + _value="- the Episode 3 has an icon that indicates that the item's enclosure download request is enquequed" + +_key="help6-9" + _value="- the Episode 2 has an icon that indicates that BePodder is downloading the item's enclosure file" + +_key="help6-10" + _value="- the Episode 1 have an icon that indicates that BePodder have just downloaded the item's enclosure file" + + + +_key="help7-0" + _value="Select an item in the 'Episodes list' and then double-click on it (or click the Download Button) to start downloading the enclosed file; you can always stop the download by clicking on the Stop Button." + +_key="help7-1" + _value="When you click on the Subscribed Podcasts in the 'Subscriptions List' the software shows you, in the 'List of episodes', all the items available in that Subscription. Select an item and then click play (Play Button) to view or listen to the file." + +_key="help7-2" + _value="You can access the Enclosures Folder by clicking on the folder icon in the Info Pannel or by right-clicking your mouse on an item and select 'Open Enclosures Folder' in the context menu." + + + +_key="help8-0" + _value="Preferences can be accessed by clicking in the menu-bar Settings>Preferences. You can select a category from the left list of the preferences dialog: FileType, Channels, Download and Proxy." + +_key="help8-1" + _value="- FileType: to specify the default browser and player. " + +_key="help8-2" + _value="- Channels: to specify preferences that control the operation to check channels new items; you can choose to Check all channels on startup or check the channel every desired minutes." + +_key="help8-3" + _value="- Download: to specify the max number of item's files to download at the same time," + +_key="help8-4" + _value="- Proxy: to set up a proxy server to work with BePodder; a proxy server acts as a security barrier between your internal network and the Internet, keeping others on the Internet from accessing information on your internal network." + + + +_key="help9-0" + _value="BePodder has built-in podcast, videoblog, imagefeeds, newsfeeds, bittorrentfeeds and internationalfeeds OPML directories with thousands of feeds grouped by category." + +_key="help9-1" + _value="OPML (Outline Processor Markup Language) is an XML-based format that allows exchange of outline-structured information between applications." + +_key="help9-2" + _value="OPML directory can be accessed by clicking in the menu-bar 'Lists' and thenselecting a list. To browse the opml directory for a feed, expand the list by clicking the arrow of the category that you are interested in (see image); using this method, you can expand the opml directory until you find the desired feed. Once you have selected it, you can add it to the subscription list by clicking the button 'Subscribe', you can also collapse all categories in the directory list by clicking the button 'Collapse All'." + +_key="help_shortcut1" +_value="This page describes the keyboard shortcuts that can be used in BePodder. The shortcuts are grouped here by function." + +_key="help_shortcut2" +_value="means that you can use either alt or control (es. Alt+Q or Ctrl+Q Quit the application), which way you have set it in the Deskbar menu preferences under Keyboard (the default shortcut key is Alt)." + +_key="help_shortcut3" + _value="General shortcuts" + +_key="help_shortcut4" + _value="Quit the application" + +_key="help_shortcut5" + _value="Shows the Preferences window" + +_key="help_shortcut6" + _value="Shows the Podcast directory list" + +_key="help_shortcut7" + _value="Shows the Videoblog directory list" + +_key="help_shortcut8" + _value="Shows the Imagefeeds directory list" + +_key="help_shortcut9" + _value="Shows the Newsfeeds directory list" + +_key="help_shortcut9b" + _value="Shows the BitTorrentfeeds directory list" + +_key="help_shortcut9c" + _value="Shows the Internationalfeeds directory list" + +_key="help_shortcut10" + _value="Fullscreen" + +_key="help_shortcut11" + _value="Shows/Hides the toolbar" + +_key="help_shortcut12" + _value="Shows the Getting Started Help" + +_key="help_shortcut13" + _value="Shows this keyboard shortcuts page" + +_key="help_shortcut14" + _value="Channels shortcuts" + +_key="help_shortcut15" + _value="Add a podcast to the subscriptions list" + +_key="help_shortcut16" + _value="Delete the selected podcast from the subscriptions list" + +_key="help_shortcut17" + _value="Check the selected podcast for new episodes (items)" + +_key="help_shortcut18" + _value="Check all podcasts for new episodes (items)" + +_key="help_shortcut19" + _value="Shows the podcast homepage" + +_key="help_shortcut20" + _value="Open enclosures folder" + +_key="help_shortcut21" + _value="Episodes shortcuts" + +_key="help_shortcut22" + _value="Play enclosure" + +_key="help_shortcut23" + _value="(Re)start download the selected episodes (items)" + +_key="help_shortcut24" + _value="Stop the episode (item) download" + +_key="help_shortcut25" + _value="Delete the selected episode (item)" + +_key="help_shortcut26" + _value="Shows the podcast episode (item) page " + +_key="help_shortcut27" + _value="Open enclosures folder" + +_key="help_buy1" + _value="BePodder Light is the basic version (free download and no time limited), the registered version adds some more nice features: unlimited number of channels, small Channel view, proxy support, automatic channels check, up to 5 enclosure downloads at the same time (multithreading)." + +_key="help_buy2" + _value="Please pay the shareware fee, it's only 15 euro (Kagi add tax in some countries), BePodder licence can be purchased online from Kagi." + +_key="help_buy3" + _value="Buy at www.funkyideasoft.com" + +_key="help_buy4" + _value="After purchasing, an email will be sent to you with a keyfile and instruction on how to install it. It's just a matter of unzipping a file and moving it to a certain directory." + +_key="help_buy5" + _value="There is no problem updating BePodder when a new version becomes available. The keyfile will unlock all downloadable packages unless otherwise notified." + + +### USELESS ######## + +"Opml Editor" "Opml Editor" +"name:" "name:" +"Add a category" "Add a category" +"Add a new Broadcast" "Add a new Broadcast" +"feed:" "feed:" +"url:" "url:" +"Test podcast" "Test podcast" +"Del a category" "Del a category" +"Add a category" "Add a category" +"Select the podcast category:" "Select the podcast category:" +"Check all" "Check all" +"Check" "Check" +"Refresh the list" "Refresh the list" +"Load" "Load" +"Load the list" "Load the list" +"Save" "Save" +"Save the list" "Save the list" +"Revert" "Revert" +"Apply" "Apply" + + + + + + + + + + + + diff --git a/release/Language/Dictionaries/BePodder.etEE b/release/Language/Dictionaries/BePodder.etEE new file mode 100644 index 0000000..83874e9 --- /dev/null +++ b/release/Language/Dictionaries/BePodder.etEE @@ -0,0 +1,603 @@ + +# Locale file for BePodder. +# Modified: 4/18/2006 +# Author: BePodderTeam +# E-mail: bepodder.team@gmail.com + + +# Attention: don't remove empty space or \n + + +### SHAREWARE POPUPS ----------------------------------- + +"Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" "Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" + +"This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" "This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" + +"Web Site" "Web Site" + +"Can't connect!" "Can't connect!" +"Http port failed!" "Http port failed!" +"Can't resolve host!" "Can't resolve host!" +"Not found!" "Not found!" +"Bad resume!" "Bad resume!" +"Aborted by Callback!" "Aborted by Callback!" +"Can't resume! (range error)" "Can't resume! (range error)" +"Access Denied!" "Access Denied!" +"User or Password Incorrect!" "User or Password Incorrect!" +"Other error (cUrl code: " "Other error (cUrl code: " +"cUrl init error!" "cUrl init error!" +"Can't open file!" "Can't open file!" +"Other error (status code: " "Other error (status code: " +"Downloading" "Downloading" + + +### MENUBAR ----------------------------------- + +"File" "File" +"About..." "About..." +"Close!" "Close!" +"Quit" "Quit" + +"Settings" "Settings" +"Preferences..." "Preferences..." + +"Subscriptions" "Subscriptions" + +"Episodes" "Episodes" + +"Lists" "Lists" +"Podcast List" "Podcast List" +"Podcast directory list" "Podcast directory list" +"Videoblog List" "Videoblog List" +"Videoblog directory list" "Videoblog directory list" +"Imagefeeds List" "Imagefeeds List" +"Imagefeeds directory list" "Imagefeeds directory list" +"Newsfeeds List" "Newsfeeds List" +"Newsfeeds directory list" "Newsfeeds directory list" +"BitTorrentfeeds List" "BitTorrentfeeds List" +"BitTorrentfeeds directory list" "BitTorrentfeeds directory list" +"Internationalfeeds List" "Internationalfeeds List" +"Internationalfeeds directory list" "Internationalfeeds directory list" + +"View" "View" +"Full Screen" "Full Screen" +"Toolbar" "Toolbar" +"Subscriptions View" "Subscriptions View" +"Small Items" "Small Items" +"Big Items" "Big Items" +"Move BePodder on workspace:" "Move BePodder on workspace:" + +"Help" "Help" +"Getting Started" "Getting Started" +"Keyboard Shortcuts" "Keyboard Shortcuts" +"Tutorials" "Tutorials" +"Online Support" "Online Support" + + + + +### BUTTONS ----------------------------------- + +# Buttons add feed window +"Insert the rss feed url!" "Insert the rss feed url!" +"Add" "Add" +"Paste" "Paste" + +# Buttons directory list window +"Collapse All" "Collapse All" +"Preview" "Preview" +"Subscribe" "Subscribe" + + +# Buttons help window +"Next" "Next" +"Prev" "Prev" +"Close" "Close" +"Index" "Index" + + +# Buttons remove windows +"Cancel" "Cancel" +"Delete" "Delete" +"Archive" "Archive" + + + +### TOOLTIPS ----------------------------------- + +# Tooltips toolbar buttons + +"Add the podcast to the Subscriptions list" "Add the podcast to the Subscriptions list" +"Delete the podcast from the Subscriptions list" "Delete the podcast from the Subscriptions list" +"Check the selected podcast for new items" "Check the selected podcast for new items" +"Show the podcast homepage" "Show the podcast homepage" + +"Delete the item and the enclosure" "Delete the item and the enclosure" +"Stop the item download" "Stop the item download" +"Download the selected episode" "Download the selected episode" +"Play the selected episode" "Play the selected episode" + +"Submit bug and idea" "Submit bug and idea" + + +# Tooltips directory window buttons + +"Collapse all categories in the directory list" "Collapse all categories in the directory list" +"Add the selected podcast to the Subscription list" "Add the selected podcast to the Subscription list" +"Checkout a podcast before downloading it" "Checkout a podcast before downloading it" + + +### INFO PANEL ----------------------------------- + +"Show channel Image" "Show Channel Image" +"XML Feed Link" "XML Feed Link" + +"Show Episode info" "Show Episode info" +"Show Subscription info" "Show Subscription info" +"Show Downloads info" "Show Downloads info" + +"Enclosure: " "Enclosure: " + +"Lookup (Dictionary)" "Lookup (Dictionary)" +"Lookup (Google)" "Lookup (Google)" +"Lookup (Acronym Finder)" "Lookup (Acronym Finder)" +"Copy" "Copy" +"Select All" "Select All" +"Copy URL" "Copy URL" +"Open URL" "Open URL" +"Subscription" "Subscription" + + +### PREFERENCES ----------------------------------- + +"Preferences" "Preferences" + +"Proxy" "Proxy" +"Enable Proxy" "Enable Proxy" +"Address" "Address" +"Port" "Port" +"Username" "Username" +"Password" "Password" + +"Max Downloads" "Max Downloads" + +"FileType" "FileType" +"Browser" "Browser" +"Player" "Player" + +"Channels" "Channels" +"Check all channels on startup" "Check all channels on startup" +"Check the channel every" "Check the channel every" + +"never" "never" +"5 minutes" "5 minutes" +"15 minutes" "15 minutes" +"30 minutes" "30 minutes" +"1 hour" "1 hour" +"2 hour" "2 hour" + + + + +### COLUMLISTVIEW ----------------------------------- + + +"1 new item" "1 new item" +"%d new items" "%d new items" +"new" "new" +"error" "error" +"not down" "not down" +"enquequed" "enquequed" +"downloading" "downloading" +"downloaded" "downloaded" +"connecting" "connecting" +"not found" "not found" +"stopped" "stopped" +"can't connect" "can't connect" +"invalid format" "invalid format" + +"Icon" "Icon" +"Title" "Title" +"Date" "Date" +"Size" "Size" +"Status" "Status" +"Download" "Download" + + + +### CONTEXT MENU ----------------------------------- + +"Add Channel" "Add Channel" +"Remove Channel" "Remove Channel" +"Check Channel" "Check Channel" +"Open Homepage" "Open Homepage" + +"Open Web Page" "Open Web Page" +"Open Enclosures folder" "Open Enclosures folder" +"Check All Channels" "Check All Channels" + +"Show Channel Image" "Show Channel Image" + +"Play enclosure" "Play enclosure" +"(Re)start download" "(Re)start download" +"Stop download" "Stop download" +"Remove Item" "Remove Item" + +"Find this Item" "Find this Item" +"Remove from this list" "Remove from this list" + + + +### ALERT ----------------------------------- + +"\nRemoving.." "\nRemoving.." +"\nAn error occured while removing!" "\nAn error occured while removing!" +"Check all the podcasts for new items" "Check all the podcasts for new items" + +"You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" "You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" + +"Can't open the selected file with:\n\n" "Can't open the selected file with:\n\n" +"\n\nPlease check if the application is installed in the right way.\n" "\n\nPlease check if the application is installed in the right way.\n" +"Download it!" "Download it!" + +# multi line text... please translate only the text after _value= and don't remove empty space + +_key="alert1" + _value=" +You are going to remove the selected item. + +Are you sure? +(you will lost the enclosure file if any)" + + +_key="alert2a" + _value=" +You are going to remove the channel: + +" + +_key="alert2b" + _value=" + +Would you like just to archive this +channel (keeping all the files and +enclosures downloaded so far) or +do you want to DELETE the whole + channel from you computer?" + +_key="alert3" + _value=" +Parsing archive.." + +_key="alert_3gp" + _value=" +3GP is a multimedia container format defined by the Third Generation Partnership Project (3GPP) for use on 3G mobile phones. It stores video streams as MPEG-4 or H.263, and audio streams as AMR-NB or AAC-LC. + +VideoLAN still doesn't support the audio AMR (3GPP)" + +_key="alert_swf" + _value=" +SWF is a proprietary vector graphics file format produced by the Flash software from Adobe (formerly Macromedia). + +Currently Flash support in BeOS/Haiku/Zeta is limited to the old standalone Flash player version 4.1015, there isn't a modern Flash player" + + + + +### HELP & SHORTCUTS ----------------------------------- + + +"Introduction" "Introduction" +"The User Interface" "The User Interface" +"Menu Bar" "Menu Bar" +"Toolbar Buttons" "Toolbar Buttons" +"First time with BePodder" "First time with BePodder" +"Download Podcast's enclosure files" "Download Podcast's enclosure files" +"Settings Overview" "Settings Overview" +"Directory lists" "Directory lists" +"Loading Help..." "Loading Help..." +"Register your copy" "Register your copy" +"Starting point" "Starting point" + + + + +# multi line text... please translate only the text after _value= and don't remove empty space + + +_key="help1-0" + _value="Welcome to the BePodder Getting Started Guide." + +_key="help1-1" + _value="If you are already familiar with podcasts and RSS/Atom feeds you can immediately go to BePodder by closing this window." + +_key="help1-2" +_value="If not, this is a short introduction providing you everything you'll need to know on how to get started with BePodder. Use the buttons below to navigate through this tutorial." + + +_key="help2-0" +_value="Podcasting is a method for publishing audio and video broadcasts via the Internet; links to free audio and video files are enclosed in RSS and Atom feeds." + +_key="help2-1" +_value="Therefore Podcasting is simply a type of online media delivery; users can subscribe to a podcast using a feed (such as RSS 'Really Simple Syndication' or Atom)." + +_key="help2-2" +_value="An aggregator (or podcatcher) like BePodder, is a piece of software that allows you to subscribe to a RSS feed and periodically check for and download new content; with BePodder you can check for new Podcast items (Episodes) of your subscribed Channels. Any item can contain an enclosure, just like an Email can contain an attachment." + + + +_key="help3-0" +_value="BePodder has an easy to use yet powerful Graphical User Interface. The main window is split into tree panels:" + +_key="help3-1" +_value="1) The Subscription list (the panel with the number 1 in the screenshot) with the list of the podcasts that you have subscribed to. When you click on a Channel you can see in the panel 2 the list of the channel's items." + +_key="help3-2" +_value="2) The Episodes list with all the items available." + +_key="help3-3" +_value="3) The Info panel show: episode info, channel info or Downloads info; you can select an info panel by clicking one of the below three buttons." + + + +_key="help4-0" +_value="At the very top of the BePodder main window is the menubar with seven menus available: File, Settings, Subscriptions, Episodes, Lists, View and Help. Some menu commands are followed by a right pointing arrow that indicates a submenu of related commands. As you explore each menu, be sure to take a look at the submenus as well. Click on a menus to show its commands:" + +_key="help4-1" +_value="File: contains commands to close the application and to show information about BePodder" + +_key="help4-2" +_value="Settings: contains command to open the Preferences window that allows you to customize various BePodder settings." + +_key="help4-3" +_value="Subscriptions: contains commands that perform actions on the selected channel of your subscriptions list." + +_key="help4-4" +_value="Episodes: contains commands that perform actions on the selected item (episode) of the channel's episode list." + +_key="help4-5" +_value="Lists: contains commands to open BePodder's OPML directories." + +_key="help4-6" +_value="View: contains commands and controls for the BePodder window." + +_key="help4-7" +_value="Help: contains commands to open BePodder's 'Getting Started Guide' and the 'Keyboard Shortcuts List'." + + + +_key="help5-0" + _value="Add Button: opens the Add Window to add a feed url (e.g. http://www.newpodcast.com/rss.xml) usually given on the podcast homepage; looks for text or graphic link that says something like 'XML', 'RSS' or 'Podcast Feed' on it." + +_key="help5-1" + _value="Channel Remove Button: opens a window in which you can select how remove the channel: just archive the select channel (keeping all the files and eclosure downloaded so far) or delete the whole channel from your computer." + +_key="help5-2" + _value="Check Button: checks the selected channel and updates the list of the available items for that podcast adding the new items." + +_key="help5-3" + _value="Web Button: shows the channel homepage in the browser. To select your favorite browser open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select your favorite browser." + +_key="help5-4" + _value="Play Button: with this button you can view or listen the file enclosure of the selected item(episode). To select your favorite player open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select you favorite player." + +_key="help5-5" + _value="Download Button: downloads the file enclosure of the selected item (episode); you can see the download info by clicking on the third button over the info panel." + +_key="help5-6" + _value="Stop Button: stops to download the file enclosure of the selected item (episode); to resume the download double-click the item (episode) or select the item and click the Download Button" + +_key="help5-7" + _value="Item Remove Button: deletes the selected item (you will loose the enclosure file)." + + + +_key="help6-0" + _value="Getting started with BePodder is easy." + +_key="help6-1" + _value="On the left of the main window you can see the 'Subscription List' with all your feed subscriptions. We have added some subscriptions for you, and you can always add your own in two ways:" + +_key="help6-2" + _value="1) click the Add Button, then insert the feed url (example: http://www.newpodcast.com/rss.xml) and click add." + +_key="help6-3" + _value="2) in the menubar select 'Directory' and then 'Podcast list' or another list, choose a podcast and click 'Subscribe'." + +_key="help6-4" + _value="If you select a Podcast in the subscriptions list and use the check button, BePodder adds the new items to the 'Episodes list' (below on the right); you can check all your podcasts by right-clicking and selecting 'Check All Channels' in the context menu." + +_key="help6-5" + _value="Look at the screenshot above, there are 3 new items indicated by a black dot in the first column of the 'Episodes list'." + +_key="help6-6" + _value="In the second column there are icons that indicate the state of the item:" + +_key="help6-7" + _value="- the Episode 4 has an icon that indicates an error" + +_key="help6-8" + _value="- the Episode 3 has an icon that indicates that the item's enclosure download request is enquequed" + +_key="help6-9" + _value="- the Episode 2 has an icon that indicates that BePodder is downloading the item's enclosure file" + +_key="help6-10" + _value="- the Episode 1 have an icon that indicates that BePodder have just downloaded the item's enclosure file" + + + +_key="help7-0" + _value="Select an item in the 'Episodes list' and then double-click on it (or click the Download Button) to start downloading the enclosed file; you can always stop the download by clicking on the Stop Button." + +_key="help7-1" + _value="When you click on the Subscribed Podcasts in the 'Subscriptions List' the software shows you, in the 'List of episodes', all the items available in that Subscription. Select an item and then click play (Play Button) to view or listen to the file." + +_key="help7-2" + _value="You can access the Enclosures Folder by clicking on the folder icon in the Info Pannel or by right-clicking your mouse on an item and select 'Open Enclosures Folder' in the context menu." + + + +_key="help8-0" + _value="Preferences can be accessed by clicking in the menu-bar Settings>Preferences. You can select a category from the left list of the preferences dialog: FileType, Channels, Download and Proxy." + +_key="help8-1" + _value="- FileType: to specify the default browser and player. " + +_key="help8-2" + _value="- Channels: to specify preferences that control the operation to check channels new items; you can choose to Check all channels on startup or check the channel every desired minutes." + +_key="help8-3" + _value="- Download: to specify the max number of item's files to download at the same time," + +_key="help8-4" + _value="- Proxy: to set up a proxy server to work with BePodder; a proxy server acts as a security barrier between your internal network and the Internet, keeping others on the Internet from accessing information on your internal network." + + + +_key="help9-0" + _value="BePodder has built-in podcast, videoblog, imagefeeds, newsfeeds, bittorrentfeeds and internationalfeeds OPML directories with thousands of feeds grouped by category." + +_key="help9-1" + _value="OPML (Outline Processor Markup Language) is an XML-based format that allows exchange of outline-structured information between applications." + +_key="help9-2" + _value="OPML directory can be accessed by clicking in the menu-bar 'Lists' and thenselecting a list. To browse the opml directory for a feed, expand the list by clicking the arrow of the category that you are interested in (see image); using this method, you can expand the opml directory until you find the desired feed. Once you have selected it, you can add it to the subscription list by clicking the button 'Subscribe', you can also collapse all categories in the directory list by clicking the button 'Collapse All'." + +_key="help_shortcut1" +_value="This page describes the keyboard shortcuts that can be used in BePodder. The shortcuts are grouped here by function." + +_key="help_shortcut2" +_value="means that you can use either alt or control (es. Alt+Q or Ctrl+Q Quit the application), which way you have set it in the Deskbar menu preferences under Keyboard (the default shortcut key is Alt)." + +_key="help_shortcut3" + _value="General shortcuts" + +_key="help_shortcut4" + _value="Quit the application" + +_key="help_shortcut5" + _value="Shows the Preferences window" + +_key="help_shortcut6" + _value="Shows the Podcast directory list" + +_key="help_shortcut7" + _value="Shows the Videoblog directory list" + +_key="help_shortcut8" + _value="Shows the Imagefeeds directory list" + +_key="help_shortcut9" + _value="Shows the Newsfeeds directory list" + +_key="help_shortcut9b" + _value="Shows the BitTorrentfeeds directory list" + +_key="help_shortcut9c" + _value="Shows the Internationalfeeds directory list" + +_key="help_shortcut10" + _value="Fullscreen" + +_key="help_shortcut11" + _value="Shows/Hides the toolbar" + +_key="help_shortcut12" + _value="Shows the Getting Started Help" + +_key="help_shortcut13" + _value="Shows this keyboard shortcuts page" + +_key="help_shortcut14" + _value="Channels shortcuts" + +_key="help_shortcut15" + _value="Add a podcast to the subscriptions list" + +_key="help_shortcut16" + _value="Delete the selected podcast from the subscriptions list" + +_key="help_shortcut17" + _value="Check the selected podcast for new episodes (items)" + +_key="help_shortcut18" + _value="Check all podcasts for new episodes (items)" + +_key="help_shortcut19" + _value="Shows the podcast homepage" + +_key="help_shortcut20" + _value="Open enclosures folder" + +_key="help_shortcut21" + _value="Episodes shortcuts" + +_key="help_shortcut22" + _value="Play enclosure" + +_key="help_shortcut23" + _value="(Re)start download the selected episodes (items)" + +_key="help_shortcut24" + _value="Stop the episode (item) download" + +_key="help_shortcut25" + _value="Delete the selected episode (item)" + +_key="help_shortcut26" + _value="Shows the podcast episode (item) page " + +_key="help_shortcut27" + _value="Open enclosures folder" + +_key="help_buy1" + _value="BePodder Light is the basic version (free download and no time limited), the registered version adds some more nice features: unlimited number of channels, small Channel view, proxy support, automatic channels check, up to 5 enclosure downloads at the same time (multithreading)." + +_key="help_buy2" + _value="Please pay the shareware fee, it's only 15 euro (Kagi add tax in some countries), BePodder licence can be purchased online from Kagi." + +_key="help_buy3" + _value="Buy at www.funkyideasoft.com" + +_key="help_buy4" + _value="After purchasing, an email will be sent to you with a keyfile and instruction on how to install it. It's just a matter of unzipping a file and moving it to a certain directory." + +_key="help_buy5" + _value="There is no problem updating BePodder when a new version becomes available. The keyfile will unlock all downloadable packages unless otherwise notified." + + +### USELESS ######## + +"Opml Editor" "Opml Editor" +"name:" "name:" +"Add a category" "Add a category" +"Add a new Broadcast" "Add a new Broadcast" +"feed:" "feed:" +"url:" "url:" +"Test podcast" "Test podcast" +"Del a category" "Del a category" +"Add a category" "Add a category" +"Select the podcast category:" "Select the podcast category:" +"Check all" "Check all" +"Check" "Check" +"Refresh the list" "Refresh the list" +"Load" "Load" +"Load the list" "Load the list" +"Save" "Save" +"Save the list" "Save the list" +"Revert" "Revert" +"Apply" "Apply" + + + + + + + + + + + + diff --git a/release/Language/Dictionaries/BePodder.fiFI b/release/Language/Dictionaries/BePodder.fiFI new file mode 100644 index 0000000..83874e9 --- /dev/null +++ b/release/Language/Dictionaries/BePodder.fiFI @@ -0,0 +1,603 @@ + +# Locale file for BePodder. +# Modified: 4/18/2006 +# Author: BePodderTeam +# E-mail: bepodder.team@gmail.com + + +# Attention: don't remove empty space or \n + + +### SHAREWARE POPUPS ----------------------------------- + +"Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" "Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" + +"This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" "This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" + +"Web Site" "Web Site" + +"Can't connect!" "Can't connect!" +"Http port failed!" "Http port failed!" +"Can't resolve host!" "Can't resolve host!" +"Not found!" "Not found!" +"Bad resume!" "Bad resume!" +"Aborted by Callback!" "Aborted by Callback!" +"Can't resume! (range error)" "Can't resume! (range error)" +"Access Denied!" "Access Denied!" +"User or Password Incorrect!" "User or Password Incorrect!" +"Other error (cUrl code: " "Other error (cUrl code: " +"cUrl init error!" "cUrl init error!" +"Can't open file!" "Can't open file!" +"Other error (status code: " "Other error (status code: " +"Downloading" "Downloading" + + +### MENUBAR ----------------------------------- + +"File" "File" +"About..." "About..." +"Close!" "Close!" +"Quit" "Quit" + +"Settings" "Settings" +"Preferences..." "Preferences..." + +"Subscriptions" "Subscriptions" + +"Episodes" "Episodes" + +"Lists" "Lists" +"Podcast List" "Podcast List" +"Podcast directory list" "Podcast directory list" +"Videoblog List" "Videoblog List" +"Videoblog directory list" "Videoblog directory list" +"Imagefeeds List" "Imagefeeds List" +"Imagefeeds directory list" "Imagefeeds directory list" +"Newsfeeds List" "Newsfeeds List" +"Newsfeeds directory list" "Newsfeeds directory list" +"BitTorrentfeeds List" "BitTorrentfeeds List" +"BitTorrentfeeds directory list" "BitTorrentfeeds directory list" +"Internationalfeeds List" "Internationalfeeds List" +"Internationalfeeds directory list" "Internationalfeeds directory list" + +"View" "View" +"Full Screen" "Full Screen" +"Toolbar" "Toolbar" +"Subscriptions View" "Subscriptions View" +"Small Items" "Small Items" +"Big Items" "Big Items" +"Move BePodder on workspace:" "Move BePodder on workspace:" + +"Help" "Help" +"Getting Started" "Getting Started" +"Keyboard Shortcuts" "Keyboard Shortcuts" +"Tutorials" "Tutorials" +"Online Support" "Online Support" + + + + +### BUTTONS ----------------------------------- + +# Buttons add feed window +"Insert the rss feed url!" "Insert the rss feed url!" +"Add" "Add" +"Paste" "Paste" + +# Buttons directory list window +"Collapse All" "Collapse All" +"Preview" "Preview" +"Subscribe" "Subscribe" + + +# Buttons help window +"Next" "Next" +"Prev" "Prev" +"Close" "Close" +"Index" "Index" + + +# Buttons remove windows +"Cancel" "Cancel" +"Delete" "Delete" +"Archive" "Archive" + + + +### TOOLTIPS ----------------------------------- + +# Tooltips toolbar buttons + +"Add the podcast to the Subscriptions list" "Add the podcast to the Subscriptions list" +"Delete the podcast from the Subscriptions list" "Delete the podcast from the Subscriptions list" +"Check the selected podcast for new items" "Check the selected podcast for new items" +"Show the podcast homepage" "Show the podcast homepage" + +"Delete the item and the enclosure" "Delete the item and the enclosure" +"Stop the item download" "Stop the item download" +"Download the selected episode" "Download the selected episode" +"Play the selected episode" "Play the selected episode" + +"Submit bug and idea" "Submit bug and idea" + + +# Tooltips directory window buttons + +"Collapse all categories in the directory list" "Collapse all categories in the directory list" +"Add the selected podcast to the Subscription list" "Add the selected podcast to the Subscription list" +"Checkout a podcast before downloading it" "Checkout a podcast before downloading it" + + +### INFO PANEL ----------------------------------- + +"Show channel Image" "Show Channel Image" +"XML Feed Link" "XML Feed Link" + +"Show Episode info" "Show Episode info" +"Show Subscription info" "Show Subscription info" +"Show Downloads info" "Show Downloads info" + +"Enclosure: " "Enclosure: " + +"Lookup (Dictionary)" "Lookup (Dictionary)" +"Lookup (Google)" "Lookup (Google)" +"Lookup (Acronym Finder)" "Lookup (Acronym Finder)" +"Copy" "Copy" +"Select All" "Select All" +"Copy URL" "Copy URL" +"Open URL" "Open URL" +"Subscription" "Subscription" + + +### PREFERENCES ----------------------------------- + +"Preferences" "Preferences" + +"Proxy" "Proxy" +"Enable Proxy" "Enable Proxy" +"Address" "Address" +"Port" "Port" +"Username" "Username" +"Password" "Password" + +"Max Downloads" "Max Downloads" + +"FileType" "FileType" +"Browser" "Browser" +"Player" "Player" + +"Channels" "Channels" +"Check all channels on startup" "Check all channels on startup" +"Check the channel every" "Check the channel every" + +"never" "never" +"5 minutes" "5 minutes" +"15 minutes" "15 minutes" +"30 minutes" "30 minutes" +"1 hour" "1 hour" +"2 hour" "2 hour" + + + + +### COLUMLISTVIEW ----------------------------------- + + +"1 new item" "1 new item" +"%d new items" "%d new items" +"new" "new" +"error" "error" +"not down" "not down" +"enquequed" "enquequed" +"downloading" "downloading" +"downloaded" "downloaded" +"connecting" "connecting" +"not found" "not found" +"stopped" "stopped" +"can't connect" "can't connect" +"invalid format" "invalid format" + +"Icon" "Icon" +"Title" "Title" +"Date" "Date" +"Size" "Size" +"Status" "Status" +"Download" "Download" + + + +### CONTEXT MENU ----------------------------------- + +"Add Channel" "Add Channel" +"Remove Channel" "Remove Channel" +"Check Channel" "Check Channel" +"Open Homepage" "Open Homepage" + +"Open Web Page" "Open Web Page" +"Open Enclosures folder" "Open Enclosures folder" +"Check All Channels" "Check All Channels" + +"Show Channel Image" "Show Channel Image" + +"Play enclosure" "Play enclosure" +"(Re)start download" "(Re)start download" +"Stop download" "Stop download" +"Remove Item" "Remove Item" + +"Find this Item" "Find this Item" +"Remove from this list" "Remove from this list" + + + +### ALERT ----------------------------------- + +"\nRemoving.." "\nRemoving.." +"\nAn error occured while removing!" "\nAn error occured while removing!" +"Check all the podcasts for new items" "Check all the podcasts for new items" + +"You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" "You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" + +"Can't open the selected file with:\n\n" "Can't open the selected file with:\n\n" +"\n\nPlease check if the application is installed in the right way.\n" "\n\nPlease check if the application is installed in the right way.\n" +"Download it!" "Download it!" + +# multi line text... please translate only the text after _value= and don't remove empty space + +_key="alert1" + _value=" +You are going to remove the selected item. + +Are you sure? +(you will lost the enclosure file if any)" + + +_key="alert2a" + _value=" +You are going to remove the channel: + +" + +_key="alert2b" + _value=" + +Would you like just to archive this +channel (keeping all the files and +enclosures downloaded so far) or +do you want to DELETE the whole + channel from you computer?" + +_key="alert3" + _value=" +Parsing archive.." + +_key="alert_3gp" + _value=" +3GP is a multimedia container format defined by the Third Generation Partnership Project (3GPP) for use on 3G mobile phones. It stores video streams as MPEG-4 or H.263, and audio streams as AMR-NB or AAC-LC. + +VideoLAN still doesn't support the audio AMR (3GPP)" + +_key="alert_swf" + _value=" +SWF is a proprietary vector graphics file format produced by the Flash software from Adobe (formerly Macromedia). + +Currently Flash support in BeOS/Haiku/Zeta is limited to the old standalone Flash player version 4.1015, there isn't a modern Flash player" + + + + +### HELP & SHORTCUTS ----------------------------------- + + +"Introduction" "Introduction" +"The User Interface" "The User Interface" +"Menu Bar" "Menu Bar" +"Toolbar Buttons" "Toolbar Buttons" +"First time with BePodder" "First time with BePodder" +"Download Podcast's enclosure files" "Download Podcast's enclosure files" +"Settings Overview" "Settings Overview" +"Directory lists" "Directory lists" +"Loading Help..." "Loading Help..." +"Register your copy" "Register your copy" +"Starting point" "Starting point" + + + + +# multi line text... please translate only the text after _value= and don't remove empty space + + +_key="help1-0" + _value="Welcome to the BePodder Getting Started Guide." + +_key="help1-1" + _value="If you are already familiar with podcasts and RSS/Atom feeds you can immediately go to BePodder by closing this window." + +_key="help1-2" +_value="If not, this is a short introduction providing you everything you'll need to know on how to get started with BePodder. Use the buttons below to navigate through this tutorial." + + +_key="help2-0" +_value="Podcasting is a method for publishing audio and video broadcasts via the Internet; links to free audio and video files are enclosed in RSS and Atom feeds." + +_key="help2-1" +_value="Therefore Podcasting is simply a type of online media delivery; users can subscribe to a podcast using a feed (such as RSS 'Really Simple Syndication' or Atom)." + +_key="help2-2" +_value="An aggregator (or podcatcher) like BePodder, is a piece of software that allows you to subscribe to a RSS feed and periodically check for and download new content; with BePodder you can check for new Podcast items (Episodes) of your subscribed Channels. Any item can contain an enclosure, just like an Email can contain an attachment." + + + +_key="help3-0" +_value="BePodder has an easy to use yet powerful Graphical User Interface. The main window is split into tree panels:" + +_key="help3-1" +_value="1) The Subscription list (the panel with the number 1 in the screenshot) with the list of the podcasts that you have subscribed to. When you click on a Channel you can see in the panel 2 the list of the channel's items." + +_key="help3-2" +_value="2) The Episodes list with all the items available." + +_key="help3-3" +_value="3) The Info panel show: episode info, channel info or Downloads info; you can select an info panel by clicking one of the below three buttons." + + + +_key="help4-0" +_value="At the very top of the BePodder main window is the menubar with seven menus available: File, Settings, Subscriptions, Episodes, Lists, View and Help. Some menu commands are followed by a right pointing arrow that indicates a submenu of related commands. As you explore each menu, be sure to take a look at the submenus as well. Click on a menus to show its commands:" + +_key="help4-1" +_value="File: contains commands to close the application and to show information about BePodder" + +_key="help4-2" +_value="Settings: contains command to open the Preferences window that allows you to customize various BePodder settings." + +_key="help4-3" +_value="Subscriptions: contains commands that perform actions on the selected channel of your subscriptions list." + +_key="help4-4" +_value="Episodes: contains commands that perform actions on the selected item (episode) of the channel's episode list." + +_key="help4-5" +_value="Lists: contains commands to open BePodder's OPML directories." + +_key="help4-6" +_value="View: contains commands and controls for the BePodder window." + +_key="help4-7" +_value="Help: contains commands to open BePodder's 'Getting Started Guide' and the 'Keyboard Shortcuts List'." + + + +_key="help5-0" + _value="Add Button: opens the Add Window to add a feed url (e.g. http://www.newpodcast.com/rss.xml) usually given on the podcast homepage; looks for text or graphic link that says something like 'XML', 'RSS' or 'Podcast Feed' on it." + +_key="help5-1" + _value="Channel Remove Button: opens a window in which you can select how remove the channel: just archive the select channel (keeping all the files and eclosure downloaded so far) or delete the whole channel from your computer." + +_key="help5-2" + _value="Check Button: checks the selected channel and updates the list of the available items for that podcast adding the new items." + +_key="help5-3" + _value="Web Button: shows the channel homepage in the browser. To select your favorite browser open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select your favorite browser." + +_key="help5-4" + _value="Play Button: with this button you can view or listen the file enclosure of the selected item(episode). To select your favorite player open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select you favorite player." + +_key="help5-5" + _value="Download Button: downloads the file enclosure of the selected item (episode); you can see the download info by clicking on the third button over the info panel." + +_key="help5-6" + _value="Stop Button: stops to download the file enclosure of the selected item (episode); to resume the download double-click the item (episode) or select the item and click the Download Button" + +_key="help5-7" + _value="Item Remove Button: deletes the selected item (you will loose the enclosure file)." + + + +_key="help6-0" + _value="Getting started with BePodder is easy." + +_key="help6-1" + _value="On the left of the main window you can see the 'Subscription List' with all your feed subscriptions. We have added some subscriptions for you, and you can always add your own in two ways:" + +_key="help6-2" + _value="1) click the Add Button, then insert the feed url (example: http://www.newpodcast.com/rss.xml) and click add." + +_key="help6-3" + _value="2) in the menubar select 'Directory' and then 'Podcast list' or another list, choose a podcast and click 'Subscribe'." + +_key="help6-4" + _value="If you select a Podcast in the subscriptions list and use the check button, BePodder adds the new items to the 'Episodes list' (below on the right); you can check all your podcasts by right-clicking and selecting 'Check All Channels' in the context menu." + +_key="help6-5" + _value="Look at the screenshot above, there are 3 new items indicated by a black dot in the first column of the 'Episodes list'." + +_key="help6-6" + _value="In the second column there are icons that indicate the state of the item:" + +_key="help6-7" + _value="- the Episode 4 has an icon that indicates an error" + +_key="help6-8" + _value="- the Episode 3 has an icon that indicates that the item's enclosure download request is enquequed" + +_key="help6-9" + _value="- the Episode 2 has an icon that indicates that BePodder is downloading the item's enclosure file" + +_key="help6-10" + _value="- the Episode 1 have an icon that indicates that BePodder have just downloaded the item's enclosure file" + + + +_key="help7-0" + _value="Select an item in the 'Episodes list' and then double-click on it (or click the Download Button) to start downloading the enclosed file; you can always stop the download by clicking on the Stop Button." + +_key="help7-1" + _value="When you click on the Subscribed Podcasts in the 'Subscriptions List' the software shows you, in the 'List of episodes', all the items available in that Subscription. Select an item and then click play (Play Button) to view or listen to the file." + +_key="help7-2" + _value="You can access the Enclosures Folder by clicking on the folder icon in the Info Pannel or by right-clicking your mouse on an item and select 'Open Enclosures Folder' in the context menu." + + + +_key="help8-0" + _value="Preferences can be accessed by clicking in the menu-bar Settings>Preferences. You can select a category from the left list of the preferences dialog: FileType, Channels, Download and Proxy." + +_key="help8-1" + _value="- FileType: to specify the default browser and player. " + +_key="help8-2" + _value="- Channels: to specify preferences that control the operation to check channels new items; you can choose to Check all channels on startup or check the channel every desired minutes." + +_key="help8-3" + _value="- Download: to specify the max number of item's files to download at the same time," + +_key="help8-4" + _value="- Proxy: to set up a proxy server to work with BePodder; a proxy server acts as a security barrier between your internal network and the Internet, keeping others on the Internet from accessing information on your internal network." + + + +_key="help9-0" + _value="BePodder has built-in podcast, videoblog, imagefeeds, newsfeeds, bittorrentfeeds and internationalfeeds OPML directories with thousands of feeds grouped by category." + +_key="help9-1" + _value="OPML (Outline Processor Markup Language) is an XML-based format that allows exchange of outline-structured information between applications." + +_key="help9-2" + _value="OPML directory can be accessed by clicking in the menu-bar 'Lists' and thenselecting a list. To browse the opml directory for a feed, expand the list by clicking the arrow of the category that you are interested in (see image); using this method, you can expand the opml directory until you find the desired feed. Once you have selected it, you can add it to the subscription list by clicking the button 'Subscribe', you can also collapse all categories in the directory list by clicking the button 'Collapse All'." + +_key="help_shortcut1" +_value="This page describes the keyboard shortcuts that can be used in BePodder. The shortcuts are grouped here by function." + +_key="help_shortcut2" +_value="means that you can use either alt or control (es. Alt+Q or Ctrl+Q Quit the application), which way you have set it in the Deskbar menu preferences under Keyboard (the default shortcut key is Alt)." + +_key="help_shortcut3" + _value="General shortcuts" + +_key="help_shortcut4" + _value="Quit the application" + +_key="help_shortcut5" + _value="Shows the Preferences window" + +_key="help_shortcut6" + _value="Shows the Podcast directory list" + +_key="help_shortcut7" + _value="Shows the Videoblog directory list" + +_key="help_shortcut8" + _value="Shows the Imagefeeds directory list" + +_key="help_shortcut9" + _value="Shows the Newsfeeds directory list" + +_key="help_shortcut9b" + _value="Shows the BitTorrentfeeds directory list" + +_key="help_shortcut9c" + _value="Shows the Internationalfeeds directory list" + +_key="help_shortcut10" + _value="Fullscreen" + +_key="help_shortcut11" + _value="Shows/Hides the toolbar" + +_key="help_shortcut12" + _value="Shows the Getting Started Help" + +_key="help_shortcut13" + _value="Shows this keyboard shortcuts page" + +_key="help_shortcut14" + _value="Channels shortcuts" + +_key="help_shortcut15" + _value="Add a podcast to the subscriptions list" + +_key="help_shortcut16" + _value="Delete the selected podcast from the subscriptions list" + +_key="help_shortcut17" + _value="Check the selected podcast for new episodes (items)" + +_key="help_shortcut18" + _value="Check all podcasts for new episodes (items)" + +_key="help_shortcut19" + _value="Shows the podcast homepage" + +_key="help_shortcut20" + _value="Open enclosures folder" + +_key="help_shortcut21" + _value="Episodes shortcuts" + +_key="help_shortcut22" + _value="Play enclosure" + +_key="help_shortcut23" + _value="(Re)start download the selected episodes (items)" + +_key="help_shortcut24" + _value="Stop the episode (item) download" + +_key="help_shortcut25" + _value="Delete the selected episode (item)" + +_key="help_shortcut26" + _value="Shows the podcast episode (item) page " + +_key="help_shortcut27" + _value="Open enclosures folder" + +_key="help_buy1" + _value="BePodder Light is the basic version (free download and no time limited), the registered version adds some more nice features: unlimited number of channels, small Channel view, proxy support, automatic channels check, up to 5 enclosure downloads at the same time (multithreading)." + +_key="help_buy2" + _value="Please pay the shareware fee, it's only 15 euro (Kagi add tax in some countries), BePodder licence can be purchased online from Kagi." + +_key="help_buy3" + _value="Buy at www.funkyideasoft.com" + +_key="help_buy4" + _value="After purchasing, an email will be sent to you with a keyfile and instruction on how to install it. It's just a matter of unzipping a file and moving it to a certain directory." + +_key="help_buy5" + _value="There is no problem updating BePodder when a new version becomes available. The keyfile will unlock all downloadable packages unless otherwise notified." + + +### USELESS ######## + +"Opml Editor" "Opml Editor" +"name:" "name:" +"Add a category" "Add a category" +"Add a new Broadcast" "Add a new Broadcast" +"feed:" "feed:" +"url:" "url:" +"Test podcast" "Test podcast" +"Del a category" "Del a category" +"Add a category" "Add a category" +"Select the podcast category:" "Select the podcast category:" +"Check all" "Check all" +"Check" "Check" +"Refresh the list" "Refresh the list" +"Load" "Load" +"Load the list" "Load the list" +"Save" "Save" +"Save the list" "Save the list" +"Revert" "Revert" +"Apply" "Apply" + + + + + + + + + + + + diff --git a/release/Language/Dictionaries/BePodder.frBE b/release/Language/Dictionaries/BePodder.frBE new file mode 100644 index 0000000..cdb5154 --- /dev/null +++ b/release/Language/Dictionaries/BePodder.frBE @@ -0,0 +1,601 @@ +# Locale file for BePodder. +# Modified: 21/04/2006 +# Author: Rémi Grumeau +# E-mail: remi@beosfrance.com + + +# Attention: don't remove empty space or \n + + +### SHAREWARE POPUPS ----------------------------------- + +"Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" "Application en version Shareware !\n\nMerci pour votre support!\n\nAcheter une license!\nPlus d'infos sur le site internet\n" + +"This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" "Désolé, la periode d'éssai de BePodder est terminée !\nMerci d'acheter une license.\n" + +"Web Site" "Site Internet" + +"Can't connect!" "Connection impossible!" +"Http port failed!" "Port HTTP indisponible!" +"Can't resolve host!" "Hôte introuvable !" +"Not found!" "Introuvable !" +"Bad resume!" "Résume impossible !" +"Aborted by Callback!" "Annulé par l'utilisateur !" +"Can't resume! (range error)" "Résume impossible ! (erreur de classement)" +"Access Denied!" "Accès refusé !" +"User or Password Incorrect!" "Identifiant ou mot de passe incorrect !" +"Other error (cUrl code: " "Erreur inconnue (code cUr : " +"cUrl init error!" "erreur d'init cUrl !" +"Can't open file!" "Ouverture impossible!" +"Other error (status code: " "Erreur inconnue (statut code: " +"Downloading" "Téléchargement en cours" + +### MENUBAR ----------------------------------- + +"File" "Fichier" +"About..." "A propos...." +"Close!" "Fermer" +"Quit" "Quitter" + +"Settings" "Préférences" +"Preferences..." "Préférences..." + +"Subscriptions" "Abonnements" + +"Episodes" "Episodes" + +"Lists" "Listes" +"Podcast List" "Liste de Podcast" +"Podcast directory list" "Dossier de la liste Podcast" +"Videoblog List" "Liste de Videoblogs" +"Videoblog directory list" "Dossier de la liste de Videoblogs" +"Imagefeeds List" "Liste des Imagefeeds" +"Imagefeeds directory list" "Dossier de la liste de Imagefeeds" +"Newsfeeds List" "Liste des Newsfeeds" +"Newsfeeds directory list" "Dossier de la liste des Newsfeeds" +"BitTorrentfeeds List" "Liste des BitTorrentfeeds" +"BitTorrentfeeds directory list" "Dossier de la liste des BitTorrentfeeds" +"Internationalfeeds List" "Liste des Internationalfeeds" +"Internationalfeeds directory list" "Dossier de la liste des Internationalfeeds" + +"View" "Affichage" +"Full Screen" "Plein-écran" +"Toolbar" "Barre d'outils" +"Subscriptions View" "Liste des abonnements" +"Small Items" "Liste simple" +"Big Items" "Liste avec icones" +"Move BePodder on workspace:" "Déplacer BePodder sur le bureau:" + +"Help" "Aide" +"Getting Started" "Bien démarrer avec BePodder" +"Keyboard Shortcuts" "Raccourics clavier" +"Tutorials" "Didacticielles" +"Online Support" "Support en ligne" + + + + +### BUTTONS ----------------------------------- + +# Buttons add feed window +"Insert the rss feed url!" "Entrer l'adresse du flux RSS!" +"Add" "Ajouter" +"Paste" "Coller" + +# Buttons directory list window +"Collapse All" "Tout minimiser" +"Preview" "Prévisualiser" +"Subscribe" "S'abonner" + + +# Buttons help window +"Next" "Suivant" +"Prev" "Précédent" +"Close" "Fermer" +"Index" "Index" + + +# Buttons remove windows +"Cancel" "Annuler" +"Delete" "Supprimer" +"Archive" "Archive" + + + +### TOOLTIPS ----------------------------------- + +# Tooltips toolbar buttons + +"Add the podcast to the Subscriptions list" "Ajouter le PodCast a votre liste d'abonnements" +"Delete the podcast from the Subscriptions list" "Supprimer le PodCast de votre liste d'abonnements" +"Check the selected podcast for new items" "Mettre a jour le PodCast" +"Show the podcast homepage" "Afficher la page d'accueil du PodCast" + +"Delete the item and the enclosure" "Delete the item and the enclosure" +"Stop the item download" "Stopper le téléchargement" +"Download the selected episode" "Télécharger l'épisode sélectionné" +"Play the selected episode" "Lire l'épisode sélectionné" + +"Submit bug and idea" "Soumettre une idée ou signaler un bug" + + +# Tooltips directory window buttons + +"Collapse all categories in the directory list" "Rassembler toutes les catégories dans la liste des dossiers" +"Add the selected podcast to the Subscription list" "Ajouter le PodCast sélectionné a votre liste d'abonnements" +"Checkout a podcast before downloading it" "Verifier le PodCast avant de le télécharger" + + +### INFO PANEL ----------------------------------- + +"Show channel Image" "Afficher l'image" +"XML Feed Link" "Lien du Feed XML" + +"Show Episode info" "Afficher les infos de l'épisode" +"Show Subscription info" "Afficher les infos de l'abonnement" +"Show Downloads info" "Afficher les infos du télechargement" + +"Enclosure: " "Fichier inclus: " + +"Lookup (Dictionary)" "Rechercher dans 'Dictionary'" +"Lookup (Google)" "Rechercher dans 'Google'" +"Lookup (Acronym Finder)" "Rechercher dans 'Acronym Finder'" +"Copy" "Copier" +"Select All" "Tout sélectionner" +"Copy URL" "Copier l'adresse" +"Open URL" "Ouvrir l'adresse" +"Subscription" "Souscription" + +"Find this Item" "Trouver ce fichier" +"Remove from this list" "Supprimer ce fichier" + + +### PREFERENCES ----------------------------------- + +"Preferences" "Préférences" + +"Proxy" "Proxy" +"Enable Proxy" "Activer le proxy" +"Address" "Addresse" +"Port" "Port" +"Username" "Identifiant" +"Password" "Mot de passe" + +"Max Downloads" "Téléchargements Max" + +"FileType" "Ouvrir les fichiers" +"Browser" "Navigateur:" +"Player" "Lecteur Audio/Vidéo:" + +"Channels" "Abonnements" +"Check all channels on startup" "Verifier tous les abonnements au démarrage" +"Check the channel every" "Vérifier tout les " + +"never" "Ne jamais vérifier" +"5 minutes" "5 minutes" +"15 minutes" "15 minutes" +"30 minutes" "30 minutes" +"1 hour" "heures" +"2 hour" "2 heures" + + + + +### COLUMLISTVIEW ----------------------------------- + + +"1 new item" "1 nouveau fichier" +"%d new items" "%d nouveaux fichiers" +"new" "nouveau" +"error" "erreur" +"not down" "non téléchargé" +"enquequed" "ajouté" +"downloading" "en cours de téléchargement" +"downloaded" "téléchargé" +"connecting" "connection en cours" +"not found" "introuvable" +"stopped" "arreté" +"can't connect" "connection impossible" +"invalid format" "format non valide" + +"Icon" "Icon" +"Title" "Titre" +"Date" "Date" +"Size" "Taille" +"Status" "Etat" +"Download" "Téléchargement" + + + +### CONTEXT MENU ----------------------------------- + +"Add Channel" "AJouter un abonnement" +"Remove Channel" "Supprimer un abonnement" +"Check Channel" "Vérifier les mises a jour" +"Open Homepage" "Ouvrir la page d'acceuil" + +"Open Web Page" "Aller sur le site internet" +"Open Enclosures folder" "Ouvrir le dossier" +"Check All Channels" "Vérifier tous les abonnements" + +"Show Channel Image" "Afficher la vignette de l'abonnement" + +"Play enclosure" "Afficher" +"(Re)start download" "(re)Télécharger" +"Stop download" "Arreter le téléchargement" +"Remove Item" "Supprimer" + +"Find this Item" "Trouver ce fichier" +"Remove from this list" "Supprimer ce fichier" + + + +### ALERT ----------------------------------- + +"You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" "Désolé mais vous ne pouvez vous inscrire qu'a 10 podcasts dans cette version d'essai.\n Veuillez vous enregistrer.\n" + +"Can't open the selected file with:\n\n" "Impossible d'ouvrir ce fichier avec:\n\n" +"\n\nPlease check if the application is installed in the right way.\n" "\n\nVeuillez vérifier que cette application est bien installée a cet endroit.\n" + +"Download it!" "Télécharger !" + +"\nRemoving.." "\nSuppression.." +"\nAn error occured while removing!" "\nUne erreur s'est produite lors de la suppression !" +"Check all the podcasts for new items" "Vérifier tous les PodCast et les mettre a jour" + +# multi line text... please translate only the text after _value= and don't remove empty space + +_key="alert1" + _value=" +Vous etes sur le point de supprimer la ligne suivante. + +Etes-vous sur ? +(le fichier inclus sera perdu, si il y en a un)" + + +_key="alert2a" + _value=" +Vous etes sur le point de supprimer l'abonnement: + +" + +_key="alert2b" + _value=" + +Désirez-vous archiver cet abonnement +(et conserver les fichiers téléchargé) ou +voulez-vous supprimer tous les fichiers +en rapport avec cet abonnement ?" + +_key="alert3" + _value=" +Archivage en cours..." + +_key="alert_3gp" + _value=" +3GP est un format de contenance multimedia défini par le Third Generation Partnership Project (3GPP) pour une utilisation sur téléphone mobile 3G. Il enregistre la vidéo en MPEG-4 ou H.263, et l'audio en AMR-NB ou AAC-LC. + +VideoLAN ne supporte pas encore le AMR-NB (3GPP)" + +_key="alert_swf" + _value=" +SWF est un format d'animation vectorielle propriétaire appartenant a Adobe (créée par Macromedia). + +Pour l'instant, le support des animations flash sous BeOS, Zeta ou Haiku se limite à la version 4.1015, aucun lecteur plus récent n'est disponible." + +### HELP & SHORTCUTS ----------------------------------- + + +"Introduction" "Introduction" +"The User Interface" "L'interface utilisateur" +"Menu Bar" "La barre du menu" +"Toolbar Buttons" "La barre d'outils" +"First time with BePodder" "Les premiers pas avec BePodder" +"Download Podcast's enclosure files" "Télécharger les fichiers relatifs aux Podcasts" +"Settings Overview" "Les parametres" +"Directory lists" "Listes des dossiers" +"Loading Help..." "Chargement de l'aide..." +"Register your copy" "Enregistrez-vous" +"Starting point" "Sommaire" + + + + +# multi line text... please translate only the text after _value= and don't remove empty space + + +_key="help1-0" + _value=Bienvenu dans l'aide à l'utilisation de BePodder." + +_key="help1-1" + _value="Si vous avez déjà utilisé BePodder ou familié aux logiciels de flux RSS/Atom, vous pouvez fermer cette fenêtre et commencer à utiliser BePodder." + +_key="help1-2" +_value="Le cas échéant, voici une petite introduction sur comment et pourquoi utiliser ce type de logiciel. Utilisez les boutons en bas de la fenetre pour naviguer dans ce didacticielle." + + + +_key="help2-0" +_value="Podcaster est une méthode pour publier du contenu audio ou vidéo sur Internet; les liens vers les fichiers sont définis dans les flux RSS/Atom." + +_key="help2-1" +_value="Le Podcasting est donc un simple moyen de mettre a disposition des fichiers; les utilisateurs peuvent alors souscrire à ce flux (comme un RSS 'Really Simple Syndication' ou Atom)." + +_key="help2-2" +_value="Un aggregator (ou podcatcher) comme BePodder, est un logiciel vous permettant de souscrire à ces flux et vérifier périodiquement si un flux à était mis à jour; avec BePodder vous pouvez vérifier si de nouveaux fichiers sont disponibles (Episodes) dans les flux souscrits. Chaque fichier peut alors contenir une pièce jointe, tout comme un email." + + + +_key="help3-0" +_value="BePodder a un interface simple et très complète. La fenêtre principale est divisée en trois parties:" + +_key="help3-1" +_value="1) La liste des abonnements (la partie avec le numéro 1) contenant la liste des flux ausquels vous avez souscrits. Lorsque vous sélectionnez un flux, vous pouvez voir la liste des épisodes qu'il contient dans la seconde partie (numéro 2)." + +_key="help3-2" +_value="2) La liste des épisodes avec les fichiers qu'ils contiennent." + +_key="help3-3" +_value="3) Informations. Cette troisième et dernière partie contient: informations générales, de l'épisodes ou du téléchargement; vous pouvez sélectionner l'info voulu en cliquant sur les boutons correspondants." + + + +_key="help4-0" +_value="Tout en haut de la fenêtre principale de BePodder se trouve le menu avec 7 sous menus: Fichier, Préférences, Abonnements, Episodes, Listes, Affichage et Aide. Les options des sous-menus précédés d'une flêche ont un autre menu déroulant associé. En explorant chaque menu, jeter un coup d'oeil à ces sous-menus également. Cliquez sur un menu pour en voir la commande:" + +_key="help4-1" +_value="Fichier: contient les commandes pour fermer l'application et afficher les informations au sujet de BePodder" + +_key="help4-2" +_value="Préférences: contient les commandes pour ouvrir le panneau des préférences, pour personnaliser les options de BePodder à votre goût." + +_key="help4-3" +_value="Abonnements: contient les commandes en relation avec l'abonnement sélectionné dans la liste des abonnements (partie 1)." + +_key="help4-4" +_value="Episodes: contient les commandes en relation avec l'épisode sélectionné dans la liste des épisode (partie 2)." + +_key="help4-5" +_value="Listes: contient la liste des flux (abonnements) prédéfinis dans BePodder ausquels vous pouvez souscrire." + +_key="help4-6" +_value="Affichage: contient les options d'affichage de la fenêtre principale de BePodder." + +_key="help4-7" +_value="Aide: contient les fiches d'aide à l'utilisation de BePodder et la liste des raccourcis clavier." + + + +_key="help5-0" + _value="Ajouter: Permet d'ajouter un flux en indiquant son adresse (ex. http://www.newpodcast.com/rss.xml), le plus souvent donné sur le site de l'auteur; Cherchez une icone ou un lien qui ressemble à 'XML', 'RSS' ou 'Podcast Feed' dessus." + +_key="help5-1" + _value="Supprimer: Permet de se déinscrire d'un flux: choississez juste d'archiver (conserve les fichiers téléchargés en relation) ou tout supprimer." + +_key="help5-2" + _value="Mise à jour: Vérifie si de nouveaux épisodes sont disponibles pour les abonnements sélectionnés." + +_key="help5-3" + _value="Site internet: Ouvre le site internet de l'abonnement dans le navigateur web. Pour sélectionner le navigateur à utiliser, ouvrez les préférences dans le menu Préférences > et sélectionnez votre navigateur dans la liste." + +_key="help5-4" + _value="Lecture: Ouvre la pièce jointe de l'épisode séléctionné. Pour sélectionner le lecteur média à utiliser, ouvrez les préférences dans le menu Préférences > et sélectionnez votre lecteur dans la liste." + +_key="help5-5" + _value="Télécharger: Télécharge la pièce jointe de l'épisode séléctionné; pour voir les informations de téléchargement, cliquez sur le troisième bouton dans la partie information (3)." + +_key="help5-6" + _value="Stop: Stoppe le téléchargement de la pièce jointe; pour relancer le téléchargement où il s'est arreté, double cliquez sur l'épisode dans la liste des épisodes (2)" + +_key="help5-7" + _value="Supprimer: supprime l'épisode (et les pièces jointes correspondante)." + + + +_key="help6-0" + _value="Démarrer avec BePodder est très simple." + +_key="help6-1" + _value="Sur la gauche, il y a la liste des abonnements, la liste de vos souscriptions. Nous en avons pré-souscrits pour vous, mais vous pouvez bien entendu en rajouter vous même:" + +_key="help6-2" + _value="1) cliquez sur le bouton Ajouter et entrer une adresse (example: http://www.newpodcast.com/rss.xml)." + +_key="help6-3" + _value="2) ou séléctionner un flux dans la liste prédéfinie dans BePodder (menu 'Listes' > 'Liste des Podcast' ou une autre liste, choississez un podcast et cliquez sur 'S'abonner'." + +_key="help6-4" + _value="Si vous séléctionnez un Podcast dans la liste des abonnements et cliquez sur le bouton 'Mise a jour', BePodder ajoute les nouveautées dans la liste des épisodes; Vous pouvez lancer une mise à jour de tous vos abonnements en même temps avec un clic droit sur ce même bouton et 'Mettre tous les abonnements à jour'." + +_key="help6-5" + _value="Sur la capture d'écran suivante, vous pouvez voir que 3 nouveaux épisodes ont été ajouté, mis en avant par un rond noir devant leur nom." + +_key="help6-6" + _value="Dans la seconde colonne il y a une icone qui indique son état:" + +_key="help6-7" + _value="- l'épisode 4 a une icone indiquant une erreur" + +_key="help6-8" + _value="- l'épisode 4 a une icone indiquant que sa pièce jointe n'a pas encore été téléchargé" + +_key="help6-9" + _value="- l'épisode 4 a une icone indiquant que BePodder télécharge la pièce jointe" + +_key="help6-10" + _value="- l'épisode 4 a une icone indiquant que BePodder a fini de télécharger la pièce jointe" + + + +_key="help7-0" + _value="Sélectionnez un épisode dans la liste des épisodes double cliquez dessus (ou cliquez surle bouton 'télécharger') pour lancer le téléchargement de la pièce jointe; Vous pouvez à tout moment le stopper en appuyant sur le bouton 'Stopper'." + +_key="help7-1" + _value="Lorsque vous cliquez sur un épisode (partie 2), BePodder affiche (partie 3) tous ce qui est disponible dans cet épisode. Sélectionnez un fichier et cliquez sur Lecture pour voir ou écouter la pièce jointe." + +_key="help7-2" + _value="Vous pouvez accéder au dossier contenant les pièces jointes téléchargées en cliquant sur le lien 'Fichiers inclus' dans le contenu de l'épisode (partie 3), ou par un clic droit sur un épisode (partie 2) et en sélectionnant 'Ouvrir le dossier'." + + + +_key="help8-0" + _value="Les préférences peuvent être personnalisées par le menu 'Préférences'. Vous pouvez alors choisir une catégorie dans la liste de gauche parmis 'Types de fichiers', 'Abonnements', 'Téléchargement' et 'Proxy'." + +_key="help8-1" + _value="- Type de fichiers: pour définir votre navigateur et lecteur audio/vidéo. " + +_key="help8-2" + _value="- Abonnements: pour définir la façon dont vous souhaitez vérifier les mises à jour de vos abonnements: au démarrage et/ou toutes les X minutes." + +_key="help8-3" + _value="- Téléchargement: pour définir le nombre de fichiers à télécharger en même temps," + +_key="help8-4" + _value="- Proxy: pour configurer les paramètres réseau si vous accéder à Internet à travers un proxy ou un routeur." + + +_key="help9-0" + _value="BePodder est livré avec une liste prédéfinie (OPML) d'une centaine de podcast, videoblog, imagefeeds, newsfeeds, bittorrentfeeds et internationalfeeds, tous classés par catégorie ." + +_key="help9-1" + _value="OPML (Outline Processor Markup Language) est un format basé sur de l'XML permettant l'échange de données entre plusieurs applications." + +_key="help9-2" + _value="Vous pouvez accéder à ces listes par le menu 'Listes' et en sélectionnant la liste voulue. Pour ouvrir une catégorie, cliquez sur la fleche noire à côté de son nom, jusqu'a trouver le flux de vos rêves ! Une fois sélectionné, ajoutez-le à votre liste d'abonnements en cliquant sur le bouton 'S'abonner', vous pouvez également replier toutes les catégories en cliquant sur le bouton 'minimiser'." + + +_key="help_shortcut1" +_value="Cette page liste les raccourcis clavier de BePodder. Les raccourcis sont ici regroupés par fonctions." + +_key="help_shortcut2" +_value="signifie que vous pouvez utiliser la touche alt ou ctrl (ex. Alt+Q ou Ctrl+Q pour quitter BePodder), selon la touche définie dans les préférences du clavier (par défaut, la touche utilisée est Alt)." + +_key="help_shortcut3" + _value="Principaux raccourcis" + +_key="help_shortcut4" + _value="Quitter" + +_key="help_shortcut5" + _value="Afficher le panneau de préférences" + +_key="help_shortcut6" + _value="Affiche la liste des Podcast" + +_key="help_shortcut7" + _value="Affiche la liste des Videoblog" + +_key="help_shortcut8" + _value="Affiche la liste des Imagefeeds" + +_key="help_shortcut9" + _value="Affiche la liste des Newsfeeds" + +_key="help_shortcut9b" + _value="Affiche la liste des BitTorrentfeeds" + +_key="help_shortcut9c" + _value="Affiche la liste des Internationalfeeds" + +_key="help_shortcut10" + _value="Plein écran" + +_key="help_shortcut11" + _value="Affiche/masque les boutons en haut" + +_key="help_shortcut12" + _value="Affiche le panneau d'aide" + +_key="help_shortcut13" + _value="Affiche le panneau des raccourcis clavier" + +_key="help_shortcut14" + _value="Raccourci des abonnements" + +_key="help_shortcut15" + _value="Ajouter un nouveau flux en tapant l'adresse" + +_key="help_shortcut16" + _value="Supprime l'abonnement sélectionné" + +_key="help_shortcut17" + _value="Vérifie les mises à jour disponible pour l'abonnement sélectionné" + +_key="help_shortcut18" + _value="Vérifie les mises à jour disponible pour tout les abonnements" + +_key="help_shortcut19" + _value="Accéder le site internet" + +_key="help_shortcut20" + _value="Ouvrir le dossier des pièces jointes" + +_key="help_shortcut21" + _value="Raccourcis des épisodes" + +_key="help_shortcut22" + _value="Ouvrir la pièce jointe" + +_key="help_shortcut23" + _value="Lancer/relancer le téléchargement" + +_key="help_shortcut24" + _value="Stopper le téléchargement" + +_key="help_shortcut25" + _value="Supprimer un épisode" + +_key="help_shortcut26" + _value="Afficher la page internet de l'épisode" + +_key="help_shortcut27" + _value="Ouvrir le dossier des pièces jointes" + +_key="help_buy1" + _value="BePodder Light est juste la version d'essai (pas de limite dans le temps). La version complète vient ajouter d'autres fonctionnalités sympa: nombre d'abonnements illimités, vue en icone plus petite de la liste des abonnements, support du proxy, vérification automatique, et jusqu'a 5 téléchargements simultannés (multithreadés)." + +_key="help_buy2" + _value="Merci d'enregistrer votre version de BePodder, c'est seulement 15 euros (Kagi ajoute une taxe pour certains pays), Une license BePodder peut être acheté sur Kagi." + +_key="help_buy3" + _value="Acheter sur www.funkyideasoft.com" + +_key="help_buy4" + _value="Après l'enregistrement, vous recevrez votre clé logiciel par email et comment l'installer (en gros, décompresser un zip et copier le fichier dans un dossier)." + +_key="help_buy5" + _value="Une clé BePodder est valable pour les prochaines versions et mise à jour du logiciel, vous serez de toute façon prévenu si ce n'est plus le cas." + + +### USELESS ######## + +"Opml Editor" "Editeur Opml" +"name:" "Nom:" +"Add a category" "Ajouter une catégorie" +"Add a new Broadcast" "Ajouter un nouvel abonnement" +"feed:" "feed:" +"url:" "adresse:" +"Test podcast" "Tester le podcast" +"Del a category" "Supprimer une categorie" +"Add a category" "Ajouter une categorie" +"Select the podcast category:" "Selectionnez la catégorie de podcast:" +"Check all" "Tout vérifier" +"Check" "Vérifier" +"Refresh the list" "Rafraichir" +"Load" "Charger" +"Load the list" "Charger la liste" +"Save" "Enregistrer" +"Save the list" "Enregistrer la liste" +"Revert" "Annuler" +"Apply" "Appliquer" + + + + + + + + + + + diff --git a/release/Language/Dictionaries/BePodder.frFR b/release/Language/Dictionaries/BePodder.frFR new file mode 100644 index 0000000..cdb5154 --- /dev/null +++ b/release/Language/Dictionaries/BePodder.frFR @@ -0,0 +1,601 @@ +# Locale file for BePodder. +# Modified: 21/04/2006 +# Author: Rémi Grumeau +# E-mail: remi@beosfrance.com + + +# Attention: don't remove empty space or \n + + +### SHAREWARE POPUPS ----------------------------------- + +"Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" "Application en version Shareware !\n\nMerci pour votre support!\n\nAcheter une license!\nPlus d'infos sur le site internet\n" + +"This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" "Désolé, la periode d'éssai de BePodder est terminée !\nMerci d'acheter une license.\n" + +"Web Site" "Site Internet" + +"Can't connect!" "Connection impossible!" +"Http port failed!" "Port HTTP indisponible!" +"Can't resolve host!" "Hôte introuvable !" +"Not found!" "Introuvable !" +"Bad resume!" "Résume impossible !" +"Aborted by Callback!" "Annulé par l'utilisateur !" +"Can't resume! (range error)" "Résume impossible ! (erreur de classement)" +"Access Denied!" "Accès refusé !" +"User or Password Incorrect!" "Identifiant ou mot de passe incorrect !" +"Other error (cUrl code: " "Erreur inconnue (code cUr : " +"cUrl init error!" "erreur d'init cUrl !" +"Can't open file!" "Ouverture impossible!" +"Other error (status code: " "Erreur inconnue (statut code: " +"Downloading" "Téléchargement en cours" + +### MENUBAR ----------------------------------- + +"File" "Fichier" +"About..." "A propos...." +"Close!" "Fermer" +"Quit" "Quitter" + +"Settings" "Préférences" +"Preferences..." "Préférences..." + +"Subscriptions" "Abonnements" + +"Episodes" "Episodes" + +"Lists" "Listes" +"Podcast List" "Liste de Podcast" +"Podcast directory list" "Dossier de la liste Podcast" +"Videoblog List" "Liste de Videoblogs" +"Videoblog directory list" "Dossier de la liste de Videoblogs" +"Imagefeeds List" "Liste des Imagefeeds" +"Imagefeeds directory list" "Dossier de la liste de Imagefeeds" +"Newsfeeds List" "Liste des Newsfeeds" +"Newsfeeds directory list" "Dossier de la liste des Newsfeeds" +"BitTorrentfeeds List" "Liste des BitTorrentfeeds" +"BitTorrentfeeds directory list" "Dossier de la liste des BitTorrentfeeds" +"Internationalfeeds List" "Liste des Internationalfeeds" +"Internationalfeeds directory list" "Dossier de la liste des Internationalfeeds" + +"View" "Affichage" +"Full Screen" "Plein-écran" +"Toolbar" "Barre d'outils" +"Subscriptions View" "Liste des abonnements" +"Small Items" "Liste simple" +"Big Items" "Liste avec icones" +"Move BePodder on workspace:" "Déplacer BePodder sur le bureau:" + +"Help" "Aide" +"Getting Started" "Bien démarrer avec BePodder" +"Keyboard Shortcuts" "Raccourics clavier" +"Tutorials" "Didacticielles" +"Online Support" "Support en ligne" + + + + +### BUTTONS ----------------------------------- + +# Buttons add feed window +"Insert the rss feed url!" "Entrer l'adresse du flux RSS!" +"Add" "Ajouter" +"Paste" "Coller" + +# Buttons directory list window +"Collapse All" "Tout minimiser" +"Preview" "Prévisualiser" +"Subscribe" "S'abonner" + + +# Buttons help window +"Next" "Suivant" +"Prev" "Précédent" +"Close" "Fermer" +"Index" "Index" + + +# Buttons remove windows +"Cancel" "Annuler" +"Delete" "Supprimer" +"Archive" "Archive" + + + +### TOOLTIPS ----------------------------------- + +# Tooltips toolbar buttons + +"Add the podcast to the Subscriptions list" "Ajouter le PodCast a votre liste d'abonnements" +"Delete the podcast from the Subscriptions list" "Supprimer le PodCast de votre liste d'abonnements" +"Check the selected podcast for new items" "Mettre a jour le PodCast" +"Show the podcast homepage" "Afficher la page d'accueil du PodCast" + +"Delete the item and the enclosure" "Delete the item and the enclosure" +"Stop the item download" "Stopper le téléchargement" +"Download the selected episode" "Télécharger l'épisode sélectionné" +"Play the selected episode" "Lire l'épisode sélectionné" + +"Submit bug and idea" "Soumettre une idée ou signaler un bug" + + +# Tooltips directory window buttons + +"Collapse all categories in the directory list" "Rassembler toutes les catégories dans la liste des dossiers" +"Add the selected podcast to the Subscription list" "Ajouter le PodCast sélectionné a votre liste d'abonnements" +"Checkout a podcast before downloading it" "Verifier le PodCast avant de le télécharger" + + +### INFO PANEL ----------------------------------- + +"Show channel Image" "Afficher l'image" +"XML Feed Link" "Lien du Feed XML" + +"Show Episode info" "Afficher les infos de l'épisode" +"Show Subscription info" "Afficher les infos de l'abonnement" +"Show Downloads info" "Afficher les infos du télechargement" + +"Enclosure: " "Fichier inclus: " + +"Lookup (Dictionary)" "Rechercher dans 'Dictionary'" +"Lookup (Google)" "Rechercher dans 'Google'" +"Lookup (Acronym Finder)" "Rechercher dans 'Acronym Finder'" +"Copy" "Copier" +"Select All" "Tout sélectionner" +"Copy URL" "Copier l'adresse" +"Open URL" "Ouvrir l'adresse" +"Subscription" "Souscription" + +"Find this Item" "Trouver ce fichier" +"Remove from this list" "Supprimer ce fichier" + + +### PREFERENCES ----------------------------------- + +"Preferences" "Préférences" + +"Proxy" "Proxy" +"Enable Proxy" "Activer le proxy" +"Address" "Addresse" +"Port" "Port" +"Username" "Identifiant" +"Password" "Mot de passe" + +"Max Downloads" "Téléchargements Max" + +"FileType" "Ouvrir les fichiers" +"Browser" "Navigateur:" +"Player" "Lecteur Audio/Vidéo:" + +"Channels" "Abonnements" +"Check all channels on startup" "Verifier tous les abonnements au démarrage" +"Check the channel every" "Vérifier tout les " + +"never" "Ne jamais vérifier" +"5 minutes" "5 minutes" +"15 minutes" "15 minutes" +"30 minutes" "30 minutes" +"1 hour" "heures" +"2 hour" "2 heures" + + + + +### COLUMLISTVIEW ----------------------------------- + + +"1 new item" "1 nouveau fichier" +"%d new items" "%d nouveaux fichiers" +"new" "nouveau" +"error" "erreur" +"not down" "non téléchargé" +"enquequed" "ajouté" +"downloading" "en cours de téléchargement" +"downloaded" "téléchargé" +"connecting" "connection en cours" +"not found" "introuvable" +"stopped" "arreté" +"can't connect" "connection impossible" +"invalid format" "format non valide" + +"Icon" "Icon" +"Title" "Titre" +"Date" "Date" +"Size" "Taille" +"Status" "Etat" +"Download" "Téléchargement" + + + +### CONTEXT MENU ----------------------------------- + +"Add Channel" "AJouter un abonnement" +"Remove Channel" "Supprimer un abonnement" +"Check Channel" "Vérifier les mises a jour" +"Open Homepage" "Ouvrir la page d'acceuil" + +"Open Web Page" "Aller sur le site internet" +"Open Enclosures folder" "Ouvrir le dossier" +"Check All Channels" "Vérifier tous les abonnements" + +"Show Channel Image" "Afficher la vignette de l'abonnement" + +"Play enclosure" "Afficher" +"(Re)start download" "(re)Télécharger" +"Stop download" "Arreter le téléchargement" +"Remove Item" "Supprimer" + +"Find this Item" "Trouver ce fichier" +"Remove from this list" "Supprimer ce fichier" + + + +### ALERT ----------------------------------- + +"You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" "Désolé mais vous ne pouvez vous inscrire qu'a 10 podcasts dans cette version d'essai.\n Veuillez vous enregistrer.\n" + +"Can't open the selected file with:\n\n" "Impossible d'ouvrir ce fichier avec:\n\n" +"\n\nPlease check if the application is installed in the right way.\n" "\n\nVeuillez vérifier que cette application est bien installée a cet endroit.\n" + +"Download it!" "Télécharger !" + +"\nRemoving.." "\nSuppression.." +"\nAn error occured while removing!" "\nUne erreur s'est produite lors de la suppression !" +"Check all the podcasts for new items" "Vérifier tous les PodCast et les mettre a jour" + +# multi line text... please translate only the text after _value= and don't remove empty space + +_key="alert1" + _value=" +Vous etes sur le point de supprimer la ligne suivante. + +Etes-vous sur ? +(le fichier inclus sera perdu, si il y en a un)" + + +_key="alert2a" + _value=" +Vous etes sur le point de supprimer l'abonnement: + +" + +_key="alert2b" + _value=" + +Désirez-vous archiver cet abonnement +(et conserver les fichiers téléchargé) ou +voulez-vous supprimer tous les fichiers +en rapport avec cet abonnement ?" + +_key="alert3" + _value=" +Archivage en cours..." + +_key="alert_3gp" + _value=" +3GP est un format de contenance multimedia défini par le Third Generation Partnership Project (3GPP) pour une utilisation sur téléphone mobile 3G. Il enregistre la vidéo en MPEG-4 ou H.263, et l'audio en AMR-NB ou AAC-LC. + +VideoLAN ne supporte pas encore le AMR-NB (3GPP)" + +_key="alert_swf" + _value=" +SWF est un format d'animation vectorielle propriétaire appartenant a Adobe (créée par Macromedia). + +Pour l'instant, le support des animations flash sous BeOS, Zeta ou Haiku se limite à la version 4.1015, aucun lecteur plus récent n'est disponible." + +### HELP & SHORTCUTS ----------------------------------- + + +"Introduction" "Introduction" +"The User Interface" "L'interface utilisateur" +"Menu Bar" "La barre du menu" +"Toolbar Buttons" "La barre d'outils" +"First time with BePodder" "Les premiers pas avec BePodder" +"Download Podcast's enclosure files" "Télécharger les fichiers relatifs aux Podcasts" +"Settings Overview" "Les parametres" +"Directory lists" "Listes des dossiers" +"Loading Help..." "Chargement de l'aide..." +"Register your copy" "Enregistrez-vous" +"Starting point" "Sommaire" + + + + +# multi line text... please translate only the text after _value= and don't remove empty space + + +_key="help1-0" + _value=Bienvenu dans l'aide à l'utilisation de BePodder." + +_key="help1-1" + _value="Si vous avez déjà utilisé BePodder ou familié aux logiciels de flux RSS/Atom, vous pouvez fermer cette fenêtre et commencer à utiliser BePodder." + +_key="help1-2" +_value="Le cas échéant, voici une petite introduction sur comment et pourquoi utiliser ce type de logiciel. Utilisez les boutons en bas de la fenetre pour naviguer dans ce didacticielle." + + + +_key="help2-0" +_value="Podcaster est une méthode pour publier du contenu audio ou vidéo sur Internet; les liens vers les fichiers sont définis dans les flux RSS/Atom." + +_key="help2-1" +_value="Le Podcasting est donc un simple moyen de mettre a disposition des fichiers; les utilisateurs peuvent alors souscrire à ce flux (comme un RSS 'Really Simple Syndication' ou Atom)." + +_key="help2-2" +_value="Un aggregator (ou podcatcher) comme BePodder, est un logiciel vous permettant de souscrire à ces flux et vérifier périodiquement si un flux à était mis à jour; avec BePodder vous pouvez vérifier si de nouveaux fichiers sont disponibles (Episodes) dans les flux souscrits. Chaque fichier peut alors contenir une pièce jointe, tout comme un email." + + + +_key="help3-0" +_value="BePodder a un interface simple et très complète. La fenêtre principale est divisée en trois parties:" + +_key="help3-1" +_value="1) La liste des abonnements (la partie avec le numéro 1) contenant la liste des flux ausquels vous avez souscrits. Lorsque vous sélectionnez un flux, vous pouvez voir la liste des épisodes qu'il contient dans la seconde partie (numéro 2)." + +_key="help3-2" +_value="2) La liste des épisodes avec les fichiers qu'ils contiennent." + +_key="help3-3" +_value="3) Informations. Cette troisième et dernière partie contient: informations générales, de l'épisodes ou du téléchargement; vous pouvez sélectionner l'info voulu en cliquant sur les boutons correspondants." + + + +_key="help4-0" +_value="Tout en haut de la fenêtre principale de BePodder se trouve le menu avec 7 sous menus: Fichier, Préférences, Abonnements, Episodes, Listes, Affichage et Aide. Les options des sous-menus précédés d'une flêche ont un autre menu déroulant associé. En explorant chaque menu, jeter un coup d'oeil à ces sous-menus également. Cliquez sur un menu pour en voir la commande:" + +_key="help4-1" +_value="Fichier: contient les commandes pour fermer l'application et afficher les informations au sujet de BePodder" + +_key="help4-2" +_value="Préférences: contient les commandes pour ouvrir le panneau des préférences, pour personnaliser les options de BePodder à votre goût." + +_key="help4-3" +_value="Abonnements: contient les commandes en relation avec l'abonnement sélectionné dans la liste des abonnements (partie 1)." + +_key="help4-4" +_value="Episodes: contient les commandes en relation avec l'épisode sélectionné dans la liste des épisode (partie 2)." + +_key="help4-5" +_value="Listes: contient la liste des flux (abonnements) prédéfinis dans BePodder ausquels vous pouvez souscrire." + +_key="help4-6" +_value="Affichage: contient les options d'affichage de la fenêtre principale de BePodder." + +_key="help4-7" +_value="Aide: contient les fiches d'aide à l'utilisation de BePodder et la liste des raccourcis clavier." + + + +_key="help5-0" + _value="Ajouter: Permet d'ajouter un flux en indiquant son adresse (ex. http://www.newpodcast.com/rss.xml), le plus souvent donné sur le site de l'auteur; Cherchez une icone ou un lien qui ressemble à 'XML', 'RSS' ou 'Podcast Feed' dessus." + +_key="help5-1" + _value="Supprimer: Permet de se déinscrire d'un flux: choississez juste d'archiver (conserve les fichiers téléchargés en relation) ou tout supprimer." + +_key="help5-2" + _value="Mise à jour: Vérifie si de nouveaux épisodes sont disponibles pour les abonnements sélectionnés." + +_key="help5-3" + _value="Site internet: Ouvre le site internet de l'abonnement dans le navigateur web. Pour sélectionner le navigateur à utiliser, ouvrez les préférences dans le menu Préférences > et sélectionnez votre navigateur dans la liste." + +_key="help5-4" + _value="Lecture: Ouvre la pièce jointe de l'épisode séléctionné. Pour sélectionner le lecteur média à utiliser, ouvrez les préférences dans le menu Préférences > et sélectionnez votre lecteur dans la liste." + +_key="help5-5" + _value="Télécharger: Télécharge la pièce jointe de l'épisode séléctionné; pour voir les informations de téléchargement, cliquez sur le troisième bouton dans la partie information (3)." + +_key="help5-6" + _value="Stop: Stoppe le téléchargement de la pièce jointe; pour relancer le téléchargement où il s'est arreté, double cliquez sur l'épisode dans la liste des épisodes (2)" + +_key="help5-7" + _value="Supprimer: supprime l'épisode (et les pièces jointes correspondante)." + + + +_key="help6-0" + _value="Démarrer avec BePodder est très simple." + +_key="help6-1" + _value="Sur la gauche, il y a la liste des abonnements, la liste de vos souscriptions. Nous en avons pré-souscrits pour vous, mais vous pouvez bien entendu en rajouter vous même:" + +_key="help6-2" + _value="1) cliquez sur le bouton Ajouter et entrer une adresse (example: http://www.newpodcast.com/rss.xml)." + +_key="help6-3" + _value="2) ou séléctionner un flux dans la liste prédéfinie dans BePodder (menu 'Listes' > 'Liste des Podcast' ou une autre liste, choississez un podcast et cliquez sur 'S'abonner'." + +_key="help6-4" + _value="Si vous séléctionnez un Podcast dans la liste des abonnements et cliquez sur le bouton 'Mise a jour', BePodder ajoute les nouveautées dans la liste des épisodes; Vous pouvez lancer une mise à jour de tous vos abonnements en même temps avec un clic droit sur ce même bouton et 'Mettre tous les abonnements à jour'." + +_key="help6-5" + _value="Sur la capture d'écran suivante, vous pouvez voir que 3 nouveaux épisodes ont été ajouté, mis en avant par un rond noir devant leur nom." + +_key="help6-6" + _value="Dans la seconde colonne il y a une icone qui indique son état:" + +_key="help6-7" + _value="- l'épisode 4 a une icone indiquant une erreur" + +_key="help6-8" + _value="- l'épisode 4 a une icone indiquant que sa pièce jointe n'a pas encore été téléchargé" + +_key="help6-9" + _value="- l'épisode 4 a une icone indiquant que BePodder télécharge la pièce jointe" + +_key="help6-10" + _value="- l'épisode 4 a une icone indiquant que BePodder a fini de télécharger la pièce jointe" + + + +_key="help7-0" + _value="Sélectionnez un épisode dans la liste des épisodes double cliquez dessus (ou cliquez surle bouton 'télécharger') pour lancer le téléchargement de la pièce jointe; Vous pouvez à tout moment le stopper en appuyant sur le bouton 'Stopper'." + +_key="help7-1" + _value="Lorsque vous cliquez sur un épisode (partie 2), BePodder affiche (partie 3) tous ce qui est disponible dans cet épisode. Sélectionnez un fichier et cliquez sur Lecture pour voir ou écouter la pièce jointe." + +_key="help7-2" + _value="Vous pouvez accéder au dossier contenant les pièces jointes téléchargées en cliquant sur le lien 'Fichiers inclus' dans le contenu de l'épisode (partie 3), ou par un clic droit sur un épisode (partie 2) et en sélectionnant 'Ouvrir le dossier'." + + + +_key="help8-0" + _value="Les préférences peuvent être personnalisées par le menu 'Préférences'. Vous pouvez alors choisir une catégorie dans la liste de gauche parmis 'Types de fichiers', 'Abonnements', 'Téléchargement' et 'Proxy'." + +_key="help8-1" + _value="- Type de fichiers: pour définir votre navigateur et lecteur audio/vidéo. " + +_key="help8-2" + _value="- Abonnements: pour définir la façon dont vous souhaitez vérifier les mises à jour de vos abonnements: au démarrage et/ou toutes les X minutes." + +_key="help8-3" + _value="- Téléchargement: pour définir le nombre de fichiers à télécharger en même temps," + +_key="help8-4" + _value="- Proxy: pour configurer les paramètres réseau si vous accéder à Internet à travers un proxy ou un routeur." + + +_key="help9-0" + _value="BePodder est livré avec une liste prédéfinie (OPML) d'une centaine de podcast, videoblog, imagefeeds, newsfeeds, bittorrentfeeds et internationalfeeds, tous classés par catégorie ." + +_key="help9-1" + _value="OPML (Outline Processor Markup Language) est un format basé sur de l'XML permettant l'échange de données entre plusieurs applications." + +_key="help9-2" + _value="Vous pouvez accéder à ces listes par le menu 'Listes' et en sélectionnant la liste voulue. Pour ouvrir une catégorie, cliquez sur la fleche noire à côté de son nom, jusqu'a trouver le flux de vos rêves ! Une fois sélectionné, ajoutez-le à votre liste d'abonnements en cliquant sur le bouton 'S'abonner', vous pouvez également replier toutes les catégories en cliquant sur le bouton 'minimiser'." + + +_key="help_shortcut1" +_value="Cette page liste les raccourcis clavier de BePodder. Les raccourcis sont ici regroupés par fonctions." + +_key="help_shortcut2" +_value="signifie que vous pouvez utiliser la touche alt ou ctrl (ex. Alt+Q ou Ctrl+Q pour quitter BePodder), selon la touche définie dans les préférences du clavier (par défaut, la touche utilisée est Alt)." + +_key="help_shortcut3" + _value="Principaux raccourcis" + +_key="help_shortcut4" + _value="Quitter" + +_key="help_shortcut5" + _value="Afficher le panneau de préférences" + +_key="help_shortcut6" + _value="Affiche la liste des Podcast" + +_key="help_shortcut7" + _value="Affiche la liste des Videoblog" + +_key="help_shortcut8" + _value="Affiche la liste des Imagefeeds" + +_key="help_shortcut9" + _value="Affiche la liste des Newsfeeds" + +_key="help_shortcut9b" + _value="Affiche la liste des BitTorrentfeeds" + +_key="help_shortcut9c" + _value="Affiche la liste des Internationalfeeds" + +_key="help_shortcut10" + _value="Plein écran" + +_key="help_shortcut11" + _value="Affiche/masque les boutons en haut" + +_key="help_shortcut12" + _value="Affiche le panneau d'aide" + +_key="help_shortcut13" + _value="Affiche le panneau des raccourcis clavier" + +_key="help_shortcut14" + _value="Raccourci des abonnements" + +_key="help_shortcut15" + _value="Ajouter un nouveau flux en tapant l'adresse" + +_key="help_shortcut16" + _value="Supprime l'abonnement sélectionné" + +_key="help_shortcut17" + _value="Vérifie les mises à jour disponible pour l'abonnement sélectionné" + +_key="help_shortcut18" + _value="Vérifie les mises à jour disponible pour tout les abonnements" + +_key="help_shortcut19" + _value="Accéder le site internet" + +_key="help_shortcut20" + _value="Ouvrir le dossier des pièces jointes" + +_key="help_shortcut21" + _value="Raccourcis des épisodes" + +_key="help_shortcut22" + _value="Ouvrir la pièce jointe" + +_key="help_shortcut23" + _value="Lancer/relancer le téléchargement" + +_key="help_shortcut24" + _value="Stopper le téléchargement" + +_key="help_shortcut25" + _value="Supprimer un épisode" + +_key="help_shortcut26" + _value="Afficher la page internet de l'épisode" + +_key="help_shortcut27" + _value="Ouvrir le dossier des pièces jointes" + +_key="help_buy1" + _value="BePodder Light est juste la version d'essai (pas de limite dans le temps). La version complète vient ajouter d'autres fonctionnalités sympa: nombre d'abonnements illimités, vue en icone plus petite de la liste des abonnements, support du proxy, vérification automatique, et jusqu'a 5 téléchargements simultannés (multithreadés)." + +_key="help_buy2" + _value="Merci d'enregistrer votre version de BePodder, c'est seulement 15 euros (Kagi ajoute une taxe pour certains pays), Une license BePodder peut être acheté sur Kagi." + +_key="help_buy3" + _value="Acheter sur www.funkyideasoft.com" + +_key="help_buy4" + _value="Après l'enregistrement, vous recevrez votre clé logiciel par email et comment l'installer (en gros, décompresser un zip et copier le fichier dans un dossier)." + +_key="help_buy5" + _value="Une clé BePodder est valable pour les prochaines versions et mise à jour du logiciel, vous serez de toute façon prévenu si ce n'est plus le cas." + + +### USELESS ######## + +"Opml Editor" "Editeur Opml" +"name:" "Nom:" +"Add a category" "Ajouter une catégorie" +"Add a new Broadcast" "Ajouter un nouvel abonnement" +"feed:" "feed:" +"url:" "adresse:" +"Test podcast" "Tester le podcast" +"Del a category" "Supprimer une categorie" +"Add a category" "Ajouter une categorie" +"Select the podcast category:" "Selectionnez la catégorie de podcast:" +"Check all" "Tout vérifier" +"Check" "Vérifier" +"Refresh the list" "Rafraichir" +"Load" "Charger" +"Load the list" "Charger la liste" +"Save" "Enregistrer" +"Save the list" "Enregistrer la liste" +"Revert" "Annuler" +"Apply" "Appliquer" + + + + + + + + + + + diff --git a/release/Language/Dictionaries/BePodder.hrHR b/release/Language/Dictionaries/BePodder.hrHR new file mode 100644 index 0000000..296dac8 --- /dev/null +++ b/release/Language/Dictionaries/BePodder.hrHR @@ -0,0 +1,604 @@ + +# Locale file for BePodder. +# Modified: 4/18/2006 +# Author: BePodderTeam +# E-mail: bepodder.team@gmail.com + + +# Attention: don't remove empty space or \n + + +### SHAREWARE POPUPS ----------------------------------- + +"Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" "Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" + +"This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" "This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" + +"Web Site" "Web Site" + +"Can't connect!" "Can't connect!" +"Http port failed!" "Http port failed!" +"Can't resolve host!" "Can't resolve host!" +"Not found!" "Not found!" +"Bad resume!" "Bad resume!" +"Aborted by Callback!" "Aborted by Callback!" +"Can't resume! (range error)" "Can't resume! (range error)" +"Access Denied!" "Access Denied!" +"User or Password Incorrect!" "User or Password Incorrect!" +"Other error (cUrl code: " "Other error (cUrl code: " +"cUrl init error!" "cUrl init error!" +"Can't open file!" "Can't open file!" +"Other error (status code: " "Other error (status code: " +"Downloading" "Downloading" + + +### MENUBAR ----------------------------------- + +"File" "File" +"About..." "About..." +"Close!" "Close!" +"Quit" "Quit" + +"Settings" "Settings" +"Preferences..." "Preferences..." + +"Subscriptions" "Subscriptions" + +"Episodes" "Episodes" + +"Lists" "Lists" +"Podcast List" "Podcast List" +"Podcast directory list" "Podcast directory list" +"Videoblog List" "Videoblog List" +"Videoblog directory list" "Videoblog directory list" +"Imagefeeds List" "Imagefeeds List" +"Imagefeeds directory list" "Imagefeeds directory list" +"Newsfeeds List" "Newsfeeds List" +"Newsfeeds directory list" "Newsfeeds directory list" +"BitTorrentfeeds List" "BitTorrentfeeds List" +"BitTorrentfeeds directory list" "BitTorrentfeeds directory list" +"Internationalfeeds List" "Internationalfeeds List" +"Internationalfeeds directory list" "Internationalfeeds directory list" + +"View" "View" +"Full Screen" "Full Screen" +"Toolbar" "Toolbar" +"Subscriptions View" "Subscriptions View" +"Small Items" "Small Items" +"Big Items" "Big Items" +"Move BePodder on workspace:" "Move BePodder on workspace:" + +"Help" "Help" +"Getting Started" "Getting Started" +"Keyboard Shortcuts" "Keyboard Shortcuts" +"Tutorials" "Tutorials" +"Online Support" "Online Support" + + + + +### BUTTONS ----------------------------------- + +# Buttons add feed window +"Insert the rss feed url!" "Insert the rss feed url!" +"Add" "Add" +"Paste" "Paste" + +# Buttons directory list window +"Collapse All" "Collapse All" +"Preview" "Preview" +"Subscribe" "Subscribe" + + +# Buttons help window +"Next" "Next" +"Prev" "Prev" +"Close" "Close" +"Index" "Index" + + +# Buttons remove windows +"Cancel" "Cancel" +"Delete" "Delete" +"Archive" "Archive" + + + +### TOOLTIPS ----------------------------------- + +# Tooltips toolbar buttons + +"Add the podcast to the Subscriptions list" "Add the podcast to the Subscriptions list" +"Delete the podcast from the Subscriptions list" "Delete the podcast from the Subscriptions list" +"Check the selected podcast for new items" "Check the selected podcast for new items" +"Show the podcast homepage" "Show the podcast homepage" + +"Delete the item and the enclosure" "Delete the item and the enclosure" +"Stop the item download" "Stop the item download" +"Download the selected episode" "Download the selected episode" +"Play the selected episode" "Play the selected episode" + +"Submit bug and idea" "Submit bug and idea" + + +# Tooltips directory window buttons + +"Collapse all categories in the directory list" "Collapse all categories in the directory list" +"Add the selected podcast to the Subscription list" "Add the selected podcast to the Subscription list" +"Checkout a podcast before downloading it" "Checkout a podcast before downloading it" + + +### INFO PANEL ----------------------------------- + +"Show channel Image" "Show Channel Image" +"XML Feed Link" "XML Feed Link" + +"Show Episode info" "Show Episode info" +"Show Subscription info" "Show Subscription info" +"Show Downloads info" "Show Downloads info" + +"Enclosure: " "Enclosure: " + +"Lookup (Dictionary)" "Lookup (Dictionary)" +"Lookup (Google)" "Lookup (Google)" +"Lookup (Acronym Finder)" "Lookup (Acronym Finder)" +"Copy" "Copy" +"Select All" "Select All" +"Copy URL" "Copy URL" +"Open URL" "Open URL" +"Subscription" "Subscription" + + +### PREFERENCES ----------------------------------- + +"Preferences" "Preferences" + +"Proxy" "Proxy" +"Enable Proxy" "Enable Proxy" +"Address" "Address" +"Port" "Port" +"Username" "Username" +"Password" "Password" + +"Max Downloads" "Max Downloads" + +"FileType" "FileType" +"Browser" "Browser" +"Player" "Player" + +"Channels" "Channels" +"Check all channels on startup" "Check all channels on startup" +"Check the channel every" "Check the channel every" + +"never" "never" +"5 minutes" "5 minutes" +"15 minutes" "15 minutes" +"30 minutes" "30 minutes" +"1 hour" "1 hour" +"2 hour" "2 hour" + + + + +### COLUMLISTVIEW ----------------------------------- + + +"1 new item" "1 new item" +"%d new items" "%d new items" +"new" "new" +"error" "error" +"not down" "not down" +"enquequed" "enquequed" +"downloading" "downloading" +"downloaded" "downloaded" +"connecting" "connecting" +"not found" "not found" +"stopped" "stopped" +"can't connect" "can't connect" +"invalid format" "invalid format" + +"Icon" "Icon" +"Title" "Title" +"Date" "Date" +"Size" "Size" +"Status" "Status" +"Download" "Download" + + + +### CONTEXT MENU ----------------------------------- + +"Add Channel" "Add Channel" +"Remove Channel" "Remove Channel" +"Check Channel" "Check Channel" +"Open Homepage" "Open Homepage" + +"Open Web Page" "Open Web Page" +"Open Enclosures folder" "Open Enclosures folder" +"Check All Channels" "Check All Channels" + +"Show Channel Image" "Show Channel Image" + +"Play enclosure" "Play enclosure" +"(Re)start download" "(Re)start download" +"Stop download" "Stop download" +"Remove Item" "Remove Item" + +"Find this Item" "Find this Item" +"Remove from this list" "Remove from this list" + + + +### ALERT ----------------------------------- + +"\nRemoving.." "\nRemoving.." +"\nAn error occured while removing!" "\nAn error occured while removing!" +"Check all the podcasts for new items" "Check all the podcasts for new items" + +"You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" "You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" + + +"Can't open the selected file with:\n\n" "Can't open the selected file with:\n\n" +"\n\nPlease check if the application is installed in the right way.\n" "\n\nPlease check if the application is installed in the right way.\n" +"Download it!" "Download it!" + +# multi line text... please translate only the text after _value= and don't remove empty space + +_key="alert1" + _value=" +You are going to remove the selected item. + +Are you sure? +(you will lost the enclosure file if any)" + + +_key="alert2a" + _value=" +You are going to remove the channel: + +" + +_key="alert2b" + _value=" + +Would you like just to archive this +channel (keeping all the files and +enclosures downloaded so far) or +do you want to DELETE the whole + channel from you computer?" + +_key="alert3" + _value=" +Parsing archive.." + +_key="alert_3gp" + _value=" +3GP is a multimedia container format defined by the Third Generation Partnership Project (3GPP) for use on 3G mobile phones. It stores video streams as MPEG-4 or H.263, and audio streams as AMR-NB or AAC-LC. + +VideoLAN still doesn't support the audio AMR (3GPP)" + +_key="alert_swf" + _value=" +SWF is a proprietary vector graphics file format produced by the Flash software from Adobe (formerly Macromedia). + +Currently Flash support in BeOS/Haiku/Zeta is limited to the old standalone Flash player version 4.1015, there isn't a modern Flash player" + + + + +### HELP & SHORTCUTS ----------------------------------- + + +"Introduction" "Introduction" +"The User Interface" "The User Interface" +"Menu Bar" "Menu Bar" +"Toolbar Buttons" "Toolbar Buttons" +"First time with BePodder" "First time with BePodder" +"Download Podcast's enclosure files" "Download Podcast's enclosure files" +"Settings Overview" "Settings Overview" +"Directory lists" "Directory lists" +"Loading Help..." "Loading Help..." +"Register your copy" "Register your copy" +"Starting point" "Starting point" + + + + +# multi line text... please translate only the text after _value= and don't remove empty space + + +_key="help1-0" + _value="Welcome to the BePodder Getting Started Guide." + +_key="help1-1" + _value="If you are already familiar with podcasts and RSS/Atom feeds you can immediately go to BePodder by closing this window." + +_key="help1-2" +_value="If not, this is a short introduction providing you everything you'll need to know on how to get started with BePodder. Use the buttons below to navigate through this tutorial." + + +_key="help2-0" +_value="Podcasting is a method for publishing audio and video broadcasts via the Internet; links to free audio and video files are enclosed in RSS and Atom feeds." + +_key="help2-1" +_value="Therefore Podcasting is simply a type of online media delivery; users can subscribe to a podcast using a feed (such as RSS 'Really Simple Syndication' or Atom)." + +_key="help2-2" +_value="An aggregator (or podcatcher) like BePodder, is a piece of software that allows you to subscribe to a RSS feed and periodically check for and download new content; with BePodder you can check for new Podcast items (Episodes) of your subscribed Channels. Any item can contain an enclosure, just like an Email can contain an attachment." + + + +_key="help3-0" +_value="BePodder has an easy to use yet powerful Graphical User Interface. The main window is split into tree panels:" + +_key="help3-1" +_value="1) The Subscription list (the panel with the number 1 in the screenshot) with the list of the podcasts that you have subscribed to. When you click on a Channel you can see in the panel 2 the list of the channel's items." + +_key="help3-2" +_value="2) The Episodes list with all the items available." + +_key="help3-3" +_value="3) The Info panel show: episode info, channel info or Downloads info; you can select an info panel by clicking one of the below three buttons." + + + +_key="help4-0" +_value="At the very top of the BePodder main window is the menubar with seven menus available: File, Settings, Subscriptions, Episodes, Lists, View and Help. Some menu commands are followed by a right pointing arrow that indicates a submenu of related commands. As you explore each menu, be sure to take a look at the submenus as well. Click on a menus to show its commands:" + +_key="help4-1" +_value="File: contains commands to close the application and to show information about BePodder" + +_key="help4-2" +_value="Settings: contains command to open the Preferences window that allows you to customize various BePodder settings." + +_key="help4-3" +_value="Subscriptions: contains commands that perform actions on the selected channel of your subscriptions list." + +_key="help4-4" +_value="Episodes: contains commands that perform actions on the selected item (episode) of the channel's episode list." + +_key="help4-5" +_value="Lists: contains commands to open BePodder's OPML directories." + +_key="help4-6" +_value="View: contains commands and controls for the BePodder window." + +_key="help4-7" +_value="Help: contains commands to open BePodder's 'Getting Started Guide' and the 'Keyboard Shortcuts List'." + + + +_key="help5-0" + _value="Add Button: opens the Add Window to add a feed url (e.g. http://www.newpodcast.com/rss.xml) usually given on the podcast homepage; looks for text or graphic link that says something like 'XML', 'RSS' or 'Podcast Feed' on it." + +_key="help5-1" + _value="Channel Remove Button: opens a window in which you can select how remove the channel: just archive the select channel (keeping all the files and eclosure downloaded so far) or delete the whole channel from your computer." + +_key="help5-2" + _value="Check Button: checks the selected channel and updates the list of the available items for that podcast adding the new items." + +_key="help5-3" + _value="Web Button: shows the channel homepage in the browser. To select your favorite browser open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select your favorite browser." + +_key="help5-4" + _value="Play Button: with this button you can view or listen the file enclosure of the selected item(episode). To select your favorite player open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select you favorite player." + +_key="help5-5" + _value="Download Button: downloads the file enclosure of the selected item (episode); you can see the download info by clicking on the third button over the info panel." + +_key="help5-6" + _value="Stop Button: stops to download the file enclosure of the selected item (episode); to resume the download double-click the item (episode) or select the item and click the Download Button" + +_key="help5-7" + _value="Item Remove Button: deletes the selected item (you will loose the enclosure file)." + + + +_key="help6-0" + _value="Getting started with BePodder is easy." + +_key="help6-1" + _value="On the left of the main window you can see the 'Subscription List' with all your feed subscriptions. We have added some subscriptions for you, and you can always add your own in two ways:" + +_key="help6-2" + _value="1) click the Add Button, then insert the feed url (example: http://www.newpodcast.com/rss.xml) and click add." + +_key="help6-3" + _value="2) in the menubar select 'Directory' and then 'Podcast list' or another list, choose a podcast and click 'Subscribe'." + +_key="help6-4" + _value="If you select a Podcast in the subscriptions list and use the check button, BePodder adds the new items to the 'Episodes list' (below on the right); you can check all your podcasts by right-clicking and selecting 'Check All Channels' in the context menu." + +_key="help6-5" + _value="Look at the screenshot above, there are 3 new items indicated by a black dot in the first column of the 'Episodes list'." + +_key="help6-6" + _value="In the second column there are icons that indicate the state of the item:" + +_key="help6-7" + _value="- the Episode 4 has an icon that indicates an error" + +_key="help6-8" + _value="- the Episode 3 has an icon that indicates that the item's enclosure download request is enquequed" + +_key="help6-9" + _value="- the Episode 2 has an icon that indicates that BePodder is downloading the item's enclosure file" + +_key="help6-10" + _value="- the Episode 1 have an icon that indicates that BePodder have just downloaded the item's enclosure file" + + + +_key="help7-0" + _value="Select an item in the 'Episodes list' and then double-click on it (or click the Download Button) to start downloading the enclosed file; you can always stop the download by clicking on the Stop Button." + +_key="help7-1" + _value="When you click on the Subscribed Podcasts in the 'Subscriptions List' the software shows you, in the 'List of episodes', all the items available in that Subscription. Select an item and then click play (Play Button) to view or listen to the file." + +_key="help7-2" + _value="You can access the Enclosures Folder by clicking on the folder icon in the Info Pannel or by right-clicking your mouse on an item and select 'Open Enclosures Folder' in the context menu." + + + +_key="help8-0" + _value="Preferences can be accessed by clicking in the menu-bar Settings>Preferences. You can select a category from the left list of the preferences dialog: FileType, Channels, Download and Proxy." + +_key="help8-1" + _value="- FileType: to specify the default browser and player. " + +_key="help8-2" + _value="- Channels: to specify preferences that control the operation to check channels new items; you can choose to Check all channels on startup or check the channel every desired minutes." + +_key="help8-3" + _value="- Download: to specify the max number of item's files to download at the same time," + +_key="help8-4" + _value="- Proxy: to set up a proxy server to work with BePodder; a proxy server acts as a security barrier between your internal network and the Internet, keeping others on the Internet from accessing information on your internal network." + + + +_key="help9-0" + _value="BePodder has built-in podcast, videoblog, imagefeeds, newsfeeds, bittorrentfeeds and internationalfeeds OPML directories with thousands of feeds grouped by category." + +_key="help9-1" + _value="OPML (Outline Processor Markup Language) is an XML-based format that allows exchange of outline-structured information between applications." + +_key="help9-2" + _value="OPML directory can be accessed by clicking in the menu-bar 'Lists' and thenselecting a list. To browse the opml directory for a feed, expand the list by clicking the arrow of the category that you are interested in (see image); using this method, you can expand the opml directory until you find the desired feed. Once you have selected it, you can add it to the subscription list by clicking the button 'Subscribe', you can also collapse all categories in the directory list by clicking the button 'Collapse All'." + +_key="help_shortcut1" +_value="This page describes the keyboard shortcuts that can be used in BePodder. The shortcuts are grouped here by function." + +_key="help_shortcut2" +_value="means that you can use either alt or control (es. Alt+Q or Ctrl+Q Quit the application), which way you have set it in the Deskbar menu preferences under Keyboard (the default shortcut key is Alt)." + +_key="help_shortcut3" + _value="General shortcuts" + +_key="help_shortcut4" + _value="Quit the application" + +_key="help_shortcut5" + _value="Shows the Preferences window" + +_key="help_shortcut6" + _value="Shows the Podcast directory list" + +_key="help_shortcut7" + _value="Shows the Videoblog directory list" + +_key="help_shortcut8" + _value="Shows the Imagefeeds directory list" + +_key="help_shortcut9" + _value="Shows the Newsfeeds directory list" + +_key="help_shortcut9b" + _value="Shows the BitTorrentfeeds directory list" + +_key="help_shortcut9c" + _value="Shows the Internationalfeeds directory list" + +_key="help_shortcut10" + _value="Fullscreen" + +_key="help_shortcut11" + _value="Shows/Hides the toolbar" + +_key="help_shortcut12" + _value="Shows the Getting Started Help" + +_key="help_shortcut13" + _value="Shows this keyboard shortcuts page" + +_key="help_shortcut14" + _value="Channels shortcuts" + +_key="help_shortcut15" + _value="Add a podcast to the subscriptions list" + +_key="help_shortcut16" + _value="Delete the selected podcast from the subscriptions list" + +_key="help_shortcut17" + _value="Check the selected podcast for new episodes (items)" + +_key="help_shortcut18" + _value="Check all podcasts for new episodes (items)" + +_key="help_shortcut19" + _value="Shows the podcast homepage" + +_key="help_shortcut20" + _value="Open enclosures folder" + +_key="help_shortcut21" + _value="Episodes shortcuts" + +_key="help_shortcut22" + _value="Play enclosure" + +_key="help_shortcut23" + _value="(Re)start download the selected episodes (items)" + +_key="help_shortcut24" + _value="Stop the episode (item) download" + +_key="help_shortcut25" + _value="Delete the selected episode (item)" + +_key="help_shortcut26" + _value="Shows the podcast episode (item) page " + +_key="help_shortcut27" + _value="Open enclosures folder" + +_key="help_buy1" + _value="BePodder Light is the basic version (free download and no time limited), the registered version adds some more nice features: unlimited number of channels, small Channel view, proxy support, automatic channels check, up to 5 enclosure downloads at the same time (multithreading)." + +_key="help_buy2" + _value="Please pay the shareware fee, it's only 15 euro (Kagi add tax in some countries), BePodder licence can be purchased online from Kagi." + +_key="help_buy3" + _value="Buy at www.funkyideasoft.com" + +_key="help_buy4" + _value="After purchasing, an email will be sent to you with a keyfile and instruction on how to install it. It's just a matter of unzipping a file and moving it to a certain directory." + +_key="help_buy5" + _value="There is no problem updating BePodder when a new version becomes available. The keyfile will unlock all downloadable packages unless otherwise notified." + + +### USELESS ######## + +"Opml Editor" "Opml Editor" +"name:" "name:" +"Add a category" "Add a category" +"Add a new Broadcast" "Add a new Broadcast" +"feed:" "feed:" +"url:" "url:" +"Test podcast" "Test podcast" +"Del a category" "Del a category" +"Add a category" "Add a category" +"Select the podcast category:" "Select the podcast category:" +"Check all" "Check all" +"Check" "Check" +"Refresh the list" "Refresh the list" +"Load" "Load" +"Load the list" "Load the list" +"Save" "Save" +"Save the list" "Save the list" +"Revert" "Revert" +"Apply" "Apply" + + + + + + + + + + + + diff --git a/release/Language/Dictionaries/BePodder.huHU b/release/Language/Dictionaries/BePodder.huHU new file mode 100644 index 0000000..296dac8 --- /dev/null +++ b/release/Language/Dictionaries/BePodder.huHU @@ -0,0 +1,604 @@ + +# Locale file for BePodder. +# Modified: 4/18/2006 +# Author: BePodderTeam +# E-mail: bepodder.team@gmail.com + + +# Attention: don't remove empty space or \n + + +### SHAREWARE POPUPS ----------------------------------- + +"Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" "Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" + +"This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" "This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" + +"Web Site" "Web Site" + +"Can't connect!" "Can't connect!" +"Http port failed!" "Http port failed!" +"Can't resolve host!" "Can't resolve host!" +"Not found!" "Not found!" +"Bad resume!" "Bad resume!" +"Aborted by Callback!" "Aborted by Callback!" +"Can't resume! (range error)" "Can't resume! (range error)" +"Access Denied!" "Access Denied!" +"User or Password Incorrect!" "User or Password Incorrect!" +"Other error (cUrl code: " "Other error (cUrl code: " +"cUrl init error!" "cUrl init error!" +"Can't open file!" "Can't open file!" +"Other error (status code: " "Other error (status code: " +"Downloading" "Downloading" + + +### MENUBAR ----------------------------------- + +"File" "File" +"About..." "About..." +"Close!" "Close!" +"Quit" "Quit" + +"Settings" "Settings" +"Preferences..." "Preferences..." + +"Subscriptions" "Subscriptions" + +"Episodes" "Episodes" + +"Lists" "Lists" +"Podcast List" "Podcast List" +"Podcast directory list" "Podcast directory list" +"Videoblog List" "Videoblog List" +"Videoblog directory list" "Videoblog directory list" +"Imagefeeds List" "Imagefeeds List" +"Imagefeeds directory list" "Imagefeeds directory list" +"Newsfeeds List" "Newsfeeds List" +"Newsfeeds directory list" "Newsfeeds directory list" +"BitTorrentfeeds List" "BitTorrentfeeds List" +"BitTorrentfeeds directory list" "BitTorrentfeeds directory list" +"Internationalfeeds List" "Internationalfeeds List" +"Internationalfeeds directory list" "Internationalfeeds directory list" + +"View" "View" +"Full Screen" "Full Screen" +"Toolbar" "Toolbar" +"Subscriptions View" "Subscriptions View" +"Small Items" "Small Items" +"Big Items" "Big Items" +"Move BePodder on workspace:" "Move BePodder on workspace:" + +"Help" "Help" +"Getting Started" "Getting Started" +"Keyboard Shortcuts" "Keyboard Shortcuts" +"Tutorials" "Tutorials" +"Online Support" "Online Support" + + + + +### BUTTONS ----------------------------------- + +# Buttons add feed window +"Insert the rss feed url!" "Insert the rss feed url!" +"Add" "Add" +"Paste" "Paste" + +# Buttons directory list window +"Collapse All" "Collapse All" +"Preview" "Preview" +"Subscribe" "Subscribe" + + +# Buttons help window +"Next" "Next" +"Prev" "Prev" +"Close" "Close" +"Index" "Index" + + +# Buttons remove windows +"Cancel" "Cancel" +"Delete" "Delete" +"Archive" "Archive" + + + +### TOOLTIPS ----------------------------------- + +# Tooltips toolbar buttons + +"Add the podcast to the Subscriptions list" "Add the podcast to the Subscriptions list" +"Delete the podcast from the Subscriptions list" "Delete the podcast from the Subscriptions list" +"Check the selected podcast for new items" "Check the selected podcast for new items" +"Show the podcast homepage" "Show the podcast homepage" + +"Delete the item and the enclosure" "Delete the item and the enclosure" +"Stop the item download" "Stop the item download" +"Download the selected episode" "Download the selected episode" +"Play the selected episode" "Play the selected episode" + +"Submit bug and idea" "Submit bug and idea" + + +# Tooltips directory window buttons + +"Collapse all categories in the directory list" "Collapse all categories in the directory list" +"Add the selected podcast to the Subscription list" "Add the selected podcast to the Subscription list" +"Checkout a podcast before downloading it" "Checkout a podcast before downloading it" + + +### INFO PANEL ----------------------------------- + +"Show channel Image" "Show Channel Image" +"XML Feed Link" "XML Feed Link" + +"Show Episode info" "Show Episode info" +"Show Subscription info" "Show Subscription info" +"Show Downloads info" "Show Downloads info" + +"Enclosure: " "Enclosure: " + +"Lookup (Dictionary)" "Lookup (Dictionary)" +"Lookup (Google)" "Lookup (Google)" +"Lookup (Acronym Finder)" "Lookup (Acronym Finder)" +"Copy" "Copy" +"Select All" "Select All" +"Copy URL" "Copy URL" +"Open URL" "Open URL" +"Subscription" "Subscription" + + +### PREFERENCES ----------------------------------- + +"Preferences" "Preferences" + +"Proxy" "Proxy" +"Enable Proxy" "Enable Proxy" +"Address" "Address" +"Port" "Port" +"Username" "Username" +"Password" "Password" + +"Max Downloads" "Max Downloads" + +"FileType" "FileType" +"Browser" "Browser" +"Player" "Player" + +"Channels" "Channels" +"Check all channels on startup" "Check all channels on startup" +"Check the channel every" "Check the channel every" + +"never" "never" +"5 minutes" "5 minutes" +"15 minutes" "15 minutes" +"30 minutes" "30 minutes" +"1 hour" "1 hour" +"2 hour" "2 hour" + + + + +### COLUMLISTVIEW ----------------------------------- + + +"1 new item" "1 new item" +"%d new items" "%d new items" +"new" "new" +"error" "error" +"not down" "not down" +"enquequed" "enquequed" +"downloading" "downloading" +"downloaded" "downloaded" +"connecting" "connecting" +"not found" "not found" +"stopped" "stopped" +"can't connect" "can't connect" +"invalid format" "invalid format" + +"Icon" "Icon" +"Title" "Title" +"Date" "Date" +"Size" "Size" +"Status" "Status" +"Download" "Download" + + + +### CONTEXT MENU ----------------------------------- + +"Add Channel" "Add Channel" +"Remove Channel" "Remove Channel" +"Check Channel" "Check Channel" +"Open Homepage" "Open Homepage" + +"Open Web Page" "Open Web Page" +"Open Enclosures folder" "Open Enclosures folder" +"Check All Channels" "Check All Channels" + +"Show Channel Image" "Show Channel Image" + +"Play enclosure" "Play enclosure" +"(Re)start download" "(Re)start download" +"Stop download" "Stop download" +"Remove Item" "Remove Item" + +"Find this Item" "Find this Item" +"Remove from this list" "Remove from this list" + + + +### ALERT ----------------------------------- + +"\nRemoving.." "\nRemoving.." +"\nAn error occured while removing!" "\nAn error occured while removing!" +"Check all the podcasts for new items" "Check all the podcasts for new items" + +"You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" "You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" + + +"Can't open the selected file with:\n\n" "Can't open the selected file with:\n\n" +"\n\nPlease check if the application is installed in the right way.\n" "\n\nPlease check if the application is installed in the right way.\n" +"Download it!" "Download it!" + +# multi line text... please translate only the text after _value= and don't remove empty space + +_key="alert1" + _value=" +You are going to remove the selected item. + +Are you sure? +(you will lost the enclosure file if any)" + + +_key="alert2a" + _value=" +You are going to remove the channel: + +" + +_key="alert2b" + _value=" + +Would you like just to archive this +channel (keeping all the files and +enclosures downloaded so far) or +do you want to DELETE the whole + channel from you computer?" + +_key="alert3" + _value=" +Parsing archive.." + +_key="alert_3gp" + _value=" +3GP is a multimedia container format defined by the Third Generation Partnership Project (3GPP) for use on 3G mobile phones. It stores video streams as MPEG-4 or H.263, and audio streams as AMR-NB or AAC-LC. + +VideoLAN still doesn't support the audio AMR (3GPP)" + +_key="alert_swf" + _value=" +SWF is a proprietary vector graphics file format produced by the Flash software from Adobe (formerly Macromedia). + +Currently Flash support in BeOS/Haiku/Zeta is limited to the old standalone Flash player version 4.1015, there isn't a modern Flash player" + + + + +### HELP & SHORTCUTS ----------------------------------- + + +"Introduction" "Introduction" +"The User Interface" "The User Interface" +"Menu Bar" "Menu Bar" +"Toolbar Buttons" "Toolbar Buttons" +"First time with BePodder" "First time with BePodder" +"Download Podcast's enclosure files" "Download Podcast's enclosure files" +"Settings Overview" "Settings Overview" +"Directory lists" "Directory lists" +"Loading Help..." "Loading Help..." +"Register your copy" "Register your copy" +"Starting point" "Starting point" + + + + +# multi line text... please translate only the text after _value= and don't remove empty space + + +_key="help1-0" + _value="Welcome to the BePodder Getting Started Guide." + +_key="help1-1" + _value="If you are already familiar with podcasts and RSS/Atom feeds you can immediately go to BePodder by closing this window." + +_key="help1-2" +_value="If not, this is a short introduction providing you everything you'll need to know on how to get started with BePodder. Use the buttons below to navigate through this tutorial." + + +_key="help2-0" +_value="Podcasting is a method for publishing audio and video broadcasts via the Internet; links to free audio and video files are enclosed in RSS and Atom feeds." + +_key="help2-1" +_value="Therefore Podcasting is simply a type of online media delivery; users can subscribe to a podcast using a feed (such as RSS 'Really Simple Syndication' or Atom)." + +_key="help2-2" +_value="An aggregator (or podcatcher) like BePodder, is a piece of software that allows you to subscribe to a RSS feed and periodically check for and download new content; with BePodder you can check for new Podcast items (Episodes) of your subscribed Channels. Any item can contain an enclosure, just like an Email can contain an attachment." + + + +_key="help3-0" +_value="BePodder has an easy to use yet powerful Graphical User Interface. The main window is split into tree panels:" + +_key="help3-1" +_value="1) The Subscription list (the panel with the number 1 in the screenshot) with the list of the podcasts that you have subscribed to. When you click on a Channel you can see in the panel 2 the list of the channel's items." + +_key="help3-2" +_value="2) The Episodes list with all the items available." + +_key="help3-3" +_value="3) The Info panel show: episode info, channel info or Downloads info; you can select an info panel by clicking one of the below three buttons." + + + +_key="help4-0" +_value="At the very top of the BePodder main window is the menubar with seven menus available: File, Settings, Subscriptions, Episodes, Lists, View and Help. Some menu commands are followed by a right pointing arrow that indicates a submenu of related commands. As you explore each menu, be sure to take a look at the submenus as well. Click on a menus to show its commands:" + +_key="help4-1" +_value="File: contains commands to close the application and to show information about BePodder" + +_key="help4-2" +_value="Settings: contains command to open the Preferences window that allows you to customize various BePodder settings." + +_key="help4-3" +_value="Subscriptions: contains commands that perform actions on the selected channel of your subscriptions list." + +_key="help4-4" +_value="Episodes: contains commands that perform actions on the selected item (episode) of the channel's episode list." + +_key="help4-5" +_value="Lists: contains commands to open BePodder's OPML directories." + +_key="help4-6" +_value="View: contains commands and controls for the BePodder window." + +_key="help4-7" +_value="Help: contains commands to open BePodder's 'Getting Started Guide' and the 'Keyboard Shortcuts List'." + + + +_key="help5-0" + _value="Add Button: opens the Add Window to add a feed url (e.g. http://www.newpodcast.com/rss.xml) usually given on the podcast homepage; looks for text or graphic link that says something like 'XML', 'RSS' or 'Podcast Feed' on it." + +_key="help5-1" + _value="Channel Remove Button: opens a window in which you can select how remove the channel: just archive the select channel (keeping all the files and eclosure downloaded so far) or delete the whole channel from your computer." + +_key="help5-2" + _value="Check Button: checks the selected channel and updates the list of the available items for that podcast adding the new items." + +_key="help5-3" + _value="Web Button: shows the channel homepage in the browser. To select your favorite browser open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select your favorite browser." + +_key="help5-4" + _value="Play Button: with this button you can view or listen the file enclosure of the selected item(episode). To select your favorite player open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select you favorite player." + +_key="help5-5" + _value="Download Button: downloads the file enclosure of the selected item (episode); you can see the download info by clicking on the third button over the info panel." + +_key="help5-6" + _value="Stop Button: stops to download the file enclosure of the selected item (episode); to resume the download double-click the item (episode) or select the item and click the Download Button" + +_key="help5-7" + _value="Item Remove Button: deletes the selected item (you will loose the enclosure file)." + + + +_key="help6-0" + _value="Getting started with BePodder is easy." + +_key="help6-1" + _value="On the left of the main window you can see the 'Subscription List' with all your feed subscriptions. We have added some subscriptions for you, and you can always add your own in two ways:" + +_key="help6-2" + _value="1) click the Add Button, then insert the feed url (example: http://www.newpodcast.com/rss.xml) and click add." + +_key="help6-3" + _value="2) in the menubar select 'Directory' and then 'Podcast list' or another list, choose a podcast and click 'Subscribe'." + +_key="help6-4" + _value="If you select a Podcast in the subscriptions list and use the check button, BePodder adds the new items to the 'Episodes list' (below on the right); you can check all your podcasts by right-clicking and selecting 'Check All Channels' in the context menu." + +_key="help6-5" + _value="Look at the screenshot above, there are 3 new items indicated by a black dot in the first column of the 'Episodes list'." + +_key="help6-6" + _value="In the second column there are icons that indicate the state of the item:" + +_key="help6-7" + _value="- the Episode 4 has an icon that indicates an error" + +_key="help6-8" + _value="- the Episode 3 has an icon that indicates that the item's enclosure download request is enquequed" + +_key="help6-9" + _value="- the Episode 2 has an icon that indicates that BePodder is downloading the item's enclosure file" + +_key="help6-10" + _value="- the Episode 1 have an icon that indicates that BePodder have just downloaded the item's enclosure file" + + + +_key="help7-0" + _value="Select an item in the 'Episodes list' and then double-click on it (or click the Download Button) to start downloading the enclosed file; you can always stop the download by clicking on the Stop Button." + +_key="help7-1" + _value="When you click on the Subscribed Podcasts in the 'Subscriptions List' the software shows you, in the 'List of episodes', all the items available in that Subscription. Select an item and then click play (Play Button) to view or listen to the file." + +_key="help7-2" + _value="You can access the Enclosures Folder by clicking on the folder icon in the Info Pannel or by right-clicking your mouse on an item and select 'Open Enclosures Folder' in the context menu." + + + +_key="help8-0" + _value="Preferences can be accessed by clicking in the menu-bar Settings>Preferences. You can select a category from the left list of the preferences dialog: FileType, Channels, Download and Proxy." + +_key="help8-1" + _value="- FileType: to specify the default browser and player. " + +_key="help8-2" + _value="- Channels: to specify preferences that control the operation to check channels new items; you can choose to Check all channels on startup or check the channel every desired minutes." + +_key="help8-3" + _value="- Download: to specify the max number of item's files to download at the same time," + +_key="help8-4" + _value="- Proxy: to set up a proxy server to work with BePodder; a proxy server acts as a security barrier between your internal network and the Internet, keeping others on the Internet from accessing information on your internal network." + + + +_key="help9-0" + _value="BePodder has built-in podcast, videoblog, imagefeeds, newsfeeds, bittorrentfeeds and internationalfeeds OPML directories with thousands of feeds grouped by category." + +_key="help9-1" + _value="OPML (Outline Processor Markup Language) is an XML-based format that allows exchange of outline-structured information between applications." + +_key="help9-2" + _value="OPML directory can be accessed by clicking in the menu-bar 'Lists' and thenselecting a list. To browse the opml directory for a feed, expand the list by clicking the arrow of the category that you are interested in (see image); using this method, you can expand the opml directory until you find the desired feed. Once you have selected it, you can add it to the subscription list by clicking the button 'Subscribe', you can also collapse all categories in the directory list by clicking the button 'Collapse All'." + +_key="help_shortcut1" +_value="This page describes the keyboard shortcuts that can be used in BePodder. The shortcuts are grouped here by function." + +_key="help_shortcut2" +_value="means that you can use either alt or control (es. Alt+Q or Ctrl+Q Quit the application), which way you have set it in the Deskbar menu preferences under Keyboard (the default shortcut key is Alt)." + +_key="help_shortcut3" + _value="General shortcuts" + +_key="help_shortcut4" + _value="Quit the application" + +_key="help_shortcut5" + _value="Shows the Preferences window" + +_key="help_shortcut6" + _value="Shows the Podcast directory list" + +_key="help_shortcut7" + _value="Shows the Videoblog directory list" + +_key="help_shortcut8" + _value="Shows the Imagefeeds directory list" + +_key="help_shortcut9" + _value="Shows the Newsfeeds directory list" + +_key="help_shortcut9b" + _value="Shows the BitTorrentfeeds directory list" + +_key="help_shortcut9c" + _value="Shows the Internationalfeeds directory list" + +_key="help_shortcut10" + _value="Fullscreen" + +_key="help_shortcut11" + _value="Shows/Hides the toolbar" + +_key="help_shortcut12" + _value="Shows the Getting Started Help" + +_key="help_shortcut13" + _value="Shows this keyboard shortcuts page" + +_key="help_shortcut14" + _value="Channels shortcuts" + +_key="help_shortcut15" + _value="Add a podcast to the subscriptions list" + +_key="help_shortcut16" + _value="Delete the selected podcast from the subscriptions list" + +_key="help_shortcut17" + _value="Check the selected podcast for new episodes (items)" + +_key="help_shortcut18" + _value="Check all podcasts for new episodes (items)" + +_key="help_shortcut19" + _value="Shows the podcast homepage" + +_key="help_shortcut20" + _value="Open enclosures folder" + +_key="help_shortcut21" + _value="Episodes shortcuts" + +_key="help_shortcut22" + _value="Play enclosure" + +_key="help_shortcut23" + _value="(Re)start download the selected episodes (items)" + +_key="help_shortcut24" + _value="Stop the episode (item) download" + +_key="help_shortcut25" + _value="Delete the selected episode (item)" + +_key="help_shortcut26" + _value="Shows the podcast episode (item) page " + +_key="help_shortcut27" + _value="Open enclosures folder" + +_key="help_buy1" + _value="BePodder Light is the basic version (free download and no time limited), the registered version adds some more nice features: unlimited number of channels, small Channel view, proxy support, automatic channels check, up to 5 enclosure downloads at the same time (multithreading)." + +_key="help_buy2" + _value="Please pay the shareware fee, it's only 15 euro (Kagi add tax in some countries), BePodder licence can be purchased online from Kagi." + +_key="help_buy3" + _value="Buy at www.funkyideasoft.com" + +_key="help_buy4" + _value="After purchasing, an email will be sent to you with a keyfile and instruction on how to install it. It's just a matter of unzipping a file and moving it to a certain directory." + +_key="help_buy5" + _value="There is no problem updating BePodder when a new version becomes available. The keyfile will unlock all downloadable packages unless otherwise notified." + + +### USELESS ######## + +"Opml Editor" "Opml Editor" +"name:" "name:" +"Add a category" "Add a category" +"Add a new Broadcast" "Add a new Broadcast" +"feed:" "feed:" +"url:" "url:" +"Test podcast" "Test podcast" +"Del a category" "Del a category" +"Add a category" "Add a category" +"Select the podcast category:" "Select the podcast category:" +"Check all" "Check all" +"Check" "Check" +"Refresh the list" "Refresh the list" +"Load" "Load" +"Load the list" "Load the list" +"Save" "Save" +"Save the list" "Save the list" +"Revert" "Revert" +"Apply" "Apply" + + + + + + + + + + + + diff --git a/release/Language/Dictionaries/BePodder.itIT b/release/Language/Dictionaries/BePodder.itIT new file mode 100644 index 0000000..ad95619 --- /dev/null +++ b/release/Language/Dictionaries/BePodder.itIT @@ -0,0 +1,601 @@ +# Locale file for BePodder. +# Modified: 4/18/2006 +# Author: Giuseppe Gargaro +# E-mail: giuseppe.gargaro@tin.it + + +# Attention: don't remove empty space or \n + + +### SHAREWARE POPUPS ----------------------------------- + +"Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" "Programma Shareware!\n\nPer favore supportateci!\n\nComprate una licenza del software!\nMaggiori informazioni sul nostro sito web\n" + +"This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" "Questa copia di BePodder è scaduta!\nPer favore comprate una chiave e supportateci.\n" + +"Web Site" "Sito Web" + +"Can't connect!" "Connessione non riuscita!" +"Http port failed!" "Http port failed!" +"Can't resolve host!" "Host non trovato... controllare se siete connessi!" +"Not found!" "Non trovato!" +"Bad resume!" "Ripresa non riuscita!" +"Aborted by Callback!" "Abbandonato dalla richiamata!" +"Can't resume! (range error)" "Non posso riprendere! (range error)" +"Access Denied!" "Accesso negato!" +"User or Password Incorrect!" "User o Password errati!" +"Other error (cUrl code: " "Altro errore (cUrl code: " +"cUrl init error!" "cUrl init error!" +"Can't open file!" "Apertura file non riuscita!" +"Other error (status code: " "Altro errore (status code: " +"Downloading" "Scaricando" + + +### MENUBAR ----------------------------------- + +"File" "File" +"About..." "Informazioni..." +"Close!" "Chiudi!" +"Quit" "Esci" + +"Settings" "Impostazioni" +"Preferences..." "Preferenze..." + +"Subscriptions" "Sottoscrizioni" + +"Episodes" "Episodi" + +"Lists" "Liste" +"Podcast List" "Lista Podcast" +"Podcast directory list" "Lista Podcast per categorie" +"Videoblog List" "Lista Videoblog" +"Videoblog directory list" "Lista Videoblog per categorie" +"Imagefeeds List" "Lista Imagefeed" +"Imagefeeds directory list" "Lista Imagefeed per categorie" +"Newsfeeds List" "Lista Newsfeed" +"Newsfeeds directory list" "Lista Newsfeeds per categorie" +"BitTorrentfeeds List" "Lista BitTorrentfeed" +"BitTorrentfeeds directory list" "Lista BitTorrentfeed per categorie" +"Internationalfeeds List" "Lista Internationalfeed" +"Internationalfeed directory list" "Lista Internationalfeed per categorie" + +"View" "Visualizza" +"Full Screen" "A tutto schermo" +"Toolbar" "Barra pulsanti" +"Subscriptions View" "Vista sottoscrizioni" +"Small Items" "Voci piccole" +"Big Items" "Voci grandi" +"Move BePodder on workspace:" "Sposta BePodder sulla scrivania:" + +"Help" "Aiuto" +"Getting Started" "Per iniziare..." +"Keyboard Shortcuts" "Scorciatoie di tastiera" +"Tutorials" "Tutorials" +"Online Support" "Supporto online" + + + + +### BUTTONS ----------------------------------- + +# Buttons add feed window +"Insert the rss feed url!" "Inserisci la url del feed rss!" +"Add" "Aggiungi" +"Paste" "Incolla" + +# Buttons directory list window +"Collapse All" "Chiudi tutte" +"Preview" "Preview" +"Subscribe" "Sottoscrivi" + + +# Buttons help window +"Next" "Avanti" +"Prev" "Indietro" +"Close" "Chiudi" +"Index" "Indice" + + +# Buttons remove windows +"Cancel" "Annulla" +"Delete" "Rimuovi" +"Archive" "Archivia" + + + +### TOOLTIPS ----------------------------------- + +# Tooltips toolbar buttons + +"Add the podcast to the Subscriptions list" "Aggiunge il podcast alla lista Sottoscrizioni" +"Delete the podcast from the Subscriptions list" "Cancella il podcast dalla lista delle Sottoscrizioni" +"Check the selected podcast for new items" "Controlla la presenza di nuovi episodi per il podcast selezionato" +"Show the podcast homepage" "Mostra il sito del podcast" + +"Delete the item and the enclosure" "Elimina la voce selezionata e il file allegato" +"Stop the item download" "Interrompe il download della trasmissione" +"Download the selected episode" "Scarica la trasmissione selezionata" +"Play the selected episode" "Riproduce la trasmissione selezionata" + +"Submit bug and idea" "Segnala bug e idee" + + +# Tooltips directory window buttons + +"Collapse all categories in the directory list" "Chiudi tutte le categorie nella lista" +"Add the selected podcast to the Subscription list" "Aggiungi il podcast selezionato alla lista Sottoscrizioni" +"Checkout a podcast before downloading it" "Checkout a podcast before downloading it" + + +### INFO PANEL ----------------------------------- + +"Show channel Image" "Mostra immagine canale" +"XML Feed Link" "XML Feed Link" + +"Show Episode info" "Mostra informazioni sull'episodio" +"Show Subscription info" "Mostra informazioni sul canale" +"Show Downloads info" "Mostra informazioni sui download" + +"Enclosure: " "Allegato: " + +"Lookup (Dictionary)" "Ricerca (Dizionario)" +"Lookup (Google)" "Ricerca (Google)" +"Lookup (Acronym Finder)" "Ricerca (Acronym Finder)" +"Copy" "Copia" +"Select All" "Seleziona tutti" +"Copy URL" "Copia URL" +"Open URL" "Apri URL" +"Subscription" "Sottoscritto" + + +### PREFERENCES ----------------------------------- + +"Preferences" "Preferenze" + +"Proxy" "Proxy" +"Enable Proxy" "Abilita Proxy" +"Address" "Indirizzo" +"Port" "Porta" +"Username" "Nome utente" +"Password" "Password" + +"Max Downloads" "Massimo numero di Download contemporanei" + +"FileType" "Tipi di file" +"Browser" "Browser" +"Player" "Player" + +"Channels" "Canali" +"Check all channels on startup" "Controlla i canali sottoscritti all'avvio" +"Check the channel every" "Controlla il canale ogni" + +"never" "mai" +"5 minutes" "5 minuti" +"15 minutes" "15 minuti" +"30 minutes" "30 minuti" +"1 hour" "1 ora" +"2 hour" "2 ore" + + + + +### COLUMLISTVIEW ----------------------------------- + + +"1 new item" "1 nuovo elemento" +"%d new items" "%d nuovi elementi" +"new" "nuovo" +"error" "errore" +"not down" "non scaricato" +"enquequed" "in coda" +"downloading" "scaricando" +"downloaded" "scaricato" +"connecting" "collegamento" +"not found" "non trovato" +"stopped" "incompleto" +"can't connect" "collegamento non riuscito" +"invalid format" "formato non valido" + +"Icon" "Icona" +"Title" "Titolo" +"Date" "Data" +"Size" "Dimensione" +"Status" "Stato" +"Download" "Download" + + + +### CONTEXT MENU ----------------------------------- + +"Add Channel" "Aggiungi canale" +"Remove Channel" "Rimuovi canale" +"Check Channel" "Controlla canale" +"Open Homepage" "Apri Homepage" + +"Open Web Page" "Apri pagina web" +"Open Enclosures folder" "Apri cartella file" +"Check All Channels" "Controlla tutti i canali" + +"Show Channel Image" "Mostra immagine canale" + +"Play enclosure" "Riproduci file" +"(Re)start download" "Riavvia download" +"Stop download" "Arresta download" +"Remove Item" "Rimuovi episodio" + +"Find this Item" "Trova la voce" +"Remove from this list" "Rimuovi dalla lista" + + + +### ALERT ----------------------------------- + +"\nRemoving.." "\nRimozione.." +"\nAn error occured while removing!" "\nSi è verificato un'errore durante la rimozione!" +"Check all the podcasts for new items" "Controlla la presenza di nuovi episodi per tutti i podcast" + +"You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" "Potete aggiungere solo 10 canali in questa versione non registrata di BePodder.\n Per favore registrate la vostra copia\n" +"Web Site" "Web Site" + +"Can't open the selected file with:\n\n" "Non è stato possibile aprire il file selezionato con l'appicazione:\n\n" +"\n\nPlease check if the application is installed in the right way.\n" "\n\nPer favore controllate che l'applicazione sia installata correttamente.\n" +"Download it!" "Scarica l'applicazione!" + +# multi line text... please translate only the text after _value= and don't remove empty space + +_key="alert1" + _value=" +State per rimuovere la voce selezionata. + +Siete sicuri? +(perderete i file allegati se ce ne sono)" + + +_key="alert2a" + _value=" +State per rimuovere il canale: + +" + +_key="alert2b" + _value=" + +Volete soltanto archiviare questo +canale (mantenendo tutti i file +fino ad ora scaricati ) o volete +RIMUOVERE l'intero canale +dal vostro computer?" + +_key="alert3" + _value=" +Analisi archivio.." + +_key="alert_3gp" + _value=" +3GP è un formato per contenuti multimediali definito dal progetto Third Generation Partnership Project (3GPP) per l'uso su telefonini 3G. Questo formato contiene video stream in MPEG-4 o H.263, e audio stream in AMR-NB o AAC-LC. + +VideoLAN ancora non supporta l'audio AMR (3GPP)" + +_key="alert_swf" + _value=" +SWF è un formato proprietario per la grafica vettoriale realizzato con il software Flash della Adobe (precedentemente della Macromedia). + +Attualmente il supporto di Flash in BeOS/Haiku/Zeta è limitato alla vecchia versione del player Flash 4.1015, non c'è un moderno player Flash" + +### HELP & SHORTCUTS ----------------------------------- + + +"Introduction" "Introduzione" +"The User Interface" "L'interfaccia utente" +"Menu Bar" "Barra dei menu" +"Toolbar Buttons" "Pulsanti toolbar" +"First time with BePodder" "La prima volta con BePodder" +"Download Podcast's enclosure files" "Scaricare i file allegati a un Podcast" +"Settings Overview" "Impostazione preferenze" +"Directory lists" "Liste" +"Loading Help..." "Avvio Help..." +"Register your copy" "Registra la tua copia" +"Starting point" "Pagina iniziale" + + + + +# multi line text... please translate only the text after _value= and don't remove empty space + + +_key="help1-0" + _value="Benvenuti nella guida rapida di BePodder." + +_key="help1-1" + _value="Se già avete familiarità con i Podcast e gli RSS feed potete immediatamente +iniziare ad utilizzare BePodder chiudendo questa finestra." + +_key="help1-2" +_value="Altrimenti eccovi una breve introduzione che vi spiegherà tutto quello che dovete sapere per iniziare ad usare l'applicazione. Utilizzate il pulsante qui sotto per proseguire attraverso questa guida." + +_key="help2-0" + _value="Il Podcasting è un metodo per pubblicare trasmissioni con contenuti audio e video in internet; i collegamenti ai file audio e video sono contenuti nei feed RSS e Atom." + +_key="help2-1" +_value="Quindi il Podcasting è semplicemente un nuovo sistema per distribuire media online; gli utenti possono sottoscrivere un podcast usando un feed (come RSS 'Really Simple Syndication' o Atom)." + +_key="help2-2" +_value=" Un aggregatore (o podcatcher) come BePoddder, è una applicazione che vi permette di sottoscrivere gli RSS feed e di cercare e scaricare nuovi contenuti periodicamente; con BePodder potete cercare nuove voci (episodi) di un podcast che avete precedentemente sottoscritto. Ogni voce può contenere un file allegato, proprio +come avviene per una Email" + + + +_key="help3-0" + _value="BePodder ha una interfaccia grafica potente e semplice. La finestra principale del programma è divisa in tre aree:" + +_key="help3-1" + _value="1) La 'lista sottoscrizioni' (nell'immagine l'area indicata dal numero 1) con tutti i Podcast che avete sottoscritto. Cliccando du un canale potete vedere nell 'area 2 la lista degli episodi disponibili per quel canale." + +_key="help3-2" + _value="2) La 'lista degli episodi' con tutti gli episodi disponibili." + +_key="help3-3" + _value="3) Il 'pannello informazioni' mostra: informazioni episodio, informazioni canale oppure informazioni sui download; potete selezionare un pannello informazioni cliccando uno dei tre pulsanti qui sotto." + + +_key="help4-0" +_value="Nella parte più alta della finestra principale di BePodder c'è la barra dei menù con sei menù disponibili: File, Impostazioni, Sottoscrizioni, Episodi, Liste, Visualizza ed Aiuto. Alcuni comandi dei menù sono seguiti da una freccia che indica la presenza di un sottomenù per il comando. Quando esplorate un menù accertatevi di dare anche un'occhiata ai sottomenù. Cliccate su un menù per visualizzarne i comandi:" + +_key="help4-1" +_value="File: contiene comandi per chiudere l'applicazione e per mostrare informazioni su BePodder" + +_key="help4-2" +_value="Impostazioni: contiene il comando che apre la finestra preferenze per consentirvi di impostare le preferenze di BePodder." + +_key="help4-3" +_value="Sottoscrizioni: contiene i comandi che eseguono alcune azioni sul canale selezionato nella vostra lista sottoscrizioni." + +_key="help4-4" +_value="Episodi: contiene i comandi che eseguono alcune azioni sulla voce(episodio) selezionata nella lista episodi del canale." + +_key="help4-5" +_value="Liste: contiene i comandi per aprire le liste OPML di BePodder." + +_key="help4-6" +_value="Visualizza: contiene i comandi per controllare la finestra di BePodder" + +_key="help4-7" +_value="Aiuto: contiene i comandi per aprire la guida rapida a BePodder e la lista delle scorciatoie di tastiera'." + + + +_key="help5-0" + _value="Add Button: apre la finestra per aggiungere un feed url (e.g. http://www.newpodcast.com/rss.xml) che normalmente potete trovare sulla homepage del podcast; cercate un link testuale o grafico che riporta la scritta 'XML', 'RSS' o 'Podcast Feed'." + +_key="help5-1" + _value="Channel Remove Button: apre una finestra in cui potete selezionare come rimuovere il canale: semplicemente archiviare (mantenendo tutti i file allegati che avete scaricato) o eliminare l'intero canale dal computer." + +_key="help5-2" + _value="Check Button: controlla il canale selezionato e aggiorna la lista degli episodi disponibili per quel podcast aggiungendo i nuovi episodi." + +_key="help5-3" + _value="Web Button: mostra la homepage del canale nel browser. Per selezionare il vostro browser preferito aprite le preferenze di BePodder, cliccate Impostazioni>Preferenze nella barra dei menu... e nella finestra delle preferenze sotto 'Tipi di file' selezionate il browser preferito." + +_key="help5-4" + _value="Play Button: con questo pulsante potete vedere o ascoltare il contenuto del file allegato all'episodio selezionato. Per selezionare il vostro player preferito aprite le preferenze di BePodder, cliccate Impostazioni>Preferenze nella barra dei menu... e nella finestra delle preferenze sotto 'Tipi di file' selezionate il player preferito." + +_key="help5-5" + _value="Download Button: scarica il file allegato all'episodio selezionato; potete visualizzare le informazioni sul download cliccando sul terzo bottone sopra il pannello delle informazioni." + +_key="help5-6" + _value="Stop Button: arresta lo scaricamento del file allegato all'episodio selezionato; per riavviare lo scaricamento cliccate due volte sull'episodio o selezionate l'episodio e cliccate Download Button" + +_key="help5-7" + _value="Item Remove Button: elimina l'episodio selezionato (perderete il file allegato)." + + +_key="help6-0" + _value="Iniziare ad utilizzare BePodder è semplice." + +_key="help6-1" + _value="Nella parte sinistra della finestra del programma c'è la lista dei feed che avete sottoscritto. Ne abbiamo aggiunti alcuni per voi, e naturalmente potete sempre +aggiungere i vostri in due modi:" + +_key="help6-2" + _value="1) cliccate sul pulsante Add (vedi toolbar overview), poi inserite l'url del feed (ad esempio: http://www.newpodcast.com/rss.xml) e premete su Aggiungi." + +_key="help6-3" + _value="2) nella barra dei menù selezionate 'Directory' e poi 'Lista Podcast' o 'Lista +Videoblog', scegliete un podcast e cliccate su 'Sottoscrivi'." + +_key="help6-4" + _value="Se dopo aver selezionato un Podcast nella lista dei sottoscritti utilizzate il pulsante Check, BePodder aggiungerà le nuove voci alla lista degli episodi sulla destra della finestra principale; potete effettuare la ricerca di nuove voci su tutti i podcast cliccando il tasto destro del mouse sulla lista dei sottoscritti e selezionando 'Controlla tutti i canali' nel menù contestuale." + +_key="help6-5" + _value="Guardate l'immagine qui sopra, ci sono 3 nuove voci contrassegnate da un quadratino nero nella prima colonna della lista degli Episodi." + +_key="help6-6" + _value="Nella seconda colonna ci sono le icone che indicano lo statoi dell'episodio:" + +_key="help6-7" + _value="- l'episodio 4 ha un icona che indica un errore" + +_key="help6-8" + _value="- l'episodio 3 ha un icona che indica che il downlod del file allegato all'episodio è in coda" + +_key="help6-9" + _value="- l'episodio 2 ha un icona che indica che BePodder sta scaricando il file allegato all'episodio" + +_key="help6-10" + _value="- l'episodio 1 ha un icona che indica che BePodder ha già scaricato il file allegato all'episodio" + + + +_key="help7-0" + _value="Selezionate una voce nella 'Lista degli episodi' ed effettuate un doppio click sulla stessa oppure cliccate sul pulsante Download; potete interrompere in ogni +momento il download cliccando sul pulsante Stop nella toolbar." + +_key="help7-1" + _value="Quando selezionate una voce nella 'Lista dei sottoscritti' l'applicazione vi mostra, nella 'Lista degli episodi', tutti gli episodi disponibili per quel canale. Selezionate una voce e poi cliccate sul pulsante Play per vederne o ascoltarne il contenuto." + +_key="help7-2" + _value="Potete accedere alla cartella degli Allegati cliccando sull'icona cartella nel pannello delle informazioni o cliccate il tasto destro del mouse su un episodio e selezionate 'Apri cartella file' nel menù contestuale." + + +_key="help8-0" + _value="Potete accedere alle preferenze cliccando Impostazioni>Preferenze nella barra dei menu. Potete selezionare una delle categorie dalla lista sulla sinistra nel pannello delle preferenze: Tipi di file, Canali, Download, Proxy." + +_key="help8-1" + _value="- Tipi di file: per impostare browser e player di default. " + +_key="help8-2" + _value="- Canali: per impostare le preferenze relative all'operazione di ricerca di nuovi episodi; potete impostare le preferenze affinchè all'avvio BePodder effettui la ricerca su tutti i canali oppure effetui la ricerca ogni tot minuti." + +_key="help8-3" + _value="- Download: per impostare il massimo numero di download contemporanei" + +_key="help8-4" + _value="- Proxy: per utilizzare un proxy server; un proxy server costituisce una sorta di barriera tra una rete locale e interneta, impedendo l'accesso di estranei alle informazioni presenti sulla rete locale." + + +_key="help9-0" + _value="BePodder contiene liste OPML integrate di podcast, videoblog, imagefeed, newsfeed, bittorrentfeed e internationalfeeds con migliaia di feed raggruppati per categorie." + +_key="help9-1" + _value="OPML (Outline Processor Markup Language) è un formato basato sullo XML che consente di scambiare informazioni strutturate tra le applicazioni." + +_key="help9-2" + _value="Potete accedere alle directory OPML cliccando nella barra dei menù 'Liste' e poi selezionando una lista. Per visualizzare i feed della lista OPML, dovete espandere la lista cliccando la freccia relativa alla categoria che vi interessa (vedi immagine); usando questo metodo, potete espandere la lista finchè non trovate il feed desiderato. Dopo averlo selezionato, potete aggiungerlo alla lista dei sottoscritti cliccando il tasto 'Sottoscrivi', potete chiudere tutte le categorie nella lista cliccando il tasto 'Chiudi tutte'." + + +_key="help_shortcut1" +_value="Questa pagina elenca le scorciatoie di tastiera che possono essere utilizzate in BePodder. Le scorciatoie di tastiera sono raggruppate per funzioni. " + +_key="help_shortcut2" +_value="indica che potete usare alternativamente i tasti alt o control (es. Alt+Q o Ctrl+Q chiudono l'applicazione), a seconda di quale avete impostato nella Deskbar sotto il menu Impostazioni Tastiera (il tasto di default per le scorciatoie di tastiera è Alt)." + +_key="help_shortcut3" + _value="Scorciatoie generali" + +_key="help_shortcut4" + _value="Chiude l'applicazione" + +_key="help_shortcut5" + _value="Mostra la finestra delle preferenze" + +_key="help_shortcut6" + _value="Mostra la lista dei Podcast" + +_key="help_shortcut7" + _value="Mostra la lista dei Videoblog" + +_key="help_shortcut8" + _value="Mostra la lista degli Imagefeeds" + +_key="help_shortcut9" + _value="Mostra la lista dei Newsfeeds" + +_key="help_shortcut9b" + _value="Mostra la lista dei BitTorrentfeeds" + +_key="help_shortcut9c" + _value="Mostra la lista degli Internationalfeeds" + +_key="help_shortcut10" + _value="A tutto schermo" + +_key="help_shortcut11" + _value="Mostra/Nasconde la barra dei pulsanti" + +_key="help_shortcut12" + _value="Mostra la guida rapida" + +_key="help_shortcut13" + _value="Mostra questa pagina con le scorciatoie di tastiere" + +_key="help_shortcut14" + _value="Scorciatoie Canali" + +_key="help_shortcut15" + _value=" Aggiunge un podcast alla lista dei sottoscritti" + +_key="help_shortcut16" + _value="Elimina il podcast selezionato nella lista dei sottoscritti" + +_key="help_shortcut17" + _value="Controlla la presenza di nuovi episodi per il podcast selezionato" + +_key="help_shortcut18" + _value="Controlla la presenza di nuovi episodi per tutti i podcast" + +_key="help_shortcut19" + _value="Mostra la homepage del podcast" + +_key="help_shortcut20" + _value="Apri cartella allegati" + +_key="help_shortcut21" + _value="Scorciatoie Episodi" + +_key="help_shortcut22" + _value="Riproduci file allegato" + +_key="help_shortcut23" + _value="(Ri)avvia download episodio selezionato" + +_key="help_shortcut24" + _value="Arresta download dell'episodio" + +_key="help_shortcut25" + _value="Elimina l'episodio selezionato" + +_key="help_shortcut26" + _value="Mostra la pagina web dell'episodio selezionato " + +_key="help_shortcut27" + _value="Apri cartella allegati" + +_key="help_buy1" + _value="BePodder Light è la versione base (download libero e durata illimitata), la versione registrata aggiunge alcune piacevoli caratteristiche: numero illimitato di canali, vista canali sottoscritti in piccolo, supporto proxy, controllo automatico dei canali, fino a 5 download contemporaneamente (multithreading)." + +_key="help_buy2" + _value="Per favore acquistate lo shareware, costa solo 15 euro (più IVA); la licenza può essere acquistata online tramite Kagi." + +_key="help_buy3" + _value="Compra su www.funkyideasoft.com" + +_key="help_buy4" + _value="Dopo l'acquisto, riceverete una mail con il keyfile e le istruzioni su come installarlo. Si tratta semplicemente di scompattare un file zip e muovere il file contenuto in una determinata cartella." + +_key="help_buy5" + _value="Non c'è nessun problema per aggiornare BePodder quando una nuova versione è disponibile. Il keyfile resta valido per tutti i package scaricabili a meno che non venga segnalato il contrario." + + +### USELESS ######## + +"Opml Editor" "Opml Editor" +"name:" "nome:" +"Add a categorie" "Aggiungi una categoria" +"Add a new Broadcast" "Aggiungi un nuovo Broadcast" +"feed:" "feed:" +"url:" "url:" +"Test podcast" "Controllo podcast" +"Del a categorie" "Elimina una categoria" +"Add a categorie" "Aggiungi una categoria" +"Select the podcast categorie:" "Seleziona la categoria del podcast:" +"Check all" "Controlla tutti" +"Check" "Controlla" +"Refresh the list" "Aggiorna la lista" +"Load" "Apri" +"Load the list" "Apre la lista" +"Save" "Salva" +"Save the list" "Salva la lista" +"Revert" "Ripristina" +"Apply" "Applica" + + + + + + + + + + + + diff --git a/release/Language/Dictionaries/BePodder.jaJP b/release/Language/Dictionaries/BePodder.jaJP new file mode 100644 index 0000000..559a668 --- /dev/null +++ b/release/Language/Dictionaries/BePodder.jaJP @@ -0,0 +1,789 @@ +# Locale file for BePodder. +# Modified: 05/21/2006 +# Author: Jorge G.Mare (koki) & Koichi Kimura (a.k.a. KiM) +# E-mail: koki@aequus.net & bem@jcom.home.ne.jp + + +# Attention: don't remove empty space or \n + + +### SHAREWARE POPUPS ----------------------------------- + +"Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" "これはシェアウェアです!\n\nソフトウェアライセンスを購入して\n私達を支援してください!\n\n詳細情報はウェブサイトを御覧ください。\n" + +"This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" "この BePodder のコピーは期限切れです!\nkeyfile を購入し、私達を支援してください。\n" + +"Web Site" "ウェブサイト" + +"Can't connect!" "Can't connect!" +"Http port failed!" "Http port failed!" +"Can't resolve host!" "Can't resolve host!" +"Not found!" "Not found!" +"Bad resume!" "Bad resume!" +"Aborted by Callback!" "Aborted by Callback!" +"Can't resume! (range error)" "Can't resume! (range error)" +"Access Denied!" "Access Denied!" +"User or Password Incorrect!" "User or Password Incorrect!" +"Other error (cUrl code: " "Other error (cUrl code: " +"cUrl init error!" "cUrl init error!" +"Can't open file!" "Can't open file!" +"Other error (status code: " "Other error (status code: " +"Downloading" "Downloading" + + +### MENUBAR ----------------------------------- + +"File" "ファイル" +"About..." "BePodder について..." +"Close!" "閉じる!" +"Quit" "終了" + +"Settings" "設定" +"Preferences..." "BePodder の設定..." + +"Subscriptions" "購読" + +"Episodes" "エピソード" + +"Lists" "リスト" +"Podcast List" "ポッドキャスト リスト" +"Podcast directory list" "ポッドキャスト ディレクトリ リスト" +"Videoblog List" "ビデオブログ リスト" +"Videoblog directory list" "ビデオブログ ディレクトリ リスト" +"Imagefeeds List" "イメージフィード リスト" +"Imagefeeds directory list" "イメージフィード ディレクトリ リスト" +"Newsfeeds List" "ニュースフィード リスト" +"Newsfeeds directory list" "ニュースフィード ディレクトリ リスト" +"BitTorrentfeeds List" "BitTorrentfeeds List" +"BitTorrentfeeds directory list" "BitTorrentfeeds directory list" +"Internationalfeeds List" "Internationalfeeds List" +"Internationalfeeds directory list" "Internationalfeeds directory list" + +"View" "表示" +"Full Screen" "全画面表示" +"Toolbar" "ツールバー" +"Subscriptions View" "購読リスト表示" +"Small Items" "小" +"Big Items" "大" +"Move BePodder on workspace:" "ワークスペースを移動:" + +"Help" "ヘルプ" +"Getting Started" "ご使用の前に..." +"Keyboard Shortcuts" "キーボード ショートカット..." +"Tutorials" "チュートリアル" +"Online Support" "オンラインサポート" + + + +### BUTTONS ----------------------------------- + +# Buttons add feed window + +"Insert the rss feed url!" "RSS フィード URL を入力" +"Add" "追加" +"Paste" "貼り付け" + + +# Buttons directory list window + +"Collapse All" "Collapse All" +"Preview" "プレビュー" +"Subscribe" "購読" + + +# Buttons help window + +"Next" "次へ" +"Prev" "前へ" +"Close" "閉じる" +"Index" "インデックス" + + +# Buttons remove windows + +"Cancel" "中止" +"Delete" "削除" +"Archive" "アーカイブ" + + + +### TOOLTIPS ----------------------------------- + +# Tooltips toolbar buttons + +"Add the podcast to the Subscriptions list" "ポッドキャストを購読リストに追加" +"Delete the podcast from the Subscriptions list" "ポッドキャストを購読リストから削除" +"Check the selected podcast for new items" "新着項目のチェック" +"Show the podcast homepage" "ポッドキャストのホームページを開く" + +"Delete the enclosure file associated with the selected item" "選択項目に関連する enclosure ファイルを削除" +"Delete the enclosed file associated with the selected item" "選択項目に関連する enclosure ファイルを削除" +"Stop the item download" "ダウンロードを停止" +"Download the selected episode" "ファイルをダウンロード" +"Play the selected episode" "ファイルを再生" + +"Submit bug and idea" "バグや要望を投稿" + + +# Tooltips directory window buttons + +"Collapse all categories in the directory list" "Collapse all categories in the directory list" +"Add the selected podcast to the Subscription list" "選択したポッドキャストを購読リストに追加" +"Checkout a podcast before downloading it" "ポッドキャストのダウンロード前に検査を終了する" + + +### INFO PANEL ----------------------------------- + +"Show channel Image" "チャンネルの画像を表示" +"XML Feed Link" "XML フィードリンク" + +"Show Episode info" "エピソード情報を表示" +"Show Subscription info" "購読情報を表示" +"Show Downloads info" "ダウンロード情報を表示" + +"Enclosure: " "Enclosure: " + +"Lookup (Dictionary)" "Dictionary で検索" +"Lookup (Google)" "Google で検索" +"Lookup (Acronym Finder)" "Acronym Finder で検索" +"Copy" "コピー" +"Select All" "すべて選択" +"Copy URL" "URL をコピー" +"Open URL" "URL を開く" +"Subscription" "購読" + + +### PREFERENCES ----------------------------------- + +"Preferences" "BePodder の設定" + +"Proxy" "プロキシ" +"Enable Proxy" "プロキシを有効" +"Address" "アドレス" +"Port" "ポート" +"Username" "ユーザ名" +"Password" "パスワード" + +"Max Downloads" "ダウンロード最大数" + +"FileType" "ファイルタイプ" +"Browser" "ブラウザ" +"Player" "プレイヤー" + +"Channels" "チャンネル" +"Check all channels on startup" "起動時に全チャンネルをチェック" +"Check the channel every" "チャンネルのチェック" + +"never" "しない" +"5 minutes" "5 分毎" +"15 minutes" "15 分毎" +"30 minutes" "30 分毎" +"1 hour" "1 時間毎" +"2 hour" "2 時間毎" + + + + +### COLUMLISTVIEW ----------------------------------- + + +"1 new item" "1 個の新着項目" +"%d new items" "%d 個の新着項目" +"new" "新着" +"error" "エラー" +"not down" "未ダウンロード" +"enquequed" "待機中" +"downloading" "ダウンロード中" +"downloaded" "ダウンロード済" +"connecting" "接続中" +"not found" "見付かりません" +"stopped" "停止中" +"can't connect" "接続できません" +"invalid format" "無効なフォーマット" + +"Icon" "Icon" +"Title" "タイトル" +"Date" "日付" +"Size" "サイズ" +"Status" "状態" +"Download" "ダウンロード" + + + +### CONTEXT MENU ----------------------------------- + +"Add Channel" "チャンネルを追加" +"Remove Channel" "チャンネルを削除" +"Check Channel" "チャンネルをチェック" +"Open Homepage" "ホームページを開く" + +"Open Web Page" "ホームページを開く" +"Open Enclosures folder" "Enclosures フォルダを開く" +"Check All Channels" "全チャンネルをチェック" + +"Show Channel Image" "チャンネルの画像を表示" + +"Play enclosure" "Enclosure を再生" +"(Re)start download" "ダウンロードを(再)開始" +"Stop download" "ダウンロードを停止" +"Remove Item" "項目を削除" + + + + +### ALERT ----------------------------------- + +"You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" "You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" + + +"Can't open the selected file with:\n\n" "Can't open the selected file with:\n\n" +"\n\nPlease check if the application is installed in the right way.\n" "\n\nPlease check if the application is installed in the right way.\n" +"Download it!" "Download it!" + +"\nRemoving.." "\n削除中.." +"\nAn error occured while removing!" "\n削除中にエラーが発生しました。" +"Check all the podcasts for new items" "全ポッドキャストの新着項目をチェック" + +# multi line text... please translate only the text after _value= and don't remove empty space + +_key="alert1" + _value=" +選択した項目を削除します。 + +本当によろしいですか? +(Enclosure ファイルも一緒に削除されます)" + + +_key="alert2a" + _value=" +次のチャンネルを削除しようとしています: + +" + +_key="alert2b" + _value=" + +今までダウンロードしたこのチャンネルの enclosure ファイルをアーカイブに保存しますか? +それとも完全に削除しますか?" + +_key="alert3" + _value=" +アーカイブを解析中.." + +_key="alert_3gp" + _value=" +3GP is a multimedia container format defined by the Third Generation Partnership Project (3GPP) for use on 3G mobile phones. It stores video streams as MPEG-4 or H.263, and audio streams as AMR-NB or AAC-LC. + +VideoLAN still doesn't support the audio AMR (3GPP)" + +_key="alert_swf" + _value=" +SWF is a proprietary vector graphics file format produced by the Flash software from Adobe (formerly Macromedia). + +Currently Flash support in BeOS/Haiku/Zeta is limited to the old standalone Flash player version 4.1015, there isn't a modern Flash player" + + + +### HELP & SHORTCUTS ----------------------------------- + + +"Introduction" "紹介" +"The User Interface" "ユーザ インタフェース" +"Menu Bar" "メニューバー" +"Toolbar Buttons" "ツールバー ボタン" +"First time with BePodder" "はじめて BePodder をご使用の方へ" +"Download Podcast's enclosure files" "ポッドキャスト enclosure ファイルのダウンロード" +"Settings Overview" "設定の概要" +"Directory lists" "ディレクトリ リスト" +"Loading Help..." "ヘルプの読込中..." +"Register your copy" "登録について" +"Starting point" "はじめに" + + + + +# multi line text... please translate only the text after _value= and don't remove empty space + + +_key="help1-0" + _value="BePodder 基本ガイドへようこそ!" + +_key="help1-1" + _value="あなたが既にポッドキャストおよびRSS/Atomフィード +について詳しいならば、このウィンドウを閉じて直ち +にBePodderを使い始めることができます。" + +_key="help1-2" +_value="このガイドはBePodderを開始するにあたり、あなたが必要とする +知識をすべて提供できるわけではありませんが、本ガイドを使用 +する場合には下のボタンをクリックしてください。" + + + +_key="help2-0" + _value=" ポッドキャスティングとはインターネットを通してオーディオおよび +ビデオ放送を発信する手段です。BePodderでは、無償のオーディオ +およびビデオファイルへのRSSまたはAtomフィードへのリンクを同封 +しています。" + +_key="help2-1" +_value="要するに、ポッドキャスティングとは単に一種のオンラインメディア +の配達手段です。ユーザがフィード (RSS 'Really Simple Syndication' +やAtomなど)を使用し、ポッドキャストを購読することができます。" + +_key="help2-2" +_value="BePodderはアグリゲータ(または、ポッドキャッチャー)に +好まれるでしょう。あなたが新しいコンテンツのRSSフィ +ードを購読して、定期的にチェックし、ダウンロードする +ための1つのソフトウェアです。あなたはBePodderと共に +購読したチャンネルに新しいポッドキャストの項目(エピ +ソード)をチェックすることができます。 +丁度、電子メールが添付ファイルを扱えるように、どんな +項目の enclosure を同梱することができます。" + + + +_key="help3-0" +_value="BePodderは簡単に使用でき、かつパワフルなグラフィカルユーザ +インタフェースを備えています。 +メインウィンドウは3つのパネルに分割されています。" + +_key="help3-1" +_value="1) 購読リスト(スクリーンショットの1番のパネル)はあなたが購読 +登録したポッドキャストのリストです。 +パネル2はチャンネルのリストです。 +クリックするとチャンネルを見ることができます。" + +_key="help3-2" +_value="2) エピソードリストは全項目が利用できる状態です。" + +_key="help3-3" +_value="3) 情報パネルの表示:エピソード情報、チャンネル情報、ダウンロード +情報は3つの内1つをクリックすることにより、情報パネルを選択す +ることができます。" + + + +_key="help4-0" +_value="BePodderのメインウィンドウ最上部にあるメニューバーでは以下の +7つのメニューを利用することができます: +[ファイル][設定][購読][エピソード][リスト][表示][ヘルプ] +一部のメニューコマンドには右側に矢印があり、関連するコマンドが +サブメニューにあります。各メニューを探る場合には、サブメニュー +にも必ず目を通してください。メニューをクリックして、コマンドを +確認してください:" + +_key="help4-1" +_value="[ファイル]:BePodderについての情報の表示およびアプリケーションを +閉じるコマンドを含んでいます。" + +_key="help4-2" +_value="[設定]:BePodderの様々な設定をカスタマイズする環境設定ウィンドウ +を開くコマンドを含んでいます。" + +_key="help4-3" +_value="[購読]:購読リストの選択されたチャンネルへの動作を実行するコマン +ドを含んでいます。" + +_key="help4-4" +_value="[エピソード]:チャンネルのエピソードリストの選択された項目(エピソ +ード)への動作を実行するコマンドを含んでいます。" + +_key="help4-5" +_value="[リスト]:BePodderのOPMLディレクトリを開くコマンドを含んでいま +す。" + +_key="help4-6" +_value="[表示]:BePodderのウィンドウ制御のコマンドを含んでいます。" + +_key="help4-7" +_value="[ヘルプ]:'基本ガイド''キーボードショートカットリスト'を開くコマンド +を含んでいます。" + +_key="help5-0" + _value="追加ボタン: 追加ウィンドウを開きます。 +追加するフィードのURLを入力します。 +(例: http://www.newpodcast.com/rss.xml) +通常、ポッドキャストのホームページ上で'XML'、'RSS'、 +'Podcast Feed'のテキストもしくはグラフィックのリンク +を得ることができます。" + +_key="help5-1" + _value="削除ボタン: チャンネルを除去するためにウィンドウを開 +き、どのようにするかを選択することができます。 +選んだチャンネルをアーカイブするか(今までダウンロー +ドした全てのファイルと eclosure を保持します)、また +はコンピュータからチャンネル全体を削除します。" + +_key="help5-2" + _value="チェックボタン: 選択されたチャンネルをチェックし、利 +用可能なリストの項目を更新し、ポッドキャストの新着 +項目を追加します。" + +_key="help5-3" + _value="ウェブボタン: ブラウザでチャンネルホームページを表示 +します。 +あなたのお気に入りのブラウザを開くにはBePodderの +環境設定で設定します。 +メニューバーの'設定'→'BePodder の設定'をクリックし、 +環境設定ウィンドウの'ファイルタイプ'でお気に入りの +ブラウザを選択してください。" + +_key="help5-4" + _value="再生ボタン: このボタンで、選択された項目(エピソード) +のenclosureファイルを視聴することができます。 +あなたのお気に入りのプレーヤーを開くにはBePodder +の環境設定で設定します。 +メニューバーの'設定'→'BePodder の設定'をクリックし、 +環境設定ウィンドウの'ファイルタイプ'でお気に入りの +プレーヤーを選択してください。" + +_key="help5-5" + _value="ダウンロードボタン: 選択項目(エピソード)のenclosure +ファイルのダウンロードを行います。情報パネルの上の +3番目のボタンをクリックすることにより、ダウンロー +ド情報を見ることができます。" + +_key="help5-6" + _value="停止ボタン: 選択項目(エピソード)のenclosureファイル +ダウンロードを停止します。ダウンロードを再開するた +めに、項目(エピソード)をダブルクリックするか、項目 +を選択してから、ダウンロードボタンをクリックしてく +ださい。" + +_key="help5-7" + _value="削除ボタン: 選択項目を削除します。 + (enclosureファイルを解放します)" + + + +_key="help6-0" + _value="BePodderの導入はとても簡単です。" + +_key="help6-1" + _value="次のようにすれば、あなたが購読した +フィードを参照することができます。 +私達はあなたのために、予めいくつか +のフィードを購読しており、あなたは +二通りの方法で追加することができま +す。" + +_key="help6-2" + _value="1) 「追加アイコン」ボタンをクリックすると、フィードのURL入力に +なります。 (入力例: http://www.newpodcast.com/rss.xml) +「追加」ボタンをクリックして購読します。" + +_key="help6-3" + _value="2) メニューバーにある「ディレクトリ」から「ポッドキャスト リスト +」または 「ビデオブログ リスト」を選択し、ポッドキャストを選んで +「購読」をクリックします。" + +_key="help6-4" + _value="購読リストでポッドキャストを選択して、チェックボタン使用してく +ださい。BePodder は正確に 'エピソードリスト' に新しい項目を追加 +します。右クリックして、コンテキストメニューから'全チャンネルを +チェック'を選択することにより、すべてのポッドキャストをチェック +することができます。" + +_key="help6-5" + _value="上のスクリーンショットを見てください。'エピソードリスト'の第1 +カラムには黒いドットによって示された3つの新着項目があります。" + +_key="help6-6" + _value="第2カラムには、項目の状態を示すアイコンがあります:" + +_key="help6-7" + _value="- Episode 4 のアイコンは、エラーを示します。" + +_key="help6-8" + _value="- Episode 3 のアイコンは、項目のenclosureファイルをダウンロード +要求中であることを示します。" + +_key="help6-9" + _value="- Episode 2 のアイコンは、項目のenclosureファイルをダウンロード +中であることを示します。" + +_key="help6-10" + _value="- Episode 1 のアイコンは、項目のenclosureファイルをダウンロード +したこと示します。" + + + +_key="help7-0" + _value=" 'エピソードリスト'で項目を選択して、項目をダブルクリックするか、 +またはダウンロードボタンをクリックしてください。ダウンロードは +停止ボタンをクリックすることでいつでも停止することができます。" + +_key="help7-1" + _value="予約購読で利用できるすべての項目を'エピソードリスト'で見るために +は、ソフトウェアの'購読リスト'で予約購読されたポッドキャストをク +リックしてください。項目を選択し、再生(再生ボタン)をクリックして +、ファイルを視聴してください。" + +_key="help7-2" + _value="情報パネルでフォルダアイコンをクリックするか、またはマウスを右 +クリックすることにより、コンテキストメニューから'Enclosures フォ +ルダを開く'を選択することで、Enclosuresフォルダにアクセスするこ +とができます。" + + + +_key="help8-0" + _value="メニューバーの'設定'→'BePodderの設定'をクリックすることで、環境 +設定へアクセスすることができます。環境設定ダイアログの左側のリ +スト'ファイルタイプ'、'チャンネル'、'ダウンロード'、'プロキシ'からカ +テゴリを選択してください。" + +_key="help8-1" + _value="- ファイルタイプ: デフォルトのブラウザとプレーヤーを指定します。 " + +_key="help8-2" + _value="- チャンネル: チャンネルの新着項目のチェックについての制御の設定 +です。アプリケーションの起動と同時に全チャンネルのチェックを行 +うかチャンネルのチェック間隔を指定します。" + +_key="help8-3" + _value="- ダウンロード: 同時にダウンロードすることができる、最大ファイル +数を指定します。" + +_key="help8-4" + _value="- プロキシ: BePodderで使用するプロキシサーバの設定を行います。 +プロキシサーバはあなたのローカルエリアネットワークとインターネ +ット間のセキュリティバリアとして機能します。インターネットから +あなたのローカルエリアネットワークへの不正アクセスを防止します。" + + + +_key="help9-0" + _value="BePodder has built-in podcast, videoblog, imagefeeds, newsfeeds, bittorrentfeeds and internationalfeeds OPML directories with thousands of feeds grouped by category." + +_key="help9-1" + _value="OPML (Outline Processor Markup Language) はアプリケーション間 +のアウトラインで構造化された情報の交換を許容するXMLベースの形 +式です。" + +_key="help9-2" + _value="OPML directory can be accessed by clicking in the menu-bar 'Lists' and thenselecting a list. To browse the opml directory for a feed, expand the list by clicking the arrow of the category that you are interested in (see image); using this method, you can expand the opml directory until you find the desired feed. Once you have selected it, you can add it to the subscription list by clicking the button 'Subscribe', you can also collapse all categories in the directory list by clicking the button 'Collapse All'." + + +_key="help_shortcut1" +_value="このページはBePodderで使用することができるキーボードショート +カットについて説明します。" + +_key="help_shortcut2" +_value="Alt/Ctrl キーはどちらでも使えます。 +(例:Alt+QまたはCtrl+Qでアプリケーションを終了) +どちらを使用するかはDeskbar-環境設定(Preferences) +→キーボード(Keyboard)で設定できます。 +(デフォルトはAlt)" + +_key="help_shortcut3" + _value="一般的なショートカット" + +_key="help_shortcut4" + _value="アプリケーションを終了" + +_key="help_shortcut5" + _value="「BePodder の設定」を開く" + +_key="help_shortcut6" + _value="ポッドキャスト ディレクトリ リスト +を開く" + +_key="help_shortcut7" + _value="ビデオブログ ディレクトリ リスト +を開く" + +_key="help_shortcut8" + _value="イメージフィード ディレクトリ リスト +を開く" + +_key="help_shortcut9" + _value="ニュースフィード ディレクトリ リスト +を開く" + + +_key="help_shortcut9b" + _value="Shows the BitTorrentfeeds directory list" + +_key="help_shortcut9c" + _value="Shows the Internationalfeeds directory list" + +_key="help_shortcut10" + _value="全画面表示" + +_key="help_shortcut11" + _value="ツールバーの表示/非表示" + +_key="help_shortcut12" + _value="「ご使用の前に」を表示" + +_key="help_shortcut13" + _value="「キーボード ショートカット」を表示" + +_key="help_shortcut14" + _value="チャンネルのショートカット" + +_key="help_shortcut15" + _value="ポッドキャストを購読リスト +に追加" + +_key="help_shortcut16" + _value="ポッドキャストを購読リスト +から削除" + +_key="help_shortcut17" + _value="選択中のポッドキャストの新着項目 +をチェック" + +_key="help_shortcut18" + _value="全ポッドキャストの新着項目 +をチェック" + +_key="help_shortcut19" + _value="ポッドキャストのホームページ +を開く" + +_key="help_shortcut20" + _value="Enclosures フォルダを開く" + +_key="help_shortcut21" + _value="エピソードのショートカット" + +_key="help_shortcut22" + _value="Enclosure を再生" + +_key="help_shortcut23" + _value="選択したエピソードのダウンロード +を(再)開始" + +_key="help_shortcut24" + _value="エピソードのダウンロードを停止" + +_key="help_shortcut25" + _value="選択したエピソードの削除" + +_key="help_shortcut26" + _value="ポッドキャストのホームページを開く" + +_key="help_shortcut27" + _value="Enclosures フォルダを開く" + +_key="help_buy1" + _value="BePodder Light is the basic version (free download and no time limited), the registered version adds some more nice features: unlimited number of channels, small Channel view, proxy support, automatic channels check, up to 5 enclosure downloads at the same time (multithreading)." + +_key="help_buy2" + _value="BePodderのライセンスはKagiからオンライン購入することができ +ます。シェアウェア料をお支払いください。 +15ユーロになります(いくつかの国はKagiに税を課金します)。" + +_key="help_buy3" + _value="購入先: www.funkyideasoft.com" + +_key="help_buy4" + _value="購入後、keyfileとそのインストール方法を記した電子メールがあな +たに送られます。添付ファイルを解凍して、あるディレクトリに +ファイルを移動するだけです。" + +_key="help_buy5" + _value="BePodderの新バージョンが出てもアップデートに支障はありませ +ん。別な方法で通知された場合を除き、keyfileはダウンロードでき +るパッケージを全て解除します。" + + +### + +"Opml Editor" "OPML エディタ" +"name:" "名前:" +"Add a categorie" "カテゴリの追加" +"Add a new Broadcast" "新しく放送を追加" +"feed:" "フィード:" +"url:" "URL:" +"Test podcast" "ポッドキャストのテスト" +"Del a categorie" "カテゴリの削除" +"Add a categorie" "カテゴリの追加" +"Select the podcast categorie:" "ポッドキャスト カテゴリの選択:" +"Check all" "すべてチェック" +"Check" "チェック" +"Refresh the list" "リストの更新" +"Load" "読込" +"Load the list" "リストを読込" +"Save" "保存" +"Save the list" "リストを保存" +"Revert" "元に戻す" +"Apply" "適用" + + + + +### LANGUAGE ----------------------------------- + +"Afrikaans" "アフリカーンス語" +"Albanian" "アルバニア語" +"Arabic" "アラビア語" +"Armenian" "アルメニア語" +"Belarusian" "ベラルーシ語" +"Bosnian" "ボスニア語" +"Breton" "ブルターニュ語" +"Bulgarian" "ブルガリア語" +"Catalan" "カタロニア語" +"Chechen" "チェチェン語" +"Chinese" "中国語" +"Czech" "チェコ語" +"Danish" "デンマーク語" +"Dutch" "オランダ語" +"English" "英語" +"Esperanto" "エス語" +"Estonian" "エストニア語" +"Finnish" "フィンランド語" +"French" "フランス語" +"Georgian" "グルジア語" +"German" "ドイツ語" +"Gaelic (Scots)" "ゲール語 (スコットランド)" +"Irish" "アイルランド語" +"Greek, Modern ()" "Greek, Modern ()" +"Hebrew" "ヘブライ語" +"Hungarian" "ハンガリー語" +"Icelandic" "アイスランド語" +"Indonesian" "インドネシア語" +"Italian" "イタリア語" +"Japanese" "日本語" +"Korean" "朝鮮語" +"Lithuanian" "リトアニア語" +"Moldavian" "モラビア語" +"Mongolian" "モンゴル語" +"Norwegian" "ノルウェー語" +"Norwegian Nynorsk" "Norwegian Nynorsk" +"Norwegian Bokmål" "Norwegian Bokmål" +"Polish" "ポーランド語" +"Portuguese" "ポルトガル語" +"Romanian" "ルーマニア語" +"Russian" "ロシア語" +"Serbian" "セルビア語" +"Croatian" "クロアチア語" +"Sinhalese" "シンハラ語" +"Slovak" "スロバキア語" +"Slovenian" "スロべニア語" +"Spanish" "スペイン語" +"Swedish" "スウェーデン語" +"Ukrainian" "ウクライナ語" + +"Downloads" "ダウンロード" +"BePodder Keyboard Shortcuts" "BePodder のキーボードショートカット" +"General" "全般" +"Archive" "アーカイブ保存" +"Toolbar Overview" "ツールバーの概要" +"Please feedback :)" "フィードバック送信" +"Unexpected error in window \"BePodder\".Should an attempt be made to continue running?" "BePodder のウィンドウで予期せぬエラーが発生しました。再試行してみますか?" +"Continue" "続行" +"Developers:" "開発者:" +"Graphic:" "グラフィック:" +"Version :" "バージョン :" +"Licensed to :" "登録者 :" +"License code:" "登録コード:" +"Only this person is allowed to use this copy of the software." "このソウトウェアは個人利用のみに使用することができます。" +"Getting Started With BePodder" "BePodder をご使用の前に" +"What are Podcasts?" "ポッドキャストとはなにか?" +"Find this Item" "この項目を検索" +"Remove from this list" "このリストから削除" + diff --git a/release/Language/Dictionaries/BePodder.nlBE b/release/Language/Dictionaries/BePodder.nlBE new file mode 100644 index 0000000..1031253 --- /dev/null +++ b/release/Language/Dictionaries/BePodder.nlBE @@ -0,0 +1,1192 @@ + + +# Locale file for BePodder. + +# Modified: 4/18/2006 + +# Author: Begasus + +# E-mail: Begasus@skynet.be + + + + + +# Attention: don't remove empty space or \n + + + + + +### SHAREWARE POPUPS ----------------------------------- + + + +"Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" "Shareware toepassing!\n\nSteun ons aub!\n\nKoop een licentie!\nMeer info op onze website\n" + + + +"This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" "Deze versie van BePodder is verlopen!\nGelieve een keyfile te kopen en ons te ondersteunen.\n" + + + +"Web Site" "Website" + +"Can't connect!" "Geen verbinding!" + +"Http port failed!" "Http poort mislukt!" + +"Can't resolve host!" "Kan host niet vinden!" + +"Not found!" "Niet gevonden!" + +"Bad resume!" "Slecht herstart!" + +"Aborted by Callback!" "Afgebroken door callback!" + +"Can't resume! (range error)" "Kan niet herstarten! (range fout)" + +"Access Denied!" "Toegang verboden!" + +"User or Password Incorrect!" "Gebruiker of paswoord foutief!" + +"Other error (cUrl code: " "Andere fout (cUrl code: " + +"cUrl init error!" "cUrl init fout!" + +"Can't open file!" "Kan bestand niet openen!" + +"Other error (status code: " "Andere fout (status code: " + +"Downloading" "Downloaden" + + + +### MENUBAR ----------------------------------- + + + +"File" "Bestand" + +"About..." "Over..." + +"Close!" "Sluiten!" + +"Quit" "Quit" + + + +"Settings" "Instellingen" + +"Preferences..." "Voorkeuren..." + + + +"Subscriptions" "Abonnementen" + + + +"Episodes" "Afleveringen" + + + +"Lists" "Lijsten" + +"Podcast List" "Podcast Lijst" + +"Podcast directory list" "Podcast maplijst" + +"Videoblog List" "Videoblog Lijst" + +"Videoblog directory list" "Videoblog maplijst" + +"Imagefeeds List" "Imagefeeds List" + +"Imagefeeds directory list" "Imagefeeds maplijst" + +"Newsfeeds List" "Newsfeeds lijst" + +"Newsfeeds directory list" "Newsfeeds maplijst" + +"BitTorrentfeeds List" "BitTorrentfeeds lijst" + +"BitTorrentfeeds directory list" "BitTorrentfeeds maplijst" + +"Internationalfeeds List" "Internationalfeeds lijst" + +"Internationalfeeds directory list" "Internationalfeeds maplijst" + + + +"View" "Venster" + +"Full Screen" "Schermvullend" + +"Toolbar" "Werkbalk" + +"Subscriptions View" "Abonnementen venster" + +"Small Items" "Kleine objecten" + +"Big Items" "Grote objecten" + +"Move BePodder on workspace:" "Verplaats BePodder naar bureaublad:" + + + +"Help" "Help" + +"Getting Started" "Handleiding" + +"Keyboard Shortcuts" "Toetscombinaties" + +"Online Support" "Online ondersteuning" + + + + + + + + + + + +### BUTTONS ----------------------------------- + + + +# Buttons add feed window + +"Insert the rss feed url!" "RSS feed url ingeven!" + +"Add" "Toevoegen" + +"Paste" "Plakken" + + + +# Buttons directory list window + +"Collapse All" "Alles inklappen" + +"Preview" "Voorbeeld" + +"Subscribe" "Abonneren" + + + + + +# Buttons help window + +"Next" "Verder" + +"Prev" "Terug" + +"Close" "Sluiten" + +"Index" "Index" + + + + + +# Buttons remove windows + +"Cancel" "Annuleren" + +"Delete" "Verwijder" + +"Archive" "Archive" + + + + + + + +### TOOLTIPS ----------------------------------- + + + +# Tooltips toolbar buttons + + + +"Add the podcast to the Subscriptions list" "Podcast toevoegen aan de abonementen" + +"Delete the podcast from the Subscriptions list" "Podcast verwijderen van de abonnementen" + +"Check the selected podcast for new items" "Podcast controleren op nieuwe objecten" + +"Show the podcast homepage" "Podcast homepage tonen" + + + +"Delete the item and the enclosure" "Delete the item and the enclosure" + +"Stop the item download" "Stop download van onderwerp" + +"Download the selected episode" "Download de geselecteerde aflevering" + +"Play the selected episode" "Geselecteerde aflevering afspelen" + + + +"Submit bug and idea" "Bug's en ideëen aanbrengen" + + + + + +# Tooltips directory window buttons + + + +"Collapse all categories in the directory list" "Alle categoriëen in de maplijst inklappen" + +"Add the selected podcast to the Subscription list" "Voeg de geselecteerde podcast toe aan de geaboneerde lijst" + +"Checkout a podcast before downloading it" "Controleer een podcast vooraleer toe te voegen" + + + +### INFO PANEL ----------------------------------- + + + +"Show channel Image" "Toon kanaal afbeelding" + +"XML Feed Link" "XML Feed Link" + + + +"Show Episode info" "Toon onderwerpsinfo" + +"Show Subscription info" "Toon abonnementsinfo" + +"Show Downloads info" "Toon downloadsinfo" + + + +"Enclosure: " "Bijlage: " + + + +"Lookup (Dictionary)" "Opzoeken (Dictionary)" + +"Lookup (Google)" "Opzoeken (Google)" + +"Lookup (Acronym Finder)" "Lookup (Acronym Finder)" + +"Copy" "Kopiëer" + +"Select All" "Selecteer alles" + +"Copy URL" "Copy URL" + +"Open URL" "Open URL" + +"Subscription" "Abonement" + + + + + +### PREFERENCES ----------------------------------- + + + +"Preferences" "Voorkeuren" + + + +"Proxy" "Proxy" + +"Enable Proxy" "Proxy inschakelen" + +"Address" "Address" + +"Port" "Poort" + +"Username" "Gebruikersnaam" + +"Password" "Paswoord" + + + +"Max Downloads" "Max Downloads" + + + +"FileType" "Bestandstype" + +"Browser" "Browser" + +"Player" "Speler" + + + +"Channels" "Kanalen" + +"Check all channels on startup" "Controleer alle kanalen bij het starten" + +"Check the channel every" "Controleer alle kanalen elke" + + + +"never" "nooit" + +"5 minutes" "5 minuten" + +"15 minutes" "15 minuten" + +"30 minutes" "30 minuten" + +"1 hour" "1 uur" + +"2 hour" "2 uur" + + + + + + + + + +### COLUMLISTVIEW ----------------------------------- + + + + + +"1 new item" "1 nieuw onderwerp" + +"%d new items" "%d nieuwe onderwerpen" + +"new" "nieuw" + +"error" "fout" + +"not down" "niet binnen" + +"enquequed" "wachtrij" + +"downloading" "downloaden" + +"downloaded" "gedownload" + +"connecting" "verbinden" + +"not found" "niet gevonden" + +"stopped" "gestopt" + +"can't connect" "geen verbinding" + +"invalid format" "ongeldig formaat" + + +"Icon" "Icon" + +"Title" "Titel" + +"Date" "Datum" + +"Size" "Grootte" + +"Status" "Status" + +"Download" "Download" + + + + + + + +### CONTEXT MENU ----------------------------------- + + + +"Add Channel" "Kanaal toevoegen" + +"Remove Channel" "Kanaal verwijderen" + +"Check Channel" "Kanaal controleren" + +"Open Homepage" "Open Homepage" + + + +"Open Web Page" "Open Web Page" + +"Open Enclosures folder" "Open bijlage map" + +"Check All Channels" "Controlleer alle kanalen" + + + +"Show Channel Image" "Toon kanaal afbeelding" + + + +"Play enclosure" "Bijlage afspelen" + +"(Re)start download" "(her)start download" + +"Stop download" "Stop download" + +"Remove Item" "Verwijder object" + + +"Find this Item" "Zoek dit object" + +"Remove from this list" "Verwijder uit de lijst" + + + + + + + + + +### ALERT ----------------------------------- + +"You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" "Je kan enkel tot 10 kanalen toevoegen in deze niet geregistreerde versie.\n Registreer je kopie\n" + + +"Can't open the selected file with:\n\n" "Kan het geselecteerd bestand niet openen met:\n\n" + +"\n\nPlease check if the application is installed in the right way.\n" "\n\nControlleer of de toepassing goed geïnstalleerd is.\n" + +"Download it!" "Download het!" + + + +"\nRemoving.." "\nVerwijren.." + +"\nAn error occured while removing!" "\nFout tijdens het verwijderen!" + +"Check all the podcasts for new items" "Controlleer alle podcasts voor nieuwe onderwerpen" + + + +# multi line text... please translate only the text after _value= and don't remove empty space + + + +_key="alert1" + + _value=" + +Je gaat het geselecteerde onderwerp verwijderen. + + + +Ben je zeker? + +(alle bijlage in de map worden mee verwijderd)" + + + + + +_key="alert2a" + + _value=" + +Je verwijderd het kanaal: + + + +" + + + +_key="alert2b" + + _value=" + + + +Wil je dit kanaal liever archieveren + +(behoud van alle bijlagen en bestanden + +die al gedownload zijn) of wil je het + +volledig kanaal verwijderen van je pc?" + + + +_key="alert3" + + _value=" + +Archief ontleden.." + + +_key="alert_3gp" + _value=" +3GP is een multimedia container formaat gedefiniëerd door Third Generation Partnership Project (3GPP) voor het gebruik op 3G mobiele telefoons. Het slaat video streams op als MPEG-4 of H.263, en audio streams als AMR-NB of AAC-LC. + +VideoLAN ondersteund audio AMR (3GPP) nog niet" + +_key="alert_swf" + _value=" +SWF is een gebonden vector grafisch bestandsformaat geproduceerd door Flash software van Adobe (voormalig Macromedia). + +Huidige ondersteuning in BeOS/Haiku/ZETA is gelimiteerd tot de losstaande Flash speler versie 4.1015, er is tot op heden geen moderne Flash speler" + + + + +### HELP & SHORTCUTS ----------------------------------- + + + + + +"Introduction" "Introductie" + +"The User Interface" "Gebruikersinterface" + +"Menu Bar" "Menubalk" + +"Toolbar Buttons" "Werkbalk" + +"First time with BePodder" "Eerste gebruik van BePodder" + +"Download Podcast's enclosure files" "Download Podcast's bijlagen" + +"Settings Overview" "Instellingen overzicht" + +"Directory lists" "Directory lijsts" + +"Loading Help..." "Help laden..." + +"Register your copy" "Registeer je kopie" + +"Starting point" "Startpunt" + + + + + + + + + +# multi line text... please translate only the text after _value= and don't remove empty space + + + + + +_key="help1-0" + + _value="Welkom bij de BePodder startersgids." + + + +_key="help1-1" + + _value="Als je al bekend bent met podcast en RSS feeds kan je dadelijk naar BePodder gaan door dit venster te sluiten." + + + +_key="help1-2" + +_value="Indien niet, volgt hier een introductie dat je zal verder helpen met alles wat je moet weten om te kunnen starten met BePodder. + +Gebruik de knoppen hieronder om door de handleiding te wandelen." + + + + + +_key="help2-0" + + _value="Podcasting is een methode voor het publiceren van audio en video broadcasts + +via het Internet; links naar gratis audio en video bestanden zijn ingebonden in de + +RSS en Atom feeds." + + + +_key="help2-1" + +_value="Daardoor is Podcasting een type van online media verdeling; gebruikers kunnen + +abonneren op een podcast door een feed te gebruiken + +(zoals RSS 'Really Simple Syndication' of Atom)." + + + +_key="help2-2" + +_value="Een aggregator (of podcatcher) zoals BePodder, is een toepassing die je in staat stelt om op een RSS feed te abonneren en periodiek te controleren op en downloaden van nieuwe onderwerpen. Met BePodder kan je controleren op nieuwe Podcast onderwerpen (episodes) van je geabonneerd kanaal. Eender welk onderwerp kan een bijlage bevatten, net zoals + +email bijlages dan bevatten." + + + + + +_key="help3-0" + +_value="BePodder heeft een makkelijk doch krachtige gebruikersinterface. Het hoofdvenster is opgesplitst in drie panelen:" + + + +_key="help3-1" + +_value="1) Het abonementen venster (het paneel met nummer 1 in de schermafbeelding) met de lijst van podcasts waar je een abbonement op hebt. Als je klikt op een kanaal dan zie je in paneel 2 de ljist van de voorwerpen van het kanaal." + + + +_key="help3-2" + +_value="2) De lijst met voorwerpen die beschikbaar zijn." + + + +_key="help3-3" + +_value="3) Het info paneel toont: info over het object, kanaal info of download info; je kan een info paneel kiezen door het klikken van de drie knoppen vanonder." + + + + + + + +_key="help4-0" + +_value="Heel vanboven in het BePodder hoofdvenster vind je de menubalk met zeven beschikbare menu's: Bestand, Instellingen, Abonementen, Afleveringen, Lijst, Venster en Help. Sommige menu's commando's worden gevolgd door pijlen wat betekend dat er een submenu van gerelateerde commando's is. Als je hierdoor bladerd, kijk dan ook zeker eens in de submenu's. Klik op een menu om het commando te zien:" + + + +_key="help4-1" + +_value="Bestsand: bevat commando's zoals het sluiten van de toepassing of toont het info venster van BePodder" + + + +_key="help4-2" + +_value="Instellingen: bevat commando's voor het openen van het instellingen venster dat je toestaat verschillende instellingen van BePodder aan te passen." + + + +_key="help4-3" + +_value="Abonementen: bevat commando's die bepaalde akties uitvoeren op het geselecteerd kanaal in je abonementenlijst." + + + +_key="help4-4" + +_value="Afleveringen: bevat commando's die bepaalde akties uitvoeren op de geselecteerde objecten in de kanaallijst." + + + +_key="help4-5" + +_value="Lijsten: bevat commando's voor het openen van BePodder's OPML mappen." + + + +_key="help4-6" + +_value="Venster: bevat commando's en controle's voor het BePodder venster." + + + +_key="help4-7" + +_value="Help: bevat commando's zoals het openen van BePodder's 'Handleiding' en de 'Toetscombinaties'." + + + + + + + +_key="help5-0" + + _value="Knop 'Toevoegen': opent het 'toevoegen' venster om een feed url (bv. 'http://www.newpodcast.com/rss.xml' welke je kan vinden op de podcast homepage) toe te voegen; dit kan via een tekst of grafische link zijn zoals 'XML', 'RSS' of 'Podcast Feed' erop." + + + +_key="help5-1" + + _value="Knop 'Verwijder': opent een venster waarin je kan selecteren hoe je het kanaal wil verwijderen: enkel het archief van het kanaal (behouden van downloads) of verwijderen van het hele kanaal van je pc." + + + +_key="help5-2" + + _value="Knop 'Controleer': controleerd het geselecteerde kanaal en werkt de lijst van beschikbare objecten bij in lijst." + + + +_key="help5-3" + + _value="Knop 'Homepage': toont de homepage van het kanaal in je browser. Om je favoriete browser te selecteren open je BePodder's instellingen, via het menu 'Instellingen' > 'Voorkeuren...' en in het instellingsvenster onder 'Bestandstype' selecteer je je favoriete browser." + + + +_key="help5-4" + + _value="Knop 'Afspelen': met deze knop kan je de bijlagen of downloads bekijken of beluisteren. Om je favoriete MediaPlayer te kiezen ga je in het menu naar 'Instellingen' > 'Voorkeuren...' en in het instellingsvenster under 'Bestandstype kies je je favoriete speler." + + + +_key="help5-5" + + _value="Knop 'Download': deze zal het geselecteerd object in de lijst downloaden; je kan info opvragen door het klikken op de derde knop boven het info paneel." + + + +_key="help5-6" + + _value="Knop 'Stop':stopt de download van het bestand of bijlage van het geselecteerd object(aflevering); om verder te gaan met de download dubbelklik op het object (aflevering) of selecteer het object en klik op de 'Download' knop." + + + +_key="help5-7" + + _value="Knop 'Verwijder object': verwijderd het geselecteerd object (hierdoor ook de bijlage)." + + + + + + + +_key="help6-0" + + _value="Beginnen met BePodder is gemakkelijk." + + + +_key="help6-1" + + _value="Aan de linkerkant vind je een lijst van je abonnementen. We hebben al enkele abonnementen toegevoegd voor je, en je kan er altijd toevoegen op twee manieren:" + + + +_key="help6-2" + + _value="1) Handmatig via 'Voeg een podcast toe aan de abonnementen' knop, plak dan de feed url (bv: http://www.newpodcast.com/rss.xml) en klik dan op Toevoegen." + + + +_key="help6-3" + + _value="2) in de menu lijst selecteer 'Map' en dan 'Podcast lijst' of 'Videoblog lijst', kies een podcast en klik op 'Abonneren'." + + + +_key="help6-4" + + _value="Als je een Podcast in de abonnee lijst selecteerd, en dan de 'Controleer' knop klikt zal BePodder de nieuwe onderwerpen in de 'Episode lijst' rechts toevoegen; je kan al je podcast door rechtsklikken controleren door 'Controlleer alle kanalen' in het context menu." + + + +_key="help6-5" + + _value="Bekijk de schermafbeelding hierboven, 3 nieuwe objecten zijn aangegeven door een zwarte dot in de eerste kollom van de lijst van afleveringen." + + + +_key="help6-6" + + _value="In de tweede kollom staan de icoontjes die de status van het object aangeven:" + + + +_key="help6-7" + + _value="- aflevering 4 heeft een icoon wat aangeeft dat er een fout is" + + + +_key="help6-8" + + _value="- aflevering 3 heeft een icoon wat aangeeft dat het object download is aangevraagd (wachtrij)" + + + +_key="help6-9" + + _value="- aflevering 2 heeft een icoon wat aangeeft dat BePodder het bestand aan het downloaden is." + + + +_key="help6-10" + + _value="- aflevering 1 heeft een icoon wat aangeeft dat BePodder het bestand gedownload heeft." + + + + + + + +_key="help7-0" + + _value="Selecteer een onderwerp in de 'Episode lijst' en dubbelklik op het onderwerp of klik op de Download knop; je kan de download stoppen door te klikken op stop." + + + +_key="help7-1" + + _value="Als je klikt op de een van de abonnementen zal de software je alle onderwerpen tonen die beschikbaar zijn voor dat abonnement in de 'Episode lijst'. + +Selecteer een onderwerp en klik op afspelen (Afspelen knop) om het bestand te + +beluisteren of bekijken." + + + +_key="help7-2" + + _value="Je kan de bijlage map bereiken door het klikken op het map icoon in het info veld, + +of door rechtsklikken op het bestand en kiezen voor 'Open bijlage map' + +in het context menu. + +Tot hier de handleiding, met deze info ben je in staat om zelf podcast toe te voegen + +die je vind via het net, en te werken met BePodder. + + + + Veel plezier!!! ;)" + + + + + +_key="help8-0" + + _value="Voorkeuren kan je berijken via de menubalk Instellingen > Voorkeuren. Je kan een categorie selecteren vanuit de lijst van de voorkeuren: Bestandstype, kanalen, Download en Proxy." + + + +_key="help8-1" + + _value="- Bestandstype: voor het vastleggen van je standaard browser en speler." + + + +_key="help8-2" + + _value="- Kanalen: voor het instellen van de controle over de manier waarop kanalen gecontroleerd worden; je kan kiezen om alle kanalen bij het starten van BePodder te kontroleren of om op ingestelde intervallen te gaan controleren." + + + +_key="help8-3" + + _value="- Download: om het maximum aantal gelijktijdige downloads in te stellen." + + + +_key="help8-4" + + _value="- Proxy: voor het instellen van een proxy met BePodder; een proxy dient als veiligheidsbrug tussen jouw netwerk en het internet, zodat anderen op het internet niet aan informatie van je eigen netwerk kunnen benaderen." + + + + + + + +_key="help9-0" + _value=" BePodder heeft een ingebouwde podcast, videoblog, imagefeeds, newsfeeds, bittorrentfeeds en internationalfeeds OPML directories met duizenden feeds gegroepeerd op categorie." + +_key="help9-1" + + _value="OPML (Outline Processor Markup Language) is een XML-gebaseerd formaat dat uitwisseling toestaat van outline-gestructureerde informatie tussen twee toepassingen." + + + +_key="help9-2" + _value="OPML directory kan toegankelijk worden door het klikken in de menu-bar 'Lijsten' en dan door selecteren van een lijst. Om door de mappen van opml te bladeren voor een feed, klap je de lijst uit door het klikken op de pijl van de categorie waarin je interesse hebt (zie afbeelding); door dit te doen kan je elke opml map uitklappen totdat je gevonden hebt wat je zoekt. Eenmaal je deze geselecteerd hebt kan je deze toevoegen door het klikken van 'Abonneren', je kan ook alle categorien uitklappen door het klikken op 'Alles uitklappen'." + + + +_key="help_shortcut1" + +_value="Deze sectie beschrijft de toetscombinaties die kunnen gebruikt worden in BePodder. De toetscombinaties zijn gegroepeerd per functie. " + + + +_key="help_shortcut2" + +_value="betekend dat je ofwel van Alt of Control gebruik kan maken (bv. Alt+Q of Ctrl+Q sluit de toepassing), zoals deze ingesteld zijn in de instellingen voor toetsenbord (de standaard knop is 'Alt')." + + + +_key="help_shortcut3" + + _value="Algemene combinaties" + + + +_key="help_shortcut4" + + _value="Toepassing afsluiten" + + + +_key="help_shortcut5" + + _value="Toon het instellingen venster" + + + +_key="help_shortcut6" + + _value="Toon de Podcast maplijst" + + + +_key="help_shortcut7" + + _value="Toon de Videoblog maplijst" + + + +_key="help_shortcut8" + + _value="Toon de Imagefeeds maplijst" + + + +_key="help_shortcut9" + + _value="Toon de Newsfeeds maplijst" + + + +_key="help_shortcut9b" + + _value="Toon de BitTorrentfeeds maplijst" + + +_key="help_shortcut9c" + + _value="Toon de Internationalfeeds maplijst" + + +_key="help_shortcut10" + + _value="Schermvullend" + + + +_key="help_shortcut11" + + _value="Toon/verberd de werkbalk" + + + +_key="help_shortcut12" + + _value="Toon de handleiding" + + + +_key="help_shortcut13" + + _value="Toon de toetscombinaties" + + + +_key="help_shortcut14" + + _value="Channels shortcuts" + + + +_key="help_shortcut15" + + _value="Podcast toevoegen aan de abonementen" + + + +_key="help_shortcut16" + + _value="Podcast verwijderen van de abonementen" + + + +_key="help_shortcut17" + + _value="Controleer de geselecteerde podcast op nieuwe onderwerp(en)" + + + +_key="help_shortcut18" + + _value="Controleer alle podcast op nieuwe onderwerp(en)" + + + +_key="help_shortcut19" + + _value="Podcast homepage tonen" + + + +_key="help_shortcut20" + + _value="Open map van bijlage" + + + +_key="help_shortcut21" + + _value="Episodes shortcuts" + + + +_key="help_shortcut22" + + _value="Bijlage afspelen" + + + +_key="help_shortcut23" + + _value="(Her)start download het geselecteerde onderwerp" + + + +_key="help_shortcut24" + + _value="Stop de bijlage/onderwerp download" + + + +_key="help_shortcut25" + + _value="Verwijder geselecteerde bijlage(onderwerp)" + + + +_key="help_shortcut26" + + _value="Toon de podcast bijlage(onderwerp) pagina" + + + +_key="help_shortcut27" + + _value="Open map van bijlage" + + + +_key="help_buy1" + _value=" BePodder Light is de basis versie (gratis download en geen tijdslimiet), de geregistreerde versie voegt enkele mooie features toe: ongelimiteerd aantal kanalen, smal kanaal venster, proxy support, automatische kanaalcheck, tot 5 gelijktijdige downloads (multithreading)." + +_key="help_buy2" + + _value="Gelieve deze shareware te registeren, het is enkel 15 Euro (Kagi voegt tax toe in sommige landen), BePodder licentie kan online gekocht worden van Kagi." + + + +_key="help_buy3" + + _value="Koop op www.funkyideasoft.com" + + + +_key="help_buy4" + + _value="Na aankoop krijg je een email met een keyfile (sleutelbestand) en instructies over hoe deze te installeren. Het is enkel een kwestie van deze uit te pakken en te verplaatsen naar een bepaalde map." + + + +_key="help_buy5" + + _value="Er is geen probleem voor het updaten van BePodder als er een nieuwe versie beschikbaar is. Het sleutelbestand zal alle gedownloade pakketen ontsleutelen tenzij anders werd aangegeven." + + + + + +### USELESS ######## + + + +"Opml Editor" "Opml bewerken" + +"name:" "naam:" + +"Add a categorie" "Categorie toevoegen" + +"Add a new Broadcast" "Een nieuwe broadcast toevoegen" + +"feed:" "feed:" + +"url:" "url:" + +"Test podcast" "Test podcast" + +"Del a categorie" "Verwijder een categorie" + +"Add a categorie" "Een categorie toevoegen" + +"Select the podcast categorie:" "Selecteer de podcast categorie:" + +"Check all" "Controleer alles" + +"Check" "Controleer" + +"Refresh the list" "Ververs lijst" + +"Load" "Laad" + +"Load the list" "Laad de lijst" + +"Save" "Opslaan" + +"Save the list" "Opslaan van list" + +"Revert" "Terug" + +"Apply" "Toepassen" + + + + + + + + + + + + + + + + + + + + + + + diff --git a/release/Language/Dictionaries/BePodder.nlNL b/release/Language/Dictionaries/BePodder.nlNL new file mode 100644 index 0000000..1031253 --- /dev/null +++ b/release/Language/Dictionaries/BePodder.nlNL @@ -0,0 +1,1192 @@ + + +# Locale file for BePodder. + +# Modified: 4/18/2006 + +# Author: Begasus + +# E-mail: Begasus@skynet.be + + + + + +# Attention: don't remove empty space or \n + + + + + +### SHAREWARE POPUPS ----------------------------------- + + + +"Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" "Shareware toepassing!\n\nSteun ons aub!\n\nKoop een licentie!\nMeer info op onze website\n" + + + +"This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" "Deze versie van BePodder is verlopen!\nGelieve een keyfile te kopen en ons te ondersteunen.\n" + + + +"Web Site" "Website" + +"Can't connect!" "Geen verbinding!" + +"Http port failed!" "Http poort mislukt!" + +"Can't resolve host!" "Kan host niet vinden!" + +"Not found!" "Niet gevonden!" + +"Bad resume!" "Slecht herstart!" + +"Aborted by Callback!" "Afgebroken door callback!" + +"Can't resume! (range error)" "Kan niet herstarten! (range fout)" + +"Access Denied!" "Toegang verboden!" + +"User or Password Incorrect!" "Gebruiker of paswoord foutief!" + +"Other error (cUrl code: " "Andere fout (cUrl code: " + +"cUrl init error!" "cUrl init fout!" + +"Can't open file!" "Kan bestand niet openen!" + +"Other error (status code: " "Andere fout (status code: " + +"Downloading" "Downloaden" + + + +### MENUBAR ----------------------------------- + + + +"File" "Bestand" + +"About..." "Over..." + +"Close!" "Sluiten!" + +"Quit" "Quit" + + + +"Settings" "Instellingen" + +"Preferences..." "Voorkeuren..." + + + +"Subscriptions" "Abonnementen" + + + +"Episodes" "Afleveringen" + + + +"Lists" "Lijsten" + +"Podcast List" "Podcast Lijst" + +"Podcast directory list" "Podcast maplijst" + +"Videoblog List" "Videoblog Lijst" + +"Videoblog directory list" "Videoblog maplijst" + +"Imagefeeds List" "Imagefeeds List" + +"Imagefeeds directory list" "Imagefeeds maplijst" + +"Newsfeeds List" "Newsfeeds lijst" + +"Newsfeeds directory list" "Newsfeeds maplijst" + +"BitTorrentfeeds List" "BitTorrentfeeds lijst" + +"BitTorrentfeeds directory list" "BitTorrentfeeds maplijst" + +"Internationalfeeds List" "Internationalfeeds lijst" + +"Internationalfeeds directory list" "Internationalfeeds maplijst" + + + +"View" "Venster" + +"Full Screen" "Schermvullend" + +"Toolbar" "Werkbalk" + +"Subscriptions View" "Abonnementen venster" + +"Small Items" "Kleine objecten" + +"Big Items" "Grote objecten" + +"Move BePodder on workspace:" "Verplaats BePodder naar bureaublad:" + + + +"Help" "Help" + +"Getting Started" "Handleiding" + +"Keyboard Shortcuts" "Toetscombinaties" + +"Online Support" "Online ondersteuning" + + + + + + + + + + + +### BUTTONS ----------------------------------- + + + +# Buttons add feed window + +"Insert the rss feed url!" "RSS feed url ingeven!" + +"Add" "Toevoegen" + +"Paste" "Plakken" + + + +# Buttons directory list window + +"Collapse All" "Alles inklappen" + +"Preview" "Voorbeeld" + +"Subscribe" "Abonneren" + + + + + +# Buttons help window + +"Next" "Verder" + +"Prev" "Terug" + +"Close" "Sluiten" + +"Index" "Index" + + + + + +# Buttons remove windows + +"Cancel" "Annuleren" + +"Delete" "Verwijder" + +"Archive" "Archive" + + + + + + + +### TOOLTIPS ----------------------------------- + + + +# Tooltips toolbar buttons + + + +"Add the podcast to the Subscriptions list" "Podcast toevoegen aan de abonementen" + +"Delete the podcast from the Subscriptions list" "Podcast verwijderen van de abonnementen" + +"Check the selected podcast for new items" "Podcast controleren op nieuwe objecten" + +"Show the podcast homepage" "Podcast homepage tonen" + + + +"Delete the item and the enclosure" "Delete the item and the enclosure" + +"Stop the item download" "Stop download van onderwerp" + +"Download the selected episode" "Download de geselecteerde aflevering" + +"Play the selected episode" "Geselecteerde aflevering afspelen" + + + +"Submit bug and idea" "Bug's en ideëen aanbrengen" + + + + + +# Tooltips directory window buttons + + + +"Collapse all categories in the directory list" "Alle categoriëen in de maplijst inklappen" + +"Add the selected podcast to the Subscription list" "Voeg de geselecteerde podcast toe aan de geaboneerde lijst" + +"Checkout a podcast before downloading it" "Controleer een podcast vooraleer toe te voegen" + + + +### INFO PANEL ----------------------------------- + + + +"Show channel Image" "Toon kanaal afbeelding" + +"XML Feed Link" "XML Feed Link" + + + +"Show Episode info" "Toon onderwerpsinfo" + +"Show Subscription info" "Toon abonnementsinfo" + +"Show Downloads info" "Toon downloadsinfo" + + + +"Enclosure: " "Bijlage: " + + + +"Lookup (Dictionary)" "Opzoeken (Dictionary)" + +"Lookup (Google)" "Opzoeken (Google)" + +"Lookup (Acronym Finder)" "Lookup (Acronym Finder)" + +"Copy" "Kopiëer" + +"Select All" "Selecteer alles" + +"Copy URL" "Copy URL" + +"Open URL" "Open URL" + +"Subscription" "Abonement" + + + + + +### PREFERENCES ----------------------------------- + + + +"Preferences" "Voorkeuren" + + + +"Proxy" "Proxy" + +"Enable Proxy" "Proxy inschakelen" + +"Address" "Address" + +"Port" "Poort" + +"Username" "Gebruikersnaam" + +"Password" "Paswoord" + + + +"Max Downloads" "Max Downloads" + + + +"FileType" "Bestandstype" + +"Browser" "Browser" + +"Player" "Speler" + + + +"Channels" "Kanalen" + +"Check all channels on startup" "Controleer alle kanalen bij het starten" + +"Check the channel every" "Controleer alle kanalen elke" + + + +"never" "nooit" + +"5 minutes" "5 minuten" + +"15 minutes" "15 minuten" + +"30 minutes" "30 minuten" + +"1 hour" "1 uur" + +"2 hour" "2 uur" + + + + + + + + + +### COLUMLISTVIEW ----------------------------------- + + + + + +"1 new item" "1 nieuw onderwerp" + +"%d new items" "%d nieuwe onderwerpen" + +"new" "nieuw" + +"error" "fout" + +"not down" "niet binnen" + +"enquequed" "wachtrij" + +"downloading" "downloaden" + +"downloaded" "gedownload" + +"connecting" "verbinden" + +"not found" "niet gevonden" + +"stopped" "gestopt" + +"can't connect" "geen verbinding" + +"invalid format" "ongeldig formaat" + + +"Icon" "Icon" + +"Title" "Titel" + +"Date" "Datum" + +"Size" "Grootte" + +"Status" "Status" + +"Download" "Download" + + + + + + + +### CONTEXT MENU ----------------------------------- + + + +"Add Channel" "Kanaal toevoegen" + +"Remove Channel" "Kanaal verwijderen" + +"Check Channel" "Kanaal controleren" + +"Open Homepage" "Open Homepage" + + + +"Open Web Page" "Open Web Page" + +"Open Enclosures folder" "Open bijlage map" + +"Check All Channels" "Controlleer alle kanalen" + + + +"Show Channel Image" "Toon kanaal afbeelding" + + + +"Play enclosure" "Bijlage afspelen" + +"(Re)start download" "(her)start download" + +"Stop download" "Stop download" + +"Remove Item" "Verwijder object" + + +"Find this Item" "Zoek dit object" + +"Remove from this list" "Verwijder uit de lijst" + + + + + + + + + +### ALERT ----------------------------------- + +"You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" "Je kan enkel tot 10 kanalen toevoegen in deze niet geregistreerde versie.\n Registreer je kopie\n" + + +"Can't open the selected file with:\n\n" "Kan het geselecteerd bestand niet openen met:\n\n" + +"\n\nPlease check if the application is installed in the right way.\n" "\n\nControlleer of de toepassing goed geïnstalleerd is.\n" + +"Download it!" "Download het!" + + + +"\nRemoving.." "\nVerwijren.." + +"\nAn error occured while removing!" "\nFout tijdens het verwijderen!" + +"Check all the podcasts for new items" "Controlleer alle podcasts voor nieuwe onderwerpen" + + + +# multi line text... please translate only the text after _value= and don't remove empty space + + + +_key="alert1" + + _value=" + +Je gaat het geselecteerde onderwerp verwijderen. + + + +Ben je zeker? + +(alle bijlage in de map worden mee verwijderd)" + + + + + +_key="alert2a" + + _value=" + +Je verwijderd het kanaal: + + + +" + + + +_key="alert2b" + + _value=" + + + +Wil je dit kanaal liever archieveren + +(behoud van alle bijlagen en bestanden + +die al gedownload zijn) of wil je het + +volledig kanaal verwijderen van je pc?" + + + +_key="alert3" + + _value=" + +Archief ontleden.." + + +_key="alert_3gp" + _value=" +3GP is een multimedia container formaat gedefiniëerd door Third Generation Partnership Project (3GPP) voor het gebruik op 3G mobiele telefoons. Het slaat video streams op als MPEG-4 of H.263, en audio streams als AMR-NB of AAC-LC. + +VideoLAN ondersteund audio AMR (3GPP) nog niet" + +_key="alert_swf" + _value=" +SWF is een gebonden vector grafisch bestandsformaat geproduceerd door Flash software van Adobe (voormalig Macromedia). + +Huidige ondersteuning in BeOS/Haiku/ZETA is gelimiteerd tot de losstaande Flash speler versie 4.1015, er is tot op heden geen moderne Flash speler" + + + + +### HELP & SHORTCUTS ----------------------------------- + + + + + +"Introduction" "Introductie" + +"The User Interface" "Gebruikersinterface" + +"Menu Bar" "Menubalk" + +"Toolbar Buttons" "Werkbalk" + +"First time with BePodder" "Eerste gebruik van BePodder" + +"Download Podcast's enclosure files" "Download Podcast's bijlagen" + +"Settings Overview" "Instellingen overzicht" + +"Directory lists" "Directory lijsts" + +"Loading Help..." "Help laden..." + +"Register your copy" "Registeer je kopie" + +"Starting point" "Startpunt" + + + + + + + + + +# multi line text... please translate only the text after _value= and don't remove empty space + + + + + +_key="help1-0" + + _value="Welkom bij de BePodder startersgids." + + + +_key="help1-1" + + _value="Als je al bekend bent met podcast en RSS feeds kan je dadelijk naar BePodder gaan door dit venster te sluiten." + + + +_key="help1-2" + +_value="Indien niet, volgt hier een introductie dat je zal verder helpen met alles wat je moet weten om te kunnen starten met BePodder. + +Gebruik de knoppen hieronder om door de handleiding te wandelen." + + + + + +_key="help2-0" + + _value="Podcasting is een methode voor het publiceren van audio en video broadcasts + +via het Internet; links naar gratis audio en video bestanden zijn ingebonden in de + +RSS en Atom feeds." + + + +_key="help2-1" + +_value="Daardoor is Podcasting een type van online media verdeling; gebruikers kunnen + +abonneren op een podcast door een feed te gebruiken + +(zoals RSS 'Really Simple Syndication' of Atom)." + + + +_key="help2-2" + +_value="Een aggregator (of podcatcher) zoals BePodder, is een toepassing die je in staat stelt om op een RSS feed te abonneren en periodiek te controleren op en downloaden van nieuwe onderwerpen. Met BePodder kan je controleren op nieuwe Podcast onderwerpen (episodes) van je geabonneerd kanaal. Eender welk onderwerp kan een bijlage bevatten, net zoals + +email bijlages dan bevatten." + + + + + +_key="help3-0" + +_value="BePodder heeft een makkelijk doch krachtige gebruikersinterface. Het hoofdvenster is opgesplitst in drie panelen:" + + + +_key="help3-1" + +_value="1) Het abonementen venster (het paneel met nummer 1 in de schermafbeelding) met de lijst van podcasts waar je een abbonement op hebt. Als je klikt op een kanaal dan zie je in paneel 2 de ljist van de voorwerpen van het kanaal." + + + +_key="help3-2" + +_value="2) De lijst met voorwerpen die beschikbaar zijn." + + + +_key="help3-3" + +_value="3) Het info paneel toont: info over het object, kanaal info of download info; je kan een info paneel kiezen door het klikken van de drie knoppen vanonder." + + + + + + + +_key="help4-0" + +_value="Heel vanboven in het BePodder hoofdvenster vind je de menubalk met zeven beschikbare menu's: Bestand, Instellingen, Abonementen, Afleveringen, Lijst, Venster en Help. Sommige menu's commando's worden gevolgd door pijlen wat betekend dat er een submenu van gerelateerde commando's is. Als je hierdoor bladerd, kijk dan ook zeker eens in de submenu's. Klik op een menu om het commando te zien:" + + + +_key="help4-1" + +_value="Bestsand: bevat commando's zoals het sluiten van de toepassing of toont het info venster van BePodder" + + + +_key="help4-2" + +_value="Instellingen: bevat commando's voor het openen van het instellingen venster dat je toestaat verschillende instellingen van BePodder aan te passen." + + + +_key="help4-3" + +_value="Abonementen: bevat commando's die bepaalde akties uitvoeren op het geselecteerd kanaal in je abonementenlijst." + + + +_key="help4-4" + +_value="Afleveringen: bevat commando's die bepaalde akties uitvoeren op de geselecteerde objecten in de kanaallijst." + + + +_key="help4-5" + +_value="Lijsten: bevat commando's voor het openen van BePodder's OPML mappen." + + + +_key="help4-6" + +_value="Venster: bevat commando's en controle's voor het BePodder venster." + + + +_key="help4-7" + +_value="Help: bevat commando's zoals het openen van BePodder's 'Handleiding' en de 'Toetscombinaties'." + + + + + + + +_key="help5-0" + + _value="Knop 'Toevoegen': opent het 'toevoegen' venster om een feed url (bv. 'http://www.newpodcast.com/rss.xml' welke je kan vinden op de podcast homepage) toe te voegen; dit kan via een tekst of grafische link zijn zoals 'XML', 'RSS' of 'Podcast Feed' erop." + + + +_key="help5-1" + + _value="Knop 'Verwijder': opent een venster waarin je kan selecteren hoe je het kanaal wil verwijderen: enkel het archief van het kanaal (behouden van downloads) of verwijderen van het hele kanaal van je pc." + + + +_key="help5-2" + + _value="Knop 'Controleer': controleerd het geselecteerde kanaal en werkt de lijst van beschikbare objecten bij in lijst." + + + +_key="help5-3" + + _value="Knop 'Homepage': toont de homepage van het kanaal in je browser. Om je favoriete browser te selecteren open je BePodder's instellingen, via het menu 'Instellingen' > 'Voorkeuren...' en in het instellingsvenster onder 'Bestandstype' selecteer je je favoriete browser." + + + +_key="help5-4" + + _value="Knop 'Afspelen': met deze knop kan je de bijlagen of downloads bekijken of beluisteren. Om je favoriete MediaPlayer te kiezen ga je in het menu naar 'Instellingen' > 'Voorkeuren...' en in het instellingsvenster under 'Bestandstype kies je je favoriete speler." + + + +_key="help5-5" + + _value="Knop 'Download': deze zal het geselecteerd object in de lijst downloaden; je kan info opvragen door het klikken op de derde knop boven het info paneel." + + + +_key="help5-6" + + _value="Knop 'Stop':stopt de download van het bestand of bijlage van het geselecteerd object(aflevering); om verder te gaan met de download dubbelklik op het object (aflevering) of selecteer het object en klik op de 'Download' knop." + + + +_key="help5-7" + + _value="Knop 'Verwijder object': verwijderd het geselecteerd object (hierdoor ook de bijlage)." + + + + + + + +_key="help6-0" + + _value="Beginnen met BePodder is gemakkelijk." + + + +_key="help6-1" + + _value="Aan de linkerkant vind je een lijst van je abonnementen. We hebben al enkele abonnementen toegevoegd voor je, en je kan er altijd toevoegen op twee manieren:" + + + +_key="help6-2" + + _value="1) Handmatig via 'Voeg een podcast toe aan de abonnementen' knop, plak dan de feed url (bv: http://www.newpodcast.com/rss.xml) en klik dan op Toevoegen." + + + +_key="help6-3" + + _value="2) in de menu lijst selecteer 'Map' en dan 'Podcast lijst' of 'Videoblog lijst', kies een podcast en klik op 'Abonneren'." + + + +_key="help6-4" + + _value="Als je een Podcast in de abonnee lijst selecteerd, en dan de 'Controleer' knop klikt zal BePodder de nieuwe onderwerpen in de 'Episode lijst' rechts toevoegen; je kan al je podcast door rechtsklikken controleren door 'Controlleer alle kanalen' in het context menu." + + + +_key="help6-5" + + _value="Bekijk de schermafbeelding hierboven, 3 nieuwe objecten zijn aangegeven door een zwarte dot in de eerste kollom van de lijst van afleveringen." + + + +_key="help6-6" + + _value="In de tweede kollom staan de icoontjes die de status van het object aangeven:" + + + +_key="help6-7" + + _value="- aflevering 4 heeft een icoon wat aangeeft dat er een fout is" + + + +_key="help6-8" + + _value="- aflevering 3 heeft een icoon wat aangeeft dat het object download is aangevraagd (wachtrij)" + + + +_key="help6-9" + + _value="- aflevering 2 heeft een icoon wat aangeeft dat BePodder het bestand aan het downloaden is." + + + +_key="help6-10" + + _value="- aflevering 1 heeft een icoon wat aangeeft dat BePodder het bestand gedownload heeft." + + + + + + + +_key="help7-0" + + _value="Selecteer een onderwerp in de 'Episode lijst' en dubbelklik op het onderwerp of klik op de Download knop; je kan de download stoppen door te klikken op stop." + + + +_key="help7-1" + + _value="Als je klikt op de een van de abonnementen zal de software je alle onderwerpen tonen die beschikbaar zijn voor dat abonnement in de 'Episode lijst'. + +Selecteer een onderwerp en klik op afspelen (Afspelen knop) om het bestand te + +beluisteren of bekijken." + + + +_key="help7-2" + + _value="Je kan de bijlage map bereiken door het klikken op het map icoon in het info veld, + +of door rechtsklikken op het bestand en kiezen voor 'Open bijlage map' + +in het context menu. + +Tot hier de handleiding, met deze info ben je in staat om zelf podcast toe te voegen + +die je vind via het net, en te werken met BePodder. + + + + Veel plezier!!! ;)" + + + + + +_key="help8-0" + + _value="Voorkeuren kan je berijken via de menubalk Instellingen > Voorkeuren. Je kan een categorie selecteren vanuit de lijst van de voorkeuren: Bestandstype, kanalen, Download en Proxy." + + + +_key="help8-1" + + _value="- Bestandstype: voor het vastleggen van je standaard browser en speler." + + + +_key="help8-2" + + _value="- Kanalen: voor het instellen van de controle over de manier waarop kanalen gecontroleerd worden; je kan kiezen om alle kanalen bij het starten van BePodder te kontroleren of om op ingestelde intervallen te gaan controleren." + + + +_key="help8-3" + + _value="- Download: om het maximum aantal gelijktijdige downloads in te stellen." + + + +_key="help8-4" + + _value="- Proxy: voor het instellen van een proxy met BePodder; een proxy dient als veiligheidsbrug tussen jouw netwerk en het internet, zodat anderen op het internet niet aan informatie van je eigen netwerk kunnen benaderen." + + + + + + + +_key="help9-0" + _value=" BePodder heeft een ingebouwde podcast, videoblog, imagefeeds, newsfeeds, bittorrentfeeds en internationalfeeds OPML directories met duizenden feeds gegroepeerd op categorie." + +_key="help9-1" + + _value="OPML (Outline Processor Markup Language) is een XML-gebaseerd formaat dat uitwisseling toestaat van outline-gestructureerde informatie tussen twee toepassingen." + + + +_key="help9-2" + _value="OPML directory kan toegankelijk worden door het klikken in de menu-bar 'Lijsten' en dan door selecteren van een lijst. Om door de mappen van opml te bladeren voor een feed, klap je de lijst uit door het klikken op de pijl van de categorie waarin je interesse hebt (zie afbeelding); door dit te doen kan je elke opml map uitklappen totdat je gevonden hebt wat je zoekt. Eenmaal je deze geselecteerd hebt kan je deze toevoegen door het klikken van 'Abonneren', je kan ook alle categorien uitklappen door het klikken op 'Alles uitklappen'." + + + +_key="help_shortcut1" + +_value="Deze sectie beschrijft de toetscombinaties die kunnen gebruikt worden in BePodder. De toetscombinaties zijn gegroepeerd per functie. " + + + +_key="help_shortcut2" + +_value="betekend dat je ofwel van Alt of Control gebruik kan maken (bv. Alt+Q of Ctrl+Q sluit de toepassing), zoals deze ingesteld zijn in de instellingen voor toetsenbord (de standaard knop is 'Alt')." + + + +_key="help_shortcut3" + + _value="Algemene combinaties" + + + +_key="help_shortcut4" + + _value="Toepassing afsluiten" + + + +_key="help_shortcut5" + + _value="Toon het instellingen venster" + + + +_key="help_shortcut6" + + _value="Toon de Podcast maplijst" + + + +_key="help_shortcut7" + + _value="Toon de Videoblog maplijst" + + + +_key="help_shortcut8" + + _value="Toon de Imagefeeds maplijst" + + + +_key="help_shortcut9" + + _value="Toon de Newsfeeds maplijst" + + + +_key="help_shortcut9b" + + _value="Toon de BitTorrentfeeds maplijst" + + +_key="help_shortcut9c" + + _value="Toon de Internationalfeeds maplijst" + + +_key="help_shortcut10" + + _value="Schermvullend" + + + +_key="help_shortcut11" + + _value="Toon/verberd de werkbalk" + + + +_key="help_shortcut12" + + _value="Toon de handleiding" + + + +_key="help_shortcut13" + + _value="Toon de toetscombinaties" + + + +_key="help_shortcut14" + + _value="Channels shortcuts" + + + +_key="help_shortcut15" + + _value="Podcast toevoegen aan de abonementen" + + + +_key="help_shortcut16" + + _value="Podcast verwijderen van de abonementen" + + + +_key="help_shortcut17" + + _value="Controleer de geselecteerde podcast op nieuwe onderwerp(en)" + + + +_key="help_shortcut18" + + _value="Controleer alle podcast op nieuwe onderwerp(en)" + + + +_key="help_shortcut19" + + _value="Podcast homepage tonen" + + + +_key="help_shortcut20" + + _value="Open map van bijlage" + + + +_key="help_shortcut21" + + _value="Episodes shortcuts" + + + +_key="help_shortcut22" + + _value="Bijlage afspelen" + + + +_key="help_shortcut23" + + _value="(Her)start download het geselecteerde onderwerp" + + + +_key="help_shortcut24" + + _value="Stop de bijlage/onderwerp download" + + + +_key="help_shortcut25" + + _value="Verwijder geselecteerde bijlage(onderwerp)" + + + +_key="help_shortcut26" + + _value="Toon de podcast bijlage(onderwerp) pagina" + + + +_key="help_shortcut27" + + _value="Open map van bijlage" + + + +_key="help_buy1" + _value=" BePodder Light is de basis versie (gratis download en geen tijdslimiet), de geregistreerde versie voegt enkele mooie features toe: ongelimiteerd aantal kanalen, smal kanaal venster, proxy support, automatische kanaalcheck, tot 5 gelijktijdige downloads (multithreading)." + +_key="help_buy2" + + _value="Gelieve deze shareware te registeren, het is enkel 15 Euro (Kagi voegt tax toe in sommige landen), BePodder licentie kan online gekocht worden van Kagi." + + + +_key="help_buy3" + + _value="Koop op www.funkyideasoft.com" + + + +_key="help_buy4" + + _value="Na aankoop krijg je een email met een keyfile (sleutelbestand) en instructies over hoe deze te installeren. Het is enkel een kwestie van deze uit te pakken en te verplaatsen naar een bepaalde map." + + + +_key="help_buy5" + + _value="Er is geen probleem voor het updaten van BePodder als er een nieuwe versie beschikbaar is. Het sleutelbestand zal alle gedownloade pakketen ontsleutelen tenzij anders werd aangegeven." + + + + + +### USELESS ######## + + + +"Opml Editor" "Opml bewerken" + +"name:" "naam:" + +"Add a categorie" "Categorie toevoegen" + +"Add a new Broadcast" "Een nieuwe broadcast toevoegen" + +"feed:" "feed:" + +"url:" "url:" + +"Test podcast" "Test podcast" + +"Del a categorie" "Verwijder een categorie" + +"Add a categorie" "Een categorie toevoegen" + +"Select the podcast categorie:" "Selecteer de podcast categorie:" + +"Check all" "Controleer alles" + +"Check" "Controleer" + +"Refresh the list" "Ververs lijst" + +"Load" "Laad" + +"Load the list" "Laad de lijst" + +"Save" "Opslaan" + +"Save the list" "Opslaan van list" + +"Revert" "Terug" + +"Apply" "Toepassen" + + + + + + + + + + + + + + + + + + + + + + + diff --git a/release/Language/Dictionaries/BePodder.noNO b/release/Language/Dictionaries/BePodder.noNO new file mode 100644 index 0000000..f2b3b96 --- /dev/null +++ b/release/Language/Dictionaries/BePodder.noNO @@ -0,0 +1,598 @@ + +# Locale file for BePodder. +# Modified: 4/18/2006 +# Author: Frank Paul Silye +# E-mail: frankps@gmail.com + + +# Attention: don't remove empty space or \n + + +### SHAREWARE POPUPS ----------------------------------- + +"Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" "Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" + +"This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" "This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" + +"Web Site" "Web Site" + +"Can't connect!" "Can't connect!" +"Http port failed!" "Http port failed!" +"Can't resolve host!" "Can't resolve host!" +"Not found!" "Not found!" +"Bad resume!" "Bad resume!" +"Aborted by Callback!" "Aborted by Callback!" +"Can't resume! (range error)" "Can't resume! (range error)" +"Access Denied!" "Access Denied!" +"User or Password Incorrect!" "User or Password Incorrect!" +"Other error (cUrl code: " "Other error (cUrl code: " +"cUrl init error!" "cUrl init error!" +"Can't open file!" "Can't open file!" +"Other error (status code: " "Other error (status code: " +"Downloading" "Downloading" + + +### MENUBAR ----------------------------------- + +"File" "Fil" +"About..." "Om..." +"Close!" "Lukk" +"Quit" "Quit" + +"Settings" "Instillinger" +"Preferences..." "Innstillinger..." + +"Subscriptions" "Abonneringer" + +"Episodes" "Episoder" + +"Lists" "Lists" +"Podcast List" "Podcast liste" +"Podcast directory list" "Podcast mappe liste" +"Videoblog List" "Videoblog liste" +"Videoblog directory list" "Videoblog mappe liste" +"Imagefeeds List" "Bildefeeds liste" +"Imagefeeds directory list" "Bildefeeds katalog liste" +"Newsfeeds List" "Nyhetfeeds liste" +"Newsfeeds directory list" "Nyhetfeeds katalog liste" +"BitTorrentfeeds List" "BitTorrentfeeds Liste" +"BitTorrentfeeds directory list" "BitTorrentfeeds katalog liste" +"Internationalfeeds List" "Internationalfeeds liste" +"Internationalfeeds directory list" "Internationalfeeds katalog liste" + +"View" "Vis" +"Full Screen" "Fullskjerm" +"Toolbar" "Verktøylinje" +"Subscriptions View" "Abonneringsvisning" +"Small Items" "Små objekter" +"Big Items" "Store objekter" +"Move BePodder on workspace:" "Flytt BePodder til skrivebord:" + +"Help" "Hjelp" +"Getting Started" "Komme i gang" +"Keyboard Shortcuts" "Tastatur snarveier" +"Tutorials" "Tutorials" +"Online Support" "Online Support" + + + + +### BUTTONS ----------------------------------- + +# Buttons add feed window +"Insert the rss feed url!" "Sett inn RSS kildens url!" +"Add" "Legg til" +"Paste" "Lim inn" + +# Buttons directory list window +"Collapse All" "Collapse All" +"Preview" "Forhåndsvis" +"Subscribe" "Abonner" + + +# Buttons help window +"Next" "Neste" +"Prev" "Forrige" +"Close" "Lukk" +"Index" "Index" + + +# Buttons remove windows +"Cancel" "Avbryt" +"Delete" "Slett" +"Archive" "Arkiv" + + + +### TOOLTIPS ----------------------------------- + +# Tooltips toolbar buttons + +"Add the podcast to the Subscriptions list" "Legg til podcasten til abonneringslisten" +"Delete the podcast from the Subscriptions list" "Slett podcasten fra abonneringslisten" +"Check the selected podcast for new items" "Sjekk valgte podcast for nye publikasjoner" +"Show the podcast homepage" "Vis hjemmeside for podcast" + +"Delete the item and the enclosure" "Delete the item and the enclosure" +"Stop the item download" "Stopp nedlasting av publikasjon" +"Download the selected episode" "Last ned valgte episode" +"Play the selected episode" "Spill valgte episode" + +"Submit bug and idea" "Fortell oss om ideer og feil" + + +# Tooltips directory window buttons + +"Collapse all categories in the directory list" "Collapse all categories in the directory list" +"Add the selected podcast to the Subscription list" "Legg til valgte podcast til abonneringsliste" +"Checkout a podcast before downloading it" "Sjekk ut en podcast før du laster den ned" + +### INFO PANEL ----------------------------------- + +"Show channel Image" "Vis kanal bilde" +"XML Feed Link" "XML feed lenke" + +"Show Episode info" "Vis episode info" +"Show Subscription info" "Vis abonnement info" +"Show Downloads info" "Vis nedlastinger info" + +"Enclosure: " "Vedlegg: " + +"Lookup (Dictionary)" "Oppslag (Dictionary)" +"Lookup (Google)" "Oppslag (Google)" +"Lookup (Acronym Finder)" "Oppslag (Acronym Finder)" +"Copy" "Kopier" +"Select All" "Velg alt" +"Copy URL" "Kopier URL" +"Open URL" "Åpne URL" +"Subscription" "Abonnement" + + +### PREFERENCES ----------------------------------- + +"Preferences" "Innstillinger" + +"Proxy" "Proxy" +"Enable Proxy" "Aktiver Proxy" +"Address" "Adresse" +"Port" "Port" +"Username" "Brukernavn" +"Password" "Passord" + +"Max Downloads" "Maks ant. nedlastinger" + +"FileType" "Filtype" +"Browser" "Nettleser:" +"Player" "Avspiller:" + +"Channels" "Kanaler" +"Check all channels on startup" "Sjekk alle kanaler ved oppstart" +"Check the channel every" "Sjekk kanalen hver" + +"never" "aldri" +"5 minutes" "5 minutter" +"15 minutes" "15 minutter" +"30 minutes" "30 minutter" +"1 hour" "1 time" +"2 hour" "2 timer" + + + + +### COLUMLISTVIEW ----------------------------------- + + +"1 new item" "1 ny publisering " +"%d new items" "nye publiseringer " +"new" "ny" +"error" "feil" +"not down" "ikke lastet ned" +"enquequed" "lagt i kø" +"downloading" "laster ned" +"downloaded" "nedlastet" +"connecting" "kobler til" +"not found" "ikke funnet" +"stopped" "stoppet" +"can't connect" "kan ikke koble til" +"invalid format" "ugyldig format" + +"Icon" "Icon" +"Title" "Tittel" +"Date" "Dato" +"Size" "Størrelse" +"Status" "Status" +"Download" "Last ned" + + + +### CONTEXT MENU ----------------------------------- + +"Add Channel" "Legg til kanal" +"Remove Channel" "Fjern kanal" +"Check Channel" "Sjekk kanal" +"Open Homepage" "Åpne hjemmeside" + +"Open Web Page" "Åpne webside" +"Open Enclosures folder" "Åpne vedleggsmappe" +"Check All Channels" "Sjekk alle kanaler" + +"Show Channel Image" "Vis kanal bilde" + +"Play enclosure" "Avspill vedlegg" +"(Re)start download" "(Re)start nedlasting" +"Stop download" "Stopp nedlasting" +"Remove Item" "Fjern publisering" + +"Find this Item" "Find this Item" +"Remove from this list" "Remove from this list" + + + +### ALERT ----------------------------------- + +"You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" "You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" + + +"Can't open the selected file with:\n\n" "Can't open the selected file with:\n\n" +"\n\nPlease check if the application is installed in the right way.\n" "\n\nPlease check if the application is installed in the right way.\n" +"Download it!" "Download it!" + + +"\nRemoving.." "\nFjerner.." +"\nAn error occured while removing!" "\nEn feil oppstod ved fjerning!" +"Check all the podcasts for new items" "Sjekk alle podcaster for nye publikasjoner" + +# multi line text... please translate only the text after _value= and don't remove empty space + +_key="alert1" + _value=" +Du er i ferd med å fjerne valgte publisering. + +Er du sikker på at du ønsker dette? +(du vil miste vedlagt fil om noens)" + + +_key="alert2a" + _value=" +Du er i ferd med å fjerne kanalen: + +" + +_key="alert2b" + _value=" + +Ønsker du bare å arkivere denne kanalen (beholde alle publikasjoner og vedlegg lastet ned til nå) eller ønsker du å SLETTE hele kanalen fra din datamaskin?" + +_key="alert3" + _value=" +Parser arkiv.." + +_key="alert_3gp" + _value=" +3GP is a multimedia container format defined by the Third Generation Partnership Project (3GPP) for use on 3G mobile phones. It stores video streams as MPEG-4 or H.263, and audio streams as AMR-NB or AAC-LC. + +VideoLAN still doesn't support the audio AMR (3GPP)" + +_key="alert_swf" + _value=" +SWF is a proprietary vector graphics file format produced by the Flash software from Adobe (formerly Macromedia). + +Currently Flash support in BeOS/Haiku/Zeta is limited to the old standalone Flash player version 4.1015, there isn't a modern Flash player" + + +### HELP & SHORTCUTS ----------------------------------- + + +"Introduction" "Introduction" +"The User Interface" "The User Interface" +"Menu Bar" "Menu Bar" +"Toolbar Buttons" "Toolbar Buttons" +"First time with BePodder" "Første gang med BePodder" +"Download Podcast's enclosure files" "Download Podcast's enclosure files" +"Settings Overview" "Settings Overview" +"Directory lists" "Directory lists" +"Loading Help..." "Loading Help..." +"Register your copy" "Register your copy" +"Starting point" "Starting point" + + + + +# multi line text... please translate only the text after _value= and don't remove empty space + + +_key="help1-0" + _value="Velkommen til BePodder komme i gang manual" + +_key="help1-1" + _value="Dersom du allerede er kjent med podcast og RSS kilder kan du gå til BePodder ved å lukke dette vinduet." + +_key="help1-2" +_value="Dersom ikke, er dette en kort introduksjon som vil gi deg alt du trenger å vite om hvordan du kan komme i gang med BePodder, bruk knappene på bunnen for å gå gjennom denne manualen." + + + +_key="help2-0" + _value="Podcasting er en metode for å publisere audio og video kringkastinger over Internet; lenker til gratis audio og video filer er vedlagt i RSS og Atom kilder." + +_key="help2-1" +_value="Podcasting er derfor simpelten en type nettbasert levering av media; brukere kan abonnere på en podcast ved å bruke en kilde (som RSS 'Really Simple Syndication' eller Atom)." + +_key="help2-2" +_value="En aggregator (eller podcatcher) som BePodder, er et program som lar deg abonnere på en RSS kilde og periodisk sjekke etter og laste ned nytt innhold. Med BePodder kan du sjekke etter nye Podcast publikasjoner (episoder) på de kanalene du abonnerer på. En hver publikasjon kan inneholde et vedlegg, akkurat som en e-post kan inneholde et vedlegg." + + +_key="help3-0" +_value="BePodder has an easy to use yet powerful Graphical User Interface. The main window is split into tree panels:" + +_key="help3-1" +_value="1) The Subscription list (the panel with the number 1 in the screenshot) with the list of the podcasts that you have subscribed to. When you click on a Channel you can see in the panel 2 the list of the channel's items." + +_key="help3-2" +_value="2) The Episodes list with all the items available." + +_key="help3-3" +_value="3) The Info panel show: episode info, channel info or Downloads info; you can select an info panel by clicking one of the below three buttons." + + + +_key="help4-0" +_value="At the very top of the BePodder main window is the menubar with seven menus available: File, Settings, Subscriptions, Episodes, Lists, View and Help. Some menu commands are followed by a right pointing arrow that indicates a submenu of related commands. As you explore each menu, be sure to take a look at the submenus as well. Click on a menus to show its commands:" + +_key="help4-1" +_value="File: contains commands to close the application and to show information about BePodder" + +_key="help4-2" +_value="Settings: contains command to open the Preferences window that allows you to customize various BePodder settings." + +_key="help4-3" +_value="Subscriptions: contains commands that perform actions on the selected channel of your subscriptions list." + +_key="help4-4" +_value="Episodes: contains commands that perform actions on the selected item (episode) of the channel's episode list." + +_key="help4-5" +_value="Lists: contains commands to open BePodder's OPML directories." + +_key="help4-6" +_value="View: contains commands and controls for the BePodder window." + +_key="help4-7" +_value="Help: contains commands to open BePodder's 'Getting Started Guide' and the 'Keyboard Shortcuts List'." + + + +_key="help5-0" + _value="Add Button: opens the Add Window to add a feed url (e.g. http://www.newpodcast.com/rss.xml) usually given on the podcast homepage; looks for text or graphic link that says something like 'XML', 'RSS' or 'Podcast Feed' on it." + +_key="help5-1" + _value="Channel Remove Button: opens a window in which you can select how remove the channel: just archive the select channel (keeping all the files and eclosure downloaded so far) or delete the whole channel from your computer." + +_key="help5-2" + _value="Check Button: checks the selected channel and updates the list of the available items for that podcast adding the new items." + +_key="help5-3" + _value="Web Button: shows the channel homepage in the browser. To select your favorite browser open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select your favorite browser." + +_key="help5-4" + _value="Play Button: with this button you can view or listen the file enclosure of the selected item(episode). To select your favorite player open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select you favorite player." + +_key="help5-5" + _value="Download Button: downloads the file enclosure of the selected item (episode); you can see the download info by clicking on the third button over the info panel." + +_key="help5-6" + _value="Stop Button: stops to download the file enclosure of the selected item (episode); to resume the download double-click the item (episode) or select the item and click the Download Button" + +_key="help5-7" + _value="Item Remove Button: deletes the selected item (you will loose the enclosure file)." + + + +_key="help6-0" + _value="Getting started with BePodder is easy." + +_key="help6-1" + _value="On the left of the main window you can see the 'Subscription List' with all your feed subscriptions. We have added some subscriptions for you, and you can always add your own in two ways:" + +_key="help6-2" + _value="1) click the Add Button, then insert the feed url (example: http://www.newpodcast.com/rss.xml) and click add." + +_key="help6-3" + _value="2) in the menubar select 'Directory' and then 'Podcast list' or another list, choose a podcast and click 'Subscribe'." + +_key="help6-4" + _value="If you select a Podcast in the subscriptions list and use the check button, BePodder adds the new items to the 'Episodes list' (below on the right); you can check all your podcasts by right-clicking and selecting 'Check All Channels' in the context menu." + +_key="help6-5" + _value="Look at the screenshot above, there are 3 new items indicated by a black dot in the first column of the 'Episodes list'." + +_key="help6-6" + _value="In the second column there are icons that indicate the state of the item:" + +_key="help6-7" + _value="- the Episode 4 has an icon that indicates an error" + +_key="help6-8" + _value="- the Episode 3 has an icon that indicates that the item's enclosure download request is enquequed" + +_key="help6-9" + _value="- the Episode 2 has an icon that indicates that BePodder is downloading the item's enclosure file" + +_key="help6-10" + _value="- the Episode 1 has an icon that indicates that BePodder have just downloaded the item's enclosure file" + + + +_key="help7-0" + _value="Select an item in the 'Episodes list' and then double-click on it (or click the Download Button) to start downloading the enclosed file; you can always stop the download by clicking on the Stop Button." + +_key="help7-1" + _value="When you click on the Subscribed Podcasts in the 'Subscriptions List' the software shows you, in the 'List of episodes', all the items available in that Subscription. Select an item and then click play (Play Button) to view or listen to the file." + +_key="help7-2" + _value="You can access the Enclosures Folder by clicking on the folder icon in the Info Pannel or by right-clicking your mouse on an item and select 'Open Enclosures Folder' in the context menu." + + + +_key="help8-0" + _value="Preferences can be accessed by clicking in the menu-bar Settings>Preferences. You can select a category from the left list of the preferences dialog: FileType, Channels, Download and Proxy." + +_key="help8-1" + _value="- FileType: to specify the default browser and player. " + +_key="help8-2" + _value="- Channels: to specify preferences that control the operation to check channels new items; you can choose to Check all channels on startup or check the channel every desired minutes." + +_key="help8-3" + _value="- Download: to specify the max number of item's files to download at the same time," + +_key="help8-4" + _value="- Proxy: to set up a proxy server to work with BePodder; a proxy server acts as a security barrier between your internal network and the Internet, keeping others on the Internet from accessing information on your internal network." + + + +_key="help9-0" + _value="BePodder has built-in podcast, videoblog, imagefeeds, newsfeeds, bittorrentfeeds and internationalfeeds OPML directories with thousands of feeds grouped by category." + +_key="help9-1" + _value="OPML (Outline Processor Markup Language) is an XML-based format that allows exchange of outline-structured information between applications." + +_key="help9-2" + _value="OPML directory can be accessed by clicking in the menu-bar 'Lists' and thenselecting a list. To browse the opml directory for a feed, expand the list by clicking the arrow of the category that you are interested in (see image); using this method, you can expand the opml directory until you find the desired feed. Once you have selected it, you can add it to the subscription list by clicking the button 'Subscribe', you can also collapse all categories in the directory list by clicking the button 'Collapse All'." + +_key="help_shortcut1" +_value="Denne siden beskriver tastatur hurtigtilganger som kan brukes i BePodder. Hurtigtilgangene er blitt gruppert etter funksjonalitet." + +_key="help_shortcut2" +_value="means that you can use either alt or control (es. Alt+Q or Ctrl+Q Quit the application), which way you have set it in the Deskbar menu preferences under Keyboard (the default shortcut key is Alt)." + +_key="help_shortcut3" + _value="Generelle hurtigtilganger" + +_key="help_shortcut4" + _value="Avslutt applikasjonen" + +_key="help_shortcut5" + _value="Viser Innstillinger vinduet" + +_key="help_shortcut6" + _value="Viser Podcast katalog liste" + +_key="help_shortcut7" + _value="Viser Videoblog katalog liste" + +_key="help_shortcut8" + _value="Viser Bildefeeds katalog liste" + +_key="help_shortcut9" + _value="Viser Nyhetfeeds katalog liste" + +_key="help_shortcut9b" + _value="Viser BitTorrentfeeds katalog liste" + +_key="help_shortcut9c" + _value="Viser Internationalfeeds katalog liste" + +_key="help_shortcut10" + _value="Fullskjerm" + +_key="help_shortcut11" + _value="Viser/Skjuler verktøylinje" + +_key="help_shortcut12" + _value="Viser Hjelp til å komme i gang" + +_key="help_shortcut13" + _value="Viser this tastatur hurtigtilganger side" + +_key="help_shortcut14" + _value="Kanaler hurtigtilganger" + +_key="help_shortcut15" + _value="Add a podcast to the subscriptions list" + +_key="help_shortcut16" + _value="Delete the selected podcast from the subscriptions list" + +_key="help_shortcut17" + _value="Check the selected podcast for new episodes (items)" + +_key="help_shortcut18" + _value="Check all podcasts for new episodes (items)" + +_key="help_shortcut19" + _value="Viser the podcast homepage" + +_key="help_shortcut20" + _value="Open enclosures folder" + +_key="help_shortcut21" + _value="Episoder hurtigtilganger" + +_key="help_shortcut22" + _value="Spill av vedlegg" + +_key="help_shortcut23" + _value="(Re)start nedlasting av valgte episoder (objekter) " + +_key="help_shortcut24" + _value="Stopp nedlastingen av episode (objekt)" + +_key="help_shortcut25" + _value="Slett valgte episode (objekt)" + +_key="help_shortcut26" + _value="Viser the podcast episode (objekt) side" + +_key="help_shortcut27" + _value=" Åpner vedleggsmappe" + +_key="help_buy1" + _value="BePodder Light is the basic version (free download and no time limited), the registered version adds some more nice features: unlimited number of channels, small Channel view, proxy support, automatic channels check, up to 5 enclosure downloads at the same time (multithreading)." + +_key="help_buy2" + _value="Please pay the shareware fee, it's only 15 euro (Kagi add tax in some countries), BePodder licence can be purchased online from Kagi." + +_key="help_buy3" + _value="Buy at www.funkyideasoft.com" + +_key="help_buy4" + _value="After purchasing, an email will be sent to you with a keyfile and instruction on how to install it. It's just a matter of unzipping a file and moving it to a certain directory." + +_key="help_buy5" + _value="There is no problem updating BePodder when a new version becomes available. The keyfile will unlock all downloadable packages unless otherwise notified." + + +### USELESS ######## + +"Opml Editor" "Rediger Opml" +"name:" "navn:" +"Add a categorie" "Legg til kategori" +"Add a new Broadcast" "Legg til ny kringkasting" +"feed:" "kilde:" +"url:" "url:" +"Test podcast" "Test podcast" +"Del a categorie" "Slett en kategori" +"Add a categorie" "Legg til en kategori" +"Select the podcast categorie:" "Velg podcast kategorien:" +"Check all" "Velg alle" +"Check" "Velg" +"Refresh the list" "Oppdater listen" +"Load" "Hent" +"Load the list" "Hent listen" +"Save" "Lagre" +"Save the list" "Lagre listen" +"Revert" "Revert" +"Apply" "Apply" + + + + + + + + + + + + diff --git a/release/Language/Dictionaries/BePodder.plPL b/release/Language/Dictionaries/BePodder.plPL new file mode 100644 index 0000000..736445a --- /dev/null +++ b/release/Language/Dictionaries/BePodder.plPL @@ -0,0 +1,599 @@ + +# Locale file for BePodder. +# Modified: 4/18/2006 +# Author: BePodderTeam +# E-mail: bepodder.team@gmail.com + + +# Attention: don't remove empty space or \n + + +### SHAREWARE POPUPS ----------------------------------- + +"Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" "Aplikacja shareware!\n\nWspieraj rozwój tego programu!\n\nKup licencję!\nWięcej informacji na naszej stronie\n" + +"This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" "Okres darmowego użytkowania programu dobiegł końca!\nKup klucz licencyjny i wesprzyj rozwój aplikacji.\n" + +"Web Site" "Strona www" + +"Can't connect!" "Brak połączenia!" +"Http port failed!" "Błąd portu Http!" +"Can't resolve host!" "Host nieznaleziony!" +"Not found!" "Nie znaleziono!" +"Bad resume!" "Niepoprawne wznowienie!" +"Aborted by Callback!" "Przerwane!" +"Can't resume! (range error)" "Nie można ponowić! (błąd zasięgu)" +"Access Denied!" "Dostęp zabroniony!" +"User or Password Incorrect!" "Hasło użytkownika niepoprawne!" +"Other error (cUrl code: " "Inny błąd (cUrl code: " +"cUrl init error!" "cUrl init error!" +"Can't open file!" "Nie można otworzyć pliku!" +"Other error (status code: " "Inny błąd (status code: " +"Downloading" "Pobieranie" + + +### MENUBAR ----------------------------------- + +"File" "Plik" +"About..." "O programie..." +"Close!" "Zamknij!" +"Quit" "Wyjdź" + +"Settings" "Ustawienia" +"Preferences..." "Preferencje..." + +"Subscriptions" "Subscrypcje" + +"Episodes" "Epizody" + +"Lists" "Listy" +"Podcast List" "Listy podcastów" +"Podcast directory list" "Katalog list podcastów" +"Videoblog List" "Listy wideoblogów" +"Videoblog directory list" "Katalog list wideoblegów" +"Imagefeeds List" "Lista obrazków" +"Imagefeeds directory list" "Katalog list obrazków" +"Newsfeeds List" "Lista newsów" +"Newsfeeds directory list" "Katalog list newsów" +"BitTorrentfeeds List" "Lista BitTorrentów" +"BitTorrentfeeds directory list" "Katalog list BitTorrentów" +"Internationalfeeds List" "Lista międzynarodowa" +"Internationalfeeds directory list" "Katalog list międzynarodowych" + +"View" "Widok" +"Full Screen" "Pełny ekran" +"Toolbar" "Toolbar" +"Subscriptions View" "Widok subskrypcji" +"Small Items" "Małe ikonki" +"Big Items" "Duże ikonki" +"Move BePodder on workspace:" "Przesuń BePoddera do pulpitu:" + +"Help" "Pomoc" +"Getting Started" "Dla początkujących" +"Keyboard Shortcuts" "Skróty klawiaturowe" +"Tutorials" "Poradniki" +"Online Support" "Wsparcie online" + + + + +### BUTTONS ----------------------------------- + +# Buttons add feed window +"Insert the rss feed url!" "Podaj adres url kanału rss!" +"Add" "Dodaj" +"Paste" "Wklej" + +# Buttons directory list window +"Collapse All" "Zwiń wszystko" +"Preview" "Podgląd" +"Subscribe" "Subskrybuj" + + +# Buttons help window +"Next" "Następny" +"Prev" "Poprzedni" +"Close" "Zamknij" +"Index" "Indeks" + + +# Buttons remove windows +"Cancel" "Zaniechaj" +"Delete" "Usuń" +"Archive" "Archiwum" + + + +### TOOLTIPS ----------------------------------- + +# Tooltips toolbar buttons + +"Add the podcast to the Subscriptions list" "Dodaj podcast listy subskrypcji" +"Delete the podcast from the Subscriptions list" "Usuń podcast z listy subskrypcji" +"Check the selected podcast for new items" "Sprawdź czy są nowe elementy w wybranym podcaście" +"Show the podcast homepage" "Przejdź do strony domowej podcastu" + +"Delete the item and the enclosure" "Skasuj wraz z załącznikiem" +"Stop the item download" "Zatrzymaj pobieranie" +"Download the selected episode" "Pobierz wybrany epizod" +"Play the selected episode" "Odtwórz zaznaczony epizod" + +"Submit bug and idea" "Zgłoś pomysł lub błąd" + + +# Tooltips directory window buttons + +"Collapse all categories in the directory list" "Zwiń wszystkie kategorie w katalogu" +"Add the selected podcast to the Subscription list" "Dodaj wybrany podcast do listy subskrypcji" +"Checkout a podcast before downloading it" "Sprawdź podcast przed pobieraniem go" + + +### INFO PANEL ----------------------------------- + +"Show channel Image" "Pokazuj obrazek kanału" +"XML Feed Link" "Link kanału XML" + +"Show Episode info" "Pokaż informacje o epizodzie" +"Show Subscription info" "Pokaż informacje o subskrypcji" +"Show Downloads info" "Pokaż informacje o elementach pobranych" + +"Enclosure: " "Załącznik: " + +"Lookup (Dictionary)" "Zablokuj (Słownik)" +"Lookup (Google)" "Zablokuj (Google)" +"Lookup (Acronym Finder)" "Zablokuj (Poszukiwacz Akronimów)" +"Copy" "Kopiuj" +"Select All" "Zaznacz wszystko" +"Copy URL" "Kopiuj URL" +"Open URL" "Otwórz URL" +"Subscription" "Subscrypcja" + + +### PREFERENCES ----------------------------------- + +"Preferences" "Preferencje" + +"Proxy" "Proxy" +"Enable Proxy" "Włącz Proxy" +"Address" "Adres" +"Port" "Port" +"Username" "Użytkownik" +"Password" "Hasło" + +"Max Downloads" "Max ilość pobieranych" + +"FileType" "Ty pliku" +"Browser" "Przeglądarka" +"Player" "Odtwarzacz" + +"Channels" "Kanały" +"Check all channels on startup" "Sprawdzaj wszystkie kanały na starcie" +"Check the channel every" "Sprawdzaj kanały co" + +"never" "nigdy" +"5 minutes" "5 minut" +"15 minutes" "15 minut" +"30 minutes" "30 minut" +"1 hour" "1 godzina" +"2 hour" "2 godziny" + + + + +### COLUMLISTVIEW ----------------------------------- + + +"1 new item" "1 nowy element" +"%d new items" "%d nowych elementów" +"new" "nowy" +"error" "błąd" +"not down" "nieściągalny" +"enquequed" "oczekujący" +"downloading" "pobieranie" +"downloaded" "pobrany" +"connecting" "łączenie" +"not found" "nie znaleziono" +"stopped" "zatrzymany" +"can't connect" "brak połączenia" +"invalid format" "błędny format" + +"Icon" "Icon" +"Title" "Tytuł" +"Date" "Data" +"Size" "Rozmiar" +"Status" "Status" +"Download" "Pobierz" + + + +### CONTEXT MENU ----------------------------------- + +"Add Channel" "Dodaj kanał" +"Remove Channel" "Usuń kanał" +"Check Channel" "Sprawdź kanał" +"Open Homepage" "Odwiedź stronę www" + +"Open Web Page" "Otwórz www" +"Open Enclosures folder" "Otwórz katalog załączników" +"Check All Channels" "Sprawdź wszystkie kanały" + +"Show Channel Image" "Pokazuj obrazek kanału" + +"Play enclosure" "Odtwórz załącznik" +"(Re)start download" "(Re)startuj pobieranie" +"Stop download" "Zatrzymaj pobieranie" +"Remove Item" "Usuń element" + +"Find this Item" "Znajdź element" +"Remove from this list" "Usuń z listy" + + + +### ALERT ----------------------------------- + +"\nRemoving.." "\nUsuwanie.." +"\nAn error occured while removing!" "\nNastąpił błąd przy usuwaniu!" +"Check all the podcasts for new items" "Sprawdź czy są nowe elementy na podcastach" + +"You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" "Możesz dodać jedynie do 10 kanałów używając niezarejestrowanej wersji BePoddera.\n Zarejestruj swoją kopię\n" + + +"Can't open the selected file with:\n\n" "Nie można odtworzyć wybranego pliku za pomocą:\n\n" +"\n\nPlease check if the application is installed in the right way.\n" "\n\nSprawdź czy aplikacja jest zainstalowana poprawnie.\n" +"Download it!" "Pobierz to!" + +# multi line text... please translate only the text after _value= and don't remove empty space + +_key="alert1" + _value=" +Chcesz usunąć wybrany element. + +Jesteś pewien? +(zostaną również usunięte załączniki)" + + +_key="alert2a" + _value=" +Chcesz usunąć kanał: + +" + +_key="alert2b" + _value=" + +Czy chciałbyś zarchiwizować ten +kanał (zachowując wszystkie pliki i +załączniki pobrane dotychczas) czy też +chcesz USUNĄC cały + kanał ze swojego komputera?" + +_key="alert3" + _value=" +Analiza archiwum.." + +_key="alert_3gp" + _value=" +3GP to multimedialny kontener stworzony przez Third Generation Partnership Project (3GPP) do użytku w telefonach 3G. Służy on przechowywaniu strumieni wideo, takich jak MPEG-4 albo H.263 i strumieni audio AMR-NB lub AAC-LC. + +VideoLAN nie obsługuje AMR audio (3GPP)" + +_key="alert_swf" + _value=" +SWF to format wektorowych plików graficznych stworzony przez Flash software z Adobe (uprzednio Macromedia). + +Aktualnie obsługa flasha w BeOSie/Haiku/Zecie ogranicza się do starej wersji odtwarzacza Flash w wersji 4.1015." + + + + +### HELP & SHORTCUTS ----------------------------------- + + +"Introduction" "Wstęp" +"The User Interface" "Interfejs użytkownika" +"Menu Bar" "Opcje menu" +"Toolbar Buttons" "Przyciski Toolbara" +"First time with BePodder" "Pierwsze uruchomienie BePoddera" +"Download Podcast's enclosure files" "Pobieranie załączników z podcastami" +"Settings Overview" "Ustawienia" +"Directory lists" "Katalogi list" +"Loading Help..." "Wgrywanie..." +"Register your copy" "Rejestruj swoją kopię" +"Starting point" "Strona główna" + + + + +# multi line text... please translate only the text after _value= and don't remove empty space + + +_key="help1-0" + _value="Witaj w przewodniku użytkownika BePoddera." + +_key="help1-1" + _value="Jeśli rozumiesz już na czym polega podcast oraz RSS/Atom, to możesz natychmiast zamknąć to okno i przejść do BePoddera." + +_key="help1-2" +_value="Jeśli nie, to ten przewodnik wprowadzi Cię w podstawy, które umożliwią Ci bezproblemową obsługę programu. Użyj przycisków znajdujących się poniżej do nawigacji w niniejszym przewodniku." + + +_key="help2-0" +_value="Podcasting to metoda publikacji przekazów audio i wideo przez Internet; linki do audio i wideo znajdują się w wiadomościach RSS lub Atom." + +_key="help2-1" +_value="Podcasting jest prostą formą dostarczania mediów online: użytkownicy mogą subskrybować podcast używając czytników (takich jak RSS 'Really Simple Syndication' czy Atom)." + +_key="help2-2" +_value="Czytnik kanałów (agregator) jak BePodder to program, który umożliwia subskrypcję kanałów RSS i w określonych odstępach czasu sprawdza dostępność nowych zawartości; przy pomocy BePoddera możesz sprawdzać czy udostepniono na subskrybowanych kanałach nowe epizody . Każdy ściągnięty element, podobnie jak np. e-mail, może zawierać załącznik." + +_key="help3-0" +_value="BePodder posiada przyjazny interfejs użytkownika (GUI). Główne okno programu jest podzielone na trzy części:" + +_key="help3-1" +_value="1) Lista subskrybowanych kanałów (panel oznaczony numerem 1 na obrazku) zawiara listę suksrybowanych podcastów. Kliknięcie na kanał powoduje wyświetlenie się w panelu 2 listy dostępnych elementów." + +_key="help3-2" +_value="2) Lista epizodów ze wszystkimi dostępnymi elementami." + +_key="help3-3" +_value="3) Panel informacyjny: informacje o epizodzie, informacje o kanałach i pobranych plikach; możesz wybrać pnel informacyjny klikając na jeden z trzech poniższych przycisków." + + + +_key="help4-0" +_value="Na szczycie głównego okna BePoddera znajduje się pasek udostępniający siedem menu: Plik, Ustawienia, Subskrypcje, Epizody, Listy, Widok i Pomoc. Obok części menu z prawej strony znajdują się strzałki, które wskazują na istnienie podmenu. Podczas przeglądania menu należy więc także zwrócić uwagę na dostępne podmenu. Kliknij na menu aby zobaczyć dostępne opcje:" + +_key="help4-1" +_value="Plik: zawiera komendy dotyczące zamykania aplikacji i panel informacji o BePodderze" + +_key="help4-2" +_value="Ustawienia: zawiera komendę uruchamiającą okno preferencji przy pomocy którego można ustawić interesujące nas ustawienia programu." + +_key="help4-3" +_value="Subscrypcje: zawiera komendy dotyczące subskrybowanych kanałów na Twoich subskrybowanych listach." + +_key="help4-4" +_value="Epizody: zawiera komendy dotyczące poszczególnych epizodów." + +_key="help4-5" +_value="Listy: zawiera komendy dotyczace katalogów OPML." + +_key="help4-6" +_value="Widok: zawiera komendy i kontrolki okien BePoddera." + +_key="help4-7" +_value="Pomoc: zawiera komendy 'Przewodnik dla początkujących' i 'Skróty klawiaturowe'." + + + +_key="help5-0" + _value="Przycisk dodaj: otwiera okno w którym możesz podać url kanału rss (np. http://www.newpodcast.com/rss.xml) zazwyczaj podawany jest on na stronie podcastu; na stronach www szukaj grafiki lub tekstu dotyczącego 'XML', 'RSS' albo 'Podcastu'." + +_key="help5-1" + _value="Przycisk usuwania kanału: otwiera okno w którym możesz wybrać sposób usunięcia kanału: archiwizacja wybranego kanału (zachowując jednocześnie wszystkie ściągnięte pliki i załączniki) albo usunięcie całego kanału z Twojego kompoutera." + +_key="help5-2" + _value="Przycisk sprawdź: sprawdza wybrany kanał i aktualizuje listę dostępnych elementów w danym podcaście dodając nowe elementy." + +_key="help5-3" + _value="Przycisk strona www: otwiera stronę domową podcastu w przeglądarce. By wybrać swoją preferowaną przeglądarkę przejdź do ustawień programu, klikając na Ustawienia>Preferencje... i w oknie preferencji w zakładce 'Typy plików' wybierz swoją preferowaną przeglądarkę." + +_key="help5-4" + _value="Przycisk odtwórz: przy pomocy tego przycisku możesz oglądać albo słuchać pliku załączonego do wybranego elementu (epizodu). By wybrać swój preferowany odtwarzacz przejdź do ustawiń programu, klikając na Ustawienia>Preferencje... i w oknie preferencji w zakładce 'Typy plików' wybierz swój preferowany odtwarzacz.." + +_key="help5-5" + _value="Przycisk pobierania: pobiera załącznik wybranego elementu (epizodu); możesz zobaczyć informacje o pobieranym pliku, klikając na trzecim przycisku panelu informacyjnego ." +_key="help5-6" + _value="Przycisk stop: zatrzymuje pobieranie pliku załączonego do wybranego elementu (epizodu); by ponowić pobieranie kliknij dwukrotnie na elemencie (epizodzie) albo wybierz element i kliknij na przycisk pobierania." + +_key="help5-7" + _value="Przycisk usuwania elementu: usuwa wybrany element (usuwa również załączone pliki)." + + + +_key="help6-0" + _value="Obsługa BePoddera jest prosta." + +_key="help6-1" + _value="Z lewej strony głównego okna znajduje się 'Lista subskrypcji' ze wszystkimi subskrybowanymi kanałami. Autorzy programu dodali dla Ciebie kilka subskrypcji. Możesz do dostępnej listy dodać swoje subskrypcje na dwa sposoby:" + +_key="help6-2" + _value="1) kliknij na przycisk dodawania kanału, później podaj url kanału rss (np.: http://www.newpodcast.com/rss.xml) i kliknij dodaj." + +_key="help6-3" + _value="2) w pasku menu kliknij na 'Listy' następnie na 'Listę podcastów' lub inną listę, wybierz podcast i kliknij 'Subskrybuj'." + +_key="help6-4" + _value="Jeśli wybierzesz podcast na liście subskrypcji i użyjesz przycisku 'sprawdź', BePodder doda nowe elementy do 'Listy epizodów' (poniżej z prawej strony); możesz sprawdzić wszystkie swoje podcasty klikając prawym przyciskiem myszy i wybierając opcję Sprawdź wszystkie kanały' z menu kontekstowego." + +_key="help6-5" + _value="Na poniższym obrazku można zauważyć w pierwszej kolumnie 'Listy epizodów' 3 nowe elementy, oznaczone czarną kropką." + +_key="help6-6" + _value="W drugiej kolumnie widzimy ikony wskazujące na stan danego elementu:" + +_key="help6-7" + _value="- Epizod 4 z ikoną wskazującą na błąd" + +_key="help6-8" + _value="- Epizod 3 z ikoną wskazującą na oczekiwanie na pobranie żądanego załącznika do elementu" + +_key="help6-9" + _value="- Epizod 2 z ikoną wskazującą na pobieranie przez BePoddera załącznika do elementu" + +_key="help6-10" + _value="- Epizod 1 z ikoną wskazującą na zakończenie pobierania załącznika do elementu" + + +_key="help7-0" + _value="Wybierz jakiś element z 'Listy epizodów' i kliknij na nim dwukrotnie (albo kliknij na przycisk pobierania), zapoczątkuje to pobieranie załącznika; możesz w każdej chwili zatrzymać pobieranie, klikając na przycisk stop." + +_key="help7-1" + _value="Jeśli klikniesz na subskrybowanym podcaście na 'Liście subskrypcji' program wyświetli Ci, w 'Liście epizodów', wszystkie elementy dostępne w ramach tej subskrypcji. Wybierz element i kliknij na przycisk odtwarzania by obejrzeć albo wysłuchać pliku." + +_key="help7-2" + _value="Możesz uzyskać dostęp do folderu z załączonymi plikami klikając na ikonę folderu w panelu informacyjnym albo klikając prawym przyciskiem myszy na elemencie i wybierając 'Otwórz folder załączników' z menu kontekstowego." + + + +_key="help8-0" + _value="Dostęp do menu Preferencji możesz uzyskać klikając na menu Ustawienia>Preferencje. W oknie dialogowym preferencji z lewej strony znajdują się cztery kategorie (zakładki): Typy plików, Kanały, Pobieranie oraz Proxy." + +_key="help8-1" + _value="- Typy plików: w menu tym możesz wybrać preferowaną przeglądarkę i odtwarzacz. " + +_key="help8-2" + _value="- Kanały: w menu tym możesz ustawić co jaki czas będzie wykonywana operacja sprawdzania kanałów w celu poszukiwania nowych zawartości; możesz w nim także wybrać opcję sprawdzania wszystkich kanałów przy starcie programu bądź sprawdzanie kanałów w określonych odstępach czasu." + +_key="help8-3" + _value="- Pobieranie: w menu tym możesz ustawić maksymalną ilość plików pobieranych jednocześnie przez program," + +_key="help8-4" + _value="- Proxy: w menu tym możesz ustawić do pracy z BePodderem serwer proxy; serwer proxy może służyć jako bariera ochronna pomiędzy Twoją siecią wewnętrzną i internetem, zapobiegając uzyskiwaniu informacji z Twojego komputera przez innych użytkowników internetu ." + + +_key="help9-0" + _value="BePodder posiada wbudowaną bazę podcastów, wideoblogów, katalogów obrazków, newsów, katalogów bittorrentów podcastów międzynarodowych z tysiącami kanałów pogrupowanych na kategorie." + +_key="help9-1" + _value="OPML (Outline Processor Markup Language) jest formatem opartym o XML, który pozwala wymieniać informacje pomiędzy aplikacjami." + +_key="help9-2" + _value="Dostęp do kanału OPML można uzyskać klikając na menu 'Katalogi' i wybierając odpowiednią listę. Poszukiwanie katalogu opml w celu odnalezienia pożądanego kanału rss polega na rozwinięciu listy poprzez kliknięcie na strzałce (patrz obrazek); używając tej metody, możesz rozwijać katalogi opml do czasu znalezienie interesującego Cię kanału. Kiedy znajdziesz już odpowiedni kanał, zaznacz go i dodaj do listy subskrypcji, klikając na przycisk 'Subskrybuj', możesz także zwinąć wszystkie kategorie w katalogu list, klikając na przycisk 'Zwiń wszystko'." + +_key="help_shortcut1" +_value="Ta strona opisuje skróty klawiaturowe, które mogą być używane w BePodderze. Skróty zostały pogrupowane według funkcji." + +_key="help_shortcut2" +_value="oznacza, że możesz użyć zarówno klawisza alt jak również control w celu wywołania różnych opcji (np. Alt+Q lub Ctrl+Q zamykają aplikację), ustawienia tego dokonałeś w menu preferences w ustawieniach klawiatury (domyślny klawisz skrótów to Alt)." + +_key="help_shortcut3" + _value="Główne skróty" + +_key="help_shortcut4" + _value="Wyjdź z programu" + +_key="help_shortcut5" + _value="Pokazuje okno preferencji" + +_key="help_shortcut6" + _value="Pokazuje listę podcastów" + +_key="help_shortcut7" + _value="Pokazuje listę wideoblogów" + +_key="help_shortcut8" + _value="Pokazuje listę obrazków" + +_key="help_shortcut9" + _value="Pokazuje listę newsów" + +_key="help_shortcut9b" + _value="Pokazuje listę BitTorrentów" + +_key="help_shortcut9c" + _value="Pokazuje listę kanałów międzynarodowych" + +_key="help_shortcut10" + _value="Pełny ekran" + +_key="help_shortcut11" + _value="Pokazuje/ukrywa toolbar" + +_key="help_shortcut12" + _value="Pokazuje poradnik dla początkujących" + +_key="help_shortcut13" + _value="Pokazuje stronę skrótów klawiaturowych" + +_key="help_shortcut14" + _value="Skróty do kanałów" + +_key="help_shortcut15" + _value="Dodaj podcast do listy subscrypcji" + +_key="help_shortcut16" + _value="Skasuj wybrany podcast z listy subskrypcji" + +_key="help_shortcut17" + _value="Sprawdź czy na wybranym podcaście są nowe epizody" + +_key="help_shortcut18" + _value="Sprawdź czy na wszystkich podcastach są nowe epizody" + +_key="help_shortcut19" + _value="Pokaż stronę domową podcastu" + +_key="help_shortcut20" + _value="Otwórz folder załączników" + +_key="help_shortcut21" + _value="Skróty do epizodów" + +_key="help_shortcut22" + _value="Odtwórz załącznik" + +_key="help_shortcut23" + _value="(Re)startuj pobieranie wybranych epizodów" + +_key="help_shortcut24" + _value="Zatrzymaj pobieranie epizodu" + +_key="help_shortcut25" + _value="Skasuj wybrany epizod" + +_key="help_shortcut26" + _value="Pokaż stronę epizodu podcastu" + +_key="help_shortcut27" + _value="Otwórz folder załączników" + +_key="help_buy1" + _value="BePodder Light jest podstawową wersją aplikacji (darmową i nielimitowaną czasowo), wersja zarejestrowana dodaje kilka interesujących nowych opcji: nielimitowaną liczbę kanałów, widok miniaturek, wsparcie dla proxy, automatyczne sprawdzanie kanałów, możliwość pobierania 5 załączników w tym samym czasie." + +_key="help_buy2" + _value="Prosimy o nabywanie pełnej wersji programu, która kosztuje jedynie 15 euro (Kagi dodaje podatek dla niektórych państw), licencję BePoddera można zakupić online od Kagi." + +_key="help_buy3" + _value="Licencję można kupić na www.funkyideasoft.com" + +_key="help_buy4" + _value="Po dokonaniu zakupu, otrzymasz email z kluczem do aplikacji wraz z instrukcją instalacji. Proces instalacji jest bardzo prosty - wypakowanie archiwum i skopiowanie pliku do określonego katalogu." + +_key="help_buy5" + _value="Żadnego problemu nie powinno też sprawić ewentualne uaktualnienie programu do nowej wersji. Klucz odblokuje też nowe wersje programu." + + +### USELESS ######## + +"Opml Editor" "Edytor Opml" +"name:" "nazwa:" +"Add a category" "Dodaj kategorię" +"Add a new Broadcast" "Dodaj nową audycję" +"feed:" "feed:" +"url:" "url:" +"Test podcast" "Testuj podcast" +"Del a category" "Usuń kategorię" +"Add a category" "Dodaj kategorię" +"Select the podcast category:" "Wybierz kategorię podcastów:" +"Check all" "Sprawdź wszystkie" +"Check" "Sprawdź" +"Refresh the list" "Odśwież listę" +"Load" "Wczytaj" +"Load the list" "Wczytaj listę" +"Save" "Zapisz" +"Save the list" "Zapisz listę" +"Revert" "Przywróć" +"Apply" "Akceptuj" + + + + + + + + + + + + diff --git a/release/Language/Dictionaries/BePodder.ptBR b/release/Language/Dictionaries/BePodder.ptBR new file mode 100644 index 0000000..e1bd55a --- /dev/null +++ b/release/Language/Dictionaries/BePodder.ptBR @@ -0,0 +1,603 @@ + +# Locale file for BePodder. +# Modified: 4/18/2006 +# Author: Daniel "DaaT" Teixeira +# E-mail: daat@iscomputeron.com + + +# Attention: don't remove empty space or \n + + +### SHAREWARE POPUPS ----------------------------------- + +"Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" "Aplicação Shareware!\n\nPor favor suporte o nosso trabalho!\n\nCompre uma licença!\nMais informação na nossa página na Internet\n" + +"This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" "Esta cópia do BePodder expirou!\nPor favor compre uma licença, suportando o nosso trabalho.\n" + +"Web Site" "Página na Internet" + +"Can't connect!" "Não é possível conectar!" +"Http port failed!" "Erro na porta http!" +"Can't resolve host!" "Anfitrião não encontrado!" +"Not found!" "Não encontrado!" +"Bad resume!" "Erro ao resumir!" +"Aborted by Callback!" "Abortado por Callback!" +"Can't resume! (range error)" "Não é possível resumir! (erro de alcance)" +"Access Denied!" "Acesso Negado!" +"User or Password Incorrect!" "Utilizador ou Palavra-passe incorrectos!" +"Other error (cUrl code: " "Outro erro (código cUrl: " +"cUrl init error!" "cUrl erro init!" +"Can't open file!" "Não é possível abrir o ficheiro!" +"Other error (status code: " "Outro erro (código do status: " +"Downloading" "A transferir" + +### MENUBAR ----------------------------------- + +"File" "Ficheiro" +"About..." "Sobre..." +"Close!" "Fechar!" +"Quit" "Quit" + +"Settings" "Definições" +"Preferences..." "Preferências..." + +"Subscriptions" "Subscrições" + +"Episodes" "Episodes" + +"Lists" "Lists" +"Podcast List" "Lista de Podcasts" +"Podcast directory list" "Lista de directórios de Podcasts" +"Videoblog List" "Lista de Videoblogs" +"Videoblog directory list" "Lista de directórios de Videoblogs" +"Imagefeeds List" "Lista de Imagefeeds" +"Imagefeeds directory list" "Lista de directórios de Imagefeeds" +"Newsfeeds List" "Lista de Newsfeeds" +"Newsfeeds directory list" "Lista de directórios de Newsfeeds" +"BitTorrentfeeds List" "Lista de BitTorrentfeeds" +"BitTorrentfeeds directory list" "Lista de directórios de BitTorrentfeeds" +"Internationalfeeds List" "Lista de Internationalfeeds" +"Internationalfeeds directory list" "Lista de directórios de Internationalfeeds" + + +"View" "Ver" +"Full Screen" "Ecrã total" +"Toolbar" "Barra de Ferramentas" +"Subscriptions View" "Vista de subscrições" +"Small Items" "Items Pequenos" +"Big Items" "Items Grandes" +"Move BePodder on workspace:" "Mover o BePodder para o workspace:" + +"Help" "Ajuda" +"Getting Started" "Iniciar" +"Keyboard Shortcuts" "Atalhos do teclado" +"Tutorials" "Tutoriais" +"Online Support" "Suporte Online" + + + +### BUTTONS ----------------------------------- + +# Buttons add feed window +"Insert the rss feed url!" "Insira o endereço do feed rss!" +"Add" "Adicionar" +"Paste" "Colar" + +# Buttons directory list window +"Collapse All" "Fechar Todos" +"Preview" "Previsão" +"Subscribe" "Subscrever" + + +# Buttons help window +"Next" "Seguinte" +"Prev" "Anterior" +"Close" "Fechar" +"Index" "Index" + + +# Buttons remove windows +"Cancel" "Cancelar" +"Delete" "Apagar" +"Archive" "Archive" + + + +### TOOLTIPS ----------------------------------- + +# Tooltips toolbar buttons + +"Add the podcast to the Subscriptions list" "Adiciona o podcast à lista de Subscrições" +"Delete the podcast from the Subscriptions list" "Apaga o podcast da lista de Subscrições" +"Check the selected podcast for new items" "Verifica se existem items novos no podcast seleccionado" +"Show the podcast homepage" "Mostra a homepage do podcast" + +"Delete the item and the enclosure" "Delete the item and the enclosure" +"Stop the item download" "Pára a transferência" +"Download the selected episode" "Transfere o episódio seleccionado" +"Play the selected episode" "Ouvir/ver o episódio seleccionado" + +"Submit bug and idea" "Submete bugs e ideias" + + +# Tooltips directory window buttons + +"Collapse all categories in the directory list" "Fechar todas as categorias na lista de directórios" +"Add the selected podcast to the Subscription list" "Adicionar o podcast seleccionado à lista de Subscrições" +"Checkout a podcast before downloading it" "Checkout a podcast before downloading it" + + +### INFO PANEL ----------------------------------- + +"Show channel Image" "Show Channel Image" +"XML Feed Link" "XML Feed Link" + +"Show Episode info" "Show Episode info" +"Show Subscription info" "Show Subscription info" +"Show Downloads info" "Show Downloads info" + +"Enclosure: " "Anexo: " + +"Lookup (Dictionary)" "Procurar (Dicionário)" +"Lookup (Google)" "Procurar (Google)" +"Lookup (Acronym Finder)" "Procurar (Acrónimos)" +"Copy" "Copiar" +"Select All" "Seleccionar todos" +"Copy URL" "Copy URL" +"Open URL" "Open URL" +"Subscription" "Subscription" + + + +### PREFERENCES ----------------------------------- + +"Preferences" "Preferências" + +"Proxy" "Proxy" +"Enable Proxy" "Enable Proxy" +"Address" "Address" +"Port" "Port" +"Username" "Username" +"Password" "Password" + +"Max Downloads" "Max Downloads" + +"FileType" "FileType" +"Browser" "Navegador:" +"Player" "Leitor:" + +"Channels" "Channels" +"Check all channels on startup" "Check all channels on startup" +"Check the channel every" "Check the channel every" + +"never" "never" +"5 minutes" "5 minutes" +"15 minutes" "15 minutes" +"30 minutes" "30 minutes" +"1 hour" "1 hour" +"2 hour" "2 hour" + + + + +### COLUMLISTVIEW ----------------------------------- + + +"1 new item" "1 novo item" +"%d new items" "%d novos items" +"new" "novo" +"error" "erro" +"not down" "não transferido" +"enquequed" "em fila de espera" +"downloading" "a transferir" +"downloaded" "transferido" +"connecting" "a conectar" +"not found" "não encontrado" +"stopped" "parado" +"can't connect" "can't connect" +"invalid format" "invalid format" + +"Icon" "Icon" +"Title" "Título" +"Date" "Data" +"Size" "Tamanho" +"Status" "Estado" +"Download" "Transferir" + + + +### CONTEXT MENU ----------------------------------- + +"Add Channel" "Adicionar Canal" +"Remove Channel" "Remover Canal" +"Check Channel" "Verificar Canal" +"Open Homepage" "Abrir Homepage" + +"Open Web Page" "Open Web Page" +"Open Enclosures folder" "Abrir pasta dos anexos" +"Check All Channels" "Verificar todos os Canais" + +"Show Channel Image" "Show Channel Image" + +"Play enclosure" "Ouvir/ver anexo" +"(Re)start download" "(Re)iniciar transferência" +"Stop download" "Parar transferência" +"Remove Item" "Remover Item" + +"Find this Item" "Procurar este item" +"Remove from this list" "Remover desta lista" + + + +### ALERT ----------------------------------- + +"You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" "Só pode adicionar até 10 canais nesta versão não registada do BePodder.\nPor favor registe a sua cópia\n" + + +"Can't open the selected file with:\n\n" "Não é possível abrir o ficheiro seleccionado com:\n\n" +"\n\nPlease check if the application is installed in the right way.\n" "\n\nPor favor verifique se a aplicação está instalada correctamente.\n" + +"Download it!" "Transfira!" + +"\nRemoving.." "\nA remover.." +"\nAn error occured while removing!" \nOcorreu um erro durante a remoção!" +"Check all the podcasts for new items" "Verificar se existem novos items em todos os podcasts" + +# multi line text... please translate only the text after _value= and don't remove empty space + +_key="alert1" + _value=" +Vai remover o item seleccionado. + +Tem a certeza? +(perderá o anexo se presente)" + + +_key="alert2a" + _value=" +Vai remover o canal: + +" + +_key="alert2b" + _value=" + +Pretende apenas arquivar o canal (mantendo +todos os ficheiros e anexos transferidos) or +quer APAGAR do seu computador o canal na +sua totalidade?" + +_key="alert3" + _value=" +A optimizar o arquivo.." + +_key="alert_3gp" + _value=" +3GP é um formato multimédia, definido pelo projecto Third Generation Partnership Project (3GPP) para ser usado em telemóveis 3G. Armazena vídeos como MPEG-4 ou H.263, e áudio como AMR-NB ou AAC-LC. + +VideoLAN VLC ainda não suporta o formato de áudio AMR (3GPP)" + +_key="alert_swf" + _value=" +SWF é um formato proprietário de ficheiros de gráficos vectoriais produzido pelo software Flash da Adobe (anteriormente Macromedia). + +Actualmente o suporte Flash no BeOS/Haiku/Zeta está limitado a um leitor Flash versão 4.1015, não existe um leitor Flash recente." + + +### HELP & SHORTCUTS ----------------------------------- + + +"Introduction" "Introducão" +"The User Interface" "O Interface do Utilizador" +"Menu Bar" "Barra de Menu" +"Toolbar Buttons" "Botões da Barra de Ferramentas" +"First time with BePodder" "Primeira vez com o BePodder" +"Download Podcast's enclosure files" "Transferir anexos dos Podcasts" +"Settings Overview" "Vista geral das definições" +"Directory lists" "Listas de Directórios" +"Loading Help..." "A carregar a Ajuda..." +"Register your copy" "Registe a sua cópia" +"Starting point" "Ponto de arranque" + + +# multi line text... please translate only the text after _value= and don't remove empty space + + +_key="help1-0" + _value="Welcome to the BePodder Getting Started Guide." + +_key="help1-1" + _value="Se já está familiarizado com podcasts e feeds RSS pode começar a usar o BePodder imediatamente fechando esta janela." + +_key="help1-2" +_value="Se não for o caso, esta é uma pequena introdução que lhe irá fornecer tudo o que precisa de saber para começar a usar o BePodder.Utilize os botões abaixo para ver este tutorial." + + +_key="help2-0" + _value="Podcasts são um método de publicação de áudio e vídeo na Internet; +links para ficheiros vídeo e áudio, gratuitos, são anexados aos feeds RSS e Atom." + +_key="help2-1" +_value="Portanto, Podcasts são apenas um método de distribuição multimédia online; os utilizadores podem subscrever um podcast usando para tal um feed (como o RSS 'Really Simple Syndication' ou o Atom)." + +_key="help2-2" +_value="Um agregador Existe software, como o BePodder, que agrega (podcatcher) todos os feeds que subscreveu e que periodicamente verifica se há novo conteúdo e o transfere. Com o BePodder pode procurar por novos episódios nos seus Canais. Qualquer um pode conter um anexo, como o e-mail o faz também." + + +_key="help3-0" +_value="O BePodder tem um interface fácil de utilizar mas poderoso ao mesmo tempo. A janela principal está dividida em três paineis:" + +_key="help3-1" +_value="1) A lista de Subscrições (o painel com o número 1 na imagem) contém a lista de Podcasts subscritos por si. Quando clica num Canal pode ver no painel 2 a lista de items do canal." + +_key="help3-2" +_value="2) A lista de Episódios com todos os items disponíveis." + +_key="help3-3" +_value="3) O painel de informações exibe: informação do episódio, informação do canal ou informação das transferências; pode seleccionar um painel de informações clicando num dos três botões." + + + +_key="help4-0" +_value="No cimo da janela principal do BePodder está a barra de menus com sete menus disponíveis: Ficheiro, Definições, Subscrições, Episódios, Listas, Ver e Ajuda. Alguns comandos nos menus têm uma seta à direita que indica a existência dum submenu com comandos relacionados. À medida que explora cada menu, não se esqueça de navegar pelos submenus também. Clique nos menus para ver os comandos de cada um:" + +_key="help4-1" +_value="Ficheiro: contém comandos para fechar esta aplicação e mostrar informação sobre o BePodder" + +_key="help4-2" +_value="Definiçõe: contém comandos para abrir as Preferências, que lhe permite customizar várias definições do BePodder." + +_key="help4-3" +_value="Subscrições: contém comandos que executam acções no canal escolhido, da sua lista de subscrições." + +_key="help4-4" +_value="Episódios: contém comandos que executam acções no item seleccionado (episódio) da lista dos episódios do canal." + +_key="help4-5" +_value="Listas: contém comandos para abrir os directórios OPML do BePodder." + +_key="help4-6" +_value="Ver: contém comandos e controlos para a janela do BePodder." + +_key="help4-7" +_value="Ajuda: contém comandos para abrir o 'Guia de Arranque' do BePodder e a 'Lista de Atalhos do Teclado'." + + + +_key="help5-0" + _value="Botão Adicionar: abre a janela Adicionar para que possa adicionar um URL (endereço) dum feed (p.e. http://www.newpodcast.com/rss.xml), normalmente fornecido na homepage do podcast; procure por um link de texto ou gráfico que diga algo como 'XML', 'RSS' ou 'Podcast Feed'." + +_key="help5-1" + _value="Botão Remover Canal: abre uma janela na qual pode seleccionar como remover o canal: arquivar apenas o canal (mantendo todos os ficheiros e anexos transferidos até à data) ou apagar totalmente o canal do seu computador." + +_key="help5-2" + _value="Botão de Verificação: verifica o canal seleccionado e actualiza a lista com novos items disponiveis para esse podcast, se os houver." + +_key="help5-3" + _value="Botão Web: mostra a homepage do canal no browser. Para escolher o seu browser preferido abra as Preferências do BePodder, clicando no menu Definiçoes->Preferências... e na janela das Preferências em 'Tipo de Ficheiro' seleccione o seu browser preferido." + +_key="help5-4" + _value="Botão de Leitura: com este botão pode ver ou ouvir os anexos do ite (episódio) seleccionado. Para escolher o seu leitor preferido abra as Preferências do BePodder, clicando no menu Definiçoes->Preferências... e na janela das Preferências em 'Tipo de Ficheiro' seleccione o seu leitor." + +_key="help5-5" + _value="Botão Transferir: transfere o(s) anexo(s) do item seleccionado (episódio); pode ver informação sobre a transferência clicando no terceiro botão no painel de informação." + +_key="help5-6" + _value="Botão Stop: pára a transferência do anexo do item (episódio) seleccionado; para resumir a transferência clique duas vezes o item ou seleccione-o e clique novamente no botão Transferir." + +_key="help5-7" + _value="Botão Remover Item: apaga o item seleccionado (perderá o anexo nele incluído)." + + + + +_key="help6-0" + _value="Começar a utilizar o BePodder é fácil." + +_key="help6-1" + _value="À esquerda pode ver uma lista das suas subscrições. Adicionámos algumas por si, mas pode sempre adicionar as suas de duas maneiras:" + +_key="help6-2" + _value="1) clique no botão 'Adicionar o podcast...', e de seguida na janela que aparece, escreva o endereço do feed (por exemplo: http://www.newpodcast.com/rss.xml) e clique em Adicionar." + +_key="help6-3" + _value="2) Seleccione o menu 'Directório' e depois 'Lista de Podcasts' ou 'Lista de Videoblogs', escolha um podcast e clique em 'Subscrever'." + +_key="help6-4" + _value="Se seleccionar um Podcast da lista e clicar no botão, o BePodder adiciona os novos items na 'Lista de Episódios' à direita; pode verificar todos os seus podcasts ao clicar com o botão direito e seleccionar 'Verificar todos os Canais' no menu." + +_key="help6-5" + _value="Veja as imagens acima, três items estão com um ponto negro na primeira coluna da 'Lista de Episódios'." + +_key="help6-6" + _value="Na segunda coluna existem ícones que indicam o estado do item:" + +_key="help6-7" + _value="- o Episódio 4 tem um ícone que indica um erro" + +_key="help6-8" + _value="- o Episódio 3 tem um ícone que indica que a transferência do anexo está em fila de espera" + +_key="help6-9" + _value="- o Episódio 2 tem um ícone que indica que o BePodder está a transferir o anexo" + +_key="help6-10" + _value="- o Episódio 1 tem um ícone que indica que o BePodder acabou de transferir o anexo" + + + +_key="help7-0" + _value="Seleccione um item na 'Lista de Episódios' e depois faça duplo-clique no item ou clique no botão (Transfere...); pode sempre interromper a transferência clicando no botão 'Parar transferência'." + +_key="help7-1" + _value="Quando clica num Podcast na 'Lista de Podcasts', o programa mostra-lhe na lista à direita todos os items disponíveis para esse Podcast. Seleccione um item e clique em 'Ouvir/Ver ...' para ver ou ouvir o ficheiro." + +_key="help7-2" + _value="Pode aceder à pasta dos anexos clicando no ícone da pasta no painel de Informação ou clicando com o botão direito e seleccionando 'Abrir pasta dos anexos' no menu." + + + +_key="help8-0" + _value="Pode aceder às Preferências clicando no menu Definições->Preferências. Pode escolher uma categoria da lista à esquerda: Tipo de Ficheiro, Canais, Transferências e Servidor Proxy."" + +_key="help8-1" + _value="- Tipo de Ficheiro: para especificar o browser e o leitor preferidos." + +_key="help8-2" + _value="- Canais: para especificar preferências que controlam a verificação de novos items nos canais; pode escolher entre verificar Todos no arranque do BePodder ou num intervalo especificado de minutos." + +_key="help8-3" + _value="- Transferências: para especificar o número máximo de anexos que podem ser transferidos ao mesmo tempo." + +_key="help8-4" + _value="- Servidor Proxy: para configurar um servidor proxy para trabalhar com o BePodder; um servidor de proxy actua como uma barreira de segurança entre a sua rede interna e a Internet, mantendo quem está na Internet afastados, impedindo-os de aceder à sua informação na rede interna." + + + +_key="help9-0" + _value="O BePodder tem incluídos directórios OPML de videoblogs, feeds de imagens, feeds de notícias, feeds bittorrent e feeds internacionais com milhares de feeds organizados por categorias." + +_key="help9-1" + _value="OPML (Outline Processor Markup Language) é um formato com base em XML que permite a troca de informação estruturada entre aplicações." + +_key="help9-2" + _value="Um directório OPML pode ser acedido clicando no menu 'Listas' e de seguida escolhendo a lista. Para navegar o directório à procura dum feed, expanda a lista clicando na seta da categoria desejada (ver imagem); ao usar este método, pode expandir o directório OPML até encontrar o feed desejado. Uma vez seleccionado, pode adicioná-lo à lista de subscrições clicando no botão 'Subscrever', pode também fechar todas as categorias na lista de directórios clicando no botão 'Fechar Todos'." + + +_key="help_shortcut1" +_value="Esta página descreve os atalhos de teclado que podem ser utilizados no BePodder. Os atalhos estão aqui agrupados por função." + +_key="help_shortcut2" +_value="signifca que pode utilizar ou Alt ou Control (p.e. Alt+Q ou Ctrl+Q Fecha a aplicação), dependendo da configuração por si definida nas Preferências da Deskbar na secção Teclado (a tecla de atalho pré-definida é Alt)." + +_key="help_shortcut3" + _value="atalhos gerais" + +_key="help_shortcut4" + _value="Fecha a aplicação" + +_key="help_shortcut5" + _value="Exibe a janela das Preferências" + +_key="help_shortcut6" + _value="Exibe a lista do directório de Podcasts" + +_key="help_shortcut7" + _value="Existe a lista do directório de Videoblogs" + +_key="help_shortcut8" + _value="Exibe a lista do directório de feeds de Imagens" + +_key="help_shortcut9" + _value="Exibe a lista do directório de feeds de Notícias" + +_key="help_shortcut9b" + _value="Exibe a lista do directório de feeds Bittorrent" + +_key="help_shortcut9c" + _value="Exibe a lista do directório de feeds Internacionais" + +_key="help_shortcut10" + _value="Ecrã Total" + +_key="help_shortcut11" + _value="Exibe/Esconde a barra de ferramentas" + +_key="help_shortcut12" + _value="Exibe o Guia de Arranque" + +_key="help_shortcut13" + _value="Exibe a página com os atalhos de Teclado" + +_key="help_shortcut14" + _value="Atalhos dos Canais" + +_key="help_shortcut15" + _value="Adiciona um podcast à lista de subscrições" + +_key="help_shortcut16" + _value="Apaga o podcast seleccionado à lista de subscrições" list" + +_key="help_shortcut17" + _value="Verifica se existem actualizações para o podcast seleccionado" + +_key="help_shortcut18" + _value="Verifica se existem actualizações para todos os podcasts" + +_key="help_shortcut19" + _value="Exibe a homepage do podcast" + +_key="help_shortcut20" + _value="Abre a pasta dos anexos" + +_key="help_shortcut21" + _value="Atalhos dos Episódios" + +_key="help_shortcut22" + _value="Lê anexo" + +_key="help_shortcut23" + _value="Resume a transferência dos episódios seleccionados" + +_key="help_shortcut24" + _value="Pára a transferência do episódio" + +_key="help_shortcut25" + _value="Apaga o episódio seleccionado" + +_key="help_shortcut26" + _value="Exibe a página do episódio do podcast" + +_key="help_shortcut27" + _value="Abre a pasta dos anexos" + +_key="help_buy1" + _value="O BePodder Light é uma versão básica (transferência grátis e sem limite de tempo), a versão registada adiciona as melhorias: número ilimitado de canais, vista de Canal, suporte para servidor de proxy, verificação automática de canais, transferência simultânea de 5 anexos." + +_key="help_buy2" + _value="Por favor compre a versão registada, são apenas 15 euros (a Kagi adiciona impostos de venda em alguns países). A licença do BePodder pode ser adquirida online através da Kagi." + +_key="help_buy3" + _value="Compre em www.funkyideasoft.com" + +_key="help_buy4" + _value="Após a compra, um e-mail ser-lhe-á enviado com um ficheiro chave e instruções sobre como instalá-lo. Basta descompactar o ficheiro e movê-lo para um directório." + +_key="help_buy5" + _value="Pode actualizar o BePodder sem problemas, quando uma nova versão fica disponível. O ficheiro chave desbloqueia todos os pacotes transferidos, a não ser que receba instruções em contrário." + + + +### USELESS ######## + +"Opml Editor" "Editor Opml" +"name:" "nome:" +"Add a categorie" "Adicionar uma categoria" +"Add a new Broadcast" "Adicionar um novo Broadcast" +"feed:" "feed:" +"url:" "endereço:" +"Test podcast" "Testar o podcast" +"Del a categorie" "Apagar uma a categoria" +"Add a categorie" "Adicionar uma categoria" +"Select the podcast categorie:" "Seleccione a categoria do podcast:" +"Check all" "Verificar todos" +"Check" "Verificar" +"Refresh the list" "Actualizar a lista" +"Load" "Carregar" +"Load the list" "Carregar a lista" +"Save" "Gravar" +"Save the list" "Gravar a lista" +"Revert" "Revert" +"Apply" "Apply" + + + + + + + + + + + + diff --git a/release/Language/Dictionaries/BePodder.ptPT b/release/Language/Dictionaries/BePodder.ptPT new file mode 100644 index 0000000..e1bd55a --- /dev/null +++ b/release/Language/Dictionaries/BePodder.ptPT @@ -0,0 +1,603 @@ + +# Locale file for BePodder. +# Modified: 4/18/2006 +# Author: Daniel "DaaT" Teixeira +# E-mail: daat@iscomputeron.com + + +# Attention: don't remove empty space or \n + + +### SHAREWARE POPUPS ----------------------------------- + +"Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" "Aplicação Shareware!\n\nPor favor suporte o nosso trabalho!\n\nCompre uma licença!\nMais informação na nossa página na Internet\n" + +"This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" "Esta cópia do BePodder expirou!\nPor favor compre uma licença, suportando o nosso trabalho.\n" + +"Web Site" "Página na Internet" + +"Can't connect!" "Não é possível conectar!" +"Http port failed!" "Erro na porta http!" +"Can't resolve host!" "Anfitrião não encontrado!" +"Not found!" "Não encontrado!" +"Bad resume!" "Erro ao resumir!" +"Aborted by Callback!" "Abortado por Callback!" +"Can't resume! (range error)" "Não é possível resumir! (erro de alcance)" +"Access Denied!" "Acesso Negado!" +"User or Password Incorrect!" "Utilizador ou Palavra-passe incorrectos!" +"Other error (cUrl code: " "Outro erro (código cUrl: " +"cUrl init error!" "cUrl erro init!" +"Can't open file!" "Não é possível abrir o ficheiro!" +"Other error (status code: " "Outro erro (código do status: " +"Downloading" "A transferir" + +### MENUBAR ----------------------------------- + +"File" "Ficheiro" +"About..." "Sobre..." +"Close!" "Fechar!" +"Quit" "Quit" + +"Settings" "Definições" +"Preferences..." "Preferências..." + +"Subscriptions" "Subscrições" + +"Episodes" "Episodes" + +"Lists" "Lists" +"Podcast List" "Lista de Podcasts" +"Podcast directory list" "Lista de directórios de Podcasts" +"Videoblog List" "Lista de Videoblogs" +"Videoblog directory list" "Lista de directórios de Videoblogs" +"Imagefeeds List" "Lista de Imagefeeds" +"Imagefeeds directory list" "Lista de directórios de Imagefeeds" +"Newsfeeds List" "Lista de Newsfeeds" +"Newsfeeds directory list" "Lista de directórios de Newsfeeds" +"BitTorrentfeeds List" "Lista de BitTorrentfeeds" +"BitTorrentfeeds directory list" "Lista de directórios de BitTorrentfeeds" +"Internationalfeeds List" "Lista de Internationalfeeds" +"Internationalfeeds directory list" "Lista de directórios de Internationalfeeds" + + +"View" "Ver" +"Full Screen" "Ecrã total" +"Toolbar" "Barra de Ferramentas" +"Subscriptions View" "Vista de subscrições" +"Small Items" "Items Pequenos" +"Big Items" "Items Grandes" +"Move BePodder on workspace:" "Mover o BePodder para o workspace:" + +"Help" "Ajuda" +"Getting Started" "Iniciar" +"Keyboard Shortcuts" "Atalhos do teclado" +"Tutorials" "Tutoriais" +"Online Support" "Suporte Online" + + + +### BUTTONS ----------------------------------- + +# Buttons add feed window +"Insert the rss feed url!" "Insira o endereço do feed rss!" +"Add" "Adicionar" +"Paste" "Colar" + +# Buttons directory list window +"Collapse All" "Fechar Todos" +"Preview" "Previsão" +"Subscribe" "Subscrever" + + +# Buttons help window +"Next" "Seguinte" +"Prev" "Anterior" +"Close" "Fechar" +"Index" "Index" + + +# Buttons remove windows +"Cancel" "Cancelar" +"Delete" "Apagar" +"Archive" "Archive" + + + +### TOOLTIPS ----------------------------------- + +# Tooltips toolbar buttons + +"Add the podcast to the Subscriptions list" "Adiciona o podcast à lista de Subscrições" +"Delete the podcast from the Subscriptions list" "Apaga o podcast da lista de Subscrições" +"Check the selected podcast for new items" "Verifica se existem items novos no podcast seleccionado" +"Show the podcast homepage" "Mostra a homepage do podcast" + +"Delete the item and the enclosure" "Delete the item and the enclosure" +"Stop the item download" "Pára a transferência" +"Download the selected episode" "Transfere o episódio seleccionado" +"Play the selected episode" "Ouvir/ver o episódio seleccionado" + +"Submit bug and idea" "Submete bugs e ideias" + + +# Tooltips directory window buttons + +"Collapse all categories in the directory list" "Fechar todas as categorias na lista de directórios" +"Add the selected podcast to the Subscription list" "Adicionar o podcast seleccionado à lista de Subscrições" +"Checkout a podcast before downloading it" "Checkout a podcast before downloading it" + + +### INFO PANEL ----------------------------------- + +"Show channel Image" "Show Channel Image" +"XML Feed Link" "XML Feed Link" + +"Show Episode info" "Show Episode info" +"Show Subscription info" "Show Subscription info" +"Show Downloads info" "Show Downloads info" + +"Enclosure: " "Anexo: " + +"Lookup (Dictionary)" "Procurar (Dicionário)" +"Lookup (Google)" "Procurar (Google)" +"Lookup (Acronym Finder)" "Procurar (Acrónimos)" +"Copy" "Copiar" +"Select All" "Seleccionar todos" +"Copy URL" "Copy URL" +"Open URL" "Open URL" +"Subscription" "Subscription" + + + +### PREFERENCES ----------------------------------- + +"Preferences" "Preferências" + +"Proxy" "Proxy" +"Enable Proxy" "Enable Proxy" +"Address" "Address" +"Port" "Port" +"Username" "Username" +"Password" "Password" + +"Max Downloads" "Max Downloads" + +"FileType" "FileType" +"Browser" "Navegador:" +"Player" "Leitor:" + +"Channels" "Channels" +"Check all channels on startup" "Check all channels on startup" +"Check the channel every" "Check the channel every" + +"never" "never" +"5 minutes" "5 minutes" +"15 minutes" "15 minutes" +"30 minutes" "30 minutes" +"1 hour" "1 hour" +"2 hour" "2 hour" + + + + +### COLUMLISTVIEW ----------------------------------- + + +"1 new item" "1 novo item" +"%d new items" "%d novos items" +"new" "novo" +"error" "erro" +"not down" "não transferido" +"enquequed" "em fila de espera" +"downloading" "a transferir" +"downloaded" "transferido" +"connecting" "a conectar" +"not found" "não encontrado" +"stopped" "parado" +"can't connect" "can't connect" +"invalid format" "invalid format" + +"Icon" "Icon" +"Title" "Título" +"Date" "Data" +"Size" "Tamanho" +"Status" "Estado" +"Download" "Transferir" + + + +### CONTEXT MENU ----------------------------------- + +"Add Channel" "Adicionar Canal" +"Remove Channel" "Remover Canal" +"Check Channel" "Verificar Canal" +"Open Homepage" "Abrir Homepage" + +"Open Web Page" "Open Web Page" +"Open Enclosures folder" "Abrir pasta dos anexos" +"Check All Channels" "Verificar todos os Canais" + +"Show Channel Image" "Show Channel Image" + +"Play enclosure" "Ouvir/ver anexo" +"(Re)start download" "(Re)iniciar transferência" +"Stop download" "Parar transferência" +"Remove Item" "Remover Item" + +"Find this Item" "Procurar este item" +"Remove from this list" "Remover desta lista" + + + +### ALERT ----------------------------------- + +"You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" "Só pode adicionar até 10 canais nesta versão não registada do BePodder.\nPor favor registe a sua cópia\n" + + +"Can't open the selected file with:\n\n" "Não é possível abrir o ficheiro seleccionado com:\n\n" +"\n\nPlease check if the application is installed in the right way.\n" "\n\nPor favor verifique se a aplicação está instalada correctamente.\n" + +"Download it!" "Transfira!" + +"\nRemoving.." "\nA remover.." +"\nAn error occured while removing!" \nOcorreu um erro durante a remoção!" +"Check all the podcasts for new items" "Verificar se existem novos items em todos os podcasts" + +# multi line text... please translate only the text after _value= and don't remove empty space + +_key="alert1" + _value=" +Vai remover o item seleccionado. + +Tem a certeza? +(perderá o anexo se presente)" + + +_key="alert2a" + _value=" +Vai remover o canal: + +" + +_key="alert2b" + _value=" + +Pretende apenas arquivar o canal (mantendo +todos os ficheiros e anexos transferidos) or +quer APAGAR do seu computador o canal na +sua totalidade?" + +_key="alert3" + _value=" +A optimizar o arquivo.." + +_key="alert_3gp" + _value=" +3GP é um formato multimédia, definido pelo projecto Third Generation Partnership Project (3GPP) para ser usado em telemóveis 3G. Armazena vídeos como MPEG-4 ou H.263, e áudio como AMR-NB ou AAC-LC. + +VideoLAN VLC ainda não suporta o formato de áudio AMR (3GPP)" + +_key="alert_swf" + _value=" +SWF é um formato proprietário de ficheiros de gráficos vectoriais produzido pelo software Flash da Adobe (anteriormente Macromedia). + +Actualmente o suporte Flash no BeOS/Haiku/Zeta está limitado a um leitor Flash versão 4.1015, não existe um leitor Flash recente." + + +### HELP & SHORTCUTS ----------------------------------- + + +"Introduction" "Introducão" +"The User Interface" "O Interface do Utilizador" +"Menu Bar" "Barra de Menu" +"Toolbar Buttons" "Botões da Barra de Ferramentas" +"First time with BePodder" "Primeira vez com o BePodder" +"Download Podcast's enclosure files" "Transferir anexos dos Podcasts" +"Settings Overview" "Vista geral das definições" +"Directory lists" "Listas de Directórios" +"Loading Help..." "A carregar a Ajuda..." +"Register your copy" "Registe a sua cópia" +"Starting point" "Ponto de arranque" + + +# multi line text... please translate only the text after _value= and don't remove empty space + + +_key="help1-0" + _value="Welcome to the BePodder Getting Started Guide." + +_key="help1-1" + _value="Se já está familiarizado com podcasts e feeds RSS pode começar a usar o BePodder imediatamente fechando esta janela." + +_key="help1-2" +_value="Se não for o caso, esta é uma pequena introdução que lhe irá fornecer tudo o que precisa de saber para começar a usar o BePodder.Utilize os botões abaixo para ver este tutorial." + + +_key="help2-0" + _value="Podcasts são um método de publicação de áudio e vídeo na Internet; +links para ficheiros vídeo e áudio, gratuitos, são anexados aos feeds RSS e Atom." + +_key="help2-1" +_value="Portanto, Podcasts são apenas um método de distribuição multimédia online; os utilizadores podem subscrever um podcast usando para tal um feed (como o RSS 'Really Simple Syndication' ou o Atom)." + +_key="help2-2" +_value="Um agregador Existe software, como o BePodder, que agrega (podcatcher) todos os feeds que subscreveu e que periodicamente verifica se há novo conteúdo e o transfere. Com o BePodder pode procurar por novos episódios nos seus Canais. Qualquer um pode conter um anexo, como o e-mail o faz também." + + +_key="help3-0" +_value="O BePodder tem um interface fácil de utilizar mas poderoso ao mesmo tempo. A janela principal está dividida em três paineis:" + +_key="help3-1" +_value="1) A lista de Subscrições (o painel com o número 1 na imagem) contém a lista de Podcasts subscritos por si. Quando clica num Canal pode ver no painel 2 a lista de items do canal." + +_key="help3-2" +_value="2) A lista de Episódios com todos os items disponíveis." + +_key="help3-3" +_value="3) O painel de informações exibe: informação do episódio, informação do canal ou informação das transferências; pode seleccionar um painel de informações clicando num dos três botões." + + + +_key="help4-0" +_value="No cimo da janela principal do BePodder está a barra de menus com sete menus disponíveis: Ficheiro, Definições, Subscrições, Episódios, Listas, Ver e Ajuda. Alguns comandos nos menus têm uma seta à direita que indica a existência dum submenu com comandos relacionados. À medida que explora cada menu, não se esqueça de navegar pelos submenus também. Clique nos menus para ver os comandos de cada um:" + +_key="help4-1" +_value="Ficheiro: contém comandos para fechar esta aplicação e mostrar informação sobre o BePodder" + +_key="help4-2" +_value="Definiçõe: contém comandos para abrir as Preferências, que lhe permite customizar várias definições do BePodder." + +_key="help4-3" +_value="Subscrições: contém comandos que executam acções no canal escolhido, da sua lista de subscrições." + +_key="help4-4" +_value="Episódios: contém comandos que executam acções no item seleccionado (episódio) da lista dos episódios do canal." + +_key="help4-5" +_value="Listas: contém comandos para abrir os directórios OPML do BePodder." + +_key="help4-6" +_value="Ver: contém comandos e controlos para a janela do BePodder." + +_key="help4-7" +_value="Ajuda: contém comandos para abrir o 'Guia de Arranque' do BePodder e a 'Lista de Atalhos do Teclado'." + + + +_key="help5-0" + _value="Botão Adicionar: abre a janela Adicionar para que possa adicionar um URL (endereço) dum feed (p.e. http://www.newpodcast.com/rss.xml), normalmente fornecido na homepage do podcast; procure por um link de texto ou gráfico que diga algo como 'XML', 'RSS' ou 'Podcast Feed'." + +_key="help5-1" + _value="Botão Remover Canal: abre uma janela na qual pode seleccionar como remover o canal: arquivar apenas o canal (mantendo todos os ficheiros e anexos transferidos até à data) ou apagar totalmente o canal do seu computador." + +_key="help5-2" + _value="Botão de Verificação: verifica o canal seleccionado e actualiza a lista com novos items disponiveis para esse podcast, se os houver." + +_key="help5-3" + _value="Botão Web: mostra a homepage do canal no browser. Para escolher o seu browser preferido abra as Preferências do BePodder, clicando no menu Definiçoes->Preferências... e na janela das Preferências em 'Tipo de Ficheiro' seleccione o seu browser preferido." + +_key="help5-4" + _value="Botão de Leitura: com este botão pode ver ou ouvir os anexos do ite (episódio) seleccionado. Para escolher o seu leitor preferido abra as Preferências do BePodder, clicando no menu Definiçoes->Preferências... e na janela das Preferências em 'Tipo de Ficheiro' seleccione o seu leitor." + +_key="help5-5" + _value="Botão Transferir: transfere o(s) anexo(s) do item seleccionado (episódio); pode ver informação sobre a transferência clicando no terceiro botão no painel de informação." + +_key="help5-6" + _value="Botão Stop: pára a transferência do anexo do item (episódio) seleccionado; para resumir a transferência clique duas vezes o item ou seleccione-o e clique novamente no botão Transferir." + +_key="help5-7" + _value="Botão Remover Item: apaga o item seleccionado (perderá o anexo nele incluído)." + + + + +_key="help6-0" + _value="Começar a utilizar o BePodder é fácil." + +_key="help6-1" + _value="À esquerda pode ver uma lista das suas subscrições. Adicionámos algumas por si, mas pode sempre adicionar as suas de duas maneiras:" + +_key="help6-2" + _value="1) clique no botão 'Adicionar o podcast...', e de seguida na janela que aparece, escreva o endereço do feed (por exemplo: http://www.newpodcast.com/rss.xml) e clique em Adicionar." + +_key="help6-3" + _value="2) Seleccione o menu 'Directório' e depois 'Lista de Podcasts' ou 'Lista de Videoblogs', escolha um podcast e clique em 'Subscrever'." + +_key="help6-4" + _value="Se seleccionar um Podcast da lista e clicar no botão, o BePodder adiciona os novos items na 'Lista de Episódios' à direita; pode verificar todos os seus podcasts ao clicar com o botão direito e seleccionar 'Verificar todos os Canais' no menu." + +_key="help6-5" + _value="Veja as imagens acima, três items estão com um ponto negro na primeira coluna da 'Lista de Episódios'." + +_key="help6-6" + _value="Na segunda coluna existem ícones que indicam o estado do item:" + +_key="help6-7" + _value="- o Episódio 4 tem um ícone que indica um erro" + +_key="help6-8" + _value="- o Episódio 3 tem um ícone que indica que a transferência do anexo está em fila de espera" + +_key="help6-9" + _value="- o Episódio 2 tem um ícone que indica que o BePodder está a transferir o anexo" + +_key="help6-10" + _value="- o Episódio 1 tem um ícone que indica que o BePodder acabou de transferir o anexo" + + + +_key="help7-0" + _value="Seleccione um item na 'Lista de Episódios' e depois faça duplo-clique no item ou clique no botão (Transfere...); pode sempre interromper a transferência clicando no botão 'Parar transferência'." + +_key="help7-1" + _value="Quando clica num Podcast na 'Lista de Podcasts', o programa mostra-lhe na lista à direita todos os items disponíveis para esse Podcast. Seleccione um item e clique em 'Ouvir/Ver ...' para ver ou ouvir o ficheiro." + +_key="help7-2" + _value="Pode aceder à pasta dos anexos clicando no ícone da pasta no painel de Informação ou clicando com o botão direito e seleccionando 'Abrir pasta dos anexos' no menu." + + + +_key="help8-0" + _value="Pode aceder às Preferências clicando no menu Definições->Preferências. Pode escolher uma categoria da lista à esquerda: Tipo de Ficheiro, Canais, Transferências e Servidor Proxy."" + +_key="help8-1" + _value="- Tipo de Ficheiro: para especificar o browser e o leitor preferidos." + +_key="help8-2" + _value="- Canais: para especificar preferências que controlam a verificação de novos items nos canais; pode escolher entre verificar Todos no arranque do BePodder ou num intervalo especificado de minutos." + +_key="help8-3" + _value="- Transferências: para especificar o número máximo de anexos que podem ser transferidos ao mesmo tempo." + +_key="help8-4" + _value="- Servidor Proxy: para configurar um servidor proxy para trabalhar com o BePodder; um servidor de proxy actua como uma barreira de segurança entre a sua rede interna e a Internet, mantendo quem está na Internet afastados, impedindo-os de aceder à sua informação na rede interna." + + + +_key="help9-0" + _value="O BePodder tem incluídos directórios OPML de videoblogs, feeds de imagens, feeds de notícias, feeds bittorrent e feeds internacionais com milhares de feeds organizados por categorias." + +_key="help9-1" + _value="OPML (Outline Processor Markup Language) é um formato com base em XML que permite a troca de informação estruturada entre aplicações." + +_key="help9-2" + _value="Um directório OPML pode ser acedido clicando no menu 'Listas' e de seguida escolhendo a lista. Para navegar o directório à procura dum feed, expanda a lista clicando na seta da categoria desejada (ver imagem); ao usar este método, pode expandir o directório OPML até encontrar o feed desejado. Uma vez seleccionado, pode adicioná-lo à lista de subscrições clicando no botão 'Subscrever', pode também fechar todas as categorias na lista de directórios clicando no botão 'Fechar Todos'." + + +_key="help_shortcut1" +_value="Esta página descreve os atalhos de teclado que podem ser utilizados no BePodder. Os atalhos estão aqui agrupados por função." + +_key="help_shortcut2" +_value="signifca que pode utilizar ou Alt ou Control (p.e. Alt+Q ou Ctrl+Q Fecha a aplicação), dependendo da configuração por si definida nas Preferências da Deskbar na secção Teclado (a tecla de atalho pré-definida é Alt)." + +_key="help_shortcut3" + _value="atalhos gerais" + +_key="help_shortcut4" + _value="Fecha a aplicação" + +_key="help_shortcut5" + _value="Exibe a janela das Preferências" + +_key="help_shortcut6" + _value="Exibe a lista do directório de Podcasts" + +_key="help_shortcut7" + _value="Existe a lista do directório de Videoblogs" + +_key="help_shortcut8" + _value="Exibe a lista do directório de feeds de Imagens" + +_key="help_shortcut9" + _value="Exibe a lista do directório de feeds de Notícias" + +_key="help_shortcut9b" + _value="Exibe a lista do directório de feeds Bittorrent" + +_key="help_shortcut9c" + _value="Exibe a lista do directório de feeds Internacionais" + +_key="help_shortcut10" + _value="Ecrã Total" + +_key="help_shortcut11" + _value="Exibe/Esconde a barra de ferramentas" + +_key="help_shortcut12" + _value="Exibe o Guia de Arranque" + +_key="help_shortcut13" + _value="Exibe a página com os atalhos de Teclado" + +_key="help_shortcut14" + _value="Atalhos dos Canais" + +_key="help_shortcut15" + _value="Adiciona um podcast à lista de subscrições" + +_key="help_shortcut16" + _value="Apaga o podcast seleccionado à lista de subscrições" list" + +_key="help_shortcut17" + _value="Verifica se existem actualizações para o podcast seleccionado" + +_key="help_shortcut18" + _value="Verifica se existem actualizações para todos os podcasts" + +_key="help_shortcut19" + _value="Exibe a homepage do podcast" + +_key="help_shortcut20" + _value="Abre a pasta dos anexos" + +_key="help_shortcut21" + _value="Atalhos dos Episódios" + +_key="help_shortcut22" + _value="Lê anexo" + +_key="help_shortcut23" + _value="Resume a transferência dos episódios seleccionados" + +_key="help_shortcut24" + _value="Pára a transferência do episódio" + +_key="help_shortcut25" + _value="Apaga o episódio seleccionado" + +_key="help_shortcut26" + _value="Exibe a página do episódio do podcast" + +_key="help_shortcut27" + _value="Abre a pasta dos anexos" + +_key="help_buy1" + _value="O BePodder Light é uma versão básica (transferência grátis e sem limite de tempo), a versão registada adiciona as melhorias: número ilimitado de canais, vista de Canal, suporte para servidor de proxy, verificação automática de canais, transferência simultânea de 5 anexos." + +_key="help_buy2" + _value="Por favor compre a versão registada, são apenas 15 euros (a Kagi adiciona impostos de venda em alguns países). A licença do BePodder pode ser adquirida online através da Kagi." + +_key="help_buy3" + _value="Compre em www.funkyideasoft.com" + +_key="help_buy4" + _value="Após a compra, um e-mail ser-lhe-á enviado com um ficheiro chave e instruções sobre como instalá-lo. Basta descompactar o ficheiro e movê-lo para um directório." + +_key="help_buy5" + _value="Pode actualizar o BePodder sem problemas, quando uma nova versão fica disponível. O ficheiro chave desbloqueia todos os pacotes transferidos, a não ser que receba instruções em contrário." + + + +### USELESS ######## + +"Opml Editor" "Editor Opml" +"name:" "nome:" +"Add a categorie" "Adicionar uma categoria" +"Add a new Broadcast" "Adicionar um novo Broadcast" +"feed:" "feed:" +"url:" "endereço:" +"Test podcast" "Testar o podcast" +"Del a categorie" "Apagar uma a categoria" +"Add a categorie" "Adicionar uma categoria" +"Select the podcast categorie:" "Seleccione a categoria do podcast:" +"Check all" "Verificar todos" +"Check" "Verificar" +"Refresh the list" "Actualizar a lista" +"Load" "Carregar" +"Load the list" "Carregar a lista" +"Save" "Gravar" +"Save the list" "Gravar a lista" +"Revert" "Revert" +"Apply" "Apply" + + + + + + + + + + + + diff --git a/release/Language/Dictionaries/BePodder.ruRU b/release/Language/Dictionaries/BePodder.ruRU new file mode 100644 index 0000000..296dac8 --- /dev/null +++ b/release/Language/Dictionaries/BePodder.ruRU @@ -0,0 +1,604 @@ + +# Locale file for BePodder. +# Modified: 4/18/2006 +# Author: BePodderTeam +# E-mail: bepodder.team@gmail.com + + +# Attention: don't remove empty space or \n + + +### SHAREWARE POPUPS ----------------------------------- + +"Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" "Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" + +"This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" "This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" + +"Web Site" "Web Site" + +"Can't connect!" "Can't connect!" +"Http port failed!" "Http port failed!" +"Can't resolve host!" "Can't resolve host!" +"Not found!" "Not found!" +"Bad resume!" "Bad resume!" +"Aborted by Callback!" "Aborted by Callback!" +"Can't resume! (range error)" "Can't resume! (range error)" +"Access Denied!" "Access Denied!" +"User or Password Incorrect!" "User or Password Incorrect!" +"Other error (cUrl code: " "Other error (cUrl code: " +"cUrl init error!" "cUrl init error!" +"Can't open file!" "Can't open file!" +"Other error (status code: " "Other error (status code: " +"Downloading" "Downloading" + + +### MENUBAR ----------------------------------- + +"File" "File" +"About..." "About..." +"Close!" "Close!" +"Quit" "Quit" + +"Settings" "Settings" +"Preferences..." "Preferences..." + +"Subscriptions" "Subscriptions" + +"Episodes" "Episodes" + +"Lists" "Lists" +"Podcast List" "Podcast List" +"Podcast directory list" "Podcast directory list" +"Videoblog List" "Videoblog List" +"Videoblog directory list" "Videoblog directory list" +"Imagefeeds List" "Imagefeeds List" +"Imagefeeds directory list" "Imagefeeds directory list" +"Newsfeeds List" "Newsfeeds List" +"Newsfeeds directory list" "Newsfeeds directory list" +"BitTorrentfeeds List" "BitTorrentfeeds List" +"BitTorrentfeeds directory list" "BitTorrentfeeds directory list" +"Internationalfeeds List" "Internationalfeeds List" +"Internationalfeeds directory list" "Internationalfeeds directory list" + +"View" "View" +"Full Screen" "Full Screen" +"Toolbar" "Toolbar" +"Subscriptions View" "Subscriptions View" +"Small Items" "Small Items" +"Big Items" "Big Items" +"Move BePodder on workspace:" "Move BePodder on workspace:" + +"Help" "Help" +"Getting Started" "Getting Started" +"Keyboard Shortcuts" "Keyboard Shortcuts" +"Tutorials" "Tutorials" +"Online Support" "Online Support" + + + + +### BUTTONS ----------------------------------- + +# Buttons add feed window +"Insert the rss feed url!" "Insert the rss feed url!" +"Add" "Add" +"Paste" "Paste" + +# Buttons directory list window +"Collapse All" "Collapse All" +"Preview" "Preview" +"Subscribe" "Subscribe" + + +# Buttons help window +"Next" "Next" +"Prev" "Prev" +"Close" "Close" +"Index" "Index" + + +# Buttons remove windows +"Cancel" "Cancel" +"Delete" "Delete" +"Archive" "Archive" + + + +### TOOLTIPS ----------------------------------- + +# Tooltips toolbar buttons + +"Add the podcast to the Subscriptions list" "Add the podcast to the Subscriptions list" +"Delete the podcast from the Subscriptions list" "Delete the podcast from the Subscriptions list" +"Check the selected podcast for new items" "Check the selected podcast for new items" +"Show the podcast homepage" "Show the podcast homepage" + +"Delete the item and the enclosure" "Delete the item and the enclosure" +"Stop the item download" "Stop the item download" +"Download the selected episode" "Download the selected episode" +"Play the selected episode" "Play the selected episode" + +"Submit bug and idea" "Submit bug and idea" + + +# Tooltips directory window buttons + +"Collapse all categories in the directory list" "Collapse all categories in the directory list" +"Add the selected podcast to the Subscription list" "Add the selected podcast to the Subscription list" +"Checkout a podcast before downloading it" "Checkout a podcast before downloading it" + + +### INFO PANEL ----------------------------------- + +"Show channel Image" "Show Channel Image" +"XML Feed Link" "XML Feed Link" + +"Show Episode info" "Show Episode info" +"Show Subscription info" "Show Subscription info" +"Show Downloads info" "Show Downloads info" + +"Enclosure: " "Enclosure: " + +"Lookup (Dictionary)" "Lookup (Dictionary)" +"Lookup (Google)" "Lookup (Google)" +"Lookup (Acronym Finder)" "Lookup (Acronym Finder)" +"Copy" "Copy" +"Select All" "Select All" +"Copy URL" "Copy URL" +"Open URL" "Open URL" +"Subscription" "Subscription" + + +### PREFERENCES ----------------------------------- + +"Preferences" "Preferences" + +"Proxy" "Proxy" +"Enable Proxy" "Enable Proxy" +"Address" "Address" +"Port" "Port" +"Username" "Username" +"Password" "Password" + +"Max Downloads" "Max Downloads" + +"FileType" "FileType" +"Browser" "Browser" +"Player" "Player" + +"Channels" "Channels" +"Check all channels on startup" "Check all channels on startup" +"Check the channel every" "Check the channel every" + +"never" "never" +"5 minutes" "5 minutes" +"15 minutes" "15 minutes" +"30 minutes" "30 minutes" +"1 hour" "1 hour" +"2 hour" "2 hour" + + + + +### COLUMLISTVIEW ----------------------------------- + + +"1 new item" "1 new item" +"%d new items" "%d new items" +"new" "new" +"error" "error" +"not down" "not down" +"enquequed" "enquequed" +"downloading" "downloading" +"downloaded" "downloaded" +"connecting" "connecting" +"not found" "not found" +"stopped" "stopped" +"can't connect" "can't connect" +"invalid format" "invalid format" + +"Icon" "Icon" +"Title" "Title" +"Date" "Date" +"Size" "Size" +"Status" "Status" +"Download" "Download" + + + +### CONTEXT MENU ----------------------------------- + +"Add Channel" "Add Channel" +"Remove Channel" "Remove Channel" +"Check Channel" "Check Channel" +"Open Homepage" "Open Homepage" + +"Open Web Page" "Open Web Page" +"Open Enclosures folder" "Open Enclosures folder" +"Check All Channels" "Check All Channels" + +"Show Channel Image" "Show Channel Image" + +"Play enclosure" "Play enclosure" +"(Re)start download" "(Re)start download" +"Stop download" "Stop download" +"Remove Item" "Remove Item" + +"Find this Item" "Find this Item" +"Remove from this list" "Remove from this list" + + + +### ALERT ----------------------------------- + +"\nRemoving.." "\nRemoving.." +"\nAn error occured while removing!" "\nAn error occured while removing!" +"Check all the podcasts for new items" "Check all the podcasts for new items" + +"You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" "You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" + + +"Can't open the selected file with:\n\n" "Can't open the selected file with:\n\n" +"\n\nPlease check if the application is installed in the right way.\n" "\n\nPlease check if the application is installed in the right way.\n" +"Download it!" "Download it!" + +# multi line text... please translate only the text after _value= and don't remove empty space + +_key="alert1" + _value=" +You are going to remove the selected item. + +Are you sure? +(you will lost the enclosure file if any)" + + +_key="alert2a" + _value=" +You are going to remove the channel: + +" + +_key="alert2b" + _value=" + +Would you like just to archive this +channel (keeping all the files and +enclosures downloaded so far) or +do you want to DELETE the whole + channel from you computer?" + +_key="alert3" + _value=" +Parsing archive.." + +_key="alert_3gp" + _value=" +3GP is a multimedia container format defined by the Third Generation Partnership Project (3GPP) for use on 3G mobile phones. It stores video streams as MPEG-4 or H.263, and audio streams as AMR-NB or AAC-LC. + +VideoLAN still doesn't support the audio AMR (3GPP)" + +_key="alert_swf" + _value=" +SWF is a proprietary vector graphics file format produced by the Flash software from Adobe (formerly Macromedia). + +Currently Flash support in BeOS/Haiku/Zeta is limited to the old standalone Flash player version 4.1015, there isn't a modern Flash player" + + + + +### HELP & SHORTCUTS ----------------------------------- + + +"Introduction" "Introduction" +"The User Interface" "The User Interface" +"Menu Bar" "Menu Bar" +"Toolbar Buttons" "Toolbar Buttons" +"First time with BePodder" "First time with BePodder" +"Download Podcast's enclosure files" "Download Podcast's enclosure files" +"Settings Overview" "Settings Overview" +"Directory lists" "Directory lists" +"Loading Help..." "Loading Help..." +"Register your copy" "Register your copy" +"Starting point" "Starting point" + + + + +# multi line text... please translate only the text after _value= and don't remove empty space + + +_key="help1-0" + _value="Welcome to the BePodder Getting Started Guide." + +_key="help1-1" + _value="If you are already familiar with podcasts and RSS/Atom feeds you can immediately go to BePodder by closing this window." + +_key="help1-2" +_value="If not, this is a short introduction providing you everything you'll need to know on how to get started with BePodder. Use the buttons below to navigate through this tutorial." + + +_key="help2-0" +_value="Podcasting is a method for publishing audio and video broadcasts via the Internet; links to free audio and video files are enclosed in RSS and Atom feeds." + +_key="help2-1" +_value="Therefore Podcasting is simply a type of online media delivery; users can subscribe to a podcast using a feed (such as RSS 'Really Simple Syndication' or Atom)." + +_key="help2-2" +_value="An aggregator (or podcatcher) like BePodder, is a piece of software that allows you to subscribe to a RSS feed and periodically check for and download new content; with BePodder you can check for new Podcast items (Episodes) of your subscribed Channels. Any item can contain an enclosure, just like an Email can contain an attachment." + + + +_key="help3-0" +_value="BePodder has an easy to use yet powerful Graphical User Interface. The main window is split into tree panels:" + +_key="help3-1" +_value="1) The Subscription list (the panel with the number 1 in the screenshot) with the list of the podcasts that you have subscribed to. When you click on a Channel you can see in the panel 2 the list of the channel's items." + +_key="help3-2" +_value="2) The Episodes list with all the items available." + +_key="help3-3" +_value="3) The Info panel show: episode info, channel info or Downloads info; you can select an info panel by clicking one of the below three buttons." + + + +_key="help4-0" +_value="At the very top of the BePodder main window is the menubar with seven menus available: File, Settings, Subscriptions, Episodes, Lists, View and Help. Some menu commands are followed by a right pointing arrow that indicates a submenu of related commands. As you explore each menu, be sure to take a look at the submenus as well. Click on a menus to show its commands:" + +_key="help4-1" +_value="File: contains commands to close the application and to show information about BePodder" + +_key="help4-2" +_value="Settings: contains command to open the Preferences window that allows you to customize various BePodder settings." + +_key="help4-3" +_value="Subscriptions: contains commands that perform actions on the selected channel of your subscriptions list." + +_key="help4-4" +_value="Episodes: contains commands that perform actions on the selected item (episode) of the channel's episode list." + +_key="help4-5" +_value="Lists: contains commands to open BePodder's OPML directories." + +_key="help4-6" +_value="View: contains commands and controls for the BePodder window." + +_key="help4-7" +_value="Help: contains commands to open BePodder's 'Getting Started Guide' and the 'Keyboard Shortcuts List'." + + + +_key="help5-0" + _value="Add Button: opens the Add Window to add a feed url (e.g. http://www.newpodcast.com/rss.xml) usually given on the podcast homepage; looks for text or graphic link that says something like 'XML', 'RSS' or 'Podcast Feed' on it." + +_key="help5-1" + _value="Channel Remove Button: opens a window in which you can select how remove the channel: just archive the select channel (keeping all the files and eclosure downloaded so far) or delete the whole channel from your computer." + +_key="help5-2" + _value="Check Button: checks the selected channel and updates the list of the available items for that podcast adding the new items." + +_key="help5-3" + _value="Web Button: shows the channel homepage in the browser. To select your favorite browser open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select your favorite browser." + +_key="help5-4" + _value="Play Button: with this button you can view or listen the file enclosure of the selected item(episode). To select your favorite player open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select you favorite player." + +_key="help5-5" + _value="Download Button: downloads the file enclosure of the selected item (episode); you can see the download info by clicking on the third button over the info panel." + +_key="help5-6" + _value="Stop Button: stops to download the file enclosure of the selected item (episode); to resume the download double-click the item (episode) or select the item and click the Download Button" + +_key="help5-7" + _value="Item Remove Button: deletes the selected item (you will loose the enclosure file)." + + + +_key="help6-0" + _value="Getting started with BePodder is easy." + +_key="help6-1" + _value="On the left of the main window you can see the 'Subscription List' with all your feed subscriptions. We have added some subscriptions for you, and you can always add your own in two ways:" + +_key="help6-2" + _value="1) click the Add Button, then insert the feed url (example: http://www.newpodcast.com/rss.xml) and click add." + +_key="help6-3" + _value="2) in the menubar select 'Directory' and then 'Podcast list' or another list, choose a podcast and click 'Subscribe'." + +_key="help6-4" + _value="If you select a Podcast in the subscriptions list and use the check button, BePodder adds the new items to the 'Episodes list' (below on the right); you can check all your podcasts by right-clicking and selecting 'Check All Channels' in the context menu." + +_key="help6-5" + _value="Look at the screenshot above, there are 3 new items indicated by a black dot in the first column of the 'Episodes list'." + +_key="help6-6" + _value="In the second column there are icons that indicate the state of the item:" + +_key="help6-7" + _value="- the Episode 4 has an icon that indicates an error" + +_key="help6-8" + _value="- the Episode 3 has an icon that indicates that the item's enclosure download request is enquequed" + +_key="help6-9" + _value="- the Episode 2 has an icon that indicates that BePodder is downloading the item's enclosure file" + +_key="help6-10" + _value="- the Episode 1 have an icon that indicates that BePodder have just downloaded the item's enclosure file" + + + +_key="help7-0" + _value="Select an item in the 'Episodes list' and then double-click on it (or click the Download Button) to start downloading the enclosed file; you can always stop the download by clicking on the Stop Button." + +_key="help7-1" + _value="When you click on the Subscribed Podcasts in the 'Subscriptions List' the software shows you, in the 'List of episodes', all the items available in that Subscription. Select an item and then click play (Play Button) to view or listen to the file." + +_key="help7-2" + _value="You can access the Enclosures Folder by clicking on the folder icon in the Info Pannel or by right-clicking your mouse on an item and select 'Open Enclosures Folder' in the context menu." + + + +_key="help8-0" + _value="Preferences can be accessed by clicking in the menu-bar Settings>Preferences. You can select a category from the left list of the preferences dialog: FileType, Channels, Download and Proxy." + +_key="help8-1" + _value="- FileType: to specify the default browser and player. " + +_key="help8-2" + _value="- Channels: to specify preferences that control the operation to check channels new items; you can choose to Check all channels on startup or check the channel every desired minutes." + +_key="help8-3" + _value="- Download: to specify the max number of item's files to download at the same time," + +_key="help8-4" + _value="- Proxy: to set up a proxy server to work with BePodder; a proxy server acts as a security barrier between your internal network and the Internet, keeping others on the Internet from accessing information on your internal network." + + + +_key="help9-0" + _value="BePodder has built-in podcast, videoblog, imagefeeds, newsfeeds, bittorrentfeeds and internationalfeeds OPML directories with thousands of feeds grouped by category." + +_key="help9-1" + _value="OPML (Outline Processor Markup Language) is an XML-based format that allows exchange of outline-structured information between applications." + +_key="help9-2" + _value="OPML directory can be accessed by clicking in the menu-bar 'Lists' and thenselecting a list. To browse the opml directory for a feed, expand the list by clicking the arrow of the category that you are interested in (see image); using this method, you can expand the opml directory until you find the desired feed. Once you have selected it, you can add it to the subscription list by clicking the button 'Subscribe', you can also collapse all categories in the directory list by clicking the button 'Collapse All'." + +_key="help_shortcut1" +_value="This page describes the keyboard shortcuts that can be used in BePodder. The shortcuts are grouped here by function." + +_key="help_shortcut2" +_value="means that you can use either alt or control (es. Alt+Q or Ctrl+Q Quit the application), which way you have set it in the Deskbar menu preferences under Keyboard (the default shortcut key is Alt)." + +_key="help_shortcut3" + _value="General shortcuts" + +_key="help_shortcut4" + _value="Quit the application" + +_key="help_shortcut5" + _value="Shows the Preferences window" + +_key="help_shortcut6" + _value="Shows the Podcast directory list" + +_key="help_shortcut7" + _value="Shows the Videoblog directory list" + +_key="help_shortcut8" + _value="Shows the Imagefeeds directory list" + +_key="help_shortcut9" + _value="Shows the Newsfeeds directory list" + +_key="help_shortcut9b" + _value="Shows the BitTorrentfeeds directory list" + +_key="help_shortcut9c" + _value="Shows the Internationalfeeds directory list" + +_key="help_shortcut10" + _value="Fullscreen" + +_key="help_shortcut11" + _value="Shows/Hides the toolbar" + +_key="help_shortcut12" + _value="Shows the Getting Started Help" + +_key="help_shortcut13" + _value="Shows this keyboard shortcuts page" + +_key="help_shortcut14" + _value="Channels shortcuts" + +_key="help_shortcut15" + _value="Add a podcast to the subscriptions list" + +_key="help_shortcut16" + _value="Delete the selected podcast from the subscriptions list" + +_key="help_shortcut17" + _value="Check the selected podcast for new episodes (items)" + +_key="help_shortcut18" + _value="Check all podcasts for new episodes (items)" + +_key="help_shortcut19" + _value="Shows the podcast homepage" + +_key="help_shortcut20" + _value="Open enclosures folder" + +_key="help_shortcut21" + _value="Episodes shortcuts" + +_key="help_shortcut22" + _value="Play enclosure" + +_key="help_shortcut23" + _value="(Re)start download the selected episodes (items)" + +_key="help_shortcut24" + _value="Stop the episode (item) download" + +_key="help_shortcut25" + _value="Delete the selected episode (item)" + +_key="help_shortcut26" + _value="Shows the podcast episode (item) page " + +_key="help_shortcut27" + _value="Open enclosures folder" + +_key="help_buy1" + _value="BePodder Light is the basic version (free download and no time limited), the registered version adds some more nice features: unlimited number of channels, small Channel view, proxy support, automatic channels check, up to 5 enclosure downloads at the same time (multithreading)." + +_key="help_buy2" + _value="Please pay the shareware fee, it's only 15 euro (Kagi add tax in some countries), BePodder licence can be purchased online from Kagi." + +_key="help_buy3" + _value="Buy at www.funkyideasoft.com" + +_key="help_buy4" + _value="After purchasing, an email will be sent to you with a keyfile and instruction on how to install it. It's just a matter of unzipping a file and moving it to a certain directory." + +_key="help_buy5" + _value="There is no problem updating BePodder when a new version becomes available. The keyfile will unlock all downloadable packages unless otherwise notified." + + +### USELESS ######## + +"Opml Editor" "Opml Editor" +"name:" "name:" +"Add a category" "Add a category" +"Add a new Broadcast" "Add a new Broadcast" +"feed:" "feed:" +"url:" "url:" +"Test podcast" "Test podcast" +"Del a category" "Del a category" +"Add a category" "Add a category" +"Select the podcast category:" "Select the podcast category:" +"Check all" "Check all" +"Check" "Check" +"Refresh the list" "Refresh the list" +"Load" "Load" +"Load the list" "Load the list" +"Save" "Save" +"Save the list" "Save the list" +"Revert" "Revert" +"Apply" "Apply" + + + + + + + + + + + + diff --git a/release/Language/Dictionaries/BePodder.svSE b/release/Language/Dictionaries/BePodder.svSE new file mode 100644 index 0000000..296dac8 --- /dev/null +++ b/release/Language/Dictionaries/BePodder.svSE @@ -0,0 +1,604 @@ + +# Locale file for BePodder. +# Modified: 4/18/2006 +# Author: BePodderTeam +# E-mail: bepodder.team@gmail.com + + +# Attention: don't remove empty space or \n + + +### SHAREWARE POPUPS ----------------------------------- + +"Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" "Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" + +"This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" "This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" + +"Web Site" "Web Site" + +"Can't connect!" "Can't connect!" +"Http port failed!" "Http port failed!" +"Can't resolve host!" "Can't resolve host!" +"Not found!" "Not found!" +"Bad resume!" "Bad resume!" +"Aborted by Callback!" "Aborted by Callback!" +"Can't resume! (range error)" "Can't resume! (range error)" +"Access Denied!" "Access Denied!" +"User or Password Incorrect!" "User or Password Incorrect!" +"Other error (cUrl code: " "Other error (cUrl code: " +"cUrl init error!" "cUrl init error!" +"Can't open file!" "Can't open file!" +"Other error (status code: " "Other error (status code: " +"Downloading" "Downloading" + + +### MENUBAR ----------------------------------- + +"File" "File" +"About..." "About..." +"Close!" "Close!" +"Quit" "Quit" + +"Settings" "Settings" +"Preferences..." "Preferences..." + +"Subscriptions" "Subscriptions" + +"Episodes" "Episodes" + +"Lists" "Lists" +"Podcast List" "Podcast List" +"Podcast directory list" "Podcast directory list" +"Videoblog List" "Videoblog List" +"Videoblog directory list" "Videoblog directory list" +"Imagefeeds List" "Imagefeeds List" +"Imagefeeds directory list" "Imagefeeds directory list" +"Newsfeeds List" "Newsfeeds List" +"Newsfeeds directory list" "Newsfeeds directory list" +"BitTorrentfeeds List" "BitTorrentfeeds List" +"BitTorrentfeeds directory list" "BitTorrentfeeds directory list" +"Internationalfeeds List" "Internationalfeeds List" +"Internationalfeeds directory list" "Internationalfeeds directory list" + +"View" "View" +"Full Screen" "Full Screen" +"Toolbar" "Toolbar" +"Subscriptions View" "Subscriptions View" +"Small Items" "Small Items" +"Big Items" "Big Items" +"Move BePodder on workspace:" "Move BePodder on workspace:" + +"Help" "Help" +"Getting Started" "Getting Started" +"Keyboard Shortcuts" "Keyboard Shortcuts" +"Tutorials" "Tutorials" +"Online Support" "Online Support" + + + + +### BUTTONS ----------------------------------- + +# Buttons add feed window +"Insert the rss feed url!" "Insert the rss feed url!" +"Add" "Add" +"Paste" "Paste" + +# Buttons directory list window +"Collapse All" "Collapse All" +"Preview" "Preview" +"Subscribe" "Subscribe" + + +# Buttons help window +"Next" "Next" +"Prev" "Prev" +"Close" "Close" +"Index" "Index" + + +# Buttons remove windows +"Cancel" "Cancel" +"Delete" "Delete" +"Archive" "Archive" + + + +### TOOLTIPS ----------------------------------- + +# Tooltips toolbar buttons + +"Add the podcast to the Subscriptions list" "Add the podcast to the Subscriptions list" +"Delete the podcast from the Subscriptions list" "Delete the podcast from the Subscriptions list" +"Check the selected podcast for new items" "Check the selected podcast for new items" +"Show the podcast homepage" "Show the podcast homepage" + +"Delete the item and the enclosure" "Delete the item and the enclosure" +"Stop the item download" "Stop the item download" +"Download the selected episode" "Download the selected episode" +"Play the selected episode" "Play the selected episode" + +"Submit bug and idea" "Submit bug and idea" + + +# Tooltips directory window buttons + +"Collapse all categories in the directory list" "Collapse all categories in the directory list" +"Add the selected podcast to the Subscription list" "Add the selected podcast to the Subscription list" +"Checkout a podcast before downloading it" "Checkout a podcast before downloading it" + + +### INFO PANEL ----------------------------------- + +"Show channel Image" "Show Channel Image" +"XML Feed Link" "XML Feed Link" + +"Show Episode info" "Show Episode info" +"Show Subscription info" "Show Subscription info" +"Show Downloads info" "Show Downloads info" + +"Enclosure: " "Enclosure: " + +"Lookup (Dictionary)" "Lookup (Dictionary)" +"Lookup (Google)" "Lookup (Google)" +"Lookup (Acronym Finder)" "Lookup (Acronym Finder)" +"Copy" "Copy" +"Select All" "Select All" +"Copy URL" "Copy URL" +"Open URL" "Open URL" +"Subscription" "Subscription" + + +### PREFERENCES ----------------------------------- + +"Preferences" "Preferences" + +"Proxy" "Proxy" +"Enable Proxy" "Enable Proxy" +"Address" "Address" +"Port" "Port" +"Username" "Username" +"Password" "Password" + +"Max Downloads" "Max Downloads" + +"FileType" "FileType" +"Browser" "Browser" +"Player" "Player" + +"Channels" "Channels" +"Check all channels on startup" "Check all channels on startup" +"Check the channel every" "Check the channel every" + +"never" "never" +"5 minutes" "5 minutes" +"15 minutes" "15 minutes" +"30 minutes" "30 minutes" +"1 hour" "1 hour" +"2 hour" "2 hour" + + + + +### COLUMLISTVIEW ----------------------------------- + + +"1 new item" "1 new item" +"%d new items" "%d new items" +"new" "new" +"error" "error" +"not down" "not down" +"enquequed" "enquequed" +"downloading" "downloading" +"downloaded" "downloaded" +"connecting" "connecting" +"not found" "not found" +"stopped" "stopped" +"can't connect" "can't connect" +"invalid format" "invalid format" + +"Icon" "Icon" +"Title" "Title" +"Date" "Date" +"Size" "Size" +"Status" "Status" +"Download" "Download" + + + +### CONTEXT MENU ----------------------------------- + +"Add Channel" "Add Channel" +"Remove Channel" "Remove Channel" +"Check Channel" "Check Channel" +"Open Homepage" "Open Homepage" + +"Open Web Page" "Open Web Page" +"Open Enclosures folder" "Open Enclosures folder" +"Check All Channels" "Check All Channels" + +"Show Channel Image" "Show Channel Image" + +"Play enclosure" "Play enclosure" +"(Re)start download" "(Re)start download" +"Stop download" "Stop download" +"Remove Item" "Remove Item" + +"Find this Item" "Find this Item" +"Remove from this list" "Remove from this list" + + + +### ALERT ----------------------------------- + +"\nRemoving.." "\nRemoving.." +"\nAn error occured while removing!" "\nAn error occured while removing!" +"Check all the podcasts for new items" "Check all the podcasts for new items" + +"You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" "You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" + + +"Can't open the selected file with:\n\n" "Can't open the selected file with:\n\n" +"\n\nPlease check if the application is installed in the right way.\n" "\n\nPlease check if the application is installed in the right way.\n" +"Download it!" "Download it!" + +# multi line text... please translate only the text after _value= and don't remove empty space + +_key="alert1" + _value=" +You are going to remove the selected item. + +Are you sure? +(you will lost the enclosure file if any)" + + +_key="alert2a" + _value=" +You are going to remove the channel: + +" + +_key="alert2b" + _value=" + +Would you like just to archive this +channel (keeping all the files and +enclosures downloaded so far) or +do you want to DELETE the whole + channel from you computer?" + +_key="alert3" + _value=" +Parsing archive.." + +_key="alert_3gp" + _value=" +3GP is a multimedia container format defined by the Third Generation Partnership Project (3GPP) for use on 3G mobile phones. It stores video streams as MPEG-4 or H.263, and audio streams as AMR-NB or AAC-LC. + +VideoLAN still doesn't support the audio AMR (3GPP)" + +_key="alert_swf" + _value=" +SWF is a proprietary vector graphics file format produced by the Flash software from Adobe (formerly Macromedia). + +Currently Flash support in BeOS/Haiku/Zeta is limited to the old standalone Flash player version 4.1015, there isn't a modern Flash player" + + + + +### HELP & SHORTCUTS ----------------------------------- + + +"Introduction" "Introduction" +"The User Interface" "The User Interface" +"Menu Bar" "Menu Bar" +"Toolbar Buttons" "Toolbar Buttons" +"First time with BePodder" "First time with BePodder" +"Download Podcast's enclosure files" "Download Podcast's enclosure files" +"Settings Overview" "Settings Overview" +"Directory lists" "Directory lists" +"Loading Help..." "Loading Help..." +"Register your copy" "Register your copy" +"Starting point" "Starting point" + + + + +# multi line text... please translate only the text after _value= and don't remove empty space + + +_key="help1-0" + _value="Welcome to the BePodder Getting Started Guide." + +_key="help1-1" + _value="If you are already familiar with podcasts and RSS/Atom feeds you can immediately go to BePodder by closing this window." + +_key="help1-2" +_value="If not, this is a short introduction providing you everything you'll need to know on how to get started with BePodder. Use the buttons below to navigate through this tutorial." + + +_key="help2-0" +_value="Podcasting is a method for publishing audio and video broadcasts via the Internet; links to free audio and video files are enclosed in RSS and Atom feeds." + +_key="help2-1" +_value="Therefore Podcasting is simply a type of online media delivery; users can subscribe to a podcast using a feed (such as RSS 'Really Simple Syndication' or Atom)." + +_key="help2-2" +_value="An aggregator (or podcatcher) like BePodder, is a piece of software that allows you to subscribe to a RSS feed and periodically check for and download new content; with BePodder you can check for new Podcast items (Episodes) of your subscribed Channels. Any item can contain an enclosure, just like an Email can contain an attachment." + + + +_key="help3-0" +_value="BePodder has an easy to use yet powerful Graphical User Interface. The main window is split into tree panels:" + +_key="help3-1" +_value="1) The Subscription list (the panel with the number 1 in the screenshot) with the list of the podcasts that you have subscribed to. When you click on a Channel you can see in the panel 2 the list of the channel's items." + +_key="help3-2" +_value="2) The Episodes list with all the items available." + +_key="help3-3" +_value="3) The Info panel show: episode info, channel info or Downloads info; you can select an info panel by clicking one of the below three buttons." + + + +_key="help4-0" +_value="At the very top of the BePodder main window is the menubar with seven menus available: File, Settings, Subscriptions, Episodes, Lists, View and Help. Some menu commands are followed by a right pointing arrow that indicates a submenu of related commands. As you explore each menu, be sure to take a look at the submenus as well. Click on a menus to show its commands:" + +_key="help4-1" +_value="File: contains commands to close the application and to show information about BePodder" + +_key="help4-2" +_value="Settings: contains command to open the Preferences window that allows you to customize various BePodder settings." + +_key="help4-3" +_value="Subscriptions: contains commands that perform actions on the selected channel of your subscriptions list." + +_key="help4-4" +_value="Episodes: contains commands that perform actions on the selected item (episode) of the channel's episode list." + +_key="help4-5" +_value="Lists: contains commands to open BePodder's OPML directories." + +_key="help4-6" +_value="View: contains commands and controls for the BePodder window." + +_key="help4-7" +_value="Help: contains commands to open BePodder's 'Getting Started Guide' and the 'Keyboard Shortcuts List'." + + + +_key="help5-0" + _value="Add Button: opens the Add Window to add a feed url (e.g. http://www.newpodcast.com/rss.xml) usually given on the podcast homepage; looks for text or graphic link that says something like 'XML', 'RSS' or 'Podcast Feed' on it." + +_key="help5-1" + _value="Channel Remove Button: opens a window in which you can select how remove the channel: just archive the select channel (keeping all the files and eclosure downloaded so far) or delete the whole channel from your computer." + +_key="help5-2" + _value="Check Button: checks the selected channel and updates the list of the available items for that podcast adding the new items." + +_key="help5-3" + _value="Web Button: shows the channel homepage in the browser. To select your favorite browser open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select your favorite browser." + +_key="help5-4" + _value="Play Button: with this button you can view or listen the file enclosure of the selected item(episode). To select your favorite player open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select you favorite player." + +_key="help5-5" + _value="Download Button: downloads the file enclosure of the selected item (episode); you can see the download info by clicking on the third button over the info panel." + +_key="help5-6" + _value="Stop Button: stops to download the file enclosure of the selected item (episode); to resume the download double-click the item (episode) or select the item and click the Download Button" + +_key="help5-7" + _value="Item Remove Button: deletes the selected item (you will loose the enclosure file)." + + + +_key="help6-0" + _value="Getting started with BePodder is easy." + +_key="help6-1" + _value="On the left of the main window you can see the 'Subscription List' with all your feed subscriptions. We have added some subscriptions for you, and you can always add your own in two ways:" + +_key="help6-2" + _value="1) click the Add Button, then insert the feed url (example: http://www.newpodcast.com/rss.xml) and click add." + +_key="help6-3" + _value="2) in the menubar select 'Directory' and then 'Podcast list' or another list, choose a podcast and click 'Subscribe'." + +_key="help6-4" + _value="If you select a Podcast in the subscriptions list and use the check button, BePodder adds the new items to the 'Episodes list' (below on the right); you can check all your podcasts by right-clicking and selecting 'Check All Channels' in the context menu." + +_key="help6-5" + _value="Look at the screenshot above, there are 3 new items indicated by a black dot in the first column of the 'Episodes list'." + +_key="help6-6" + _value="In the second column there are icons that indicate the state of the item:" + +_key="help6-7" + _value="- the Episode 4 has an icon that indicates an error" + +_key="help6-8" + _value="- the Episode 3 has an icon that indicates that the item's enclosure download request is enquequed" + +_key="help6-9" + _value="- the Episode 2 has an icon that indicates that BePodder is downloading the item's enclosure file" + +_key="help6-10" + _value="- the Episode 1 have an icon that indicates that BePodder have just downloaded the item's enclosure file" + + + +_key="help7-0" + _value="Select an item in the 'Episodes list' and then double-click on it (or click the Download Button) to start downloading the enclosed file; you can always stop the download by clicking on the Stop Button." + +_key="help7-1" + _value="When you click on the Subscribed Podcasts in the 'Subscriptions List' the software shows you, in the 'List of episodes', all the items available in that Subscription. Select an item and then click play (Play Button) to view or listen to the file." + +_key="help7-2" + _value="You can access the Enclosures Folder by clicking on the folder icon in the Info Pannel or by right-clicking your mouse on an item and select 'Open Enclosures Folder' in the context menu." + + + +_key="help8-0" + _value="Preferences can be accessed by clicking in the menu-bar Settings>Preferences. You can select a category from the left list of the preferences dialog: FileType, Channels, Download and Proxy." + +_key="help8-1" + _value="- FileType: to specify the default browser and player. " + +_key="help8-2" + _value="- Channels: to specify preferences that control the operation to check channels new items; you can choose to Check all channels on startup or check the channel every desired minutes." + +_key="help8-3" + _value="- Download: to specify the max number of item's files to download at the same time," + +_key="help8-4" + _value="- Proxy: to set up a proxy server to work with BePodder; a proxy server acts as a security barrier between your internal network and the Internet, keeping others on the Internet from accessing information on your internal network." + + + +_key="help9-0" + _value="BePodder has built-in podcast, videoblog, imagefeeds, newsfeeds, bittorrentfeeds and internationalfeeds OPML directories with thousands of feeds grouped by category." + +_key="help9-1" + _value="OPML (Outline Processor Markup Language) is an XML-based format that allows exchange of outline-structured information between applications." + +_key="help9-2" + _value="OPML directory can be accessed by clicking in the menu-bar 'Lists' and thenselecting a list. To browse the opml directory for a feed, expand the list by clicking the arrow of the category that you are interested in (see image); using this method, you can expand the opml directory until you find the desired feed. Once you have selected it, you can add it to the subscription list by clicking the button 'Subscribe', you can also collapse all categories in the directory list by clicking the button 'Collapse All'." + +_key="help_shortcut1" +_value="This page describes the keyboard shortcuts that can be used in BePodder. The shortcuts are grouped here by function." + +_key="help_shortcut2" +_value="means that you can use either alt or control (es. Alt+Q or Ctrl+Q Quit the application), which way you have set it in the Deskbar menu preferences under Keyboard (the default shortcut key is Alt)." + +_key="help_shortcut3" + _value="General shortcuts" + +_key="help_shortcut4" + _value="Quit the application" + +_key="help_shortcut5" + _value="Shows the Preferences window" + +_key="help_shortcut6" + _value="Shows the Podcast directory list" + +_key="help_shortcut7" + _value="Shows the Videoblog directory list" + +_key="help_shortcut8" + _value="Shows the Imagefeeds directory list" + +_key="help_shortcut9" + _value="Shows the Newsfeeds directory list" + +_key="help_shortcut9b" + _value="Shows the BitTorrentfeeds directory list" + +_key="help_shortcut9c" + _value="Shows the Internationalfeeds directory list" + +_key="help_shortcut10" + _value="Fullscreen" + +_key="help_shortcut11" + _value="Shows/Hides the toolbar" + +_key="help_shortcut12" + _value="Shows the Getting Started Help" + +_key="help_shortcut13" + _value="Shows this keyboard shortcuts page" + +_key="help_shortcut14" + _value="Channels shortcuts" + +_key="help_shortcut15" + _value="Add a podcast to the subscriptions list" + +_key="help_shortcut16" + _value="Delete the selected podcast from the subscriptions list" + +_key="help_shortcut17" + _value="Check the selected podcast for new episodes (items)" + +_key="help_shortcut18" + _value="Check all podcasts for new episodes (items)" + +_key="help_shortcut19" + _value="Shows the podcast homepage" + +_key="help_shortcut20" + _value="Open enclosures folder" + +_key="help_shortcut21" + _value="Episodes shortcuts" + +_key="help_shortcut22" + _value="Play enclosure" + +_key="help_shortcut23" + _value="(Re)start download the selected episodes (items)" + +_key="help_shortcut24" + _value="Stop the episode (item) download" + +_key="help_shortcut25" + _value="Delete the selected episode (item)" + +_key="help_shortcut26" + _value="Shows the podcast episode (item) page " + +_key="help_shortcut27" + _value="Open enclosures folder" + +_key="help_buy1" + _value="BePodder Light is the basic version (free download and no time limited), the registered version adds some more nice features: unlimited number of channels, small Channel view, proxy support, automatic channels check, up to 5 enclosure downloads at the same time (multithreading)." + +_key="help_buy2" + _value="Please pay the shareware fee, it's only 15 euro (Kagi add tax in some countries), BePodder licence can be purchased online from Kagi." + +_key="help_buy3" + _value="Buy at www.funkyideasoft.com" + +_key="help_buy4" + _value="After purchasing, an email will be sent to you with a keyfile and instruction on how to install it. It's just a matter of unzipping a file and moving it to a certain directory." + +_key="help_buy5" + _value="There is no problem updating BePodder when a new version becomes available. The keyfile will unlock all downloadable packages unless otherwise notified." + + +### USELESS ######## + +"Opml Editor" "Opml Editor" +"name:" "name:" +"Add a category" "Add a category" +"Add a new Broadcast" "Add a new Broadcast" +"feed:" "feed:" +"url:" "url:" +"Test podcast" "Test podcast" +"Del a category" "Del a category" +"Add a category" "Add a category" +"Select the podcast category:" "Select the podcast category:" +"Check all" "Check all" +"Check" "Check" +"Refresh the list" "Refresh the list" +"Load" "Load" +"Load the list" "Load the list" +"Save" "Save" +"Save the list" "Save the list" +"Revert" "Revert" +"Apply" "Apply" + + + + + + + + + + + + diff --git a/release/Language/Dictionaries/BePodder.trTR b/release/Language/Dictionaries/BePodder.trTR new file mode 100644 index 0000000..296dac8 --- /dev/null +++ b/release/Language/Dictionaries/BePodder.trTR @@ -0,0 +1,604 @@ + +# Locale file for BePodder. +# Modified: 4/18/2006 +# Author: BePodderTeam +# E-mail: bepodder.team@gmail.com + + +# Attention: don't remove empty space or \n + + +### SHAREWARE POPUPS ----------------------------------- + +"Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" "Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" + +"This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" "This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" + +"Web Site" "Web Site" + +"Can't connect!" "Can't connect!" +"Http port failed!" "Http port failed!" +"Can't resolve host!" "Can't resolve host!" +"Not found!" "Not found!" +"Bad resume!" "Bad resume!" +"Aborted by Callback!" "Aborted by Callback!" +"Can't resume! (range error)" "Can't resume! (range error)" +"Access Denied!" "Access Denied!" +"User or Password Incorrect!" "User or Password Incorrect!" +"Other error (cUrl code: " "Other error (cUrl code: " +"cUrl init error!" "cUrl init error!" +"Can't open file!" "Can't open file!" +"Other error (status code: " "Other error (status code: " +"Downloading" "Downloading" + + +### MENUBAR ----------------------------------- + +"File" "File" +"About..." "About..." +"Close!" "Close!" +"Quit" "Quit" + +"Settings" "Settings" +"Preferences..." "Preferences..." + +"Subscriptions" "Subscriptions" + +"Episodes" "Episodes" + +"Lists" "Lists" +"Podcast List" "Podcast List" +"Podcast directory list" "Podcast directory list" +"Videoblog List" "Videoblog List" +"Videoblog directory list" "Videoblog directory list" +"Imagefeeds List" "Imagefeeds List" +"Imagefeeds directory list" "Imagefeeds directory list" +"Newsfeeds List" "Newsfeeds List" +"Newsfeeds directory list" "Newsfeeds directory list" +"BitTorrentfeeds List" "BitTorrentfeeds List" +"BitTorrentfeeds directory list" "BitTorrentfeeds directory list" +"Internationalfeeds List" "Internationalfeeds List" +"Internationalfeeds directory list" "Internationalfeeds directory list" + +"View" "View" +"Full Screen" "Full Screen" +"Toolbar" "Toolbar" +"Subscriptions View" "Subscriptions View" +"Small Items" "Small Items" +"Big Items" "Big Items" +"Move BePodder on workspace:" "Move BePodder on workspace:" + +"Help" "Help" +"Getting Started" "Getting Started" +"Keyboard Shortcuts" "Keyboard Shortcuts" +"Tutorials" "Tutorials" +"Online Support" "Online Support" + + + + +### BUTTONS ----------------------------------- + +# Buttons add feed window +"Insert the rss feed url!" "Insert the rss feed url!" +"Add" "Add" +"Paste" "Paste" + +# Buttons directory list window +"Collapse All" "Collapse All" +"Preview" "Preview" +"Subscribe" "Subscribe" + + +# Buttons help window +"Next" "Next" +"Prev" "Prev" +"Close" "Close" +"Index" "Index" + + +# Buttons remove windows +"Cancel" "Cancel" +"Delete" "Delete" +"Archive" "Archive" + + + +### TOOLTIPS ----------------------------------- + +# Tooltips toolbar buttons + +"Add the podcast to the Subscriptions list" "Add the podcast to the Subscriptions list" +"Delete the podcast from the Subscriptions list" "Delete the podcast from the Subscriptions list" +"Check the selected podcast for new items" "Check the selected podcast for new items" +"Show the podcast homepage" "Show the podcast homepage" + +"Delete the item and the enclosure" "Delete the item and the enclosure" +"Stop the item download" "Stop the item download" +"Download the selected episode" "Download the selected episode" +"Play the selected episode" "Play the selected episode" + +"Submit bug and idea" "Submit bug and idea" + + +# Tooltips directory window buttons + +"Collapse all categories in the directory list" "Collapse all categories in the directory list" +"Add the selected podcast to the Subscription list" "Add the selected podcast to the Subscription list" +"Checkout a podcast before downloading it" "Checkout a podcast before downloading it" + + +### INFO PANEL ----------------------------------- + +"Show channel Image" "Show Channel Image" +"XML Feed Link" "XML Feed Link" + +"Show Episode info" "Show Episode info" +"Show Subscription info" "Show Subscription info" +"Show Downloads info" "Show Downloads info" + +"Enclosure: " "Enclosure: " + +"Lookup (Dictionary)" "Lookup (Dictionary)" +"Lookup (Google)" "Lookup (Google)" +"Lookup (Acronym Finder)" "Lookup (Acronym Finder)" +"Copy" "Copy" +"Select All" "Select All" +"Copy URL" "Copy URL" +"Open URL" "Open URL" +"Subscription" "Subscription" + + +### PREFERENCES ----------------------------------- + +"Preferences" "Preferences" + +"Proxy" "Proxy" +"Enable Proxy" "Enable Proxy" +"Address" "Address" +"Port" "Port" +"Username" "Username" +"Password" "Password" + +"Max Downloads" "Max Downloads" + +"FileType" "FileType" +"Browser" "Browser" +"Player" "Player" + +"Channels" "Channels" +"Check all channels on startup" "Check all channels on startup" +"Check the channel every" "Check the channel every" + +"never" "never" +"5 minutes" "5 minutes" +"15 minutes" "15 minutes" +"30 minutes" "30 minutes" +"1 hour" "1 hour" +"2 hour" "2 hour" + + + + +### COLUMLISTVIEW ----------------------------------- + + +"1 new item" "1 new item" +"%d new items" "%d new items" +"new" "new" +"error" "error" +"not down" "not down" +"enquequed" "enquequed" +"downloading" "downloading" +"downloaded" "downloaded" +"connecting" "connecting" +"not found" "not found" +"stopped" "stopped" +"can't connect" "can't connect" +"invalid format" "invalid format" + +"Icon" "Icon" +"Title" "Title" +"Date" "Date" +"Size" "Size" +"Status" "Status" +"Download" "Download" + + + +### CONTEXT MENU ----------------------------------- + +"Add Channel" "Add Channel" +"Remove Channel" "Remove Channel" +"Check Channel" "Check Channel" +"Open Homepage" "Open Homepage" + +"Open Web Page" "Open Web Page" +"Open Enclosures folder" "Open Enclosures folder" +"Check All Channels" "Check All Channels" + +"Show Channel Image" "Show Channel Image" + +"Play enclosure" "Play enclosure" +"(Re)start download" "(Re)start download" +"Stop download" "Stop download" +"Remove Item" "Remove Item" + +"Find this Item" "Find this Item" +"Remove from this list" "Remove from this list" + + + +### ALERT ----------------------------------- + +"\nRemoving.." "\nRemoving.." +"\nAn error occured while removing!" "\nAn error occured while removing!" +"Check all the podcasts for new items" "Check all the podcasts for new items" + +"You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" "You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" + + +"Can't open the selected file with:\n\n" "Can't open the selected file with:\n\n" +"\n\nPlease check if the application is installed in the right way.\n" "\n\nPlease check if the application is installed in the right way.\n" +"Download it!" "Download it!" + +# multi line text... please translate only the text after _value= and don't remove empty space + +_key="alert1" + _value=" +You are going to remove the selected item. + +Are you sure? +(you will lost the enclosure file if any)" + + +_key="alert2a" + _value=" +You are going to remove the channel: + +" + +_key="alert2b" + _value=" + +Would you like just to archive this +channel (keeping all the files and +enclosures downloaded so far) or +do you want to DELETE the whole + channel from you computer?" + +_key="alert3" + _value=" +Parsing archive.." + +_key="alert_3gp" + _value=" +3GP is a multimedia container format defined by the Third Generation Partnership Project (3GPP) for use on 3G mobile phones. It stores video streams as MPEG-4 or H.263, and audio streams as AMR-NB or AAC-LC. + +VideoLAN still doesn't support the audio AMR (3GPP)" + +_key="alert_swf" + _value=" +SWF is a proprietary vector graphics file format produced by the Flash software from Adobe (formerly Macromedia). + +Currently Flash support in BeOS/Haiku/Zeta is limited to the old standalone Flash player version 4.1015, there isn't a modern Flash player" + + + + +### HELP & SHORTCUTS ----------------------------------- + + +"Introduction" "Introduction" +"The User Interface" "The User Interface" +"Menu Bar" "Menu Bar" +"Toolbar Buttons" "Toolbar Buttons" +"First time with BePodder" "First time with BePodder" +"Download Podcast's enclosure files" "Download Podcast's enclosure files" +"Settings Overview" "Settings Overview" +"Directory lists" "Directory lists" +"Loading Help..." "Loading Help..." +"Register your copy" "Register your copy" +"Starting point" "Starting point" + + + + +# multi line text... please translate only the text after _value= and don't remove empty space + + +_key="help1-0" + _value="Welcome to the BePodder Getting Started Guide." + +_key="help1-1" + _value="If you are already familiar with podcasts and RSS/Atom feeds you can immediately go to BePodder by closing this window." + +_key="help1-2" +_value="If not, this is a short introduction providing you everything you'll need to know on how to get started with BePodder. Use the buttons below to navigate through this tutorial." + + +_key="help2-0" +_value="Podcasting is a method for publishing audio and video broadcasts via the Internet; links to free audio and video files are enclosed in RSS and Atom feeds." + +_key="help2-1" +_value="Therefore Podcasting is simply a type of online media delivery; users can subscribe to a podcast using a feed (such as RSS 'Really Simple Syndication' or Atom)." + +_key="help2-2" +_value="An aggregator (or podcatcher) like BePodder, is a piece of software that allows you to subscribe to a RSS feed and periodically check for and download new content; with BePodder you can check for new Podcast items (Episodes) of your subscribed Channels. Any item can contain an enclosure, just like an Email can contain an attachment." + + + +_key="help3-0" +_value="BePodder has an easy to use yet powerful Graphical User Interface. The main window is split into tree panels:" + +_key="help3-1" +_value="1) The Subscription list (the panel with the number 1 in the screenshot) with the list of the podcasts that you have subscribed to. When you click on a Channel you can see in the panel 2 the list of the channel's items." + +_key="help3-2" +_value="2) The Episodes list with all the items available." + +_key="help3-3" +_value="3) The Info panel show: episode info, channel info or Downloads info; you can select an info panel by clicking one of the below three buttons." + + + +_key="help4-0" +_value="At the very top of the BePodder main window is the menubar with seven menus available: File, Settings, Subscriptions, Episodes, Lists, View and Help. Some menu commands are followed by a right pointing arrow that indicates a submenu of related commands. As you explore each menu, be sure to take a look at the submenus as well. Click on a menus to show its commands:" + +_key="help4-1" +_value="File: contains commands to close the application and to show information about BePodder" + +_key="help4-2" +_value="Settings: contains command to open the Preferences window that allows you to customize various BePodder settings." + +_key="help4-3" +_value="Subscriptions: contains commands that perform actions on the selected channel of your subscriptions list." + +_key="help4-4" +_value="Episodes: contains commands that perform actions on the selected item (episode) of the channel's episode list." + +_key="help4-5" +_value="Lists: contains commands to open BePodder's OPML directories." + +_key="help4-6" +_value="View: contains commands and controls for the BePodder window." + +_key="help4-7" +_value="Help: contains commands to open BePodder's 'Getting Started Guide' and the 'Keyboard Shortcuts List'." + + + +_key="help5-0" + _value="Add Button: opens the Add Window to add a feed url (e.g. http://www.newpodcast.com/rss.xml) usually given on the podcast homepage; looks for text or graphic link that says something like 'XML', 'RSS' or 'Podcast Feed' on it." + +_key="help5-1" + _value="Channel Remove Button: opens a window in which you can select how remove the channel: just archive the select channel (keeping all the files and eclosure downloaded so far) or delete the whole channel from your computer." + +_key="help5-2" + _value="Check Button: checks the selected channel and updates the list of the available items for that podcast adding the new items." + +_key="help5-3" + _value="Web Button: shows the channel homepage in the browser. To select your favorite browser open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select your favorite browser." + +_key="help5-4" + _value="Play Button: with this button you can view or listen the file enclosure of the selected item(episode). To select your favorite player open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select you favorite player." + +_key="help5-5" + _value="Download Button: downloads the file enclosure of the selected item (episode); you can see the download info by clicking on the third button over the info panel." + +_key="help5-6" + _value="Stop Button: stops to download the file enclosure of the selected item (episode); to resume the download double-click the item (episode) or select the item and click the Download Button" + +_key="help5-7" + _value="Item Remove Button: deletes the selected item (you will loose the enclosure file)." + + + +_key="help6-0" + _value="Getting started with BePodder is easy." + +_key="help6-1" + _value="On the left of the main window you can see the 'Subscription List' with all your feed subscriptions. We have added some subscriptions for you, and you can always add your own in two ways:" + +_key="help6-2" + _value="1) click the Add Button, then insert the feed url (example: http://www.newpodcast.com/rss.xml) and click add." + +_key="help6-3" + _value="2) in the menubar select 'Directory' and then 'Podcast list' or another list, choose a podcast and click 'Subscribe'." + +_key="help6-4" + _value="If you select a Podcast in the subscriptions list and use the check button, BePodder adds the new items to the 'Episodes list' (below on the right); you can check all your podcasts by right-clicking and selecting 'Check All Channels' in the context menu." + +_key="help6-5" + _value="Look at the screenshot above, there are 3 new items indicated by a black dot in the first column of the 'Episodes list'." + +_key="help6-6" + _value="In the second column there are icons that indicate the state of the item:" + +_key="help6-7" + _value="- the Episode 4 has an icon that indicates an error" + +_key="help6-8" + _value="- the Episode 3 has an icon that indicates that the item's enclosure download request is enquequed" + +_key="help6-9" + _value="- the Episode 2 has an icon that indicates that BePodder is downloading the item's enclosure file" + +_key="help6-10" + _value="- the Episode 1 have an icon that indicates that BePodder have just downloaded the item's enclosure file" + + + +_key="help7-0" + _value="Select an item in the 'Episodes list' and then double-click on it (or click the Download Button) to start downloading the enclosed file; you can always stop the download by clicking on the Stop Button." + +_key="help7-1" + _value="When you click on the Subscribed Podcasts in the 'Subscriptions List' the software shows you, in the 'List of episodes', all the items available in that Subscription. Select an item and then click play (Play Button) to view or listen to the file." + +_key="help7-2" + _value="You can access the Enclosures Folder by clicking on the folder icon in the Info Pannel or by right-clicking your mouse on an item and select 'Open Enclosures Folder' in the context menu." + + + +_key="help8-0" + _value="Preferences can be accessed by clicking in the menu-bar Settings>Preferences. You can select a category from the left list of the preferences dialog: FileType, Channels, Download and Proxy." + +_key="help8-1" + _value="- FileType: to specify the default browser and player. " + +_key="help8-2" + _value="- Channels: to specify preferences that control the operation to check channels new items; you can choose to Check all channels on startup or check the channel every desired minutes." + +_key="help8-3" + _value="- Download: to specify the max number of item's files to download at the same time," + +_key="help8-4" + _value="- Proxy: to set up a proxy server to work with BePodder; a proxy server acts as a security barrier between your internal network and the Internet, keeping others on the Internet from accessing information on your internal network." + + + +_key="help9-0" + _value="BePodder has built-in podcast, videoblog, imagefeeds, newsfeeds, bittorrentfeeds and internationalfeeds OPML directories with thousands of feeds grouped by category." + +_key="help9-1" + _value="OPML (Outline Processor Markup Language) is an XML-based format that allows exchange of outline-structured information between applications." + +_key="help9-2" + _value="OPML directory can be accessed by clicking in the menu-bar 'Lists' and thenselecting a list. To browse the opml directory for a feed, expand the list by clicking the arrow of the category that you are interested in (see image); using this method, you can expand the opml directory until you find the desired feed. Once you have selected it, you can add it to the subscription list by clicking the button 'Subscribe', you can also collapse all categories in the directory list by clicking the button 'Collapse All'." + +_key="help_shortcut1" +_value="This page describes the keyboard shortcuts that can be used in BePodder. The shortcuts are grouped here by function." + +_key="help_shortcut2" +_value="means that you can use either alt or control (es. Alt+Q or Ctrl+Q Quit the application), which way you have set it in the Deskbar menu preferences under Keyboard (the default shortcut key is Alt)." + +_key="help_shortcut3" + _value="General shortcuts" + +_key="help_shortcut4" + _value="Quit the application" + +_key="help_shortcut5" + _value="Shows the Preferences window" + +_key="help_shortcut6" + _value="Shows the Podcast directory list" + +_key="help_shortcut7" + _value="Shows the Videoblog directory list" + +_key="help_shortcut8" + _value="Shows the Imagefeeds directory list" + +_key="help_shortcut9" + _value="Shows the Newsfeeds directory list" + +_key="help_shortcut9b" + _value="Shows the BitTorrentfeeds directory list" + +_key="help_shortcut9c" + _value="Shows the Internationalfeeds directory list" + +_key="help_shortcut10" + _value="Fullscreen" + +_key="help_shortcut11" + _value="Shows/Hides the toolbar" + +_key="help_shortcut12" + _value="Shows the Getting Started Help" + +_key="help_shortcut13" + _value="Shows this keyboard shortcuts page" + +_key="help_shortcut14" + _value="Channels shortcuts" + +_key="help_shortcut15" + _value="Add a podcast to the subscriptions list" + +_key="help_shortcut16" + _value="Delete the selected podcast from the subscriptions list" + +_key="help_shortcut17" + _value="Check the selected podcast for new episodes (items)" + +_key="help_shortcut18" + _value="Check all podcasts for new episodes (items)" + +_key="help_shortcut19" + _value="Shows the podcast homepage" + +_key="help_shortcut20" + _value="Open enclosures folder" + +_key="help_shortcut21" + _value="Episodes shortcuts" + +_key="help_shortcut22" + _value="Play enclosure" + +_key="help_shortcut23" + _value="(Re)start download the selected episodes (items)" + +_key="help_shortcut24" + _value="Stop the episode (item) download" + +_key="help_shortcut25" + _value="Delete the selected episode (item)" + +_key="help_shortcut26" + _value="Shows the podcast episode (item) page " + +_key="help_shortcut27" + _value="Open enclosures folder" + +_key="help_buy1" + _value="BePodder Light is the basic version (free download and no time limited), the registered version adds some more nice features: unlimited number of channels, small Channel view, proxy support, automatic channels check, up to 5 enclosure downloads at the same time (multithreading)." + +_key="help_buy2" + _value="Please pay the shareware fee, it's only 15 euro (Kagi add tax in some countries), BePodder licence can be purchased online from Kagi." + +_key="help_buy3" + _value="Buy at www.funkyideasoft.com" + +_key="help_buy4" + _value="After purchasing, an email will be sent to you with a keyfile and instruction on how to install it. It's just a matter of unzipping a file and moving it to a certain directory." + +_key="help_buy5" + _value="There is no problem updating BePodder when a new version becomes available. The keyfile will unlock all downloadable packages unless otherwise notified." + + +### USELESS ######## + +"Opml Editor" "Opml Editor" +"name:" "name:" +"Add a category" "Add a category" +"Add a new Broadcast" "Add a new Broadcast" +"feed:" "feed:" +"url:" "url:" +"Test podcast" "Test podcast" +"Del a category" "Del a category" +"Add a category" "Add a category" +"Select the podcast category:" "Select the podcast category:" +"Check all" "Check all" +"Check" "Check" +"Refresh the list" "Refresh the list" +"Load" "Load" +"Load the list" "Load the list" +"Save" "Save" +"Save the list" "Save the list" +"Revert" "Revert" +"Apply" "Apply" + + + + + + + + + + + + diff --git a/release/Language/Dictionaries/BePodder.zhCN b/release/Language/Dictionaries/BePodder.zhCN new file mode 100644 index 0000000..296dac8 --- /dev/null +++ b/release/Language/Dictionaries/BePodder.zhCN @@ -0,0 +1,604 @@ + +# Locale file for BePodder. +# Modified: 4/18/2006 +# Author: BePodderTeam +# E-mail: bepodder.team@gmail.com + + +# Attention: don't remove empty space or \n + + +### SHAREWARE POPUPS ----------------------------------- + +"Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" "Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n" + +"This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" "This BePodder copy has expired!\nPlease buy a keyfile and support us.\n" + +"Web Site" "Web Site" + +"Can't connect!" "Can't connect!" +"Http port failed!" "Http port failed!" +"Can't resolve host!" "Can't resolve host!" +"Not found!" "Not found!" +"Bad resume!" "Bad resume!" +"Aborted by Callback!" "Aborted by Callback!" +"Can't resume! (range error)" "Can't resume! (range error)" +"Access Denied!" "Access Denied!" +"User or Password Incorrect!" "User or Password Incorrect!" +"Other error (cUrl code: " "Other error (cUrl code: " +"cUrl init error!" "cUrl init error!" +"Can't open file!" "Can't open file!" +"Other error (status code: " "Other error (status code: " +"Downloading" "Downloading" + + +### MENUBAR ----------------------------------- + +"File" "File" +"About..." "About..." +"Close!" "Close!" +"Quit" "Quit" + +"Settings" "Settings" +"Preferences..." "Preferences..." + +"Subscriptions" "Subscriptions" + +"Episodes" "Episodes" + +"Lists" "Lists" +"Podcast List" "Podcast List" +"Podcast directory list" "Podcast directory list" +"Videoblog List" "Videoblog List" +"Videoblog directory list" "Videoblog directory list" +"Imagefeeds List" "Imagefeeds List" +"Imagefeeds directory list" "Imagefeeds directory list" +"Newsfeeds List" "Newsfeeds List" +"Newsfeeds directory list" "Newsfeeds directory list" +"BitTorrentfeeds List" "BitTorrentfeeds List" +"BitTorrentfeeds directory list" "BitTorrentfeeds directory list" +"Internationalfeeds List" "Internationalfeeds List" +"Internationalfeeds directory list" "Internationalfeeds directory list" + +"View" "View" +"Full Screen" "Full Screen" +"Toolbar" "Toolbar" +"Subscriptions View" "Subscriptions View" +"Small Items" "Small Items" +"Big Items" "Big Items" +"Move BePodder on workspace:" "Move BePodder on workspace:" + +"Help" "Help" +"Getting Started" "Getting Started" +"Keyboard Shortcuts" "Keyboard Shortcuts" +"Tutorials" "Tutorials" +"Online Support" "Online Support" + + + + +### BUTTONS ----------------------------------- + +# Buttons add feed window +"Insert the rss feed url!" "Insert the rss feed url!" +"Add" "Add" +"Paste" "Paste" + +# Buttons directory list window +"Collapse All" "Collapse All" +"Preview" "Preview" +"Subscribe" "Subscribe" + + +# Buttons help window +"Next" "Next" +"Prev" "Prev" +"Close" "Close" +"Index" "Index" + + +# Buttons remove windows +"Cancel" "Cancel" +"Delete" "Delete" +"Archive" "Archive" + + + +### TOOLTIPS ----------------------------------- + +# Tooltips toolbar buttons + +"Add the podcast to the Subscriptions list" "Add the podcast to the Subscriptions list" +"Delete the podcast from the Subscriptions list" "Delete the podcast from the Subscriptions list" +"Check the selected podcast for new items" "Check the selected podcast for new items" +"Show the podcast homepage" "Show the podcast homepage" + +"Delete the item and the enclosure" "Delete the item and the enclosure" +"Stop the item download" "Stop the item download" +"Download the selected episode" "Download the selected episode" +"Play the selected episode" "Play the selected episode" + +"Submit bug and idea" "Submit bug and idea" + + +# Tooltips directory window buttons + +"Collapse all categories in the directory list" "Collapse all categories in the directory list" +"Add the selected podcast to the Subscription list" "Add the selected podcast to the Subscription list" +"Checkout a podcast before downloading it" "Checkout a podcast before downloading it" + + +### INFO PANEL ----------------------------------- + +"Show channel Image" "Show Channel Image" +"XML Feed Link" "XML Feed Link" + +"Show Episode info" "Show Episode info" +"Show Subscription info" "Show Subscription info" +"Show Downloads info" "Show Downloads info" + +"Enclosure: " "Enclosure: " + +"Lookup (Dictionary)" "Lookup (Dictionary)" +"Lookup (Google)" "Lookup (Google)" +"Lookup (Acronym Finder)" "Lookup (Acronym Finder)" +"Copy" "Copy" +"Select All" "Select All" +"Copy URL" "Copy URL" +"Open URL" "Open URL" +"Subscription" "Subscription" + + +### PREFERENCES ----------------------------------- + +"Preferences" "Preferences" + +"Proxy" "Proxy" +"Enable Proxy" "Enable Proxy" +"Address" "Address" +"Port" "Port" +"Username" "Username" +"Password" "Password" + +"Max Downloads" "Max Downloads" + +"FileType" "FileType" +"Browser" "Browser" +"Player" "Player" + +"Channels" "Channels" +"Check all channels on startup" "Check all channels on startup" +"Check the channel every" "Check the channel every" + +"never" "never" +"5 minutes" "5 minutes" +"15 minutes" "15 minutes" +"30 minutes" "30 minutes" +"1 hour" "1 hour" +"2 hour" "2 hour" + + + + +### COLUMLISTVIEW ----------------------------------- + + +"1 new item" "1 new item" +"%d new items" "%d new items" +"new" "new" +"error" "error" +"not down" "not down" +"enquequed" "enquequed" +"downloading" "downloading" +"downloaded" "downloaded" +"connecting" "connecting" +"not found" "not found" +"stopped" "stopped" +"can't connect" "can't connect" +"invalid format" "invalid format" + +"Icon" "Icon" +"Title" "Title" +"Date" "Date" +"Size" "Size" +"Status" "Status" +"Download" "Download" + + + +### CONTEXT MENU ----------------------------------- + +"Add Channel" "Add Channel" +"Remove Channel" "Remove Channel" +"Check Channel" "Check Channel" +"Open Homepage" "Open Homepage" + +"Open Web Page" "Open Web Page" +"Open Enclosures folder" "Open Enclosures folder" +"Check All Channels" "Check All Channels" + +"Show Channel Image" "Show Channel Image" + +"Play enclosure" "Play enclosure" +"(Re)start download" "(Re)start download" +"Stop download" "Stop download" +"Remove Item" "Remove Item" + +"Find this Item" "Find this Item" +"Remove from this list" "Remove from this list" + + + +### ALERT ----------------------------------- + +"\nRemoving.." "\nRemoving.." +"\nAn error occured while removing!" "\nAn error occured while removing!" +"Check all the podcasts for new items" "Check all the podcasts for new items" + +"You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" "You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n" + + +"Can't open the selected file with:\n\n" "Can't open the selected file with:\n\n" +"\n\nPlease check if the application is installed in the right way.\n" "\n\nPlease check if the application is installed in the right way.\n" +"Download it!" "Download it!" + +# multi line text... please translate only the text after _value= and don't remove empty space + +_key="alert1" + _value=" +You are going to remove the selected item. + +Are you sure? +(you will lost the enclosure file if any)" + + +_key="alert2a" + _value=" +You are going to remove the channel: + +" + +_key="alert2b" + _value=" + +Would you like just to archive this +channel (keeping all the files and +enclosures downloaded so far) or +do you want to DELETE the whole + channel from you computer?" + +_key="alert3" + _value=" +Parsing archive.." + +_key="alert_3gp" + _value=" +3GP is a multimedia container format defined by the Third Generation Partnership Project (3GPP) for use on 3G mobile phones. It stores video streams as MPEG-4 or H.263, and audio streams as AMR-NB or AAC-LC. + +VideoLAN still doesn't support the audio AMR (3GPP)" + +_key="alert_swf" + _value=" +SWF is a proprietary vector graphics file format produced by the Flash software from Adobe (formerly Macromedia). + +Currently Flash support in BeOS/Haiku/Zeta is limited to the old standalone Flash player version 4.1015, there isn't a modern Flash player" + + + + +### HELP & SHORTCUTS ----------------------------------- + + +"Introduction" "Introduction" +"The User Interface" "The User Interface" +"Menu Bar" "Menu Bar" +"Toolbar Buttons" "Toolbar Buttons" +"First time with BePodder" "First time with BePodder" +"Download Podcast's enclosure files" "Download Podcast's enclosure files" +"Settings Overview" "Settings Overview" +"Directory lists" "Directory lists" +"Loading Help..." "Loading Help..." +"Register your copy" "Register your copy" +"Starting point" "Starting point" + + + + +# multi line text... please translate only the text after _value= and don't remove empty space + + +_key="help1-0" + _value="Welcome to the BePodder Getting Started Guide." + +_key="help1-1" + _value="If you are already familiar with podcasts and RSS/Atom feeds you can immediately go to BePodder by closing this window." + +_key="help1-2" +_value="If not, this is a short introduction providing you everything you'll need to know on how to get started with BePodder. Use the buttons below to navigate through this tutorial." + + +_key="help2-0" +_value="Podcasting is a method for publishing audio and video broadcasts via the Internet; links to free audio and video files are enclosed in RSS and Atom feeds." + +_key="help2-1" +_value="Therefore Podcasting is simply a type of online media delivery; users can subscribe to a podcast using a feed (such as RSS 'Really Simple Syndication' or Atom)." + +_key="help2-2" +_value="An aggregator (or podcatcher) like BePodder, is a piece of software that allows you to subscribe to a RSS feed and periodically check for and download new content; with BePodder you can check for new Podcast items (Episodes) of your subscribed Channels. Any item can contain an enclosure, just like an Email can contain an attachment." + + + +_key="help3-0" +_value="BePodder has an easy to use yet powerful Graphical User Interface. The main window is split into tree panels:" + +_key="help3-1" +_value="1) The Subscription list (the panel with the number 1 in the screenshot) with the list of the podcasts that you have subscribed to. When you click on a Channel you can see in the panel 2 the list of the channel's items." + +_key="help3-2" +_value="2) The Episodes list with all the items available." + +_key="help3-3" +_value="3) The Info panel show: episode info, channel info or Downloads info; you can select an info panel by clicking one of the below three buttons." + + + +_key="help4-0" +_value="At the very top of the BePodder main window is the menubar with seven menus available: File, Settings, Subscriptions, Episodes, Lists, View and Help. Some menu commands are followed by a right pointing arrow that indicates a submenu of related commands. As you explore each menu, be sure to take a look at the submenus as well. Click on a menus to show its commands:" + +_key="help4-1" +_value="File: contains commands to close the application and to show information about BePodder" + +_key="help4-2" +_value="Settings: contains command to open the Preferences window that allows you to customize various BePodder settings." + +_key="help4-3" +_value="Subscriptions: contains commands that perform actions on the selected channel of your subscriptions list." + +_key="help4-4" +_value="Episodes: contains commands that perform actions on the selected item (episode) of the channel's episode list." + +_key="help4-5" +_value="Lists: contains commands to open BePodder's OPML directories." + +_key="help4-6" +_value="View: contains commands and controls for the BePodder window." + +_key="help4-7" +_value="Help: contains commands to open BePodder's 'Getting Started Guide' and the 'Keyboard Shortcuts List'." + + + +_key="help5-0" + _value="Add Button: opens the Add Window to add a feed url (e.g. http://www.newpodcast.com/rss.xml) usually given on the podcast homepage; looks for text or graphic link that says something like 'XML', 'RSS' or 'Podcast Feed' on it." + +_key="help5-1" + _value="Channel Remove Button: opens a window in which you can select how remove the channel: just archive the select channel (keeping all the files and eclosure downloaded so far) or delete the whole channel from your computer." + +_key="help5-2" + _value="Check Button: checks the selected channel and updates the list of the available items for that podcast adding the new items." + +_key="help5-3" + _value="Web Button: shows the channel homepage in the browser. To select your favorite browser open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select your favorite browser." + +_key="help5-4" + _value="Play Button: with this button you can view or listen the file enclosure of the selected item(episode). To select your favorite player open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select you favorite player." + +_key="help5-5" + _value="Download Button: downloads the file enclosure of the selected item (episode); you can see the download info by clicking on the third button over the info panel." + +_key="help5-6" + _value="Stop Button: stops to download the file enclosure of the selected item (episode); to resume the download double-click the item (episode) or select the item and click the Download Button" + +_key="help5-7" + _value="Item Remove Button: deletes the selected item (you will loose the enclosure file)." + + + +_key="help6-0" + _value="Getting started with BePodder is easy." + +_key="help6-1" + _value="On the left of the main window you can see the 'Subscription List' with all your feed subscriptions. We have added some subscriptions for you, and you can always add your own in two ways:" + +_key="help6-2" + _value="1) click the Add Button, then insert the feed url (example: http://www.newpodcast.com/rss.xml) and click add." + +_key="help6-3" + _value="2) in the menubar select 'Directory' and then 'Podcast list' or another list, choose a podcast and click 'Subscribe'." + +_key="help6-4" + _value="If you select a Podcast in the subscriptions list and use the check button, BePodder adds the new items to the 'Episodes list' (below on the right); you can check all your podcasts by right-clicking and selecting 'Check All Channels' in the context menu." + +_key="help6-5" + _value="Look at the screenshot above, there are 3 new items indicated by a black dot in the first column of the 'Episodes list'." + +_key="help6-6" + _value="In the second column there are icons that indicate the state of the item:" + +_key="help6-7" + _value="- the Episode 4 has an icon that indicates an error" + +_key="help6-8" + _value="- the Episode 3 has an icon that indicates that the item's enclosure download request is enquequed" + +_key="help6-9" + _value="- the Episode 2 has an icon that indicates that BePodder is downloading the item's enclosure file" + +_key="help6-10" + _value="- the Episode 1 have an icon that indicates that BePodder have just downloaded the item's enclosure file" + + + +_key="help7-0" + _value="Select an item in the 'Episodes list' and then double-click on it (or click the Download Button) to start downloading the enclosed file; you can always stop the download by clicking on the Stop Button." + +_key="help7-1" + _value="When you click on the Subscribed Podcasts in the 'Subscriptions List' the software shows you, in the 'List of episodes', all the items available in that Subscription. Select an item and then click play (Play Button) to view or listen to the file." + +_key="help7-2" + _value="You can access the Enclosures Folder by clicking on the folder icon in the Info Pannel or by right-clicking your mouse on an item and select 'Open Enclosures Folder' in the context menu." + + + +_key="help8-0" + _value="Preferences can be accessed by clicking in the menu-bar Settings>Preferences. You can select a category from the left list of the preferences dialog: FileType, Channels, Download and Proxy." + +_key="help8-1" + _value="- FileType: to specify the default browser and player. " + +_key="help8-2" + _value="- Channels: to specify preferences that control the operation to check channels new items; you can choose to Check all channels on startup or check the channel every desired minutes." + +_key="help8-3" + _value="- Download: to specify the max number of item's files to download at the same time," + +_key="help8-4" + _value="- Proxy: to set up a proxy server to work with BePodder; a proxy server acts as a security barrier between your internal network and the Internet, keeping others on the Internet from accessing information on your internal network." + + + +_key="help9-0" + _value="BePodder has built-in podcast, videoblog, imagefeeds, newsfeeds, bittorrentfeeds and internationalfeeds OPML directories with thousands of feeds grouped by category." + +_key="help9-1" + _value="OPML (Outline Processor Markup Language) is an XML-based format that allows exchange of outline-structured information between applications." + +_key="help9-2" + _value="OPML directory can be accessed by clicking in the menu-bar 'Lists' and thenselecting a list. To browse the opml directory for a feed, expand the list by clicking the arrow of the category that you are interested in (see image); using this method, you can expand the opml directory until you find the desired feed. Once you have selected it, you can add it to the subscription list by clicking the button 'Subscribe', you can also collapse all categories in the directory list by clicking the button 'Collapse All'." + +_key="help_shortcut1" +_value="This page describes the keyboard shortcuts that can be used in BePodder. The shortcuts are grouped here by function." + +_key="help_shortcut2" +_value="means that you can use either alt or control (es. Alt+Q or Ctrl+Q Quit the application), which way you have set it in the Deskbar menu preferences under Keyboard (the default shortcut key is Alt)." + +_key="help_shortcut3" + _value="General shortcuts" + +_key="help_shortcut4" + _value="Quit the application" + +_key="help_shortcut5" + _value="Shows the Preferences window" + +_key="help_shortcut6" + _value="Shows the Podcast directory list" + +_key="help_shortcut7" + _value="Shows the Videoblog directory list" + +_key="help_shortcut8" + _value="Shows the Imagefeeds directory list" + +_key="help_shortcut9" + _value="Shows the Newsfeeds directory list" + +_key="help_shortcut9b" + _value="Shows the BitTorrentfeeds directory list" + +_key="help_shortcut9c" + _value="Shows the Internationalfeeds directory list" + +_key="help_shortcut10" + _value="Fullscreen" + +_key="help_shortcut11" + _value="Shows/Hides the toolbar" + +_key="help_shortcut12" + _value="Shows the Getting Started Help" + +_key="help_shortcut13" + _value="Shows this keyboard shortcuts page" + +_key="help_shortcut14" + _value="Channels shortcuts" + +_key="help_shortcut15" + _value="Add a podcast to the subscriptions list" + +_key="help_shortcut16" + _value="Delete the selected podcast from the subscriptions list" + +_key="help_shortcut17" + _value="Check the selected podcast for new episodes (items)" + +_key="help_shortcut18" + _value="Check all podcasts for new episodes (items)" + +_key="help_shortcut19" + _value="Shows the podcast homepage" + +_key="help_shortcut20" + _value="Open enclosures folder" + +_key="help_shortcut21" + _value="Episodes shortcuts" + +_key="help_shortcut22" + _value="Play enclosure" + +_key="help_shortcut23" + _value="(Re)start download the selected episodes (items)" + +_key="help_shortcut24" + _value="Stop the episode (item) download" + +_key="help_shortcut25" + _value="Delete the selected episode (item)" + +_key="help_shortcut26" + _value="Shows the podcast episode (item) page " + +_key="help_shortcut27" + _value="Open enclosures folder" + +_key="help_buy1" + _value="BePodder Light is the basic version (free download and no time limited), the registered version adds some more nice features: unlimited number of channels, small Channel view, proxy support, automatic channels check, up to 5 enclosure downloads at the same time (multithreading)." + +_key="help_buy2" + _value="Please pay the shareware fee, it's only 15 euro (Kagi add tax in some countries), BePodder licence can be purchased online from Kagi." + +_key="help_buy3" + _value="Buy at www.funkyideasoft.com" + +_key="help_buy4" + _value="After purchasing, an email will be sent to you with a keyfile and instruction on how to install it. It's just a matter of unzipping a file and moving it to a certain directory." + +_key="help_buy5" + _value="There is no problem updating BePodder when a new version becomes available. The keyfile will unlock all downloadable packages unless otherwise notified." + + +### USELESS ######## + +"Opml Editor" "Opml Editor" +"name:" "name:" +"Add a category" "Add a category" +"Add a new Broadcast" "Add a new Broadcast" +"feed:" "feed:" +"url:" "url:" +"Test podcast" "Test podcast" +"Del a category" "Del a category" +"Add a category" "Add a category" +"Select the podcast category:" "Select the podcast category:" +"Check all" "Check all" +"Check" "Check" +"Refresh the list" "Refresh the list" +"Load" "Load" +"Load the list" "Load the list" +"Save" "Save" +"Save the list" "Save the list" +"Revert" "Revert" +"Apply" "Apply" + + + + + + + + + + + + diff --git a/release/helpR5.xml b/release/helpR5.xml new file mode 100644 index 0000000..e746aef --- /dev/null +++ b/release/helpR5.xml @@ -0,0 +1,433 @@ + + + + + help1.png + Welcome to the BePodder Getting Started Guide. + + dot.png + If you are already familiar with podcasts and RSS/Atom feeds you can immediately go to BePodder by closing this window. + + + If not, this is a short introduction providing you everything you'll need to know on how to get started with BePodder. Use the buttons below to navigate through this tutorial. + + + + + + Introduction + Podcasting is a method for publishing audio and video broadcasts via the Internet; links to free audio and video files are enclosed in RSS and Atom feeds. + diagram1.png + Therefore Podcasting is simply a type of online media delivery; users can subscribe to a podcast using a feed (such as RSS 'Really Simple Syndication' or Atom). + + dot2.png + An aggregator (or podcatcher) like BePodder, is a piece of software that allows you to subscribe to a RSS feed and periodically check for and download new content; with BePodder you can check for new Podcast items (Episodes) of your subscribed Channels. Any item can contain an enclosure, just like an Email can contain an attachment. + + + + + The User Interface + BePodder has an easy to use yet powerful Graphical User Interface. The main window is split into tree panels: + + gui1.png + + 1) The Subscription list (the panel with the number 1 in the screenshot) with the list of the podcasts that you have subscribed to. When you click on a Channel you can see in the panel 2 the list of the channel's items. + 2) The Episodes list with all the items available. + 3) The Info panel show: episode info, channel info or Downloads info; you can select an info panel by clicking one of the below three buttons. + info_button.png + + + + Menu Bar + At the very top of the BePodder main window is the menubar with seven menus available: File, Settings, Subscriptions, Episodes, Lists, View and Help. Some menu commands are followed by a right pointing arrow that indicates a submenu of related commands. As you explore each menu, be sure to take a look at the submenus as well. Click on a menus to show its commands: + File: contains commands to close the application and to show information about BePodder + Settings: contains command to open the Preferences window that allows you to customize various BePodder settings. + Subscriptions: contains commands that perform actions on the selected channel of your subscriptions list. + Episodes: contains commands that perform actions on the selected item (episode) of the channel's episode list. + Lists: contains commands to open BePodder's OPML directories. + View: contains commands and controls for the BePodder window. + Help: contains commands to open BePodder's 'Getting Started Guide' and the 'Keyboard Shortcuts List'. + + + + + Toolbar Buttons + + add-channel-file.png + Add Button: opens the Add Window to add a feed url (e.g. http://www.newpodcast.com/rss.xml) usually given on the podcast homepage; looks for text or graphic link that says something like 'XML', 'RSS' or 'Podcast Feed' on it. + + + delete-channel-file.png + Channel Remove Button: opens a window in which you can select how remove the channel: just archive the select channel (keeping all the files and eclosure downloaded so far) or delete the whole channel from your computer. + + + refresh-channel-file.png + Check Button: checks the selected channel and updates the list of the available items for that podcast adding the new items. + + + www-channel-file.png + Web Button: shows the channel homepage in the browser. To select your favorite browser open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select your favorite browser. + + + emblem-play.png + Play Button: with this button you can view or listen the file enclosure of the selected item(episode). To select your favorite player open BePodder's Preferences, click in the manu-bar Settings>Preferences... and in the Preferences Window under 'File Type' select you favorite player. + + + emblem-download.png + Download Button: downloads the file enclosure of the selected item (episode); you can see the download info by clicking on the third button over the info panel. + + + emblem-stop.png + Stop Button: stops to download the file enclosure of the selected item (episode); to resume the download double-click the item (episode) or select the item and click the Download Button + + + emblem-delete.png + Item Remove Button: deletes the selected item (you will loose the enclosure file). + + + + + + First time with BePodder + Getting started with BePodder is easy. + + gui2.png + On the left of the main window you can see the 'Subscription List' with all your feed subscriptions. We have added some subscriptions for you, and you can always add your own in two ways: + + 1) click the Add Button, then insert the feed url (example: http://www.newpodcast.com/rss.xml) and click add. + 2) in the menubar select 'Directory' and then 'Podcast list' or another list, choose a podcast and click 'Subscribe'. + If you select a Podcast in the subscriptions list and use the check button, BePodder adds the new items to the 'Episodes list' (below on the right); you can check all your podcasts by right-clicking and selecting 'Check All Channels' in the context menu. + gui3.png + Look at the screenshot above, there are 3 new items indicated by a black dot in the first column of the 'Episodes list'. + In the second column there are icons that indicate the state of the item: + - the Episode 4 has an icon that indicates an error + - the Episode 3 has an icon that indicates that the item's enclosure download request is enquequed + - the Episode 2 has an icon that indicates that BePodder is downloading the item's enclosure file + - the Episode 1 have an icon that indicates that BePodder have just downloaded the item's enclosure file + + + + Download Podcast's enclosure files + Select an item in the 'Episodes list' and then double-click on it (or click the Download Button) to start downloading the enclosed file; you can always stop the download by clicking on the Stop Button. + + gui4.png + + When you click on the Subscribed Podcasts in the 'Subscriptions List' the software shows you, in the 'List of episodes', all the items available in that Subscription. Select an item and then click play (Play Button) to view or listen to the file. + + gui5.png + + You can access the Enclosures Folder by clicking on the folder icon in the Info Pannel or by right-clicking your mouse on an item and select 'Open Enclosures Folder' in the context menu. + + + + Settings Overview + Preferences can be accessed by clicking in the menu-bar Settings>Preferences. You can select a category from the left list of the preferences dialog: FileType, Channels, Download and Proxy. + + gui6.png + + - FileType: to specify the default browser and player. + - Channels: to specify preferences that control the operation to check channels new items; you can choose to Check all channels on startup or check the channel every desired minutes. + - Download: to specify the max number of item's files to download at the same time, + - Proxy: to set up a proxy server to work with BePodder; a proxy server acts as a security barrier between your internal network and the Internet, keeping others on the Internet from accessing information on your internal network. + + + + Directory lists + BePodder has built-in podcast, videoblog, imagefeeds and newsfeeds OPML directories with thousands of feeds grouped by category. + OPML (Outline Processor Markup Language) is an XML-based format that allows exchange of outline-structured information between applications. + gui7.png + OPML directory can be accessed by clicking in the menu-bar 'Lists' and thenselecting a list. To browse the opml directory for a feed, expand the list by clicking the arrow of the category that you are interested in (see image); using this method, you can expand the opml directory until you find the desired feed. Once you have selected it, you can add it to the subscription list by clicking the button 'Subscribe', you can also refresh the list by clicking the button 'Refresh'. + + + + Keyboard Shortcuts + This page describes the keyboard shortcuts that can be used in BePodder. The shortcuts are grouped here by function. + + key_alt.png + / + key_ctrl.png + means that you can use either alt or control (es. Alt+Q or Ctrl+Q Quit the application), which way you have set it in the Deskbar menu preferences under Keyboard (the default shortcut key is Alt). + + + General shortcuts + + + key_alt.png + / + key_ctrl.png + + + key_q.png + arrow.png + Quit the application + + + key_alt.png + / + key_ctrl.png + + + key_p.png + arrow.png + Shows the Preferences window + + + key_alt.png + / + key_ctrl.png + + + key_l.png + arrow.png + Shows the Podcast directory list + + + key_alt.png + / + key_ctrl.png + + + key_m.png + arrow.png + Shows the Videoblog directory list + + + key_alt.png + / + key_ctrl.png + + + key_i.png + arrow.png + Shows the Imagefeeds directory list + + + key_alt.png + / + key_ctrl.png + + + key_n.png + arrow.png + Shows the Newsfeeds directory list + + + key_alt.png + / + key_ctrl.png + + + key_b.png + arrow.png + Shows the BitTorrentfeeds directory list + + + key_alt.png + / + key_ctrl.png + + + key_f.png + arrow.png + Fullscreen + + + key_alt.png + / + key_ctrl.png + + + key_t.png + arrow.png + Shows/Hides the toolbar + + + key_alt.png + / + key_ctrl.png + + + key_g.png + arrow.png + Shows the Getting Started Help + + + key_alt.png + / + key_ctrl.png + + + key_k.png + arrow.png + Shows this keyboard shortcuts page + + + Channels shortcuts + + + key_shift.png + key_alt.png + / + key_ctrl.png + + + key_a.png + arrow.png + Add a podcast to the subscriptions list + + + key_shift.png + key_alt.png + / + key_ctrl.png + + + key_r.png + arrow.png + Delete the selected podcast from the subscriptions list + + + key_shift.png + key_alt.png + / + key_ctrl.png + + + key_c.png + arrow.png + Check the selected podcast for new episodes (items) + + + key_shift.png + key_alt.png + / + key_ctrl.png + + + key_n.png + arrow.png + Check all podcasts for new episodes (items) + + + key_shift.png + key_alt.png + / + key_ctrl.png + + + key_h.png + arrow.png + Shows the podcast homepage + + + key_alt.png + / + key_ctrl.png + + + key_o.png + arrow.png + Open enclosures folder + + + Episodes shortcuts + + + key_alt.png + / + key_ctrl.png + + + key_e.png + arrow.png + Play enclosure + + + key_alt.png + / + key_ctrl.png + + + key_d.png + arrow.png + (Re)start download the selected episodes (items) + + + key_alt.png + / + key_ctrl.png + + + key_s.png + arrow.png + Stop the episode (item) download + + + key_alt.png + / + key_ctrl.png + + + key_r.png + arrow.png + Delete the selected episode (item) + + + key_alt.png + / + key_ctrl.png + + + key_h.png + arrow.png + Shows the podcast episode (item) page + + + key_alt.png + / + key_ctrl.png + + + key_o.png + arrow.png + Open enclosures folder + + + + + + + + Register your copy + The trial program is fully-functional but is will run only 30 days from the first time you open the application. + Please pay the shareware fee, it's only 15 euro (Kagi add tax in some countries), BePodder licence can be purchased online from Kagi. + Buy at www.funkyideasoft.com + After purchasing, an email will be sent to you with a keyfile and instruction on how to install it. It's just a matter of unzipping a file and moving it to a certain directory. + There is no problem updating BePodder when a new version becomes available. The keyfile will unlock all downloadable packages unless otherwise notified. + + + + + + Index + + dot_index.png + Starting point + + + + dot_index.png + Introduction + + + dot_index.png + The User Interface + + + dot_index.png + Menu Bar + + + dot_index.png + Toolbar Buttons + + + dot_index.png + First time with BePodder + + + dot_index.png + Download Podcast's enclosure files + + + dot_index.png + Settings Overview + + + dot_index.png + Register your copy + + + + + + + + diff --git a/release/tutorial/bittorrent.html b/release/tutorial/bittorrent.html new file mode 100644 index 0000000..cd34fae Binary files /dev/null and b/release/tutorial/bittorrent.html differ diff --git a/release/tutorial/gmail.html b/release/tutorial/gmail.html new file mode 100644 index 0000000..91a3658 Binary files /dev/null and b/release/tutorial/gmail.html differ diff --git a/release/tutorial/images/add-channel-button.png b/release/tutorial/images/add-channel-button.png new file mode 100644 index 0000000..3c1acdc Binary files /dev/null and b/release/tutorial/images/add-channel-button.png differ diff --git a/release/tutorial/images/bittorrent_off.png b/release/tutorial/images/bittorrent_off.png new file mode 100644 index 0000000..d930510 Binary files /dev/null and b/release/tutorial/images/bittorrent_off.png differ diff --git a/release/tutorial/images/bittorrent_on.png b/release/tutorial/images/bittorrent_on.png new file mode 100644 index 0000000..07c4a52 Binary files /dev/null and b/release/tutorial/images/bittorrent_on.png differ diff --git a/release/tutorial/images/bp_main_page.png b/release/tutorial/images/bp_main_page.png new file mode 100644 index 0000000..fab0e46 Binary files /dev/null and b/release/tutorial/images/bp_main_page.png differ diff --git a/release/tutorial/images/enjoy.jpg b/release/tutorial/images/enjoy.jpg new file mode 100644 index 0000000..2ebd91e Binary files /dev/null and b/release/tutorial/images/enjoy.jpg differ diff --git a/release/tutorial/images/gmail_off.png b/release/tutorial/images/gmail_off.png new file mode 100644 index 0000000..bfe188c Binary files /dev/null and b/release/tutorial/images/gmail_off.png differ diff --git a/release/tutorial/images/gmail_on.png b/release/tutorial/images/gmail_on.png new file mode 100644 index 0000000..397a697 Binary files /dev/null and b/release/tutorial/images/gmail_on.png differ diff --git a/release/tutorial/images/gui1.png b/release/tutorial/images/gui1.png new file mode 100644 index 0000000..7d5b7a0 Binary files /dev/null and b/release/tutorial/images/gui1.png differ diff --git a/release/tutorial/images/gui5.png b/release/tutorial/images/gui5.png new file mode 100644 index 0000000..f6a462d Binary files /dev/null and b/release/tutorial/images/gui5.png differ diff --git a/release/tutorial/images/gui6.png b/release/tutorial/images/gui6.png new file mode 100644 index 0000000..e5f630a Binary files /dev/null and b/release/tutorial/images/gui6.png differ diff --git a/release/tutorial/images/gui7.png b/release/tutorial/images/gui7.png new file mode 100644 index 0000000..d47a821 Binary files /dev/null and b/release/tutorial/images/gui7.png differ diff --git a/release/tutorial/images/introduction_off.png b/release/tutorial/images/introduction_off.png new file mode 100644 index 0000000..1a017b7 Binary files /dev/null and b/release/tutorial/images/introduction_off.png differ diff --git a/release/tutorial/images/introduction_on.png b/release/tutorial/images/introduction_on.png new file mode 100644 index 0000000..084f679 Binary files /dev/null and b/release/tutorial/images/introduction_on.png differ diff --git a/release/tutorial/images/next.png b/release/tutorial/images/next.png new file mode 100644 index 0000000..afcd6c3 Binary files /dev/null and b/release/tutorial/images/next.png differ diff --git a/release/tutorial/images/photocasting_off.png b/release/tutorial/images/photocasting_off.png new file mode 100644 index 0000000..e09f174 Binary files /dev/null and b/release/tutorial/images/photocasting_off.png differ diff --git a/release/tutorial/images/photocasting_on.png b/release/tutorial/images/photocasting_on.png new file mode 100644 index 0000000..f6d4f37 Binary files /dev/null and b/release/tutorial/images/photocasting_on.png differ diff --git a/release/tutorial/images/play-item-button.png b/release/tutorial/images/play-item-button.png new file mode 100644 index 0000000..78b8a54 Binary files /dev/null and b/release/tutorial/images/play-item-button.png differ diff --git a/release/tutorial/images/prev.png b/release/tutorial/images/prev.png new file mode 100644 index 0000000..2814fbd Binary files /dev/null and b/release/tutorial/images/prev.png differ diff --git a/release/tutorial/images/rss-icon.gif b/release/tutorial/images/rss-icon.gif new file mode 100644 index 0000000..dbec63c Binary files /dev/null and b/release/tutorial/images/rss-icon.gif differ diff --git a/release/tutorial/images/rss.gif b/release/tutorial/images/rss.gif new file mode 100644 index 0000000..70d8f8c Binary files /dev/null and b/release/tutorial/images/rss.gif differ diff --git a/release/tutorial/images/screen1.png b/release/tutorial/images/screen1.png new file mode 100644 index 0000000..ef21913 Binary files /dev/null and b/release/tutorial/images/screen1.png differ diff --git a/release/tutorial/images/screen2.png b/release/tutorial/images/screen2.png new file mode 100644 index 0000000..e4a24c3 Binary files /dev/null and b/release/tutorial/images/screen2.png differ diff --git a/release/tutorial/images/screen3.png b/release/tutorial/images/screen3.png new file mode 100644 index 0000000..a7b1024 Binary files /dev/null and b/release/tutorial/images/screen3.png differ diff --git a/release/tutorial/images/screen4.png b/release/tutorial/images/screen4.png new file mode 100644 index 0000000..0f99616 Binary files /dev/null and b/release/tutorial/images/screen4.png differ diff --git a/release/tutorial/images/screen5.png b/release/tutorial/images/screen5.png new file mode 100644 index 0000000..4f18384 Binary files /dev/null and b/release/tutorial/images/screen5.png differ diff --git a/release/tutorial/images/screen6.png b/release/tutorial/images/screen6.png new file mode 100644 index 0000000..e434fcd Binary files /dev/null and b/release/tutorial/images/screen6.png differ diff --git a/release/tutorial/images/videocasting_off.png b/release/tutorial/images/videocasting_off.png new file mode 100644 index 0000000..7d39fcd Binary files /dev/null and b/release/tutorial/images/videocasting_off.png differ diff --git a/release/tutorial/images/videocasting_on.png b/release/tutorial/images/videocasting_on.png new file mode 100644 index 0000000..c2962d7 Binary files /dev/null and b/release/tutorial/images/videocasting_on.png differ diff --git a/release/tutorial/images/xml.png b/release/tutorial/images/xml.png new file mode 100644 index 0000000..78a8c10 Binary files /dev/null and b/release/tutorial/images/xml.png differ diff --git a/release/tutorial/introduction.html b/release/tutorial/introduction.html new file mode 100644 index 0000000..c19d413 Binary files /dev/null and b/release/tutorial/introduction.html differ diff --git a/release/tutorial/photocasting.html b/release/tutorial/photocasting.html new file mode 100644 index 0000000..81ef52f Binary files /dev/null and b/release/tutorial/photocasting.html differ diff --git a/release/tutorial/videocasting.html b/release/tutorial/videocasting.html new file mode 100644 index 0000000..876be30 Binary files /dev/null and b/release/tutorial/videocasting.html differ diff --git a/resources/AppIcon.svg b/resources/AppIcon.svg new file mode 100644 index 0000000..9d4fb0a --- /dev/null +++ b/resources/AppIcon.svg @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/resources/BePodder.rsrc b/resources/BePodder.rsrc new file mode 100644 index 0000000..f3b8390 Binary files /dev/null and b/resources/BePodder.rsrc differ diff --git a/resources/Icons.rsrc b/resources/Icons.rsrc new file mode 100644 index 0000000..b8bd6a7 Binary files /dev/null and b/resources/Icons.rsrc differ diff --git a/sources-experimental/Action.h b/sources-experimental/Action.h new file mode 100644 index 0000000..87521fa --- /dev/null +++ b/sources-experimental/Action.h @@ -0,0 +1,26 @@ +#ifndef _Action_h_ +#define _Action_h_ + +#include +#include + +#define ActionID bigtime_t + +class Action +{ + public: + Action(){fActionID=0;}; + virtual ~Action(){}; + + virtual status_t Perform(BMessage* errors) = 0; + virtual BString GetDescription() = 0; + + //general purpose ID.. + void SetActionID(ActionID id){ fActionID=id;} + ActionID GetActionID(){ return fActionID;} + + private: + ActionID fActionID; +}; + +#endif diff --git a/sources-experimental/ActionAsync.cpp b/sources-experimental/ActionAsync.cpp new file mode 100644 index 0000000..06c8a38 --- /dev/null +++ b/sources-experimental/ActionAsync.cpp @@ -0,0 +1,13 @@ +#include "ActionAsync.h" + + +ActionAsync::ActionAsync(BHandler *target ,uint32 what ){ + SetTargetAndWhat(target,what); +} + + +void +ActionAsync::SetTargetAndWhat(BHandler *tar,uint32 what){ + SetTarget(tar); + SetMessage(new BMessage(what)); +} diff --git a/sources-experimental/ActionAsync.h b/sources-experimental/ActionAsync.h new file mode 100644 index 0000000..b6669de --- /dev/null +++ b/sources-experimental/ActionAsync.h @@ -0,0 +1,15 @@ +#ifndef _ActionAsync_h_ +#define _ActionAsync_h_ + +#include "Action.h" +#include + +class ActionAsync : public Action , public BInvoker +{ + public: + ActionAsync(BHandler *target = NULL ,uint32 what = 0); + + void SetTargetAndWhat(BHandler *tar,uint32 what); +}; + +#endif diff --git a/sources-experimental/ActionAsyncWrapper.cpp b/sources-experimental/ActionAsyncWrapper.cpp new file mode 100644 index 0000000..0e28368 --- /dev/null +++ b/sources-experimental/ActionAsyncWrapper.cpp @@ -0,0 +1,15 @@ +#include "ActionAsyncWrapper.h" + + +ActionAsyncWrapper::ActionAsyncWrapper(Action* action){ + SetTargetAndWhat(NULL,0); + fAction = action; +} + +status_t +ActionAsyncWrapper::Perform(BMessage* errors) { + if(fAction) + return fAction->Perform(errors); + else + return B_ERROR; +} diff --git a/sources-experimental/ActionAsyncWrapper.h b/sources-experimental/ActionAsyncWrapper.h new file mode 100644 index 0000000..9120b07 --- /dev/null +++ b/sources-experimental/ActionAsyncWrapper.h @@ -0,0 +1,19 @@ +#ifndef _ActionAsyncWrapper_h_ +#define _ActionAsyncWrapper_h_ + +#include "ActionAsync.h" +#include + +class ActionAsyncWrapper : public ActionAsync +{ + public: + ActionAsyncWrapper(Action* action); + + status_t Perform(BMessage* errors); + + private: + Action* fAction; + +}; + +#endif diff --git a/sources-experimental/ActionDelete.cpp b/sources-experimental/ActionDelete.cpp new file mode 100644 index 0000000..eb33fdd --- /dev/null +++ b/sources-experimental/ActionDelete.cpp @@ -0,0 +1,27 @@ +#include "ActionDelete.h" +#include "Logger.h" +#include + +ActionDelete::ActionDelete(BString who,bool recoursive) { + fRecoursive = recoursive; + fWho=who; +} + +status_t +ActionDelete::Perform(BMessage* errors){ + + BString commandline; + commandline << "rm "; + if(fRecoursive) + commandline << "-r "; + commandline << "\"" << fWho << "\""; + LOG("ActionDelete",liDebug,"\n\nPerforming action [%s]\n\n",commandline.String() ); + int retcode = system(commandline.String()); + + if(retcode!=0 ){ + if(errors) errors->AddString("error","Can't delete!"); + return B_ERROR; + } + + return B_OK; +} diff --git a/sources-experimental/ActionDelete.h b/sources-experimental/ActionDelete.h new file mode 100644 index 0000000..c562e4d --- /dev/null +++ b/sources-experimental/ActionDelete.h @@ -0,0 +1,22 @@ +#ifndef _ActionDelete_h_ +#define _ActionDelete_h_ + +#include "Action.h" +#include + +class ActionDelete : public Action +{ + public: + ActionDelete(BString fWho,bool recoursive); + + + status_t Perform(BMessage* errors); + BString GetDescription() { return BString("ActionDelete"); } + + private: + int del(); + + BString fWho; + bool fRecoursive; +}; +#endif diff --git a/sources-experimental/ActionDownload.cpp b/sources-experimental/ActionDownload.cpp new file mode 100644 index 0000000..3fdf7e8 --- /dev/null +++ b/sources-experimental/ActionDownload.cpp @@ -0,0 +1,335 @@ +#include "ActionDownload.h" +#include +#include +#include +#include +//#include "Logger.h" + +#include "DownloadManager.h" +extern DownloadManager* download_manager; + + +ActionDownload::ActionDownload(BString URL, entry_ref dest, + bool allowResume, + BString fileType, + BLooper *target, + uint32 msg + ):ActionAsync(target,msg), + + fDest(dest), + fAllowResume(allowResume), + fFileType(fileType) +{ + //try to find username and password + + /*int32 dobleslash=URL.FindFirst("//"); + int32 doblepoint=URL.FindFirst(":",dobleslash); + int32 at=URL.FindFirst("@"); + + if(at>0){ + + if(doblepoint>0) { //with pwd + URL.CopyInto(fUsername,dobleslash+2,doblepoint-dobleslash-2); + URL.CopyInto(fPassword,doblepoint+1,at - doblepoint-1); + } + else + URL.CopyInto(fUsername,dobleslash+2,at - dobleslash-2); + + URL.Remove(dobleslash+2,at - dobleslash-1); + printf("// %ld : %ld @ %ld %s\n",dobleslash,doblepoint,at,URL.String()); + + } + */ + fUrl = URL; + + file = NULL; + curl=NULL; + resuming = 0.0; + SetShouldStop(false); +// LOG("ActionDownload",liDebug,"downloading URL=%s, to %s",URL.String(),BPath(&dest).Path()); +} + + +status_t +ActionDownload::openFile(BMessage* errors){ + + uint32 openMode = 0; + + if(fAllowResume) + openMode = B_WRITE_ONLY | B_CREATE_FILE | B_OPEN_AT_END; + else + openMode = B_WRITE_ONLY | B_CREATE_FILE | B_ERASE_FILE; + + if(file) return B_ERROR; + + file = new BFile(&fDest,openMode); + + if(!file || file->InitCheck()!=B_OK) + { + BString err("Can't open file!"); + errors->AddInt32("status",ERROR_OPENFILE); + errors->AddString("error",err); + return B_ERROR; + } + + + + + return B_OK; +} + + +status_t +ActionDownload::Perform(BMessage* errors){ + + + //is it these the right place? + fillMessage(this,errors); + // + + CURLcode res; + status_t status = B_OK; + + curl = curl_easy_init(); + + if(!curl) { + BString err("Internal error (CURL can't' init)!"); + errors->AddInt32("status",ERROR_CURL_INIT); + errors->AddString("error",err); + return B_ERROR; + } + + /* BString fullUrl; + if(fUsername != "") { + + if(fPassword == "") fPassword.SetTo("x"); + + fUrl.MoveInto(fullUrl,0,fUrl.FindFirst("//")+2); + fullUrl << fUsername << ":" << fPassword << "@"; + fullUrl << fUrl; + } + else + fullUrl=fUrl; + + printf("fullUrl %s\n",fullUrl.String()); + */ + + curl_easy_setopt(curl, CURLOPT_URL, fUrl.String()); + curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, callback); + curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, this ); + curl_easy_setopt(curl, CURLOPT_NOPROGRESS,FALSE); + + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION,save_file); + curl_easy_setopt(curl, CURLOPT_WRITEDATA,this); + + curl_easy_setopt(curl, CURLOPT_PASSWDFUNCTION,passwd); + curl_easy_setopt(curl, CURLOPT_PASSWDDATA,this); + + curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION , 1); //follow the white link! + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER , FALSE); //https + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST , FALSE); //https + + curl_easy_setopt(curl, CURLOPT_FAILONERROR , 1); + + download_manager->FinishCurl(curl); + + //RESUME + if(fAllowResume){ + BNode stat(&fDest); + // file->Seek(SEEK_END,0); + // size_t resume = (size_t)file->Position(); + off_t size = 0; + stat.GetSize(&size); + + size_t resume = size; + + + if(resume>0){ + curl_easy_setopt(curl, CURLOPT_RESUME_FROM, resume); + resuming = (double)resume; + } + } + + BMessage connect(*Message()); + // connect.what = Command(); + connect.AddInt32("status",OK_CONNECTING); + //Target()->PostMessage(&connect); + Invoke(&connect); + + + + + res = curl_easy_perform(curl); + + if(res !=0) + { + BString err("Can't connect!"); + errors->AddInt32("status",ERROR_PERFORMING); + errors->AddString("error",err); + errors->AddInt32("curl_error",res); + errors->AddBool("should_stop",ShouldStop()); + status = B_ERROR; + } + else + { + errors->AddInt32("status",OK_DOWNLOADED); + } + + curl_easy_cleanup(curl); + + errors->AddString("path",GetLocalPath()); + errors->AddRef("entry",&fDest); + + + + if(fFileType != "") + { + printf("Setting file type to: %s\n", fFileType.String()); + BNodeInfo(file).SetType(fFileType.String()); + } + else + { + printf("Ready to call update_mime_info(%s, false, true, false);\n",BPath(&fDest).Path()); + update_mime_info(BPath(&fDest).Path(),false,true,false); + } + delete file; + file = NULL; + + if(res == CURLE_BAD_DOWNLOAD_RESUME || res == CURLE_HTTP_RANGE_ERROR) { + // sarebbe bello chiedere.. va be per ora ci riprova e basta! + // cosa chiede? che alternative avrebbe se no l'utente? + fAllowResume = false; + errors->MakeEmpty(); + Perform(errors); + } +// else +// if(res!=0) { +// debugger("Found"); +// errors->MakeEmpty(); +// Perform(errors); + // } + + return status; +} + +BString +ActionDownload::GetDescription(){ + return "HTTP File download"; +} + +BString +ActionDownload::GetLocalPath(){ + return BPath(&fDest).Path(); +} + +void +ActionDownload::fillMessage(ActionDownload* ad,BMessage* msg){ + //fill with common fileds + int32 what=msg->what; //preserve original what. + *msg = ad->extraInfo; + + msg->AddInt64("sid",ad->GetActionID()); + msg->AddString("url",ad->fUrl); + + msg->what=what; +} + + + +void +ActionDownload::sendProgressX(ActionDownload* ad,double max,double current){ + + + BMessage *msg=ad->Message(); + msg->MakeEmpty(); + + fillMessage(ad,msg); + + + + msg->AddInt32("status",OK_PROGRESS); + msg->AddFloat("max_progress",max); + msg->AddFloat("current_progress",current); + //perc + float div = (current / max ) * 100; + + msg->AddInt32("percentage_progress",(int32)floor(div)); + + double speed = 0; + if(curl_easy_getinfo(ad->curl,CURLINFO_SPEED_DOWNLOAD,&speed) == CURLE_OK) + msg->AddFloat("download_speed",speed); + + + //TOTALE: + if(curl_easy_getinfo(ad->curl,CURLINFO_CONTENT_LENGTH_DOWNLOAD,&speed) == CURLE_OK) + msg->AddFloat("total_size",speed); + + // ATTUALE: CURLINFO_SIZE_DOWNLOAD + if(curl_easy_getinfo(ad->curl,CURLINFO_SIZE_DOWNLOAD,&speed) == CURLE_OK) + msg->AddFloat("actual_size",speed); + + char *array = NULL; + + + if(curl_easy_getinfo(ad->curl,CURLINFO_EFFECTIVE_URL,&array) == CURLE_OK) + msg->AddString("effective_url",BString(array)); + + //Andrea: this method is no more used, is the caller (of this class) who decided the filetype, + // if empty we ask the system to try to identify.. see end of Perform + /* + if(ad->fFileType == "" && curl_easy_getinfo(ad->curl,CURLINFO_CONTENT_TYPE,&array) == CURLE_OK) { + ad->fFileType.SetTo(array); + BNodeInfo(ad->file).SetType(ad->fFileType.String()); + msg->AddString("filetype",BString(array)); + }*/ + + ad->Invoke(); +} + +/* +void +ActionDownload::sendError(BLooper* looper,uint32 amsg,Status st,BString descr){ + BMessage msg(amsg); + msg.AddInt32("status",st); + msg.AddString("error",descr); + looper->PostMessage(&msg); +} +*/ +// + +int +ActionDownload::callback(void *data, + double dltotal, + double dlnow, + double , + double ) +{ + ActionDownload *ad=((ActionDownload*)data); + + //LOG("ActionDownload",liDebug,"callback total %f, now %f", dltotal,dlnow); + + if(ad->Target()) + sendProgressX(ad,ad->resuming+dltotal,ad->resuming+dlnow); + return 0; +} + +size_t +ActionDownload::save_file( void *ptr, size_t size, size_t nmemb, void *data){ + ActionDownload *ad=((ActionDownload*)data); + + if(!ad->file) { + BMessage errors; //how to report these errors?? + if(ad->openFile(&errors) != B_OK) return 0; + } + BFile* file=ad->file; + if(ad->ShouldStop()) return 0; + return file->Write(ptr,size*nmemb); +} + +int +ActionDownload::passwd (void *clientp, const char *prompt, char *buffer, int buflen){ + return 0; +} + + +//. diff --git a/sources-experimental/ActionDownload.h b/sources-experimental/ActionDownload.h new file mode 100644 index 0000000..6d20ffc --- /dev/null +++ b/sources-experimental/ActionDownload.h @@ -0,0 +1,88 @@ +#ifndef _ActionDownload_h_ +#define _ActionDownload_h_ + +#include "ActionAsync.h" +#include +#include +#include +#include "curl/curl.h" + +class ActionDownload : public ActionAsync +{ + public: + ActionDownload(BString URL, entry_ref dest,bool allowResume, BString fileType, BLooper *target = NULL ,uint32 msg = 0); + ~ActionDownload(){}; + + status_t Perform(BMessage* errors); + BString GetDescription(); + BString GetLocalPath(); + + //void SetLooper(BLooper *loop,uint32 msg){ fTarget=loop; fMsg=msg;}; + + //for compaatibility: + void SetExtraData(BString extra){ + extraInfo.AddString("extra",extra); + } + + void SetKey(BString key, BString data){ + extraInfo.AddString(key.String(),data); + } + + void SetRef(BString key, entry_ref *ref){ + extraInfo.AddRef(key.String(),ref); + } + + status_t GetRef(BString key, entry_ref* ref){ + return extraInfo.FindRef(key.String(),ref); + } + + + BString GetKey(BString key){ + BString data; + extraInfo.FindString(key.String(),&data); + return data; + } + + + void SetShouldStop(bool stop){ fShouldStop=stop;} + bool ShouldStop(){ return fShouldStop; } + + enum Status { + ERROR_OPENFILE, // 0 + ERROR_CURL_INIT, // 1 + ERROR_PERFORMING, // 2 + OK_CONNECTING, // 3 + OK_PROGRESS, // 4 + OK_DOWNLOADED // 5 + }; + +private: + + + status_t openFile(BMessage*); + + static void fillMessage(ActionDownload*,BMessage*); + static void sendProgressX(ActionDownload*,double max,double current); + + //curl callbacks: + static size_t save_file ( void *ptr, size_t size, size_t nmemb, void *stream); + static int callback (void *clientp,double dltotal,double dlnow,double , double); + static int passwd (void *clientp, const char *prompt, char *buffer, int buflen); + + + CURL* curl; + BString fUrl; //from. + entry_ref fDest; + + BMessage extraInfo; + bool fShouldStop; + BFile* file; + double resuming; + bool fAllowResume; + + BString fUsername; + BString fPassword; + BString fFileType; +}; + +#endif diff --git a/sources-experimental/ActionHTTPContent.cpp b/sources-experimental/ActionHTTPContent.cpp new file mode 100644 index 0000000..c92a111 --- /dev/null +++ b/sources-experimental/ActionHTTPContent.cpp @@ -0,0 +1,88 @@ +#include "ActionHTTPContent.h" +#include +#include +#include + + +#include "DownloadManager.h" +extern DownloadManager* download_manager; + + + +ActionHTTPContent::ActionHTTPContent(BString url){ + curl = NULL; + SetShouldStop(false); + SetUrl(url); +} + +ActionHTTPContent::~ActionHTTPContent(){ +}; + +status_t +ActionHTTPContent::Perform(BMessage* errors){ + + + + CURLcode res; + status_t status = B_OK; + + curl = curl_easy_init(); + + if(!curl) { + BString err("Internal error (CURL can't' init)!"); + return B_ERROR; + } + + curl_easy_setopt(curl, CURLOPT_URL, fUrl.String()); + + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION,save_file); + curl_easy_setopt(curl, CURLOPT_WRITEDATA,this); + + + curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION , 1); //follow the white link! + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER , FALSE); //https + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST , FALSE); //https + + curl_easy_setopt(curl, CURLOPT_FAILONERROR , 1); + + download_manager->FinishCurl(curl); + + + + res = curl_easy_perform(curl); + + if(res ==0) + AfterPerforming(errors); + + curl_easy_cleanup(curl); + return status; +} + +BString +ActionHTTPContent::GetDescription(){ + return "HTTP Content"; +} + + +size_t +ActionHTTPContent::save_file( void *ptr, size_t size, size_t nmemb, void *data){ + ActionHTTPContent *ad=((ActionHTTPContent*)data); + + + if(ad->ShouldStop()) return 0; + + ad->content.Append((const char*)ptr, size*nmemb); + + return size*nmemb; +} + + + + +void +ActionHTTPContent::AfterPerforming(BMessage* errors){ + if(content != "") + errors->AddString("content",content); +} + +//. diff --git a/sources-experimental/ActionHTTPContent.h b/sources-experimental/ActionHTTPContent.h new file mode 100644 index 0000000..a37495c --- /dev/null +++ b/sources-experimental/ActionHTTPContent.h @@ -0,0 +1,42 @@ +#ifndef _ActionHTTPContent_h_ +#define _ActionHTTPContent_h_ + +#include "ActionAsync.h" +#include +#include + +#include +#include "curl/curl.h" + + +class ActionHTTPContent : public ActionAsync +{ + public: + ActionHTTPContent(BString url); + ~ActionHTTPContent(); + + status_t Perform(BMessage* errors); + BString GetDescription(); + + void SetShouldStop(bool stop){ fShouldStop=stop;} + bool ShouldStop(){ return fShouldStop; } + + virtual void AfterPerforming(BMessage* errors) ; + + void SetUrl(BString url) { fUrl =url; }; + + +private: + + + BString content; + + //curl callbacks: + static size_t save_file ( void *ptr, size_t size, size_t nmemb, void *stream); + + CURL* curl; + BString fUrl; //from. + bool fShouldStop; +}; + +#endif diff --git a/sources-experimental/AddWindow.cpp b/sources-experimental/AddWindow.cpp new file mode 100644 index 0000000..31f709e --- /dev/null +++ b/sources-experimental/AddWindow.cpp @@ -0,0 +1,141 @@ + +#include "AddWindow.h" +#include "Application.h" + +#include +#include "BPLocale.h" +#include +#include +#include +#include +#include +#include +#include +#include "MainWindow.h" +#include "BPAlert.h" +#include "PBox.h" + +extern MainWindow* main_window; + + +AddWindow::AddWindow() : + BWindow(BRect(250,70,640,270),"AddWindow", B_MODAL_WINDOW, B_NOT_RESIZABLE|B_NOT_ZOOMABLE|B_ASYNCHRONOUS_CONTROLS) +{ + + + BButton* but; + BButton* but2; + + BFont font=*(be_plain_font); + + + BRect r(Bounds()); + + BBox *box = new BBox(r,"url_bbox", B_FOLLOW_LEFT_RIGHT, B_WILL_DRAW, B_FANCY_BORDER); + box->SetBorder(B_PLAIN_BORDER); + + AddChild(box); + BRect rect(0, 0, 390, 165); + + BMessage templ; + templ.AddString("name", "Add Subscription"); + BMessage settings; + settings.AddString("name", "rss_url"); + settings.AddString("description", "Feed URL"); + settings.AddInt32("type", B_STRING_TYPE); + settings.AddBool("multi_line", true); + templ.AddMessage("setting", &settings); + BMessage values; + + text = new PBox(rect, templ, values, "rss_url"); + text->SetBorder(B_PLAIN_BORDER); + + box->AddChild(text); + + + + addrect = box->Bounds(); + addrect.InsetBy(25, 20); + addrect.top = addrect.bottom - 12; + addrect.left = addrect.right - font.StringWidth(_T("Cancel")) - 30; + box->AddChild(but = new BButton(addrect,"",_T("Cancel"),new BMessage('can'))); + + addrect.right = addrect.left - 15; + addrect.left = addrect.right - font.StringWidth(_T("Add")) - 30; + box->AddChild(but2 = new BButton(addrect,"",_T("Add"),new BMessage('sav'))); + + + //controlliamo se c'e' qualcosa nella clipboard? + const char *clip_text = NULL; + bool addButton = false; + int32 textLen; + BString url; + BMessage *clip = (BMessage *)NULL; + if (be_clipboard->Lock() ){ + clip = be_clipboard->Data(); + + if ( clip && ( clip->FindData("text/plain", B_MIME_TYPE,(const void **)&clip_text, &textLen) == B_OK )){ + url.SetTo(clip_text,textLen); + + if(url.FindFirst("http://") == 0) + addButton = true; + else + if(url.FindFirst("pcast://") == 0) + addButton = true; + else + if(url.FindFirst("feed://") == 0) + addButton = true; + } + be_clipboard->Unlock(); + } + + if(addButton==true){ + addrect.right = addrect.left - 15; + addrect.left = addrect.right - font.StringWidth(_T("Paste")) - 30; + BMessage* msg=new BMessage('past'); + msg->AddString("url",url); + BButton* clip_but; + box->AddChild(clip_but = new BButton(addrect,"",_T("Paste"),msg)); + } + + MoveTo(BPAlert::AlertPosition(Bounds().Width(),Bounds().Height())); + + + BTextView *textView = (BTextView*)FindView("rss_url"); + if (textView){ + textView->MakeFocus(true); + } +} + + +void +AddWindow::MessageReceived(BMessage *mess){ + + + if(mess->what == 'can'){ + BMessenger(this).SendMessage(B_QUIT_REQUESTED); + } + else + if(mess->what == 'sav'){ + BTextView *textView = (BTextView*)FindView("rss_url"); + if (textView){ + BMessage msg(DOWNLOAD_CHANNEL); + msg.AddString("url",textView->Text()); + BMessenger(main_window).SendMessage(&msg); + BMessenger(this).SendMessage(B_QUIT_REQUESTED); + } + } + else + if(mess->what== 'past'){ + BString url; + mess->FindString("url",&url); + BTextView *textView = (BTextView*)FindView("rss_url"); + if (textView){ + textView->SetText(url.String()); + } + } + else BWindow::MessageReceived(mess); +} + + + diff --git a/sources-experimental/AddWindow.cpp_OR b/sources-experimental/AddWindow.cpp_OR new file mode 100644 index 0000000..ae22d4f --- /dev/null +++ b/sources-experimental/AddWindow.cpp_OR @@ -0,0 +1,146 @@ + +#include "AddWindow.h" +#include "Application.h" + +#include +#include "BPLocale.h" +#include +#include +#include +#include +#include +#include +#include +#include "MainWindow.h" +#include "BPAlert.h" + + +extern MainWindow* main_window; + + +AddWindow::AddWindow() : + BWindow(BRect(250,70,640,220),"AddWindow", B_MODAL_WINDOW, B_NOT_RESIZABLE|B_NOT_ZOOMABLE|B_ASYNCHRONOUS_CONTROLS) +{ + + + BButton* but; + BButton* but2; + + +// const rgb_color bgcolor = {255,215,96,255}; + const rgb_color boxcolor = {255,233,167,255}; +//#ifdef ZETA +// SetWindowColor(bgcolor); +//#endif + + BFont font=*(be_plain_font); + + + BRect r(Bounds()); + //r.InsetBy(0,15); + + BBox *box = new BBox(r,"url_bbox", B_FOLLOW_LEFT_RIGHT, B_FANCY_BORDER); + + box->SetLabel(_T("Insert the rss feed url!")); + box->SetBorder(B_PLAIN_BORDER); + box->SetViewColor(boxcolor); + + AddChild(box); + + + + BStringView* txt = new BStringView(BRect(20,15,370,65),"url-",_T("URL:")); + box->AddChild(txt); + txt->SetViewColor(boxcolor); + txt->ResizeToPreferred(); + + BRect rect(20,txt->Frame().bottom+1,370 - B_V_SCROLL_BAR_WIDTH ,95); + BRect rr= rect.OffsetToCopy(0,0); + //rr = + rr.InsetBy(BPoint(2,2)); + text = new BTextView(rect,"",rr,B_FOLLOW_LEFT_RIGHT,B_WILL_DRAW | B_NAVIGABLE); + BScrollView* scroller = new BScrollView("scroller",text,B_FOLLOW_LEFT_RIGHT,B_WILL_DRAW | B_NAVIGABLE,false,true); + //text->SetWordWrap(false); + box->AddChild(scroller); + //text->SetDivider(30); + //text->SetText(""); + //text->SetViewColor(boxcolor); + //text->MakeFocus(true); + + + addrect = box->Bounds(); + addrect.InsetBy(25, 20); + addrect.top = addrect.bottom - 12; + addrect.left = addrect.right - font.StringWidth(_T("Cancel")) - 30; + box->AddChild(but = new BButton(addrect,"",_T("Cancel"),new BMessage('can'))); + but->SetViewColor(boxcolor); + + addrect.right = addrect.left - 15; + addrect.left = addrect.right - font.StringWidth(_T("Add")) - 30; + box->AddChild(but2 = new BButton(addrect,"",_T("Add"),new BMessage('sav'))); + but2->SetViewColor(boxcolor); + + + //controlliamo se c'e' qualcosa nella clipboard? + const char *clip_text = NULL; + bool addButton = false; + int32 textLen; + BString url; + BMessage *clip = (BMessage *)NULL; + if (be_clipboard->Lock() ){ + clip = be_clipboard->Data(); + + if ( clip && ( clip->FindData("text/plain", B_MIME_TYPE,(const void **)&clip_text, &textLen) == B_OK )){ + url.SetTo(clip_text,textLen); + + if(url.FindFirst("http://") == 0) + addButton = true; + else + if(url.FindFirst("pcast://") == 0) + addButton = true; + else + if(url.FindFirst("feed://") == 0) + addButton = true; + } + be_clipboard->Unlock(); + } + + if(addButton==true){ + addrect.right = addrect.left - 15; + addrect.left = addrect.right - font.StringWidth(_T("Paste")) - 30; + BMessage* msg=new BMessage('past'); + msg->AddString("url",url); + BButton* clip_but; + box->AddChild(clip_but = new BButton(addrect,"",_T("Paste"),msg)); + clip_but->SetViewColor(boxcolor); + } + + MoveTo(BPAlert::AlertPosition(Bounds().Width(),Bounds().Height())); +} + + +void +AddWindow::MessageReceived(BMessage *mess){ + + + if(mess->what == 'can'){ + BMessenger(this).SendMessage(B_QUIT_REQUESTED); + } + else + if(mess->what == 'sav'){ + BMessage msg(DOWNLOAD_CHANNEL); + msg.AddString("url",text->Text()); + BMessenger(main_window).SendMessage(&msg); + BMessenger(this).SendMessage(B_QUIT_REQUESTED); + } + else + if(mess->what== 'past'){ + BString url; + mess->FindString("url",&url); + text->SetText(url.String()); + } + else BWindow::MessageReceived(mess); +} + + + diff --git a/sources-experimental/AddWindow.h b/sources-experimental/AddWindow.h new file mode 100644 index 0000000..415f18c --- /dev/null +++ b/sources-experimental/AddWindow.h @@ -0,0 +1,25 @@ +#include + +#include + +#define DOWNLOAD_CHANNEL 'addu' + +class PBox; + +class AddWindow: public BWindow +{ + + + + + public: + AddWindow(); + void MessageReceived(BMessage *mess); + + PBox* text; + BRect addrect; + + + +}; + diff --git a/sources-experimental/Archive.h b/sources-experimental/Archive.h new file mode 100644 index 0000000..b6f6cfb --- /dev/null +++ b/sources-experimental/Archive.h @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#ifndef _Archive_H_ +#define _Archive_H_ + +#include "Store.h" +#include "Retriver.h" +#include "ElementListener.h" + +class Archive : public Store, public Retriver, public ElementListener { + + public: + + // from Store + virtual void SetKey(ItemProperty key,void* data,ssize_t size) = 0; + virtual void SetKeyString(ItemProperty key,const char* data) = 0; + virtual void SetKeyInt32(ItemProperty key,int32 data) = 0; + + + //from Retriver + virtual ssize_t GetData(ItemProperty key,const void** data)= 0; + virtual int32 CountData()= 0; + virtual BString GetDataString(ItemProperty key)= 0; + virtual int32 GetDataInt32(ItemProperty key)= 0; + + //from ElementListener + virtual void KeyModified(int32 key, void* data, ssize_t numBytes) = 0; + +}; + +#endif + +//.. diff --git a/sources-experimental/AttributeDumper.cpp b/sources-experimental/AttributeDumper.cpp new file mode 100644 index 0000000..0e87ea0 --- /dev/null +++ b/sources-experimental/AttributeDumper.cpp @@ -0,0 +1,201 @@ +#include "AttributeDumper.h" +#include "ItemProperty.h" +#include "TypeConstants.h" +#include "AttributeMap.h" + +#include +#include +#include +#include +#include +#include "FileStatus.h" +#include "Utils.h" + +// from the BeBook: +// The value of an indexed attribute can be, at most, 255 bytes. +// from the ITunesRSS format: +// All fields will be truncated to 255 unicode characters, except for + +#define INDEX_LIMIT_LENGHT 255 + +AttributeDumper::AttributeDumper(entry_ref* ref) { + + fRef=*ref; + //BFile *fFile = new BFile(&fRef,B_WRITE_ONLY | B_CREATE_FILE | B_ERASE_FILE); + fNode = new BNode(ref); //fFile; +} +/* +AttributeDumper::AttributeDumper(node_ref* nref) { + + BDirectory *fDir = new BDirectory(nref); + fNode = fDir; +} +*/ +AttributeDumper::AttributeDumper(entry_ref* ref,bool asdir){ + + fNode = NULL; + + //new name + BString filename; + filename << real_time_clock_usecs(); + // + + BDirectory dir(ref); + + fPath.SetTo(&dir,NULL); + fPath.Append(filename.String()); + + if(!asdir) + { + + BFile *fFile = new BFile(fPath.Path(),B_WRITE_ONLY | B_CREATE_FILE | B_ERASE_FILE); + fNode = fFile; + + BNodeInfo(fNode).SetType(MIME_ITEM); + + get_ref_for_path(fPath.Path(),&fRef); + } + else + { + BDirectory *fDir = new BDirectory(dir); + dir.CreateDirectory(fPath.Path(),fDir); + fNode = fDir; + + BNodeInfo(fNode).SetType(MIME_CHANNEL); + + printf("New directory Path [%s]\n",fPath.Path()); + + get_ref_for_path(fPath.Path(),&fRef); + } + + +} +AttributeDumper::~AttributeDumper(){ + if(fNode) delete fNode; +} +void +AttributeDumper::KeyModified(int32 key, void* data, ssize_t numBytes){ + + + + switch(key) + { + case ITEM_TITLE: + _writeAttr(ATTR_ITEM_TITLE,BString((const char*)data,numBytes)); + break; + case ITEM_GUID: + _writeAttr(ATTR_ITEM_GUID,BString((const char*)data,numBytes)); + break; + case ITEM_LINK: + _writeAttr(ATTR_ITEM_LINK,BString((const char*)data,numBytes)); + break; + case ITEM_CATEGORY: + _writeAttr(ATTR_CATEGORY,BString((const char*)data,numBytes)); + break; + + case ITEM_KEYWORDS: + _writeAttr(ATTR_ITEM_KEYWORDS,BString((const char*)data,numBytes)); + break; + + case ITEM_PUBDATE: + { + time_t when = *((time_t*)data); + if(fNode) fNode->WriteAttr(ATTR_ITEM_PUBDATE,B_TIME_TYPE,0,&when,sizeof(when)); + } + break; + case ITEM_ENCLOSURE_LENGTH: + { + off_t size = *((off_t*)data); + if(fNode) fNode->WriteAttr(ATTR_ENCLOSURE_SIZE,B_TIME_TYPE,0,&size,sizeof(size)); + } + break; + + case ITEM_ENCLOSURE_LOCALPATH: + _writeAttr(ATTR_ENCLOSURE_PATH,BString((const char*)data,numBytes)); + break; + + case ITEM_ENCLOSURE_URL: + _writeAttr(ATTR_ENCLOSURE_URL,BString((const char*)data,numBytes)); + break; + case ITEM_ENCLOSURE_TYPE: + _writeAttr(ATTR_ENCLOSURE_TYPE,BString((const char*)data,numBytes)); + break; + case ITEM_ENCLOSURE_FILE_STATUS:{ + FileStatus fs = *((FileStatus*)data); + if(fNode) fNode->WriteAttr(ATTR_ITEM_STATUS,B_INT32_TYPE,0,&fs,sizeof(FileStatus)); + } + break; + + case ITEM_DESCRIPTION: + _writeAttr(ATTR_ITEM_DESCRIPTION,BString((const char*)data,numBytes),false); + break; + + // CHANNEL: + + case CHANNEL_TITLE: + _writeAttr(ATTR_TITLE,BString((const char*)data,numBytes)); + break; + case CHANNEL_WEBLINK: + _writeAttr(ATTR_WEBLINK,BString((const char*)data,numBytes)); + break; + case CHANNEL_URL: + _writeAttr(ATTR_URL,BString((const char*)data,numBytes)); + break; + case CHANNEL_CATEGORY: + _writeAttr(ATTR_CATEGORY,BString((const char*)data,numBytes)); + break; + + case CHANNEL_IMAGE_DATA: + _addBitmap((BBitmap*)data); + break; + case CHANNEL_DESCRIPTION: + _writeAttr(ATTR_DESCRIPTION,BString((const char*)data,numBytes),false); + break; + case CHANNEL_NEWITEMS: + { +// int32 c = *((int32*)data); + + } + break; + case CHANNEL_RSS_FILE_STATUS: + { +// int32 c = *((int32*)data); + + } + break; + default: + break; + }; + +} + +void +AttributeDumper::_writeAttr(const char* name,BString data,bool cut){ + if(cut) data.Truncate(INDEX_LIMIT_LENGHT); + if(fNode) fNode->WriteAttr(name,B_STRING_TYPE,0,data.String(),data.Length()); + +} + +status_t +AttributeDumper::_addBitmap(BBitmap *icon) { + + + char *buffer = NULL; + int32 size = -1; + BMessage flattenedIcon; + status_t ret = B_ERROR; + BMessage iconMsg; + + if (icon->Archive(&flattenedIcon) != B_OK) return ret; + + size = flattenedIcon.FlattenedSize(); + buffer = (char *)calloc(size, sizeof(char)); + if (flattenedIcon.Flatten(buffer, size) == B_OK) { + if(fNode) ret = fNode->WriteAttr(ATTR_IMAGE, B_MESSAGE_TYPE, 0, buffer, size); + }; + + free(buffer); + return ret; +}; + +//__ diff --git a/sources-experimental/AttributeDumper.h b/sources-experimental/AttributeDumper.h new file mode 100644 index 0000000..1af5127 --- /dev/null +++ b/sources-experimental/AttributeDumper.h @@ -0,0 +1,40 @@ +#ifndef AttributeDumper_H_ +#define AttributeDumper_H_ + +//Dumps ItemProperty as file attribute. + +#include "ElementListener.h" + +#include +#include +#include +#include + +class AttributeDumper : public ElementListener { + +public: + AttributeDumper(entry_ref* ref); + //AttributeDumper(node_ref* nref); + + //create the file: + AttributeDumper(entry_ref*,bool asdir); + + + + virtual ~AttributeDumper(); + + void KeyModified(int32 key, void* data, ssize_t numBytes); + + BPath GetPath(){ return fPath; } + void GetNodeRef(node_ref* ref){ if(fNode) fNode->GetNodeRef(ref); } + void GetEntryRef(entry_ref* ref){ *ref=fRef; } +private: + void _writeAttr(const char* name,BString data,bool cut = true); + status_t _addBitmap(BBitmap* icon); + + BNode* fNode; + entry_ref fRef; + BPath fPath; +}; + +#endif diff --git a/sources-experimental/AttributeExtractor.cpp b/sources-experimental/AttributeExtractor.cpp new file mode 100644 index 0000000..6453ff0 --- /dev/null +++ b/sources-experimental/AttributeExtractor.cpp @@ -0,0 +1,138 @@ +#include "AttributeExtractor.h" +#include "FileStatus.h" +#include "AttributeMap.h" +#include +#include +#include +#include +#include "Utils.h" + +void +AttributeExtractor::Parse(BNode *node,bool deep){ + + char buf[B_ATTR_NAME_LENGTH]; + + node->RewindAttrs(); + + while (node->GetNextAttrName(buf) == B_OK) { + //printf("> Attr name: %s\n", buf); + BString attr(buf); + + if(attr.ICompare(ATTR_TITLE)==0){ + size_t r = node->ReadAttr(buf,0,0,buf,B_ATTR_NAME_LENGTH); + buf[r]='\0'; + NotifyNotifier(CHANNEL_TITLE,buf,r); + } + else + if(attr.ICompare(ATTR_WEBLINK)==0){ + size_t r = node->ReadAttr(buf,0,0,buf,B_ATTR_NAME_LENGTH); + buf[r]='\0'; + NotifyNotifier(CHANNEL_WEBLINK,buf,r); + } + else + if(attr.ICompare(ATTR_IMAGE)==0){ + + //new style + + char* buffer; + int32 size; + status_t err = ReadAttributeData(node,ATTR_IMAGE,&buffer,&size); + + if(err !=B_OK ) return; + + BMessage iconMsg; + + if (iconMsg.Unflatten(buffer) != B_OK) { + free(buffer); + return ; + }; + BBitmap* icon = new BBitmap(&iconMsg); + if(!icon) { + free(buffer); + return; + } + + NotifyNotifier(CHANNEL_IMAGE_DATA,(void*)icon,sizeof(BBitmap*)); + + free(buffer); + delete icon; + + + } + + else if(attr.ICompare(ATTR_ITEM_TITLE)==0){ + size_t r = node->ReadAttr(buf,0,0,buf,B_ATTR_NAME_LENGTH); + buf[r]='\0'; + NotifyNotifier(ITEM_TITLE,buf,r); + } + else if(attr.ICompare(ATTR_URL)==0){ + size_t r = node->ReadAttr(buf,0,0,buf,B_ATTR_NAME_LENGTH); + buf[r]='\0'; + NotifyNotifier(CHANNEL_URL,buf,r); + } + else if(attr.ICompare(ATTR_ITEM_GUID)==0){ + size_t r = node->ReadAttr(buf,0,0,buf,B_ATTR_NAME_LENGTH); + buf[r]='\0'; + NotifyNotifier(ITEM_GUID,buf,r); + } + else if(attr.ICompare(ATTR_ENCLOSURE_URL)==0){ + size_t r = node->ReadAttr(buf,0,0,buf,B_ATTR_NAME_LENGTH); + buf[r]='\0'; + NotifyNotifier(ITEM_ENCLOSURE_URL,buf,r); + } + else if(attr.ICompare(ATTR_ENCLOSURE_PATH)==0){ + size_t r = node->ReadAttr(buf,0,0,buf,B_ATTR_NAME_LENGTH); + buf[r]='\0'; + NotifyNotifier(ITEM_ENCLOSURE_LOCALPATH,buf,r); + } + else if(attr.ICompare(ATTR_ENCLOSURE_TYPE)==0){ + size_t r = node->ReadAttr(buf,0,0,buf,B_ATTR_NAME_LENGTH); + buf[r]='\0'; + NotifyNotifier(ITEM_ENCLOSURE_TYPE,buf,r); + } + + else if(attr.ICompare(ATTR_ITEM_PUBDATE)==0){ + size_t r = node->ReadAttr(buf,0,0,buf,sizeof(time_t)); + //time_t time; + //memcpy(&time,buf,sizeof(time)); + //printf("EX DEBUG TIME %ld\n",time); + NotifyNotifier(ITEM_PUBDATE,(void*)buf,r); + } + else if(attr.ICompare(ATTR_ITEM_STATUS)==0){ + size_t r = node->ReadAttr(buf,0,0,buf,sizeof(FileStatus)); + NotifyNotifier(ITEM_ENCLOSURE_FILE_STATUS,(void*)buf,r); + } + else if(attr.ICompare(ATTR_ENCLOSURE_SIZE)==0){ + size_t r = node->ReadAttr(buf,0,0,buf,B_ATTR_NAME_LENGTH); + NotifyNotifier(ITEM_ENCLOSURE_LENGTH,(void*)buf,r); + } + //this doesn't need to be extracted: + if(deep){ + if(attr.ICompare(ATTR_ITEM_DESCRIPTION)==0){ + //new style + + char* buffer; + int32 size; + status_t err = ReadAttributeString(node,ATTR_ITEM_DESCRIPTION,&buffer,&size); + + if(err !=B_OK ) return; + NotifyNotifier(ITEM_DESCRIPTION,(void*)buffer,size); + free(buffer); + } + else if(attr.ICompare(ATTR_ITEM_LINK)==0){ + size_t r = node->ReadAttr(buf,0,0,buf,B_ATTR_NAME_LENGTH); + buf[r]='\0'; + NotifyNotifier(ITEM_LINK,buf,r); + } + else if(attr.ICompare(ATTR_DESCRIPTION)==0){ + char* buffer; + int32 size; + status_t err = ReadAttributeString(node,ATTR_DESCRIPTION,&buffer,&size); + if(err !=B_OK ) return; + NotifyNotifier(CHANNEL_DESCRIPTION,(void*)buffer,size); + free(buffer); + } + + } + } +} diff --git a/sources-experimental/AttributeExtractor.h b/sources-experimental/AttributeExtractor.h new file mode 100644 index 0000000..4dfac2f --- /dev/null +++ b/sources-experimental/AttributeExtractor.h @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#ifndef AttributeExtractor_H_ +#define AttributeExtractor_H_ + +#include + +#include "Extractor.h" + + + +class AttributeExtractor : public Extractor +{ + +public: + + void Parse(BNode* node, bool deep = false); + +}; +#endif diff --git a/sources-experimental/AttributeMap.h b/sources-experimental/AttributeMap.h new file mode 100644 index 0000000..a4f74c1 --- /dev/null +++ b/sources-experimental/AttributeMap.h @@ -0,0 +1,38 @@ +#ifndef AttributeMap_H_ +#define AttributeMap_H_ + +#define MIME_ITEM "application/bp-item" +#define MIME_CHANNEL "application/bp-channel" +#define MIME_ARCHIVED_CHANNEL "application/bp-archived-channel" + +#define ATTR_TITLE "bp:title" +#define ATTR_URL "bp:link" +#define ATTR_WEBLINK "bp:weblink" +#define ATTR_IMAGE "bp:image" +#define ATTR_CATEGORY "bp:category" +#define ATTR_DESCRIPTION "bp:description" + +#define ATTR_ITEM_TITLE "bp:item_title" +#define ATTR_ITEM_STATUS "bp:item_status" +#define ATTR_ITEM_GUID "bp:item_guid" +#define ATTR_ITEM_PUBDATE "bp:item_pubdate" +#define ATTR_ITEM_LINK "bp:item_link" +#define ATTR_ITEM_KEYWORDS "bp:item_keywords" + + +#define ATTR_ITEM_DESCRIPTION "bp:item_description" + +#define ATTR_ENCLOSURE_URL "bp:enclosure_url" +#define ATTR_ENCLOSURE_PATH "bp:enclosure_path" +#define ATTR_ENCLOSURE_SIZE "bp:enclosure_size" +#define ATTR_ENCLOSURE_TYPE "bp:enclosure_type" + + +#define ATTR_COLUMNS_STATE "_pb/columns" +#define ATTR_EXTRA_STATE "_pb/extras" +#define ATTR_CACHE "pb:cache" +#define ATTR_GROUPS "pb:groups" + + +#endif +//-- diff --git a/sources-experimental/AutoFiletypeMap.h b/sources-experimental/AutoFiletypeMap.h new file mode 100644 index 0000000..a380295 --- /dev/null +++ b/sources-experimental/AutoFiletypeMap.h @@ -0,0 +1,50 @@ +#ifndef _AutoFiletypeMap_H_ +#define _AutoFiletypeMap_H_ + +#define MEDIAPLAYER 0 +#define SOUNDPLAY 1 +#define VLC 2 +#define NONE 3 + + +struct coppia { + const char* extension; + const int application; + const char* alert; +}; + + +const coppia autotypes[]= { + {".3gp",VLC,_T("alert_3gp")}, + {".3g2",VLC,_T("alert_3gp")}, + {".avi",MEDIAPLAYER,NULL}, + {".flv",VLC,NULL}, + {".m3u",SOUNDPLAY,NULL}, + {".m4a",VLC,NULL}, + {".m4b",VLC,NULL}, + {".m4p",VLC,NULL}, + {".m4v",VLC,NULL}, + {".mov",VLC,NULL}, + {".mp4",VLC,NULL}, + {".swf",NONE,_T("alert_swf")}, + {".wma",VLC,NULL}, + {".wmv",VLC,NULL} +}; + +int32 +FindBestApplication(entry_ref* ref,BString &alert){ + + int count = sizeof(autotypes)/sizeof(coppia); + + for(int i=0;iname); + int32 last=name.IFindLast(autotypes[i].extension); + if(last>0) { + alert.SetTo(autotypes[i].alert); + return autotypes[i].application; + } + } + return -1; +} + +#endif diff --git a/sources-experimental/BPAlert.cpp b/sources-experimental/BPAlert.cpp new file mode 100644 index 0000000..839a63d --- /dev/null +++ b/sources-experimental/BPAlert.cpp @@ -0,0 +1,708 @@ +// Standard Includes ----------------------------------------------------------- +#include + +// System Includes ------------------------------------------------------------- +#include +#include +#include +#include + +#include "BPAlert.h" +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include +//#define DEBUG_ALERT +#ifdef DEBUG_ALERT +#define FTRACE(x) fprintf(x) +#else +#define FTRACE(x) /* nothing */ +#endif + +// Default size of the Alert window. +#define DEFAULT_RECT BRect(0, 0, 310, 75) +#define max(LHS, RHS) ((LHS) > (RHS) ? (LHS) : (RHS)) + +// Globals --------------------------------------------------------------------- +static const unsigned int kAlertButtonMsg = 'ALTB'; +static const int kSemTimeOut = 50000; + +static const int kButtonBottomOffset = 9; +static const int kDefButtonBottomOffset = 6; +static const int kButtonRightOffset = 6; +static const int kButtonSpaceOffset = 6; +static const int kButtonOffsetSpaceOffset = 26; +static const int kButtonMinOffsetSpaceOffset = kButtonOffsetSpaceOffset / 2; +static const int kButtonLeftOffset = 62; +static const int kButtonUsualWidth = 75; + +static const int kWindowIconOffset = 27; +static const int kWindowMinWidth = 310; +static const int kWindowMinOffset = 12; +static const int kWindowOffsetMinWidth = 335; + +static const int kIconStripeWidth = 30; + +static const int kTextLeftOffset = 10; +static const int kTextIconOffsetSpace = kIconStripeWidth; //kWindowIconOffset + kIconStripeWidth - 2; +static const int kTextTopOffset = 6; +static const int kTextRightOffset = 10; +static const int kTextBottomOffset = 45; + +//------------------------------------------------------------------------------ +class TAlertView : public BView { + public: + TAlertView(BRect frame); + TAlertView(BMessage* archive); + ~TAlertView(); + + static TAlertView* Instantiate(BMessage* archive); + status_t Archive(BMessage* archive, bool deep = true); + + virtual void Draw(BRect updateRect); + + // These functions (or something analogous) are missing from libbe.so's + // dump. I can only assume that the bitmap is a public var in the + // original implementation -- or BPAlert is a friend of TAlertView. + // Neither one is necessary, since I can just add these. + void SetBitmap(BBitmap* Icon) { fIconBitmap = Icon; } + BBitmap* Bitmap() { return fIconBitmap; } + + private: + BBitmap* fIconBitmap; +}; + +//------------------------------------------------------------------------------ +// I'm making a guess based on the name and TextEntryAlert's implementation that +// this is a BMessageFilter. I'm not sure, but I think I actually prefer how +// TextEntryAlert does it, but there are clearly no message filtering functions +// on BPAlert so here we go. +class _BPAlertFilter_ : public BMessageFilter { + public: + _BPAlertFilter_(BPAlert* Alert); + ~_BPAlertFilter_(); + + virtual filter_result Filter(BMessage* msg, BHandler** target); + + private: + BPAlert* fAlert; +}; + + +static float +width_from_label(BButton *button) +{ + // BButton::GetPreferredSize() does not return the minimum width + // required to fit the label. Thus, the width is computed here. + return button->StringWidth(button->Label()) + 20.0f; +} + + +// #pragma mark - BPAlert + + +BPAlert::BPAlert(const char *title, const char *text, const char *button1, + const char *button2, const char *button3, button_width width, + BBitmap* icon) + : BWindow(DEFAULT_RECT, title, B_MODAL_WINDOW, B_NOT_RESIZABLE) +{ + InitObject(text, button1, button2, button3, width, B_EVEN_SPACING, icon); +} + + +BPAlert::BPAlert(const char *title, const char *text, const char *button1, + const char *button2, const char *button3, button_width width, + button_spacing spacing, BBitmap* icon) + : BWindow(DEFAULT_RECT, title, B_MODAL_WINDOW, + B_NOT_CLOSABLE | B_NOT_RESIZABLE) +{ + InitObject(text, button1, button2, button3, width, spacing, icon); +} + + +BPAlert::~BPAlert() +{ + // Probably not necessary, but it makes me feel better. + if (fAlertSem >= B_OK) + delete_sem(fAlertSem); +} + + +BPAlert::BPAlert(BMessage* data) + : BWindow(data) +{ + fInvoker = NULL; + fAlertSem = -1; + fAlertVal = -1; + + fTextView = (BTextView*)FindView("_tv_"); + + fButtons[0] = (BButton*)FindView("_b0_"); + fButtons[1] = (BButton*)FindView("_b1_"); + fButtons[2] = (BButton*)FindView("_b2_"); + + if (fButtons[2]) + SetDefaultButton(fButtons[2]); + else if (fButtons[1]) + SetDefaultButton(fButtons[1]); + else if (fButtons[0]) + SetDefaultButton(fButtons[0]); + + TAlertView* master = (TAlertView*)FindView("_master_"); + if (master) + master->SetBitmap(InitIcon()); + + // Get keys + char key; + for (int32 i = 0; i < 3; ++i) { + if (data->FindInt8("_but_key", i, (int8*)&key) == B_OK) + fKeys[i] = key; + } + + int32 temp; + // Get alert type + //if (data->FindInt32("_atype", &temp) == B_OK) + // fMsgType = (alert_type)temp; + + // Get button width + if (data->FindInt32("_but_width", &temp) == B_OK) + fButtonWidth = (button_width)temp; + + AddCommonFilter(new _BPAlertFilter_(this)); +} + + +BArchivable* +BPAlert::Instantiate(BMessage* data) +{ + if (!validate_instantiation(data, "BPAlert")) + return NULL; + + return new BPAlert(data); +} + + +status_t +BPAlert::Archive(BMessage* data, bool deep) const +{ + BWindow::Archive(data, deep); + + // Stow the text + data->AddString("_text", fTextView->Text()); + + // Stow the alert type + //data->AddInt32("_atype", fMsgType); + + // Stow the button width + data->AddInt32("_but_width", fButtonWidth); + + // Stow the shortcut keys + if (fKeys[0] || fKeys[1] || fKeys[2]) { + // If we have any to save, we must save something for everyone so it + // doesn't get confusing on the unarchive. + data->AddInt8("_but_key", fKeys[0]); + data->AddInt8("_but_key", fKeys[1]); + data->AddInt8("_but_key", fKeys[2]); + } + + return B_OK; +} + + +void +BPAlert::SetShortcut(int32 index, char key) +{ + if (index >= 0 && index < 3) + fKeys[index] = key; +} + + +char +BPAlert::Shortcut(int32 index) const +{ + if (index >= 0 && index < 3) + return fKeys[index]; + + return 0; +} + + +int32 +BPAlert::Go() +{ + fAlertSem = create_sem(0, "AlertSem"); + if (fAlertSem < B_OK) { + Quit(); + return -1; + } + + // Get the originating window, if it exists + BWindow* window = + dynamic_cast(BLooper::LooperForThread(find_thread(NULL))); + + Show(); + + // Heavily modified from TextEntryAlert code; the original didn't let the + // blocked window ever draw. + if (window) { + status_t err; + for (;;) { + do { + err = acquire_sem_etc(fAlertSem, 1, B_RELATIVE_TIMEOUT, + kSemTimeOut); + // We've (probably) had our time slice taken away from us + } while (err == B_INTERRUPTED); + + if (err == B_BAD_SEM_ID) { + // Semaphore was finally nuked in MessageReceived + break; + } + window->UpdateIfNeeded(); + } + } else { + // No window to update, so just hang out until we're done. + while (acquire_sem(fAlertSem) == B_INTERRUPTED) { + } + } + + // Have to cache the value since we delete on Quit() + int32 value = fAlertVal; + if (Lock()) + Quit(); + + //for(int i=0;i<3;i++) + //if(fButtons[i]) + //printf("fButtons %d %f %f\n",i,fButtons[i]->Frame().left,fButtons[i]->Frame().top); + + return value; +} + + +status_t +BPAlert::Go(BInvoker* invoker) +{ + fInvoker = invoker; + Show(); + return B_OK; +} + + +void +BPAlert::MessageReceived(BMessage* msg) +{ + if (msg->what != kAlertButtonMsg) + return BWindow::MessageReceived(msg); + + int32 which; + if (msg->FindInt32("which", &which) == B_OK) { + if (fAlertSem < B_OK) { + // Semaphore hasn't been created; we're running asynchronous + if (fInvoker) { + BMessage* out = fInvoker->Message(); + if (out && (out->ReplaceInt32("which", which) == B_OK + || out->AddInt32("which", which) == B_OK)) + fInvoker->Invoke(); + } + PostMessage(B_QUIT_REQUESTED); + } else { + // Created semaphore means were running synchronously + fAlertVal = which; + + // TextAlertVar does release_sem() below, and then sets the + // member var. That doesn't make much sense to me, since we + // want to be able to clean up at some point. Better to just + // nuke the semaphore now; we don't need it any more and this + // lets synchronous Go() continue just as well. + delete_sem(fAlertSem); + fAlertSem = -1; + } + } +} + + +void +BPAlert::FrameResized(float newWidth, float newHeight) +{ + BWindow::FrameResized(newWidth, newHeight); +} + + +BButton* +BPAlert::ButtonAt(int32 index) const +{ + if (index >= 0 && index < 3) + return fButtons[index]; + + return NULL; +} + + +BTextView* +BPAlert::TextView() const +{ + return fTextView; +} + + +BHandler* +BPAlert::ResolveSpecifier(BMessage* msg, int32 index, + BMessage* specifier, int32 form, const char* property) +{ + return BWindow::ResolveSpecifier(msg, index, specifier, form, property); +} + + +status_t +BPAlert::GetSupportedSuites(BMessage* data) +{ + return BWindow::GetSupportedSuites(data); +} + + +void +BPAlert::DispatchMessage(BMessage* msg, BHandler* handler) +{ + BWindow::DispatchMessage(msg, handler); +} + + +void +BPAlert::Quit() +{ + BWindow::Quit(); +} + + +bool +BPAlert::QuitRequested() +{ + return BWindow::QuitRequested(); +} + + +BPoint +BPAlert::AlertPosition(float width, float height) +{ + BPoint result(100, 100); + + BWindow* window = + dynamic_cast(BLooper::LooperForThread(find_thread(NULL))); + + BScreen screen(window); + BRect screenRect(0, 0, 640, 480); + if (screen.IsValid()) + screenRect = screen.Frame(); + + // Horizontally, we're smack in the middle + result.x = (screenRect.Width() / 2.0) - (width / 2.0); + + // This is probably sooo wrong, but it looks right on 1024 x 768 + result.y = (screenRect.Height() / 4.0) - ceil(height / 3.0); + + return result; +} + + +status_t +BPAlert::Perform(perform_code d, void* arg) +{ + return BWindow::Perform(d, arg); +} + + +void BPAlert::_ReservedAlert1() {} +void BPAlert::_ReservedAlert2() {} +void BPAlert::_ReservedAlert3() {} + + +void +BPAlert::InitObject(const char* text, const char* button0, const char* button1, + const char* button2, button_width width, button_spacing spacing, + BBitmap* icon) +{ + fInvoker = NULL; + fAlertSem = -1; + fAlertVal = -1; + fButtons[0] = fButtons[1] = fButtons[2] = NULL; + fTextView = NULL; + fKeys[0] = fKeys[1] = fKeys[2] = 0; + fIcon = icon; + fButtonWidth = width; + + // Set up the "_master_" view + TAlertView* masterView = new TAlertView(Bounds()); + AddChild(masterView); + masterView->SetBitmap(InitIcon()); + + // Must have at least one button + //if (button0 == NULL) { + // debugger("BPAlert's must have at least one button."); + // button0 = ""; + //} + + int kTextIconOffset = 0; + + //here xeD mod + if(masterView->Bitmap()) + kTextIconOffset = masterView->Bitmap()->Bounds().right + kTextIconOffsetSpace; + + BMessage ProtoMsg(kAlertButtonMsg); + ProtoMsg.AddInt32("which", 0); + // Set up the buttons + int buttonCount = 0; + fButtons[buttonCount] = new BButton(BRect(0, 0, 0, 0), "_b0_", button0, + new BMessage(ProtoMsg), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM); + masterView->AddChild(fButtons[buttonCount]); + if(button0==NULL) fButtons[buttonCount] ->Hide(); + + ++buttonCount; + + if (button1) { + ProtoMsg.ReplaceInt32("which", 1); + fButtons[buttonCount] = new BButton(BRect(0, 0, 0, 0), "_b1_", button1, + new BMessage(ProtoMsg), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM); + + masterView->AddChild(fButtons[buttonCount]); + ++buttonCount; + } + if (button2) { + ProtoMsg.ReplaceInt32("which", 2); + fButtons[buttonCount] = new BButton(BRect(0, 0, 0, 0), "_b2_", button2, + new BMessage(ProtoMsg), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM); + + masterView->AddChild(fButtons[buttonCount]); + ++buttonCount; + } + + SetDefaultButton(fButtons[buttonCount - 1]); + + // Find the widest button only if the widest value needs to be known. + float maxWidth = 0; + if (fButtonWidth == B_WIDTH_FROM_WIDEST) { + for (int i = 0; i < buttonCount; ++i) { + float temp = width_from_label(fButtons[i]); + maxWidth = max(maxWidth, temp); + } + } + + for (int i = buttonCount - 1; i >= 0; --i) { + // Determine the button's size + float buttonWidth = 0, buttonHeight = 0; + fButtons[i]->GetPreferredSize(&buttonWidth, &buttonHeight); + if (fButtonWidth == B_WIDTH_FROM_WIDEST) + buttonWidth = maxWidth; + else if (fButtonWidth == B_WIDTH_FROM_LABEL) + buttonWidth = width_from_label(fButtons[i]); + else // B_WIDTH_AS_USUAL + buttonWidth = max(buttonWidth, kButtonUsualWidth); + fButtons[i]->ResizeTo(buttonWidth, buttonHeight); + + // Determine the button's placement + float buttonX, buttonY; + buttonY = Bounds().bottom - buttonHeight; + if (i == buttonCount - 1) { + // The right-most button + buttonX = Bounds().right - fButtons[i]->Frame().Width() - + kButtonRightOffset; + buttonY -= kDefButtonBottomOffset; + + } else { + buttonX = fButtons[i + 1]->Frame().left - + fButtons[i]->Frame().Width() - kButtonSpaceOffset; + buttonY -= kButtonBottomOffset; + if (i == 0) { + if (spacing == B_OFFSET_SPACING) { + if (buttonCount == 3) + buttonX -= kButtonOffsetSpaceOffset; + else { + // If there are two buttons, the left wall of + // button0 needs to line up with the left wall + // of the TextView. + buttonX = (masterView->Bitmap()) ? + kTextIconOffset : kTextLeftOffset; + if (fButtons[i + 1]->Frame().left - + (buttonX + fButtons[i]->Frame().Width()) < + kButtonMinOffsetSpaceOffset) { + // Recompute buttonX using min offset space + // if using the current buttonX would not + // provide enough space or cause an overlap. + buttonX = fButtons[i + 1]->Frame().left - + fButtons[i]->Frame().Width() - + kButtonMinOffsetSpaceOffset; + } + } + } else if (buttonCount == 3) + buttonX -= 3; + } + } + + fButtons[i]->MoveTo(buttonX, buttonY); + } // for (int i = buttonCount - 1; i >= 0; --i) + + if(buttonCount - 1 >0){ + //relocate the 0 button + float y1=fButtons[0]->Frame().top -(fButtons[buttonCount - 1]->Frame().Height()/2.0) + (fButtons[0]->Frame().Height()/2.0); + fButtons[buttonCount - 1]->MoveTo(fButtons[buttonCount - 1]->Frame().left,y1); + + } + // Adjust the window's width, if necessary + float totalWidth = kButtonRightOffset; + totalWidth += fButtons[buttonCount - 1]->Frame().right - + fButtons[0]->Frame().left; + if (masterView->Bitmap()) + totalWidth += kIconStripeWidth + kWindowIconOffset; + else + totalWidth += kWindowMinOffset; + + if (spacing == B_OFFSET_SPACING) { + totalWidth -= 2; + if (buttonCount == 3) + totalWidth = max(kWindowOffsetMinWidth, totalWidth); + else + totalWidth = max(kWindowMinWidth, totalWidth); + } else { + totalWidth += 5; + totalWidth = max(kWindowMinWidth, totalWidth); + } + ResizeTo(totalWidth, Bounds().Height()); + + // Set up the text view + BRect TextViewRect(kTextLeftOffset, kTextTopOffset, + Bounds().right - kTextRightOffset, + Bounds().bottom - kTextBottomOffset); + if (masterView->Bitmap()) + TextViewRect.left = kTextIconOffset; + + fTextView = new BTextView(TextViewRect, "_tv_", TextViewRect, + B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW); + masterView->AddChild(fTextView); + + fTextView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + fTextView->SetText(text, strlen(text)); + fTextView->MakeEditable(false); + fTextView->MakeSelectable(false); + fTextView->SetWordWrap(true); + + // Now resize the TextView vertically so that all the text is visible + float textHeight = fTextView->TextHeight(0, fTextView->CountLines()); + TextViewRect.OffsetTo(0, 0); + textHeight -= TextViewRect.Height(); + ResizeBy(0, textHeight); + fTextView->ResizeBy(0, textHeight); + TextViewRect.bottom += textHeight; + fTextView->SetTextRect(TextViewRect); + + AddCommonFilter(new _BPAlertFilter_(this)); + + MoveTo(AlertPosition(Frame().Width(), Frame().Height())); +} + + +BBitmap* +BPAlert::InitIcon() +{ return fIcon; } + + +//------------------------------------------------------------------------------ +// #pragma mark - TAlertView + + +TAlertView::TAlertView(BRect frame) + : BView(frame, "TAlertView", B_FOLLOW_ALL_SIDES, B_WILL_DRAW), + fIconBitmap(NULL) +{ + SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); +} + + +TAlertView::TAlertView(BMessage* archive) + : BView(archive), + fIconBitmap(NULL) +{ +} + + +TAlertView::~TAlertView(){} + + +TAlertView* +TAlertView::Instantiate(BMessage* archive) +{ + if (!validate_instantiation(archive, "TAlertView")) + return NULL; + + return new TAlertView(archive); +} + + +status_t +TAlertView::Archive(BMessage* archive, bool deep) +{ + return BView::Archive(archive, deep); +} + + +void +TAlertView::Draw(BRect updateRect) +{ + // Here's the fun stuff + if (fIconBitmap) { + BRect StripeRect = Bounds(); + StripeRect.right = kIconStripeWidth; + SetHighColor(tint_color(ViewColor(), B_DARKEN_1_TINT)); + FillRect(StripeRect); + + //SetDrawingMode(B_OP_OVER); + SetDrawingMode(B_OP_ALPHA); + DrawBitmapAsync(fIconBitmap, BPoint(18, 6)); + SetDrawingMode(B_OP_COPY); + } +} + + +//------------------------------------------------------------------------------ +// #pragma mark - _BPAlertFilter_ + + +_BPAlertFilter_::_BPAlertFilter_(BPAlert* Alert) + : BMessageFilter(B_KEY_DOWN), + fAlert(Alert) +{ +} + + +_BPAlertFilter_::~_BPAlertFilter_() +{ +} + + +filter_result +_BPAlertFilter_::Filter(BMessage* msg, BHandler** target) +{ + if (msg->what == B_KEY_DOWN) { + char byte; + if (msg->FindInt8("byte", (int8*)&byte) == B_OK) { + for (int i = 0; i < 3; ++i) { + if (byte == fAlert->Shortcut(i) && fAlert->ButtonAt(i)) { + char space = ' '; + fAlert->ButtonAt(i)->KeyDown(&space, 1); + + return B_SKIP_MESSAGE; + } + } + } + } + + return B_DISPATCH_MESSAGE; +} diff --git a/sources-experimental/BPAlert.h b/sources-experimental/BPAlert.h new file mode 100644 index 0000000..31136a8 --- /dev/null +++ b/sources-experimental/BPAlert.h @@ -0,0 +1,119 @@ +/******************************************************************************* +/ +/ File: Alert.h +/ +/ Description: BPAlert displays a modal alert window. +/ +/ Copyright 1993-98, Be Incorporated, All Rights Reserved +/ +*******************************************************************************/ + +#ifndef _ALERT_H +#define _ALERT_H + +#include +#include + +class BBitmap; +class BButton; +class BInvoker; +class BTextView; + +enum button_spacing { + B_EVEN_SPACING = 0, + B_OFFSET_SPACING +}; + +/*----------------------------------------------------------------*/ +/*----- BPAlert class ---------------------------------------------*/ + +class BPAlert : public BWindow +{ +public: + + BPAlert( const char *title, + const char *text, + const char *button1, + const char *button2 = NULL, + const char *button3 = NULL, + button_width width = B_WIDTH_AS_USUAL, + BBitmap* icon = NULL); + BPAlert( const char *title, + const char *text, + const char *button1, + const char *button2, + const char *button3, + button_width width, + button_spacing spacing, + BBitmap* type = NULL); +virtual ~BPAlert(); + +/* Archiving */ + BPAlert(BMessage *data); +static BArchivable *Instantiate(BMessage *data); +virtual status_t Archive(BMessage *data, bool deep = true) const; + +/* BPAlert guts */ + void SetShortcut(int32 button_index, char key); + char Shortcut(int32 button_index) const; + + int32 Go(); + status_t Go(BInvoker *invoker); + +virtual void MessageReceived(BMessage *an_event); +virtual void FrameResized(float new_width, float new_height); + BButton *ButtonAt(int32 index) const; + BTextView *TextView() const; + +virtual BHandler *ResolveSpecifier(BMessage *msg, + int32 index, + BMessage *specifier, + int32 form, + const char *property); +virtual status_t GetSupportedSuites(BMessage *data); + +virtual void DispatchMessage(BMessage *msg, BHandler *handler); +virtual void Quit(); +virtual bool QuitRequested(); + +static BPoint AlertPosition(float width, float height); + +/*----- Private or reserved -----------------------------------------*/ +virtual status_t Perform(perform_code d, void *arg); + +private: +friend class _BPAlertFilter_; + +virtual void _ReservedAlert1(); +virtual void _ReservedAlert2(); +virtual void _ReservedAlert3(); + + void InitObject(const char *text, + const char *button1, + const char *button2 = NULL, + const char *button3 = NULL, + button_width width = B_WIDTH_AS_USUAL, + button_spacing spacing = B_EVEN_SPACING, + BBitmap* icon = NULL); + BBitmap *InitIcon(); + + sem_id fAlertSem; + int32 fAlertVal; + BButton *fButtons[3]; + BTextView *fTextView; + char fKeys[3]; + BBitmap* fIcon; + button_width fButtonWidth; + BInvoker *fInvoker; + uint32 _reserved[4]; +}; + +/*-------------------------------------------------------------*/ +/*-------------------------------------------------------------*/ + +// functions to display HTML alerts with Opera + +status_t TellTellBrowser(BMessage*m); +status_t TellTellBrowser(BMessage*m,BMessage*r); + +#endif /* _ALERT_H */ diff --git a/sources-experimental/BPEpisode.cpp b/sources-experimental/BPEpisode.cpp new file mode 100644 index 0000000..5641526 --- /dev/null +++ b/sources-experimental/BPEpisode.cpp @@ -0,0 +1,37 @@ +#include "BPEpisode.h" +#include "Utils.h" +#include "AttributeMap.h" + + +BPEpisode::BPEpisode(entry_ref* ref):BNode(ref){ +} + +FileStatus +BPEpisode::GetStatus(){ + return (FileStatus)ReadAttributeInt32(this,ATTR_ITEM_STATUS); +} + +void +BPEpisode::SetStatus(FileStatus status){ + WriteAttributeInt32(this,ATTR_ITEM_STATUS,(int32)status); + NotifyListener(ITEM_ENCLOSURE_FILE_STATUS,(void*)&status,sizeof(status)); +} + +BString +BPEpisode::EnclosureLocalPath(){ + return ReadAttributeString(this,ATTR_ENCLOSURE_PATH); +} + +BString +BPEpisode::EnclosureLink(){ + return ReadAttributeString(this,ATTR_ENCLOSURE_URL); +} + +BString +BPEpisode::Guid(){ + return ReadAttributeString(this,ATTR_ITEM_GUID); +} +BString +BPEpisode::EnclosureType(){ + return ReadAttributeString(this,ATTR_ENCLOSURE_TYPE); +} diff --git a/sources-experimental/BPEpisode.h b/sources-experimental/BPEpisode.h new file mode 100644 index 0000000..5f22e63 --- /dev/null +++ b/sources-experimental/BPEpisode.h @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2007 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#ifndef BPEpisode_H_ +#define BPEpisode_H_ + +#include + +#include "Extractor.h" +#include "FileStatus.h" +#include "Notifier.h" + +class BPEpisode : public BNode , public Notifier { + + public: + BPEpisode(entry_ref*); + + FileStatus GetStatus(); + void SetStatus(FileStatus); //NOTIFY! + + BString EnclosureLocalPath(); + BString EnclosureLink(); + BString Guid(); + BString EnclosureType(); + +}; +#endif diff --git a/sources-experimental/BPLocale.h b/sources-experimental/BPLocale.h new file mode 100644 index 0000000..82c9c43 --- /dev/null +++ b/sources-experimental/BPLocale.h @@ -0,0 +1,19 @@ +#ifndef _BPLocale_H +#define _BPLocale_H + +#ifdef ZETA + #include + #ifndef _TT + #define _TT(A) _T(A) + #endif +#else + #ifndef _T + #include "R5Locale.h" + #define _TT(A) findKey(A) + #define _T(A) A + #endif +#endif + +#endif + +//end. diff --git a/sources-experimental/BPSettingsWindow.cpp b/sources-experimental/BPSettingsWindow.cpp new file mode 100644 index 0000000..ba17a37 --- /dev/null +++ b/sources-experimental/BPSettingsWindow.cpp @@ -0,0 +1,275 @@ +#include "BPSettingsWindow.h" +#include "SettingsTextView.h" + +#include +#include +#include "BPLocale.h" +#include +#include +#include +#include +#include "PBox.h" +#include +#include "Setting.h" +extern Setting podder_settings; + +//#include "LicenceInfo.h" +//extern LicenceInfo linfo; + + +BPSettingsWindow::BPSettingsWindow() : + SettingsWindow(&podder_settings,be_app,APPLY_SETTINGS) +{ + + BMessage data; + + podder_settings.FindMessage(SETTINGS_FILETYPE,&data); + BBox* abox = CreateFileTypeBox(data); + AddBox(_T("FileType") ,abox); + data.MakeEmpty(); + + + podder_settings.FindMessage(SETTINGS_CHANNELS,&data); + //if(!linfo.Valid()) data.MakeEmpty(); + abox = CreateChannelsBox(data); + AddBox(_T("Channels"), abox); + //if(!linfo.Valid()) { FillOfValue(abox); FixLabel(abox); } + data.MakeEmpty(); + + //downloads + podder_settings.FindMessage(SETTINGS_DOWNLOAD,&data); + //if(!linfo.Valid()) data.MakeEmpty(); + abox = CreateDownloadBox(data); + AddBox(_T("Download"),abox); + //if(!linfo.Valid()) { FillOfValue(abox); FixLabel(abox); } + data.MakeEmpty(); + + // Proxy + podder_settings.FindMessage(SETTINGS_PROXY,&data); + //if(!linfo.Valid()) data.MakeEmpty(); + abox = CreateProxyBox(data); + AddBox(_T("Proxy"), abox); + //if(!linfo.Valid()) { FillOfValue(abox); FixLabel(abox); } + data.MakeEmpty(); + + // Updates + podder_settings.FindMessage(SETTINGS_UPDATES,&data); + abox = CreateUpdateBox(data); + AddBox(_T("Updates"), abox); + data.MakeEmpty(); + + + //slist->Select(0); + Select(0); + +} + + +void +BPSettingsWindow::FillOfValue(BView* box){ //this name is fake! ;) + int32 count = box->CountChildren(); + for(int i=0;iChildAt(i)); + + if(dynamic_cast(box)) + (dynamic_cast(box))->SetEnabled(false); + + if(dynamic_cast(box)) + (dynamic_cast(box))->SetEnabled(false); +} + +void +BPSettingsWindow::FixLabel(BView* box){ //this name is fake! :p + BView* child = box->FindView("pbox_title"); + + if(!child) + return; + SettingsTextView* stw=dynamic_cast(child); + if(!stw) return; + + BString text = stw->Text(); + text << " " << _T("(only in registred version!)"); + + stw->SetText(text.String()); + +} +BBox* +BPSettingsWindow::CreateGeneralBox(BMessage data){ + /* + BMessage main_msg; + + BMessage num_download; + num_download.AddString("name","starton_workspace"); + num_download.AddString("description", _T("Max Downloads")); + num_download.AddInt32("type",B_INT32_TYPE); + num_download.AddInt32("valid_value",1); + num_download.AddInt32("valid_value",2); + num_download.AddInt32("valid_value",3); + num_download.AddInt32("valid_value",4); + num_download.AddInt32("valid_value",5); + num_download.AddInt32("default", 1); + + main_msg.AddMessage("setting", &num_download); + main_msg.AddString("name",_T("Downloads")); + + + PBox *proxy=new PBox(dxrect,main_msg,data,SETTINGS_ GENERAL); + return (BBox*)proxy;*/ + return NULL; +} + +BBox* +BPSettingsWindow::CreateUpdateBox(BMessage data) { + BMessage main_msg; + BMessage setting; + setting.AddString("name","check_updates"); + setting.AddString("description", _T("Check for updates at startup")); + setting.AddInt32("type",B_BOOL_TYPE); + setting.AddBool("default", true); + + main_msg.AddMessage("setting", &setting); + main_msg.AddString("name",_T("Updates")); + + PBox *proxy=new PBox(BRect(0,0,0,0),main_msg,data,SETTINGS_UPDATES); + return (BBox*)proxy; +} + +BBox* +BPSettingsWindow::CreateDownloadBox(BMessage data){ + + BMessage main_msg; + + BMessage num_download; + num_download.AddString("name","max_downloads"); + num_download.AddString("description", _T("Max Downloads")); + num_download.AddInt32("type",B_INT32_TYPE); + num_download.AddInt32("valid_value",1); + num_download.AddInt32("valid_value",2); + num_download.AddInt32("valid_value",3); + num_download.AddInt32("valid_value",4); + num_download.AddInt32("valid_value",5); + num_download.AddInt32("default", 1); + + main_msg.AddMessage("setting", &num_download); + main_msg.AddString("name",_T("Downloads")); + + + PBox *proxy=new PBox(BRect(0,0,0,0),main_msg,data,SETTINGS_DOWNLOAD); + return (BBox*)proxy; +} + + +BBox* +BPSettingsWindow::CreateFileTypeBox(BMessage data){ + + // ATTENZIONE NON CAMBIARE QUESTI SETTATGGI + // SE NON SI MODIFICANO LE RISPETTIVE CLASSI DI LOAD_SETTIINGS + + BMessage setting; + setting.AddString("name","browser"); + setting.AddString("description", _T("Browser")); + setting.AddInt32("type",B_STRING_TYPE); + setting.AddString("valid_value","Firefox"); //0 + setting.AddString("valid_value","NetPositive"); //1 + setting.AddString("valid_value","System Default"); //2 + setting.AddString("default", "NetPositive"); + + BMessage setting2; + setting2.AddString("name","player"); + setting2.AddString("description", _T("Player")); + setting2.AddInt32("type",B_STRING_TYPE); + setting2.AddString("valid_value","MediaPlayer"); + setting2.AddString("valid_value","SoundPlay"); + setting2.AddString("valid_value","VideoLAN"); + setting2.AddString("valid_value","Auto"); + setting2.AddString("default", "Auto"); + + BMessage main_msg; + main_msg.AddMessage("setting", &setting); + main_msg.AddMessage("setting", &setting2); + + main_msg.AddString("name",_T("FileType")); + + + PBox *proxy=new PBox(BRect(0,0,0,0),main_msg,data,SETTINGS_FILETYPE); + return (BBox*)proxy; +} + +BBox* +BPSettingsWindow::CreateChannelsBox(BMessage data){ + + BMessage setting; + setting.AddString("name","check_startup"); + setting.AddString("description", _T("Check all channels on startup")); + setting.AddInt32("type",B_BOOL_TYPE); + + BMessage setting2; + setting2.AddString("name","check_time"); + setting2.AddString("description", _T("Check the channel every")); + setting2.AddInt32("type",B_STRING_TYPE); + setting2.AddString("valid_value",_T("never")); + setting2.AddString("valid_value",_T("5 minutes")); + setting2.AddString("valid_value",_T("15 minutes")); + setting2.AddString("valid_value",_T("30 minutes")); + setting2.AddString("valid_value",_T("1 hour")); + setting2.AddString("valid_value",_T("2 hour")); + setting2.AddString("default", _T("never")); + + BMessage main_msg; + main_msg.AddMessage("setting", &setting); + main_msg.AddMessage("setting", &setting2); + main_msg.AddString("name",_T("Channels")); + + + PBox *proxy=new PBox(BRect(0,0,0,0),main_msg,data,SETTINGS_CHANNELS); + return (BBox*)proxy; +} + +BBox* +BPSettingsWindow::CreateProxyBox(BMessage data){ + + BMessage main_msg; + + BMessage enable_proxy; + enable_proxy.AddString("name","enable"); + enable_proxy.AddString("description", _T("Enable Proxy")); + enable_proxy.AddInt32("type",B_BOOL_TYPE); + enable_proxy.AddString("enable_control","address"); + enable_proxy.AddString("enable_control","port"); + enable_proxy.AddString("enable_control","username"); + enable_proxy.AddString("enable_control","password"); + + BMessage address; + address.AddString("name","address"); + address.AddString("description", _T("Address")); + address.AddInt32("type",B_STRING_TYPE); + + BMessage port; + port.AddString("name","port"); + port.AddString("description", _T("Port")); + port.AddInt32("type",B_INT32_TYPE); + + BMessage res; + res.AddString("name","username"); + res.AddString("description", _T("Username")); + res.AddInt32("type",B_STRING_TYPE); + + BMessage year; + year.AddString("name","password"); + year.AddString("description", _T("Password")); + year.AddInt32("type",B_STRING_TYPE); + year.AddBool("is_secret",true); + + main_msg.AddMessage("setting", &enable_proxy); + main_msg.AddMessage("setting", &address); + main_msg.AddMessage("setting", &port); + main_msg.AddMessage("setting", &res); + main_msg.AddMessage("setting", &year); + main_msg.AddString("name",_T("Proxy")); + + + PBox *proxy=new PBox(BRect(0,0,0,0),main_msg,data,SETTINGS_PROXY); + + return (BBox*)proxy; +} + diff --git a/sources-experimental/BPSettingsWindow.h b/sources-experimental/BPSettingsWindow.h new file mode 100644 index 0000000..1822033 --- /dev/null +++ b/sources-experimental/BPSettingsWindow.h @@ -0,0 +1,58 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "SettingsWindow.h" + +#define SETTINGS_MAINWINDOW "main_window_setting" +#define SETTINGS_FILETYPE "filetype_setting" +#define SETTINGS_PROXY "proxy_setting" +#define SETTINGS_DOWNLOAD "download_setting" +#define SETTINGS_CHANNELS "channels_setting" +#define SETTINGS_GENERAL "general_setting" +#define SETTINGS_UPDATES "updates_setting" + +#define SETTINGS_GROUPS "groups_setting" + + +class BPSettingsWindow: public SettingsWindow +{ + + + + + public: + BPSettingsWindow(); + + + + + + private: + + + + BBox* CreateGeneralBox(BMessage); + BBox* CreateFileTypeBox(BMessage); + BBox* CreateChannelsBox(BMessage); + BBox* CreateProxyBox(BMessage); + BBox* CreateDownloadBox(BMessage); + + BBox* CreateUpdateBox(BMessage); + + + + void FillOfValue(BView*); //this name is fake! ;) + void FixLabel(BView*); //this name is fake! :p + }; diff --git a/sources-experimental/BitmapTextRender.h b/sources-experimental/BitmapTextRender.h new file mode 100644 index 0000000..1d7ef16 --- /dev/null +++ b/sources-experimental/BitmapTextRender.h @@ -0,0 +1,92 @@ +#ifndef _BitmapTextRender_H_ +#define _BitmapTextRender_H_ + +#include "TextRender.h" +#include "Bitmap.h" +#include +#include + +#include +#include +#include +#include + + +#define kIconSpace 3.0 + +/* + ATTENZIONE + + This class owns the Bitmap pointer! + It deletes the pointer as soon as you change it or you set it to NULL. + +*/ + +class BitmapTextRender : public TextRender +{ + public: + + BitmapTextRender():TextRender(){ + fHeight = 0; + fWidth = 0; + fBitmap=NULL; + }; + + void LoadBitmap(const char* filename){ + if(fBitmap!=NULL) delete fBitmap; + + + if(filename!=NULL) + fBitmap = BTranslationUtils::GetBitmap(filename); + else + fBitmap = NULL; + + if(fBitmap){ + fHeight = fBitmap->Bounds().Height(); + fWidth = fBitmap->Bounds().Width(); + } + else { + fHeight = 0; + fWidth = 0; + } + + } + + virtual ~BitmapTextRender() {}; + + void Render(BView *target,const char* txt,int16 num,BPoint pos,BRect r) { + + if(!fBitmap) return; + + target->SetDrawingMode( B_OP_ALPHA ); + target->DrawBitmapAsync( fBitmap,BPoint(r.left + kIconSpace, r.top )); + //target->DrawBitmapAsync( pointer,BPoint(r.left + kIconSpace, r.top + ((r.Height()/2.0) - 8) )); //- fHeight + (fHeight/4) + 2) + target->StrokeRect(r); + target->SetDrawingMode( B_OP_OVER ); + }; + + + + + float Size(float maxwidth){ return fWidth + 1 + kIconSpace + kIconSpace;} + + void GetHeight(font_height *h){ + h->ascent=fHeight/2; + h->descent=fHeight/2; + h->leading=0; + }; + + void + GetEscapements(const char * /*charArray*/, int32 numChars,float escapementArray[]) { + escapementArray[0]=1; + for(int i=1;iMakeFocus(true); + } + private: + BBitmap* fMap; +}; + +#endif +//--- diff --git a/sources-experimental/BitmapWindow.cpp b/sources-experimental/BitmapWindow.cpp new file mode 100644 index 0000000..9c11762 --- /dev/null +++ b/sources-experimental/BitmapWindow.cpp @@ -0,0 +1,24 @@ +#include "BitmapWindow.h" + +#include "Utils.h" +#include +#include "BPLocale.h" +#include "BitmapView.h" + +BitmapWindow::BitmapWindow(BBitmap* image) : + BWindow(BRect(162,50,848,700),_T("Channel Image"), B_TITLED_WINDOW,B_NOT_RESIZABLE| B_NOT_ZOOMABLE|B_ASYNCHRONOUS_CONTROLS|B_WILL_DRAW) +{ + ResizeTo(image->Bounds().Width(),image->Bounds().Height()); + AddChild(new BitmapView(image->Bounds(),image)); +} + + +//bool +//BitmapWindow::QuitRequested(){ +// return true; +//} + + + + + diff --git a/sources-experimental/BitmapWindow.h b/sources-experimental/BitmapWindow.h new file mode 100644 index 0000000..1365a1f --- /dev/null +++ b/sources-experimental/BitmapWindow.h @@ -0,0 +1,13 @@ +#include "Application.h" +#include +#include +#include + +class BitmapWindow: public BWindow +{ + + + public: + BitmapWindow(BBitmap* image); +// bool QuitRequested(); +}; diff --git a/sources-experimental/ChannelSettingsWindow.cpp b/sources-experimental/ChannelSettingsWindow.cpp new file mode 100644 index 0000000..187bcce --- /dev/null +++ b/sources-experimental/ChannelSettingsWindow.cpp @@ -0,0 +1,83 @@ +#include "ChannelSettingsWindow.h" +#include "SettingsTextView.h" + +#include +#include +#include "BPLocale.h" +#include +#include +#include +#include +#include "PBox.h" +#include + + + +ChannelSettingsWindow::ChannelSettingsWindow(BMessage* s,BHandler* h) : + SettingsWindow(s,h,APPLY_CHANNEL_SETTINGS) { + + AddBox(_T("Remove") ,CreateBox(*s)); + Select(0); +} + + + + +BBox* +ChannelSettingsWindow::CreateBox(BMessage data) { + BMessage main_msg; + + BMessage when; + when.AddString("name","when_delete"); + when.AddString("description", _T("WHEN?")); + when.AddInt32("type",B_STRING_TYPE); + when.AddString("valid_value","never"); //0 + when.AddString("valid_value","After a chek"); //1 + when.AddString("valid_value","When there are new episodes"); //2 + when.AddString("valid_value","System Default"); //3 + when.AddString("default", "never"); + + main_msg.AddMessage("setting", &when); + + + BMessage what_new; + what_new.AddString("name","what_delete_new"); + what_new.AddString("description", _T("Episodes nuovi")); + what_new.AddInt32("type",B_BOOL_TYPE); + what_new.AddBool("default", false); + main_msg.AddMessage("setting", &what_new); + + + what_new.MakeEmpty(); + what_new.AddString("name","what_delete_read"); + what_new.AddString("description", _T("Episodes letti (o con errore)")); + what_new.AddInt32("type",B_BOOL_TYPE); + what_new.AddBool("default", false); + main_msg.AddMessage("setting", &what_new); + + what_new.MakeEmpty(); + what_new.AddString("name","what_delete_downloaded"); + what_new.AddString("description", _T("Episodes scaricati")); + what_new.AddInt32("type",B_BOOL_TYPE); + what_new.AddBool("default", false); + main_msg.AddMessage("setting", &what_new); + + + BMessage who; + who.AddString("name","who_delete"); + who.AddString("description", _T("WHO?")); + who.AddInt32("type",B_STRING_TYPE); + who.AddString("valid_value","Tutti gli episodes presenti"); //0 + who.AddString("valid_value","Episodes piu vecchi di 1 giorno"); //1 + who.AddString("valid_value","Episodes piu vecchi di 3 giorni"); //2 + who.AddString("valid_value","Episodes piu vecchi di 1 settimana"); //3 + who.AddString("valid_value","Episodes piu vecchi di 1 mese"); //4 + who.AddString("default", "Tutti gli episodes presenti"); + + main_msg.AddMessage("setting", &who); + + main_msg.AddString("name",_T("Remove")); + PBox *proxy=new PBox(BRect(0,0,0,0),main_msg,data,SETTINGS_CHANNEL); + return (BBox*)proxy; +} + diff --git a/sources-experimental/ChannelSettingsWindow.h b/sources-experimental/ChannelSettingsWindow.h new file mode 100644 index 0000000..7e0622c --- /dev/null +++ b/sources-experimental/ChannelSettingsWindow.h @@ -0,0 +1,39 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "SettingsWindow.h" + +#define SETTINGS_CHANNEL "channel_setting" +#define APPLY_CHANNEL_SETTINGS 'achs' + +class ChannelSettingsWindow: public SettingsWindow +{ + + + + + public: + ChannelSettingsWindow(BMessage*,BHandler*); + + + + + + private: + + + + BBox* CreateBox(BMessage); + }; diff --git a/sources-experimental/Cursors.cpp b/sources-experimental/Cursors.cpp new file mode 100644 index 0000000..144c297 --- /dev/null +++ b/sources-experimental/Cursors.cpp @@ -0,0 +1,167 @@ +//****************************************************************************************************** +//**** PROJECT HEADER FILES +//****************************************************************************************************** +#include "Cursors.h" + + +//****************************************************************************************************** +//**** CONSTANT DEFINITIONS +//****************************************************************************************************** +uint8 c_v_resize_cursor_data[68] = +{ + 16,1,7,7, + 0,0, //0000000000000000 + 1,0, //0000000100000000 + 1,0, //0000000100000000 + 1,0, //0000000100000000 + 1,0, //0000000100000000 + 17,16, //0001000100010000 + 49,24, //0011000100011000 + 113,28, //0111000100011100 + 49,24, //0011000100011000 + 17,16, //0001000100010000 + 1,0, //0000000100000000 + 1,0, //0000000100000000 + 1,0, //0000000100000000 + 1,0, //0000000100000000 + 0,0, //0000000000000000 + 0,0, //0000000000000000 + + 3,128, //0000001110000000 + 3,128, //0000001110000000 + 3,128, //0000001110000000 + 3,128, //0000001110000000 + 27,176, //0001101110110000 + 59,184, //0011101110111000 + 123,188,//0111101110111100 + 251,190,//1111101110111110 + 123,188,//0111101110111100 + 59,184, //0011101110111000 + 27,176, //0001101110110000 + 3,128, //0000001110000000 + 3,128, //0000001110000000 + 3,128, //0000001110000000 + 3,128, //0000001110000000 + 0,0 //0000000000000000 +}; + +uint8 c_h_resize_cursor_data[68] = +{ + 16,1,7,7, + 0,0, //0000000000000000 + 1,0, //0000000100000000 + 3,128, //0000001110000000 + 7,192, //0000011111000000 + 0,0, //0000000000000000 + 0,0, //0000000000000000 + 0,0, //0000000000000000 + 127,252,//0111111111111100 + 0,0, //0000000000000000 + 0,0, //0000000000000000 + 0,0, //0000000000000000 + 7,192, //0000011111000000 + 3,128, //0000001110000000 + 1,0, //0000000100000000 + 0,0, //0000000000000000 + 0,0, //0000000000000000 + + 1,0, //0000000100000000 + 3,128, //0000001110000000 + 7,192, //0000011111000000 + 15,224, //0000111111100000 + 15,224, //0000111111100000 + 0,0, //0000000000000000 + 255,254,//1111111111111110 + 255,254,//1111111111111110 + 255,254,//1111111111111110 + 0,0, //0000000000000000 + 15,224, //0000111111100000 + 15,224, //0000111111100000 + 7,192, //0000011111000000 + 3,128, //0000001110000000 + 1,0, //0000000100000000 + 0,0 //0000000000000000 +}; + +/* +uint8 c_crosshairs_cursor_data[68] = +{ + 16,1,7,7, + 0,0, //0000000000000000 + 1,0, //0000000100000000 + 1,0, //0000000100000000 + 1,0, //0000000100000000 + 1,0, //0000000100000000 + 1,0, //0000000100000000 + 0,0, //0000000000000000 + 125,124,//0111110101111100 + 0,0, //0000000000000000 + 1,0, //0000000100000000 + 1,0, //0000000100000000 + 1,0, //0000000100000000 + 1,0, //0000000100000000 + 1,0, //0000000100000000 + 0,0, //0000000000000000 + 0,0, //0000000000000000 + + 3,128, //0000001110000000 + 3,128, //0000001110000000 + 3,128, //0000001110000000 + 3,128, //0000001110000000 + 3,128, //0000001110000000 + 3,128, //0000001110000000 + 255,254,//1111111111111110 + 255,254,//1111111111111110 + 255,254,//1111111111111110 + 3,128, //0000001110000000 + 3,128, //0000001110000000 + 3,128, //0000001110000000 + 3,128, //0000001110000000 + 3,128, //0000001110000000 + 3,128, //0000001110000000 + 0,0 //0000000000000000 +}; + +uint8 c_magnify_cursor_data[68] = +{ + 16,1,6,6, + 0,0, //0000000000000000 + 7,0, //0000011100000000 + 24,192, //0001100011000000 + 32,32, //0010000000100000 + 32,32, //0010000000100000 + 64,16, //0100000000010000 + 64,16, //0100000000010000 + 64,16, //0100000000010000 + 32,32, //0010000000100000 + 32,32, //0010000000100000 + 24,240, //0001100011110000 + 7,56, //0000011100111000 + 0,28, //0000000000011100 + 0,14, //0000000000001110 + 0,4, //0000000000000100 + 0,0, //0000000000000000 + + 7,0, //0000011100000000 + 31,192, //0001111111000000 + 63,224, //0011111111100000 + 120,240,//0111100011110000 + 112,112,//0111000001110000 + 224,56, //1110000000111000 + 224,56, //1110000000111000 + 224,56, //1110000000111000 + 112,112,//0111000001110000 + 120,240,//0111100011110000 + 63,248, //0011111111111000 + 31,252, //0001111111111100 + 7,62, //0000011100111110 + 0,31, //0000000000011111 + 0,14, //0000000000001110 + 0,4, //0000000000000100 +}; +*/ +const void* c_v_resize_cursor = c_v_resize_cursor_data; +const void* c_h_resize_cursor = c_h_resize_cursor_data; +//const void* c_crosshairs_cursor = c_crosshairs_cursor_data; +//const void* c_magnify_cursor = c_magnify_cursor_data; + diff --git a/sources-experimental/Cursors.h b/sources-experimental/Cursors.h new file mode 100644 index 0000000..8053187 --- /dev/null +++ b/sources-experimental/Cursors.h @@ -0,0 +1,20 @@ +#ifndef _SGB_CURSORS_H_ +#define _SGB_CURSORS_H_ + + +//****************************************************************************************************** +//**** SYSTEM HEADER FILES +//****************************************************************************************************** +#include + + +//****************************************************************************************************** +//**** CONSTANT DEFINITIONS +//****************************************************************************************************** +extern const void* c_v_resize_cursor; +extern const void* c_h_resize_cursor; +//extern const void* c_crosshairs_cursor; +//extern const void* c_magnify_cursor; + + +#endif //_SGB_CURSORS_H_ diff --git a/sources-experimental/DirectoryItem.h b/sources-experimental/DirectoryItem.h new file mode 100644 index 0000000..392be01 --- /dev/null +++ b/sources-experimental/DirectoryItem.h @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#define DirectoryItem_H_ +#define DirectoryItem_H_ + +#include "IconTextItem.h" + +class DirectoryItem : public IconTextItem { + + public: + DirectoryItem(const char *text, BBitmap *icon = NULL,const char *linkz = NULL,BPoint spiaz=BPoint(0,0)) + :IconTextItem(text,icon) + { fLink.SetTo(linkz); SetSpiaz(spiaz); } + + BString Link(){ return fLink; } + private: + BString fLink; + + +}; diff --git a/sources-experimental/DirectoryWindow.cpp b/sources-experimental/DirectoryWindow.cpp new file mode 100644 index 0000000..22a79cf --- /dev/null +++ b/sources-experimental/DirectoryWindow.cpp @@ -0,0 +1,460 @@ + +#include "DirectoryWindow.h" +#include "Utils.h" +#include +#include +#include "BPLocale.h" +#include + +#include "DirectoryItem.h" +#include +#include +#include + +#include "Logger.h" +#include "Utils.h" + +static BBitmap* fItemIcon; +static BBitmap* fFolderIcon; //? +extern BMessage Directory_list; //? + + +#include "MainWindow.h" +extern MainWindow* main_window; + + +#include "BPLocale.h" + +//generic map + +#include +#include "Utils.h" + +#include "ActionDownload.h" +#include "DownloadManager.h" + +#include "PercentageWindow.h" + +extern DownloadManager download_manager; + +static KeyMap fDirectoryTrees; + +#define back_color 101,154,206,255 + +DirectoryWindow::DirectoryWindow(const char* opml_name,BString opml_url): + BWindow(BRect(350,100,750,700),opml_name, B_TITLED_WINDOW,B_ASYNCHRONOUS_CONTROLS) +{ + fAlert = NULL; + + SetSizeLimits(400,1280,150,1024); + + fOpmlName.SetTo( opml_name); + fOpmlURL = opml_url; + + + if(fFolderIcon == NULL) + fFolderIcon = LoadIcon("folder"); + + if(fItemIcon == NULL) + fItemIcon= LoadIcon("02.png"); + + BBox *bgbox=new BBox(Bounds(),"back",B_FOLLOW_ALL,B_WILL_DRAW,B_PLAIN_BORDER); + AddChild(bgbox); + + alist=new BOutlineListView(BRect(15,15,370,530), "ListView1",B_SINGLE_SELECTION_LIST,B_FOLLOW_ALL,B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE); + + + // (240,240,129); + + alist->SetLowColor(back_color); //101,154,206); + alist->SetViewColor(back_color); //101,154,206); //53,140,42) 101,154,206 + alist->SetHighColor(0,0,0); + alist->SetFontSize(12); + + + bgbox->AddChild(new BScrollView("PodcastScroll", alist, B_FOLLOW_ALL, 0, false, true)); + + BBox *viewd=new BBox(BRect(20,551,390,600),NULL, B_FOLLOW_BOTTOM | B_FOLLOW_RIGHT,B_WILL_DRAW,B_NO_BORDER); + bgbox->AddChild(viewd); + + + BButton *button1= new BButton(BRect(0,0,100,30),"noname",_T("Collapse All"),new BMessage('refr'), B_FOLLOW_ALL); + viewd->AddChild(button1); +#ifdef ZETA + button1->SetToolTipText(_T("Collapse all categories in the directory list")); +#endif + /*BButton *button2= new BButton(BRect(130,0,230,30),"noname",_T("Preview"),new BMessage('prev'), B_FOLLOW_ALL); + viewd->AddChild(button2); +#ifdef ZETA + button2->SetToolTipText(_T("Checkout a podcast before downloading it")); +#endif */ + BButton *button3= new BButton(BRect(260,0,360,30),"noname",_T("Subscribe"),new BMessage('subs'), B_FOLLOW_ALL); + viewd->AddChild(button3); +#ifdef ZETA + button3->SetToolTipText(_T("Add the selected podcast to the Subscription list")); +#endif + alist->SetInvocationMessage(new BMessage('invo')); + + PostMessage('refr'); +} + +void +DirectoryWindow::StartDownload(BString url){ + + //show the alert + fAlert= new PercentageWindow("BePodder",_T("Downloading"), LoadIcon("enqueued-32.png")); + fAlert->Go(this,B_QUIT_REQUESTED); + entry_ref dest; + get_ref_for_path(tmpnam(NULL),&dest); + ActionDownload* action = new ActionDownload(url,dest, false, "", this,'info'); + + download_manager.SingleThreadAction(action); +} + +/*void +DirectoryWindow::~DirectoryWindow(){ + + OPMLParser parser; + while(fDirectoryTrees.CountItems()) + { + OPMLTree tree=fDirectoryTrees.ValueAt(0); + parser. + RemoveItemsAt(0); + } + +}*/ + +void +DirectoryWindow::MessageReceived(BMessage *mess2){ + + switch(mess2->what){ + case 'info': + DownloadInfo(mess2); + break; + case 'refr': + { + //BPath path("http://"); + //path.Append("directories"); + //path.Append(fOpmlName.String()); + + //BString url("http://www.funkyideasoft.com/directories/bepodder_podcast_opml.tar.gz"); + + OPMLTree* tree = fDirectoryTrees.ValueFor(fOpmlURL); + if(tree) { +// OPMLParser parser; +// OPMLTree* tree = parser.Parse(path.Path()); + ApplyTree(tree); +// parser.DeleteOPMLTree(tree); + } + else + StartDownload(fOpmlURL); + + /*BPath path(GetAppRelativePath().String()); + path.Append("directories"); + path.Append(fOpmlName.String()); + OPMLParser parser; + OPMLTree* tree = parser.Parse(path.Path()); + if(tree) + { + ApplyTree(tree); + parser.DeleteOPMLTree(tree); + }*/ + //else error! + + + + + + + } + break; + case 'subs': + { + DirectoryItem* item=(DirectoryItem*)alist->ItemAt(alist->CurrentSelection()); + if(!item) return; + if(item->Link() == "") return; + + //send message to main_window! + BMessage msg('addu'); + msg.AddString("url",item->Link()); + BMessenger(main_window).SendMessage(&msg); + //BMessenger(this).SendMessage(B_QUIT_REQUESTED); + } + break; + case 'invo': + { + // mess2->PrintToStream(); + int32 index=mess2->FindInt32("index"); + BListItem* item=alist->ItemAt(index); + if(alist->CountItemsUnder(item,true) > 0){ + if(!item->IsExpanded()) + alist->Expand(item); + else + alist->Collapse(item); + } + else + { + //send message to main_window! + BMessage msg('addu'); + msg.AddString("url",((DirectoryItem*)item)->Link()); + BMessenger(main_window).SendMessage(&msg); + } + + } + break; + default: + BWindow :: MessageReceived(mess2); + break; + } +} +void +DirectoryWindow::ApplyTree(OPMLTree* tree){ + + alist->MakeEmpty(); + + if(!tree->foglie) return; //should never happen! + +// OPMLParser pa; +// pa.PrintToStream(tree->foglie->ItemAt(0),0); + + _addItem(NULL,tree->foglie->ItemAt(0)); + + DirectoryItem* item=(DirectoryItem*)alist->ItemAt(0); + if(!item) return; + alist->Expand(item); + alist->Select(0); + alist->MakeFocus(true); +} + +void +DirectoryWindow::_addItem(BListItem* root,OPMLTree* foglia){ + + BBitmap* icon = fFolderIcon; + BPoint spiaz(0,0); + + if(!foglia->foglie) + icon = fItemIcon; + else + spiaz.y=+3; + + DirectoryItem *leaf = new DirectoryItem(foglia->description.String(), icon ,foglia->link.String(),spiaz); + if(root) + { + alist->AddUnder(leaf,root); + if(root->IsExpanded()) alist->Collapse(root); + LOG("DirectoryWindow", liDebug ,"Added Item [%s] under [%s]",foglia->description.String(),((IconTextItem *)root)->Text()); + } + else + { + alist->AddItem(leaf,alist->CountItems()); + LOG("DirectoryWindow", liDebug ,"Added Item [%s]",foglia->description.String()); + + } + + + + if(!foglia->foglie) return; + + + for(int32 i=foglia->foglie->CountItems() -1 ; i>=0 ; i--){ + OPMLTree* subfoglia = foglia->foglie->ItemAt(i); + _addItem(leaf,subfoglia); + } + +} + +void +DirectoryWindow::DownloadInfo(BMessage* msg){ + + ActionDownload::Status status = (ActionDownload::Status)msg->FindInt32("status"); + BString extra; + + switch(status){ + case ActionDownload::OK_DOWNLOADED: + + // done. + + + { + if(fAlert && fAlert->Lock()) + fAlert->Quit(); + //BMessenger(fAlert).SendMessage(B_QUIT_REQUESTED); + + + msg->PrintToStream(); + + BString filename; + if(msg->FindString("path",&filename) == B_OK){ + + + const char* newName=tmpnam(NULL); + + filename.Prepend("tar -xzvOf "); + filename << " > " << newName; + + system(filename.String()); + + OPMLParser parser; + OPMLTree* tree = parser.Parse(newName); + + unlink(newName); + msg->FindString("path",&filename); + unlink(filename.String()); + + if(tree) { + ApplyTree(tree); + BString url; + if(msg->FindString("url",&url)==B_OK) + fDirectoryTrees.AddItem(url,tree); + else + parser.DeleteOPMLTree(tree); + } + + } + } + break; + + case ActionDownload::OK_CONNECTING: + //item->SetFileStatus(CONNECTING); + break; + case ActionDownload::OK_PROGRESS: + { + + int32 perc; +// float speed; + + + if(msg->FindInt32("percentage_progress",&perc)==B_OK){ +// BString per; +// per << "Downloading " << perc << "%"; +// SetDescription(per.String()); + if(fAlert) fAlert->SetPercentage(perc); + } + + + } + break; + + case ActionDownload::ERROR_PERFORMING: + { + + + int32 error=msg->FindInt32("curl_error"); + + switch(error){ + case CURLE_COULDNT_CONNECT: + SetError(_T("Can't connect!")); + break; + case CURLE_HTTP_PORT_FAILED: + SetError(_T("Http port failed!")); + break; + case CURLE_COULDNT_RESOLVE_HOST: + SetError(_T("Can't resolve host!")); + break; + case CURLE_HTTP_NOT_FOUND: + SetError(_T("Not found!")); + break; + + case CURLE_WRITE_ERROR: + { + bool stopped = msg->FindBool("should_stop"); + + if(!stopped) + //item->SetFileStatus(STOPPED); + //else + { + //item->SetFileStatus(ERROR); + SetError("Write error!"); + } + } + break; + + case CURLE_BAD_DOWNLOAD_RESUME: + //item->SetFileStatus(ERROR); + SetError("Bad resume!"); + break; + case CURLE_ABORTED_BY_CALLBACK: + //item->SetFileStatus(ERROR); + SetError("Aborted by Callback!"); + break; + case CURLE_HTTP_RANGE_ERROR: + //item->SetFileStatus(ERROR); + SetError("Can't resume! (range error)"); + break; + case CURLE_FTP_ACCESS_DENIED: + //item->SetFileStatus(ERROR); + SetError("Access Denied!"); + break; + case CURLE_FTP_USER_PASSWORD_INCORRECT: + //item->SetFileStatus(ERROR); + SetError("User or Password Incorrect!"); + break; + + default: + { + //item->SetFileStatus(ERROR); + BString ser("Other error (cUrl code: "); + ser << error << " )"; + SetError(ser.String()); + } + break; + } + + deletePath(msg); + + } + break; + + case ActionDownload::ERROR_CURL_INIT: + SetError("cUrl init error!"); + deletePath(msg); + break; + + case ActionDownload::ERROR_OPENFILE: + //item->SetFileStatus(ERROR); + SetError("Can't open file!"); + deletePath(msg); + break; + default: + { + //item->SetFileStatus(ERROR); + BString ser("Other error (status code: "); + ser << (long)status << " )"; + SetError(ser.String()); + deletePath(msg); + } + break; + } +} + +void +DirectoryWindow::deletePath(BMessage* msg){ + BString path; + if(msg->FindString("path",&path)==B_OK) + unlink(path.String()); + +} + +void +DirectoryWindow::SetError(const char* tex){ + if(fAlert && fAlert->Lock()) + fAlert->Quit(); + + BString t(fOpmlName); + t << " : " << tex; + BPAlert *error=new BPAlert("BePodder",t.String(),"ok",NULL,NULL,B_WIDTH_AS_USUAL, LoadIcon("delete-32.png")); + error->Go(); + PostMessage(B_QUIT_REQUESTED); + +} + +//void +//DirectoryWindow::SetDescription(const char* tex){ +// if(fAlert && fAlert->Lock()){ +// BString t(fOpmlName); +// t << " : " << tex; +// fAlert->TextView()->SetText(t.String()); +// fAlert->Unlock(); +// } +//} +//-- diff --git a/sources-experimental/DirectoryWindow.h b/sources-experimental/DirectoryWindow.h new file mode 100644 index 0000000..e723a4a --- /dev/null +++ b/sources-experimental/DirectoryWindow.h @@ -0,0 +1,59 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "OPMLParser.h" + +#include "BPAlert.h" + +#include "KeyMap.h" + +class PercentageWindow; + +class DirectoryWindow: public BWindow +{ + + + + + public: + DirectoryWindow(const char* opml_name,BString opml_url); //,const rgb_color back_color); + // ~DirectoryWindow(); + + void MessageReceived(BMessage *mess2); + + + + +private: + + PercentageWindow* fAlert; + + void StartDownload(BString url); + + + void DownloadInfo(BMessage*); + + + //void SetDescription(const char*); + void SetError(const char* tex); + void ApplyTree(OPMLTree*); + + void deletePath(BMessage* msg); + + void _addItem(BListItem* root,OPMLTree*); + BOutlineListView *alist; + + BString fOpmlName; + BString fOpmlURL; + + + +}; + diff --git a/sources-experimental/DownloadListItem.cpp b/sources-experimental/DownloadListItem.cpp new file mode 100644 index 0000000..8930795 --- /dev/null +++ b/sources-experimental/DownloadListItem.cpp @@ -0,0 +1,151 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#include "DownloadListItem.h" +#include "ItemProperty.h" + +#include +#include "BPLocale.h" + +#include "Utils.h" +#include "curl/curl.h" +#include "FileStatus.h" +#include "ColumnListView.h" +#include "ColumnTypes.h" +#include "DownloadListView.h" +#include "EpisodeListItem.h" +#include "SubscriptionListItem.h" + +DownloadListItem::DownloadListItem(SubscriptionListItem* ch):BRow(16.0) +{ + int index = 0; + time_t time = 0; + + SetField( iconfield = new BBitmapField(NULL) , index++); + SetField( channel = new BStringField(NULL) , index++); + SetField( field = new BStringField(NULL) , index++); + SetField( new BDateField(&time) , index++); + SetField( sizefield = new BSizeField(0), index++); + SetField( fieldStaus = new FileStatusField(NEW) , index++); + + + if(ch){ + channel->SetString(ch->GetTitle().String()); + } + + fShouldMeRemoved = false; + + fLinked=NULL; + fRss.AddElementListener(this); + +} + +void +DownloadListItem::LinkToEpisode(EpisodeListItem* item){ + if(fLinked!=NULL) + debugger("DownloadListItem::fLinked !=NULL, should never happen."); + fLinked=item; + fRss.AddElementListener(fLinked); +} + +void +DownloadListItem::Unlink(){ + if(fLinked) + fRss.RemoveElementListener(fLinked); + fLinked=NULL; +} + + +void +DownloadListItem::KeyModified(int32 key, void* data,ssize_t size) +{ + switch(key){ + + case ITEM_TITLE: + field->SetString((const char*)data); + break; + case ITEM_PUBDATE: + { + time_t when = *((time_t*)data); + SetField( new BDateField(&when), 3 ); + } + + break; + + case ITEM_ENCLOSURE_LENGTH: + { + off_t size= *((off_t*)data); + sizefield-> SetSize(size); + } + break; + + case ITEM_ENCLOSURE_FILE_STATUS: + { + + // BString sdata; + int32 val=*((int*)data); + FileStatus status = (FileStatus)val; + + switch(status) + { + case NOT_DOWNLOADED: + case NEW: + case NO_ENCLOSURE: + iconfield->SetBitmap(NULL); + break; + case DOWNLOADED: + iconfield->SetBitmap(LoadIcon("done-micro.png")); + break; + case STOPPED: + iconfield->SetBitmap(LoadIcon("stopped-micro.png")); + break; + case DOWNLOADING: + iconfield->SetBitmap(LoadIcon("download-micro.png")); + break; + case ENQUEQUED: + iconfield->SetBitmap(LoadIcon("enqueued-micro.png")); + break; + case CONNECTING: break; //just use the last one! + default: + iconfield->SetBitmap(LoadIcon("error-micro.png")); + //sdata.SetTo(_T("error")); + break; + } + + fieldStaus->SetFileStatus(status); + if(fList) + fList->UpdateRow(this); + } + break; + case ITEM_ENCLOSURE_FILE_PERCENTAGE: + { + int32 val=*((int*)data); + fieldStaus->SetFilePercentage(val,fLatestSpeed); + } + break; + case ITEM_ENCLOSURE_DOWNLOAD_SPEED: + fLatestSpeed= *((float*)data); + break; + + + default: + break; + }; + +} + +DownloadListItem::~DownloadListItem(){ +} + +float +DownloadListItem::GetLastSpeed(){ + return fLatestSpeed; +} +int32 +DownloadListItem::GetPercentage(){ + return fieldStaus->GetPercentage(); +} + diff --git a/sources-experimental/DownloadListItem.h b/sources-experimental/DownloadListItem.h new file mode 100644 index 0000000..198e8cf --- /dev/null +++ b/sources-experimental/DownloadListItem.h @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#ifndef _DownloadListItem_H +#define _DownloadListItem_H + +#include "ColumnListView.h" +#include "ColumnTypes.h" + +#include "ElementListener.h" + +#include "FileStatusColumn.h" + +#include +#include "RssItem.h" + +class DownloadListView; +class EpisodeListItem; +class SubscriptionListItem; + +class DownloadListItem : public BRow, public ElementListener +{ + public: + DownloadListItem(SubscriptionListItem* channel); + ~DownloadListItem(); + + + void KeyModified(int32 key, void* data,ssize_t size); + + + entry_ref fRef; + RssItem fRss; + + + void LinkToEpisode(EpisodeListItem* item); + void Unlink(); + + float GetLastSpeed(); + int32 GetPercentage(); + + //test + bool fShouldMeRemoved; + + private: + + BBitmapField* iconfield; + BStringField* field; + BStringField* channel; + BSizeField* sizefield; + FileStatusField* fieldStaus; + EpisodeListItem* fLinked; + + + float fLatestSpeed; + +}; + +#endif diff --git a/sources-experimental/DownloadListView.cpp b/sources-experimental/DownloadListView.cpp new file mode 100644 index 0000000..b9ce2e1 --- /dev/null +++ b/sources-experimental/DownloadListView.cpp @@ -0,0 +1,123 @@ +#include "DownloadListView.h" +#include "SubscriptionColumn.h" + +#include "MyColumnTypes.h" +#include +#include "BPLocale.h" +#include +#include + +#include "FileStatusColumn.h" +#include "DownloadListItem.h" + +DownloadListView::DownloadListView(BRect r): +BColumnListView(r,"DownloadListView",B_FOLLOW_ALL, B_WILL_DRAW|B_NAVIGABLE,B_FANCY_BORDER,true) +{ + BColumn *icon = new BMyBitmapColumn(_T("Icon"),16,16,16); + BColumn *channel = new BStringColumn(_T("Subscription"),140,10,500,5,B_ALIGN_LEFT); + BColumn *title = new BStringColumn(_T("Title"),140,10,500,5,B_ALIGN_LEFT); + BColumn *date = new BPositiveDateColumn(_T("Date"),70,10,150,B_ALIGN_LEFT); + BColumn *size = new BPositiveSizeColumn(_T("Size"),80,10,150,B_ALIGN_LEFT); + + int index = 0; + AddColumn(icon,index++); + AddColumn(channel,index++); + AddColumn(title,index++); + AddColumn(date,index++); + AddColumn(size,index++); + AddColumn(new FileStatusColumn(_T("Status"), + 200,110,400,0,B_ALIGN_LEFT), + index++); + //SetColumnFlags(B_ALLOW_COLUMN_RESIZE); + SetColumnFlags((column_flags)(B_ALLOW_COLUMN_REMOVE|B_ALLOW_COLUMN_RESIZE|B_ALLOW_COLUMN_POPUP|B_ALLOW_COLUMN_MOVE)); + SetSelectionMode(B_SINGLE_SELECTION_LIST); + SetSortingEnabled(true); + SetSortColumn(date,false,false); + + BView* sview = new BView(BRect(0,0,100,B_H_SCROLL_BAR_HEIGHT-1),NULL,B_FOLLOW_ALL_SIDES,B_WILL_DRAW); + sview->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + + + fCounter = new BStringView(BRect(2,1,98,B_H_SCROLL_BAR_HEIGHT-2),"",""); + fCounter->SetFontSize(10); + fCounter->SetViewColor( ui_color(B_PANEL_BACKGROUND_COLOR) ); + + sview->AddChild(fCounter); + AddStatusView(sview); + + const rgb_color greyBox = {255,234,130 }; + SetColor(B_COLOR_SELECTION,greyBox); + SetColor(B_COLOR_SELECTION_TEXT,Color(B_COLOR_TEXT)); + + const rgb_color white={255,255,255,255}; + SetColor(B_COLOR_BACKGROUND,white); + + + SetSortingEnabled(true); + ClearSortColumns(); + //SetSortColumn(ColumnAt(index),true,true); + + + //messages + + BMessage* selected=new BMessage(DOWNLOAD_SELECTED); + selected->AddInt32("buttons",0); + + SetSelectionMessage(selected); + + SetInvocationMessage(new BMessage(DOWNLOAD_INVOKED)); +} + +void +DownloadListView::SelectionChanged(){ + uint32 buttons = 0; + + BMessage *msg = Window()->CurrentMessage(); + + if(msg) //don't remove. + msg->FindInt32("buttons", (int32 *)&buttons) ; + + + DownloadListItem* dli =(DownloadListItem*) CurrentSelection(); + if(!dli) return; + + if(SelectionMessage()){ + + SelectionMessage()->ReplaceInt32("buttons",buttons); + SelectionMessage()->AddRef("entry_ref",&dli->fRef); + + } + BColumnListView::SelectionChanged(); +} + +void +DownloadListView::ResetSelectionMessage(){ + + if(SelectionMessage()){ + + SelectionMessage()->ReplaceInt32("buttons",0); + SelectionMessage()->RemoveName("entry_ref"); + + } +} + +void +DownloadListView::AddRow(BRow* row, BRow *parent){ + BColumnListView::AddRow(row,parent); + UpdateCount(); +} +void +DownloadListView::AddRow(BRow* row, int32 index, BRow *parent){ + BColumnListView::AddRow(row,index,parent); + UpdateCount(); +} + +void +DownloadListView::UpdateCount(){ + BString text; + text << CountRows(); + fCounter->SetText(text.String()); +} + + +//-- diff --git a/sources-experimental/DownloadListView.h b/sources-experimental/DownloadListView.h new file mode 100644 index 0000000..0099144 --- /dev/null +++ b/sources-experimental/DownloadListView.h @@ -0,0 +1,31 @@ +#ifndef _DownloadListView_H_ +#define _DownloadListView_H_ + +#include "ColumnListView.h" +#include "FileStatusColumn.h" +#include + +#define DOWNLOAD_SELECTED 'dwse' +#define DOWNLOAD_INVOKED 'dwin' + +class DownloadListView : public BColumnListView +{ + public: + DownloadListView(BRect r); + + void SelectionChanged(); + void AddRow(BRow*, BRow *parent = 0); + void AddRow(BRow*, int32 index, BRow *parent = 0); + + void ResetSelectionMessage(); + + private: + void UpdateCount(); + BStringView* fCounter; + + +}; + +#endif + +//. diff --git a/sources-experimental/DownloadManager.cpp b/sources-experimental/DownloadManager.cpp new file mode 100644 index 0000000..6d0655e --- /dev/null +++ b/sources-experimental/DownloadManager.cpp @@ -0,0 +1,161 @@ +#include "DownloadManager.h" +#include + +#define DEFAULT_CHANNELS_DOWNLOAD 3 +#define DEFAULT_ITEMS_DOWNLOAD 1 + +DownloadManager::DownloadManager(BLooper* target){ + + queue[CHANNELS_QUEUE] = new QueueFileDownload("qSubscriptions",DEFAULT_CHANNELS_DOWNLOAD,target,DOWNLOAD_CHANNEL_INFO); + queue[ITEMS_QUEUE] = new QueueFileDownload("qEnclosures",DEFAULT_ITEMS_DOWNLOAD,target,DOWNLOAD_ITEM_INFO); + queue[EXTRA_QUEUE] = new QueueFileDownload("qExtra",1,target,DOWNLOAD_EXTRA_INFO); +} + +void +DownloadManager::Enqueue(QueueType type,ActionDownload* ad){ + queue[type]->AddAction(ad); +} + +void +DownloadManager::TryStopCurrentAction(QueueType type,BString key,BString value){ + + if(queue[type]->Lock()){ + for(int i=0;iCountThreads();i++) { + ActionDownload *ad = (ActionDownload*)queue[type]->CurrentAction(i); + + if(ad && ad->GetKey(key).Compare(value.String()) ==0 ) + ad->SetShouldStop(true); + } + + queue[type]->Unlock(); + } +} + +bool +DownloadManager::RemoveFromQueue(QueueType type ,BString key,BString value){ + if(queue[type]->Lock()){ + + for(int32 i=0;iCountActions();i++){ + ActionDownload *ad = (ActionDownload*)queue[type]->ActionAt(i); + if(ad->GetKey(key).Compare(value.String()) ==0 ){ + queue[type]->RemoveActionAt(i); + queue[type]->Unlock(); + return true; + } + } + + for(int i=0;iCountThreads();i++) { + ActionDownload *ad = (ActionDownload*)queue[type]->CurrentAction(i); + + if(ad && ad->GetKey(key).Compare(value.String()) ==0 ) + ad->SetShouldStop(true); + } + queue[type]->Unlock(); + return false; + } + return false; +} + +void +DownloadManager::RemoveQueue(QueueType type,BList* removed){ + + + queue[type]->Lock(); + + while(queue[type]->CountActions()) + { + //ActionDownload *ad = (ActionDownload*) + queue[type]->ActionAt(0); + queue[type]->RemoveActionAt(0); + } + + // *************************************** + // we did not unlock + // so no one can add new item. + // *************************************** + + for(int i=0;iCountThreads();i++) { + if(queue[type]->CurrentAction(i)) + removed->AddItem( (void*)queue[type]->CurrentAction(i)); + } +} + +void +DownloadManager::LoadProxySetting(BMessage* data){ + + bool value; + + enabled=false; + address.SetTo(""); + userpwd.SetTo(""); + port = 0; + + + if(data->FindBool("enable",&value)==B_OK) + enabled=value; + + if(!enabled) return; + + BString username,password; + data->FindString("username",&username); + data->FindInt32("port",&port); + data->FindString("address",&address); + data->FindString("password",&password); + if(username !="" || password !="") + userpwd << username << ":" << password; + +} + + +void +DownloadManager::LoadDownloadSetting(BMessage* data){ + + //here magic stuff! :=) + int32 number = 1; + if(data->FindInt32("max_downloads",&number) == B_OK){ + queue[ITEMS_QUEUE]->SetDownloadCount(number); + } +} + +thread_id +DownloadManager::SingleThreadAction(ActionAsync* action,bool autoResume){ + + thread_id id = spawn_thread(DownloadManager::SingleThreadPerform,"single_action_thread",B_NORMAL_PRIORITY,(void*)action); + if(autoResume) resume_thread(id); + return id; +} + +int32 +DownloadManager::SingleThreadPerform(void* a){ + + ActionAsync* ad=(ActionAsync*)a; + + // perform the action + BMessage err; + + //status_t status = + ad->Perform(&err); + // do post-perform! + + if(ad->Target()){ + err.what=ad->Command(); + //BMessenger(ad->Looper()).SendMessage(&err); + ad->Invoke(&err); + } + return 0; +} + + +void +DownloadManager::FinishCurl(CURL* curl){ + if(!enabled) return; + + curl_easy_setopt(curl, CURLOPT_PROXY, address.String()); + curl_easy_setopt(curl, CURLOPT_PROXYPORT, port); + curl_easy_setopt(curl, CURLOPT_PROXYTYPE , CURLPROXY_HTTP); + //curl_easy_setopt(curl, CURLOPT_PROXYAUTH, CURLAUTH_BASIC ); + if(userpwd != "") { + curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD , userpwd.String() ); + //println("auth %s\n",userpwd.String()); + } +} diff --git a/sources-experimental/DownloadManager.h b/sources-experimental/DownloadManager.h new file mode 100644 index 0000000..14dd4c4 --- /dev/null +++ b/sources-experimental/DownloadManager.h @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#ifndef DownloadManager_H_ +#define DownloadManager_H_ + +#include "ActionDownload.h" +#include "QueueFileDownload.h" +#include +#include +#include "curl/curl.h" + +#define DOWNLOAD_CHANNEL_INFO 'addc' +#define DOWNLOAD_ITEM_INFO 'adde' +#define DOWNLOAD_EXTRA_INFO 'extr' +class DownloadManager { + + public: + DownloadManager(BLooper* target); + + enum QueueType { + CHANNELS_QUEUE =0, + ITEMS_QUEUE, + EXTRA_QUEUE + }; + + void Enqueue(QueueType,ActionDownload*); + + void TryStopCurrentAction(QueueType,BString key,BString value); + + bool RemoveFromQueue(QueueType,BString key,BString value); + + void RemoveQueue(QueueType,BList* removed); + + void LoadProxySetting(BMessage* data); + void LoadDownloadSetting(BMessage* data); + + + + + thread_id SingleThreadAction(ActionAsync* action,bool autoResume=true); + + void FinishCurl(CURL* curl); + +private: + + static int32 SingleThreadPerform(void* a); + + QueueFileDownload * queue[3]; + + //proxy + int32 port; + BString address; + BString userpwd; + bool enabled; + +}; + +#endif diff --git a/sources-experimental/ElementListener.h b/sources-experimental/ElementListener.h new file mode 100644 index 0000000..2ca84d9 --- /dev/null +++ b/sources-experimental/ElementListener.h @@ -0,0 +1,17 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * Interface for something that reacts aftwer a change +*/ + +#ifndef _ElementListener_h_ +#define _ElementListener_h_ + +#include + +class ElementListener +{ + public: + virtual void KeyModified(int32 key, void* data,ssize_t numBytes) = 0; +}; +#endif diff --git a/sources-experimental/ElementNotifier.cpp b/sources-experimental/ElementNotifier.cpp new file mode 100644 index 0000000..2685e8f --- /dev/null +++ b/sources-experimental/ElementNotifier.cpp @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#include "ElementNotifier.h" +#include + +void +ElementNotifier::SetElementListener(ElementListener* list) +{ + fListener = list; +} + +void +ElementNotifier::NotifyListener(ItemProperty key,void* data,ssize_t size) +{ + fListener->KeyModified(key,data,size); +} diff --git a/sources-experimental/ElementNotifier.h b/sources-experimental/ElementNotifier.h new file mode 100644 index 0000000..a4431ae --- /dev/null +++ b/sources-experimental/ElementNotifier.h @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#ifndef ElementNotifier_H_ +#define ElementNotifier_H_ + +#include +#include +#include +#include + +#include "ElementListener.h" +#include + + +#include "ItemProperty.h" + + + +class ElementNotifier +{ + +public: + + void SetElementListener(ElementListener*); + + + protected: + + ElementListener* fListener; + void NotifyListener(ItemProperty key,void* data,ssize_t); + +}; +#endif diff --git a/sources-experimental/EntryIterator.cpp b/sources-experimental/EntryIterator.cpp new file mode 100644 index 0000000..f6fb907 --- /dev/null +++ b/sources-experimental/EntryIterator.cpp @@ -0,0 +1,457 @@ + +#include +#include +#include + +#include +#include + +#include "EntryIterator.h" +#include "NodeWalker.h" +#include "ObjectList.h" + +TWalkerWrapper::TWalkerWrapper(TWalker *walker) + : fWalker(walker), + fStatus(B_OK) +{ +} + +TWalkerWrapper::~TWalkerWrapper() +{ + delete fWalker; +} + +status_t +TWalkerWrapper::InitCheck() const +{ + return fStatus; +} + +status_t +TWalkerWrapper::GetNextEntry(BEntry *entry, bool traverse) +{ + fStatus = fWalker->GetNextEntry(entry, traverse); + return fStatus; +} + +status_t +TWalkerWrapper::GetNextRef(entry_ref *ref) +{ + fStatus = fWalker->GetNextRef(ref); + return fStatus; +} + +int32 +TWalkerWrapper::GetNextDirents(struct dirent *buffer, size_t length, int32 count) +{ + int32 result = fWalker->GetNextDirents(buffer, length, count); + fStatus = result < 0 ? result : (result ? B_OK : B_ENTRY_NOT_FOUND); + return result; +} + +status_t +TWalkerWrapper::Rewind() +{ + return fWalker->Rewind(); +} + +int32 +TWalkerWrapper::CountEntries() +{ + return fWalker->CountEntries(); +} + +EntryListBase::EntryListBase() + : fStatus(B_OK) +{ +} + +status_t +EntryListBase::InitCheck() const +{ + return fStatus; +} + +dirent * +EntryListBase::Next(dirent *ent) +{ + return (dirent *)((char *)ent + ent->d_reclen + sizeof(dirent)); +} + +CachedEntryIterator::CachedEntryIterator(BEntryList *iterator, int32 numEntries, + bool sortInodes) + : fIterator(iterator), + fEntryRefBuffer(NULL), + fCacheSize(numEntries), + fNumEntries(0), + fIndex(0), + fDirentBuffer(NULL), + fCurrentDirent(NULL), + fSortInodes(sortInodes), + fSortedList(NULL), + fEntryBuffer(NULL) +{ +} + + +CachedEntryIterator::~CachedEntryIterator() +{ + delete [] fEntryRefBuffer; + free(fDirentBuffer); + delete fSortedList; + delete [] fEntryBuffer; +} + +status_t +CachedEntryIterator::GetNextEntry(BEntry *result, bool traverse) +{ + ASSERT(!fDirentBuffer); + ASSERT(!fEntryRefBuffer); + + if (!fEntryBuffer) { + fEntryBuffer = new BEntry [fCacheSize]; + ASSERT(fIndex == 0 && fNumEntries == 0); + } + if (fIndex >= fNumEntries) { + // fill up the buffer or stop if error; keep error around + // and return it when appropriate + fStatus = B_OK; + for (fNumEntries = 0; fNumEntries < fCacheSize; fNumEntries++) { + fStatus = fIterator->GetNextEntry(&fEntryBuffer[fNumEntries], + traverse); + if (fStatus != B_OK) + break; + } + fIndex = 0; + } + *result = fEntryBuffer[fIndex++]; + if (fIndex > fNumEntries) + // we are at the end of the cache we loaded up, time to return + // an error, if we had one + return fStatus; + + return B_OK; +} + +status_t +CachedEntryIterator::GetNextRef(entry_ref *ref) +{ + ASSERT(!fDirentBuffer); + ASSERT(!fEntryBuffer); + + if (!fEntryRefBuffer) { + fEntryRefBuffer = new entry_ref[fCacheSize]; + ASSERT(fIndex == 0 && fNumEntries == 0); + } + + if (fIndex >= fNumEntries) { + // fill up the buffer or stop if error; keep error around + // and return it when appropriate + fStatus = B_OK; + for (fNumEntries = 0; fNumEntries < fCacheSize; fNumEntries++) { + fStatus = fIterator->GetNextRef(&fEntryRefBuffer[fNumEntries]); + if (fStatus != B_OK) + break; + } + fIndex = 0; + } + *ref = fEntryRefBuffer[fIndex++]; + if (fIndex > fNumEntries) + // we are at the end of the cache we loaded up, time to return + // an error, if we had one + return fStatus; + + return B_OK; +} + + +static int +CompareInode(const dirent *ent1, const dirent *ent2) +{ + if (ent1->d_ino < ent2->d_ino) + return -1; + else if (ent1->d_ino == ent2->d_ino) + return 0; + else + return 1; +} + +int32 +CachedEntryIterator::GetNextDirents(struct dirent *ent, size_t size, + int32 count) +{ + ASSERT(!fEntryRefBuffer); + if (!fDirentBuffer) { + fDirentBuffer = (dirent *)malloc(kDirentBufferSize); + ASSERT(fIndex == 0 && fNumEntries == 0); + ASSERT(size > sizeof(dirent) + B_FILE_NAME_LENGTH); + } + + if (!count) + return 0; + + if (fIndex >= fNumEntries) { + // we are out of stock, cache em up + fCurrentDirent = fDirentBuffer; + uint32 bufferRemain = kDirentBufferSize; + for (fNumEntries = 0; fNumEntries < fCacheSize; ) { + int32 count = fIterator->GetNextDirents(fCurrentDirent, + bufferRemain, 1); + + if (count <= 0) + break; + + fNumEntries += count; + + int32 currentDirentSize = fCurrentDirent->d_reclen + (ssize_t)sizeof(dirent); + bufferRemain -= currentDirentSize; + if (bufferRemain < (sizeof(dirent) + B_FILE_NAME_LENGTH)) + // cant fit a big entryRef in the buffer, just bail + // and start from scratch + break; + + fCurrentDirent = (dirent *)((char *)fCurrentDirent + currentDirentSize); + } + fCurrentDirent = fDirentBuffer; + if (fSortInodes) { + if (!fSortedList) + fSortedList = new BObjectList(fCacheSize); + else + fSortedList->MakeEmpty(); + + for (int32 count = 0; count < fNumEntries; count++) { + fSortedList->AddItem(fCurrentDirent, 0); + fCurrentDirent = Next(fCurrentDirent); + } + fSortedList->SortItems(CompareInode); + fCurrentDirent = fDirentBuffer; + } + fIndex = 0; + } + if (fIndex >= fNumEntries) + // we are done, no more dirents left + return 0; + + if (fSortInodes) + fCurrentDirent = fSortedList->ItemAt(fIndex); + + fIndex++; + uint32 currentDirentSize = fCurrentDirent->d_reclen + sizeof(dirent); + ASSERT(currentDirentSize <= size); + if (currentDirentSize > size) + return 0; + + memcpy(ent, fCurrentDirent, currentDirentSize); + + if (!fSortInodes) + fCurrentDirent = (dirent *)((char *)fCurrentDirent + currentDirentSize); + + return 1; +} + +status_t +CachedEntryIterator::Rewind() +{ + fIndex = 0; + fNumEntries = 0; + fCurrentDirent = NULL; + fStatus = B_OK; + + delete fSortedList; + fSortedList = NULL; + + return fIterator->Rewind(); +} + +int32 +CachedEntryIterator::CountEntries() +{ + return fIterator->CountEntries(); +} + +void +CachedEntryIterator::SetTo(BEntryList *iterator) +{ + fIndex = 0; + fNumEntries = 0; + fStatus = B_OK; + fIterator = iterator; +} + +CachedDirectoryEntryList::CachedDirectoryEntryList(const BDirectory &dir) + : CachedEntryIterator(0, 40, true), + fDir(dir) +{ + fStatus = fDir.InitCheck(); + SetTo(&fDir); +} + +CachedDirectoryEntryList::~CachedDirectoryEntryList() +{ +} + + +DirectoryEntryList::DirectoryEntryList(const BDirectory &dir) + : fDir(dir) +{ + fStatus = fDir.InitCheck(); +} + +status_t +DirectoryEntryList::GetNextEntry(BEntry *entry, bool traverse) +{ + fStatus = fDir.GetNextEntry(entry, traverse); + return fStatus; +} + +status_t +DirectoryEntryList::GetNextRef(entry_ref *ref) +{ + fStatus = fDir.GetNextRef(ref); + return fStatus; +} + +int32 +DirectoryEntryList::GetNextDirents(struct dirent *buffer, size_t length, + int32 count) +{ + fStatus = fDir.GetNextDirents(buffer, length, count); + return fStatus; +} + +status_t +DirectoryEntryList::Rewind() +{ + fStatus = fDir.Rewind(); + return fStatus; +} + +int32 +DirectoryEntryList::CountEntries() +{ + return fDir.CountEntries(); +} + + +EntryIteratorList::EntryIteratorList() + : fList(5, true), + fCurrentIndex(0) +{ +} + +EntryIteratorList::~EntryIteratorList() +{ + int32 count = fList.CountItems(); + for (;count; count--) { + // workaround for BEntryList not having a proper destructor + BEntryList *entry = fList.RemoveItemAt(count - 1); + EntryListBase *fixedEntry = dynamic_cast(entry); + + if (fixedEntry) + delete fixedEntry; + else + delete entry; + } +} + + +void +EntryIteratorList::AddItem(BEntryList *walker) +{ + fList.AddItem(walker); +} + +status_t +EntryIteratorList::GetNextEntry(BEntry *entry, bool traverse) +{ + for (;;) { + if (fCurrentIndex >= fList.CountItems()) { + fStatus = B_ENTRY_NOT_FOUND; + break; + } + + fStatus = fList.ItemAt(fCurrentIndex)->GetNextEntry(entry, traverse); + if (fStatus != B_ENTRY_NOT_FOUND) + break; + + fCurrentIndex++; + } + return fStatus; +} + +status_t +EntryIteratorList::GetNextRef(entry_ref *ref) +{ + for (;;) { + if (fCurrentIndex >= fList.CountItems()) { + fStatus = B_ENTRY_NOT_FOUND; + break; + } + + fStatus = fList.ItemAt(fCurrentIndex)->GetNextRef(ref); + if (fStatus != B_ENTRY_NOT_FOUND) + break; + + fCurrentIndex++; + } + return fStatus; +} + +int32 +EntryIteratorList::GetNextDirents(struct dirent *buffer, size_t length, int32 count) +{ + int32 result = 0; + for (;;) { + if (fCurrentIndex >= fList.CountItems()) { + fStatus = B_ENTRY_NOT_FOUND; + break; + } + + result = fList.ItemAt(fCurrentIndex)->GetNextDirents(buffer, length, count); + if (result > 0) { + fStatus = B_OK; + break; + } + + fCurrentIndex++; + } + return result; +} + +status_t +EntryIteratorList::Rewind() +{ + fCurrentIndex = 0; + int32 count = fList.CountItems(); + for (int32 index = 0; index < count; index++) + fStatus = fList.ItemAt(index)->Rewind(); + + return fStatus; +} + +int32 +EntryIteratorList::CountEntries() +{ + int32 result = 0; + + int32 count = fList.CountItems(); + for (int32 index = 0; index < count; index++) + result += fList.ItemAt(fCurrentIndex)->CountEntries(); + + return result; +} + + +CachedEntryIteratorList::CachedEntryIteratorList() + : CachedEntryIterator(0, 10, true) +{ + fStatus = B_OK; + SetTo(&fIteratorList); +} + +void +CachedEntryIteratorList::AddItem(BEntryList *walker) +{ + fIteratorList.AddItem(walker); +} + diff --git a/sources-experimental/EntryIterator.h b/sources-experimental/EntryIterator.h new file mode 100644 index 0000000..247b5db --- /dev/null +++ b/sources-experimental/EntryIterator.h @@ -0,0 +1,157 @@ +#ifndef __ENTRY_ITERATOR__ +#define __ENTRY_ITERATOR__ + +#include +#include "ObjectList.h" +#include "NodeWalker.h" + + + +class EntryListBase : public BEntryList { + // this is what BEntryList should have been +public: + EntryListBase(); + virtual ~EntryListBase() {} + + virtual status_t InitCheck() const; + + virtual status_t GetNextEntry(BEntry *entry, bool traverse = false) = 0; + virtual status_t GetNextRef(entry_ref *ref) = 0; + virtual int32 GetNextDirents(struct dirent *buffer, size_t length, + int32 count = INT_MAX) = 0; + + virtual status_t Rewind() = 0; + virtual int32 CountEntries() = 0; + + static dirent *Next(dirent *); + +protected: + status_t fStatus; +}; + +class TWalkerWrapper : public EntryListBase { + // this is to be able to use TWalker polymorfically as BEntryListBase +public: + TWalkerWrapper(TWalker *walker); + virtual ~TWalkerWrapper(); + + virtual status_t InitCheck() const; + virtual status_t GetNextEntry(BEntry *entry, bool traverse = false); + virtual status_t GetNextRef(entry_ref *ref); + virtual int32 GetNextDirents(struct dirent *buffer, size_t length, + int32 count = INT_MAX); + virtual status_t Rewind(); + virtual int32 CountEntries(); + +protected: + TWalker *fWalker; + status_t fStatus; +}; + +const int32 kDirentBufferSize = 10 * 1024; + +class CachedEntryIterator : public EntryListBase { +public: + // takes any iterator and runs it through a cache of a specified size + // used to cluster entry_ref reads together, away from node accesses + // + // each chunk of iterators in the cache are then returned in an order, + // sorted by their i-node number -- this turns out to give quite a bit + // better performance over just using the order in which they show up using + // the default BEntryList iterator subclass + + CachedEntryIterator(BEntryList *iterator, int32 numEntries, + bool sortInodes = false); + // CachedEntryIterator does not get to own the + virtual ~CachedEntryIterator(); + + virtual status_t GetNextEntry(BEntry *entry, bool traverse = false); + virtual status_t GetNextRef(entry_ref *ref); + virtual int32 GetNextDirents(struct dirent *buffer, size_t length, + int32 count = INT_MAX); + + virtual status_t Rewind(); + virtual int32 CountEntries(); + + virtual void SetTo(BEntryList *iterator); + // CachedEntryIterator does not get to own the + +private: + BEntryList *fIterator; + entry_ref *fEntryRefBuffer; + int32 fCacheSize; + int32 fNumEntries; + int32 fIndex; + + dirent *fDirentBuffer; + dirent *fCurrentDirent; + bool fSortInodes; + BObjectList *fSortedList; + + BEntry *fEntryBuffer; +}; + +class DirectoryEntryList : public EntryListBase { +public: + DirectoryEntryList(const BDirectory &); + + virtual status_t GetNextEntry(BEntry *entry, bool traverse = false); + virtual status_t GetNextRef(entry_ref *ref); + virtual int32 GetNextDirents(struct dirent *buffer, size_t length, + int32 count = INT_MAX); + + virtual status_t Rewind(); + virtual int32 CountEntries(); + +private: + BDirectory fDir; +}; + +class CachedDirectoryEntryList : public CachedEntryIterator { + // this class is to work around not being able to delete + // BEntryList polymorfically - need to have a special + // caching entry list iterator for directories +public: + CachedDirectoryEntryList(const BDirectory &); + virtual ~CachedDirectoryEntryList(); + +private: + BDirectory fDir; +}; + +class EntryIteratorList : public EntryListBase { + // This wraps up several BEntryList style iterators and + // iterates them all, going from one to the other as it finishes + // up each of them +public: + EntryIteratorList(); + virtual ~EntryIteratorList(); + + void AddItem(BEntryList *); + // list gets to own walkers + + virtual status_t GetNextEntry(BEntry *entry, bool traverse = false); + virtual status_t GetNextRef(entry_ref *ref); + virtual int32 GetNextDirents(struct dirent *buffer, size_t length, + int32 count = INT_MAX); + + virtual status_t Rewind(); + virtual int32 CountEntries(); + +protected: + BObjectList fList; + int32 fCurrentIndex; +}; + +class CachedEntryIteratorList : public CachedEntryIterator { +public: + CachedEntryIteratorList(); + void AddItem(BEntryList *); + +protected: + EntryIteratorList fIteratorList; +}; + + + +#endif diff --git a/sources-experimental/EpisodeListItem.cpp b/sources-experimental/EpisodeListItem.cpp new file mode 100644 index 0000000..2d06167 --- /dev/null +++ b/sources-experimental/EpisodeListItem.cpp @@ -0,0 +1,148 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#include "EpisodeListItem.h" +#include "ItemProperty.h" + +#include +#include "BPLocale.h" + +#include "Utils.h" +#include "curl/curl.h" +#include "FileStatus.h" +#include "ColumnListView.h" +#include "ColumnTypes.h" + + +EpisodeListItem::EpisodeListItem():BRow(16.0),isNew(false) +{ + int index = 0; + time_t time = 0; + fLatestSpeed = 0; + + SetField( iconfield = new BBitmapField(NULL) , index++); + SetField( field = new BStringField(NULL) , index++); + SetField( new BDateField(&time) , index++); + SetField( sizefield = new BSizeField(0), index++); + SetField( fieldStaus = new FileStatusField(NEW) , index++); + + //fRss.AddElementListener(this); +} + + +void +EpisodeListItem::KeyModified(int32 key, void* data,ssize_t size) +{ + switch(key) + { + + case ITEM_TITLE: + { + field->SetString((const char*)data); + } + break; + case ITEM_PUBDATE: + { + time_t when = *((time_t*)data); + SetField( new BDateField(&when), 2 ); + } + + break; + + case ITEM_ENCLOSURE_LENGTH: + { + off_t size= *((off_t*)data); + sizefield-> SetSize(size); + } + break; + + case ITEM_ENCLOSURE_URL: + + if( fieldStaus->GetFileStatus()== NEW ) + iconfield->SetBitmap(LoadIcon("clip.png")); + break; + + case ITEM_ENCLOSURE_FILE_STATUS: + { + + // BString sdata; + int32 val=*((int*)data); + FileStatus status = (FileStatus)val; + + if(status!=NEW) + SetIsNew(false); + else + SetIsNew(true); + + switch(status) + { + case NEW: + break; + + case NOT_DOWNLOADED: + iconfield->SetBitmap(LoadIcon("clip.png")); + break; + + case NO_ENCLOSURE: + iconfield->SetBitmap(NULL); + break; + + case DOWNLOADED: + iconfield->SetBitmap(LoadIcon("done-micro.png")); + break; + case STOPPED: + iconfield->SetBitmap(LoadIcon("stopped-micro.png")); + break; + case DOWNLOADING: + iconfield->SetBitmap(LoadIcon("download-micro.png")); + break; + case ENQUEQUED: + iconfield->SetBitmap(LoadIcon("enqueued-micro.png")); + break; + case CONNECTING: break;//just use the last one! + default: + iconfield->SetBitmap(LoadIcon("error-micro.png")); + //sdata.SetTo(_T("error")); + break; + } + + fieldStaus->SetFileStatus(status); + //test + if(fList) + fList->UpdateRow(this); + } + break; + case ITEM_ENCLOSURE_FILE_PERCENTAGE: + { + int32 val=*((int*)data); + fieldStaus->SetFilePercentage(val,fLatestSpeed); + } + break; + case ITEM_ENCLOSURE_DOWNLOAD_SPEED: + fLatestSpeed= *((float*)data); + break; + + default: + break; + }; + + + +} + +EpisodeListItem::~EpisodeListItem(){ +} + +void +EpisodeListItem::DrawBackground( BRect _rect, BView* parent, bool _is_selected, bool _is_focus ) { + +// BRow::DrawBackground(_rect,parent,_is_selected,_is_focus); + if(isNew) { + parent->SetHighColor(0,0,0); + parent->FillRect(BRect(_rect.left + 6, _rect.top + 6,_rect.left + 9,_rect.top + 9)); + } +} + diff --git a/sources-experimental/EpisodeListItem.h b/sources-experimental/EpisodeListItem.h new file mode 100644 index 0000000..31461ea --- /dev/null +++ b/sources-experimental/EpisodeListItem.h @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#ifndef _EpisodeListItem_H +#define _EpisodeListItem_H + +#include "ColumnListView.h" +#include "ColumnTypes.h" + +#include "ElementListener.h" + +#include "FileStatusColumn.h" + +#include "RssItem.h" +#include + +class EpisodeListItem : public BRow, public ElementListener +{ + public: + EpisodeListItem(); + ~EpisodeListItem(); + + void KeyModified(int32 key, void* data,ssize_t size); + void DrawBackground( BRect _rect, BView* _target_view, bool _is_selected, bool _is_focus ); + + bool IsNew(){ return isNew; } + + off_t GetEnclosureSize(){ return sizefield->Size(); }; + const char* GetTitle(){ return field->String(); }; + time_t GetDate(){ return ((BDateField*)GetField(2))->UnixTime(); }; + + entry_ref fRef; + + private: + void SetIsNew(bool set){ isNew = set; } + + BBitmapField* iconfield; + BStringField* field; + BSizeField* sizefield; + FileStatusField* fieldStaus; + + bool isNew; + float fLatestSpeed; +}; + +#endif diff --git a/sources-experimental/EpisodeListView.cpp b/sources-experimental/EpisodeListView.cpp new file mode 100644 index 0000000..45aa204 --- /dev/null +++ b/sources-experimental/EpisodeListView.cpp @@ -0,0 +1,128 @@ +#include "EpisodeListView.h" +#include "SubscriptionColumn.h" + +#include "MyColumnTypes.h" +#include +#include "BPLocale.h" +#include +#include +#include "EpisodeListItem.h" +#include "FileStatusColumn.h" +#include "Colors.h" +#include "ImageButton.h" + +class StatusView : public BView { + public: + StatusView(BRect r); + void SetCount(int32); + private: + BStringView* fCounter; +}; + +StatusView::StatusView(BRect r):BView(r,NULL,B_FOLLOW_ALL_SIDES,B_WILL_DRAW){ + SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + BRect rect(Bounds()); + rect.InsetBy(2,2); + fCounter = new BStringView(rect,"",""); + fCounter->SetFontSize(10); + BFont font; + fCounter->GetFont(&font); + font_height fh; + font.GetHeight(&fh); + fCounter->ResizeBy(20,fh.descent); + fCounter->MoveBy(-20,fh.descent); + fCounter->SetViewColor( ui_color(B_PANEL_BACKGROUND_COLOR) ); + AddChild(fCounter); + + rect=Bounds(); + rect.left = fCounter->Bounds().right + 1; + //AddChild(new ImageButton(rect,"name",NULL)); + +} + +void +StatusView::SetCount(int32 count){ + BString text; + text << count; + fCounter->SetText(text.String()); +} + +EpisodeListView::EpisodeListView(BRect r): +BColumnListView(r,"EpisodeListView",B_FOLLOW_ALL, B_WILL_DRAW|B_NAVIGABLE,B_FANCY_BORDER,true) +{ + BColumn *icon = new BMyBitmapColumn(_T("Icon"),16,16,16); + BColumn *title = new BStringColumn(_T("Title"),140,10,500,B_TRUNCATE_MIDDLE,B_ALIGN_LEFT); + BColumn *date = new BPositiveDateColumn(_T("Date"),70,10,150,B_ALIGN_LEFT); + BColumn *size = new BPositiveSizeColumn(_T("Size"),80,10,150,B_ALIGN_LEFT); + + int index = 0; + AddColumn(icon,index++); + AddColumn(title,index++); + AddColumn(date,index++); + AddColumn(size,index++); + AddColumn(new FileStatusColumn(_T("Status"),200,110,400,0,B_ALIGN_LEFT),index++); + + SetColumnFlags((column_flags)(B_ALLOW_COLUMN_REMOVE|B_ALLOW_COLUMN_RESIZE|B_ALLOW_COLUMN_POPUP|B_ALLOW_COLUMN_MOVE)); + SetSelectionMode(B_MULTIPLE_SELECTION_LIST); + SetSortingEnabled(true); + SetSortColumn(date,false,false); + + AddStatusView(fStatusView=new StatusView(BRect(0,0,100,B_H_SCROLL_BAR_HEIGHT-1))); + + SetColor(B_COLOR_BACKGROUND,White); + + SetColor(B_COLOR_SELECTION, ui_color(B_MENU_SELECTION_BACKGROUND_COLOR)); + + //FIX make sense? + #ifdef ZETA + SetColor(B_COLOR_SELECTION_TEXT,ui_color(B_MENU_SELECTED_ITEM_TEXT_COLOR)); + #else + SetColor(B_COLOR_SELECTION_TEXT,White); + #endif + +} + +void +EpisodeListView::SelectionChanged(){ + uint32 buttons = 0; + + BMessage *msg = Window()->CurrentMessage(); + + if(msg) //don't remove. + msg->FindInt32("buttons", (int32 *)&buttons) ; + + if(SelectionMessage()) + SelectionMessage()->ReplaceInt32("buttons",buttons); + +// EpisodeListItem* sel = (EpisodeListItem*)CurrentSelection(); + +// SelectionMessage()->RemoveName("entry_ref"); +// SelectionMessage()->AddRef("entry_ref",&sel->fRef); + + BColumnListView::SelectionChanged(); +} + + +void +EpisodeListView::AddRow(BRow* row, BRow *parent){ + BColumnListView::AddRow(row,parent); + UpdateCount(); +} +void +EpisodeListView::RemoveRow(BRow* row){ + BColumnListView::RemoveRow(row); + UpdateCount(); +} +void +EpisodeListView::AddRow(BRow* row, int32 index, BRow *parent){ + BColumnListView::AddRow(row,index,parent); + UpdateCount(); +} + +void +EpisodeListView::UpdateCount(){ + fStatusView->SetCount(CountRows()); +} + + +//-- diff --git a/sources-experimental/EpisodeListView.h b/sources-experimental/EpisodeListView.h new file mode 100644 index 0000000..8f94b70 --- /dev/null +++ b/sources-experimental/EpisodeListView.h @@ -0,0 +1,27 @@ +#ifndef _EpisodeListView_H_ +#define _EpisodeListView_H_ + +#include "ColumnListView.h" +#include "FileStatusColumn.h" +#include + +class StatusView; + +class EpisodeListView : public BColumnListView { + + public: + EpisodeListView(BRect r); + + void SelectionChanged(); + void AddRow(BRow*, BRow *parent = 0); + void AddRow(BRow*, int32 index, BRow *parent = 0); + void RemoveRow(BRow*); + + private: + void UpdateCount(); + StatusView* fStatusView; +}; + +#endif + +//. diff --git a/sources-experimental/Extractor.cpp b/sources-experimental/Extractor.cpp new file mode 100644 index 0000000..e3dd032 --- /dev/null +++ b/sources-experimental/Extractor.cpp @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#include "Extractor.h" +#include + +void +Extractor::SetNotifier(Notifier* list) +{ + fNotifier = list; +} + +void +Extractor::NotifyNotifier(ItemProperty key,void* data,ssize_t size){ + fNotifier->SetKey(key,data,size); +} + +void +Extractor::NotifyString(ItemProperty key,const char* data){ + fNotifier->SetKeyString(key,data); +} + +void +Extractor::NotifyInt32(ItemProperty key,int32 data){ + fNotifier->SetKeyInt32(key,data); +} + diff --git a/sources-experimental/Extractor.h b/sources-experimental/Extractor.h new file mode 100644 index 0000000..4363dd3 --- /dev/null +++ b/sources-experimental/Extractor.h @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#ifndef Extractor_H_ +#define Extractor_H_ + +#include "Notifier.h" +#include "ItemProperty.h" + + + +class Extractor +{ + +public: + + void SetNotifier(Notifier*); + + + protected: + + Notifier* fNotifier; + void NotifyNotifier(ItemProperty key,void* data,ssize_t); + void NotifyString(ItemProperty key,const char* data); + void NotifyInt32(ItemProperty key,int32 data); + +}; +#endif diff --git a/sources-experimental/FileStatus.h b/sources-experimental/FileStatus.h new file mode 100644 index 0000000..2b35583 --- /dev/null +++ b/sources-experimental/FileStatus.h @@ -0,0 +1,23 @@ +#ifndef FileStatus_H_ +#define FileStatus_H_ + +enum FileStatus { + // IMPORTANTE + // aggiungere nuovi stati in fondo a meno che non + // sapete esattamente che pasticcio riskiate di fare! + + ERROR = -1, + NOT_DOWNLOADED, // persistent. + ENQUEQUED, + DOWNLOADING, + DOWNLOADED, //persistent. + STOPPED, //should be persistent. + NOT_FOUND, + CANT_CONNECT, + CONNECTING, //no really a status.. + NEW, //I hate this! :) *8* + BAD_FORMAT, //if channel is not a valid rss file. + NO_ENCLOSURE //simple *10* + +}; +#endif diff --git a/sources-experimental/FileStatusColumn.cpp b/sources-experimental/FileStatusColumn.cpp new file mode 100644 index 0000000..45f6ddc --- /dev/null +++ b/sources-experimental/FileStatusColumn.cpp @@ -0,0 +1,318 @@ + +#include "FileStatusColumn.h" +#include "BPLocale.h" + +#include "Utils.h" +#include "stdio.h" + +#define kTEXT_MARGIN 8 +#define kSPACE_TEXT 0 + + +const int64 kKB_SIZE = 1024; +const int64 kMB_SIZE = 1048576; +const int64 kGB_SIZE = 1073741824; +const int64 kTB_SIZE = kGB_SIZE * kKB_SIZE; + + static BBitmap* fBar1 = NULL; + static BBitmap* fBar2 = NULL; + static BBitmap* fBack = NULL; + +//===================================================================== + +FileStatusField::FileStatusField(FileStatus status) + :fWidth(0), + fString(""), + fClippedString("") +{ + SetFileStatus(status); + SetFilePercentage(0); + SwapBitmap(); +} + +void FileStatusField::SetFileStatus(FileStatus status) +{ + + + if(status!=fStatus) + { + + fWidth = 0; + fClippedString.SetTo(""); + fStatus=status; + SwapBitmap(); + + + switch(fStatus){ + case NO_ENCLOSURE: + fOriginalStatus.SetTo(" "); + break; + case NEW: + fOriginalStatus.SetTo(_T("new")); + break; + case NOT_DOWNLOADED: + fOriginalStatus.SetTo(_TT("not down")); + break; + case DOWNLOADED: + fOriginalStatus.SetTo(_T("downloaded")); + break; + case ERROR: + fOriginalStatus.SetTo(_T("error")); + break; + case STOPPED: + fOriginalStatus.SetTo(_T("stopped")); + break; + case NOT_FOUND: + fOriginalStatus.SetTo(_T("not found")); + break; + case CANT_CONNECT: + fOriginalStatus.SetTo(_T("can't connect")); + break; + case DOWNLOADING: + fOriginalStatus.SetTo(_T("downloading")); + break; + case ENQUEQUED: + fOriginalStatus.SetTo(_T("enquequed")); + break; + case CONNECTING: + fOriginalStatus.SetTo(_T("connecting")); + break; + default: + fOriginalStatus.SetTo(_T("error")); + break; + } + fString=fOriginalStatus; + if(fStatus==STOPPED){ + //pervert game + int perv=fPercentage; + SetFilePercentage(0); + SetFilePercentage(perv); + } + } + +} + +void +FileStatusField::SetFilePercentage(int per,float speed) +{ + if(fPercentage==per) return; + + fWidth = 0; + SwapBitmap(); + fClippedString.SetTo(""); + fPercentage=per; + + if(fStatus == STOPPED || + fStatus == DOWNLOADING ) + { + BString sp; + sp << per << "% " ; + + if(speed>0 && fStatus == DOWNLOADING ) + { + + float size=speed; + char str[256]; + if (size < kKB_SIZE) + { + sprintf(str, "%Ld b/s", size); + } + else + { + const char* suffix; + float float_value; + if (size >= kTB_SIZE) + { + suffix = "TB/s"; + float_value = (float)size / kTB_SIZE; + } + else if (size >= kGB_SIZE) + { + suffix = "GB/s"; + float_value = (float)size / kGB_SIZE; + } + else if (size >= kMB_SIZE) + { + suffix = "MB/s"; + float_value = (float)size / kMB_SIZE; + } + else + { + suffix = "k/s"; + float_value = (float)size / kKB_SIZE; + } + + sprintf(str, "%.2f %s", float_value, suffix); + // strip off an insignificant zero so we don't get readings + // such as 1.00 + char *period = 0; + char *tmp (NULL); + for (tmp = str; *tmp; tmp++) + { + if (*tmp == '.') + period = tmp; + } + if (period && period[1] && period[2] == '0') + // move the rest of the string over the insignificant zero + for (tmp = &period[2]; *tmp; tmp++) + *tmp = tmp[1]; + + + sp << str << " "; //speed; + } + sp << fOriginalStatus; + fString = sp; + } + } +} + +void +FileStatusField::SwapBitmap(){ + + if(fBar==fBar1) fBar=fBar2; + else fBar=fBar1; + +} + +//-------------------------------------------------------------------- + +void FileStatusField::SetString(const char* val) +{ + fString = val; + fClippedString = ""; + fWidth = 0; +} + + +//-------------------------------------------------------------------- + +const char* FileStatusField::String() const +{ + return fString.String(); +} + + +//-------------------------------------------------------------------- + +void FileStatusField::SetWidth(float width) +{ + fWidth = width; +} + +//-------------------------------------------------------------------- + +float FileStatusField::Width() +{ + return fWidth; +} + + +//-------------------------------------------------------------------- + +void FileStatusField::SetClippedString(const char* val) +{ + fClippedString = val; +} + + +//-------------------------------------------------------------------- + +const char* FileStatusField::ClippedString() +{ + return fClippedString.String(); +} + + +//===================================================================== + +FileStatusColumn::FileStatusColumn(const char* title, float width, float minWidth, + float maxWidth, uint32 truncate, alignment align) + :BTitledColumn(title, width, minWidth, maxWidth, align), + fTruncate(truncate) +{ + if(fBar1 ==NULL) fBar1=LoadIcon("fullbar1.png"); + if(fBar2==NULL) fBar2=LoadIcon("fullbar2.png"); + if(fBack==NULL) fBack=LoadIcon("graybar.png"); +} + + +//-------------------------------------------------------------------- + +void FileStatusColumn::DrawField(BField* _field, BRect rect, BView* parent) +{ + + FileStatusField* field = static_cast(_field); + + float width = rect.Width() - (2 * kTEXT_MARGIN); + float basePoint = 0; + + if(field->GetFileStatus() == STOPPED || + field->GetFileStatus() == DOWNLOADING ) + { + basePoint = 100 + kSPACE_TEXT; + } + + if (width - basePoint != field->Width()) + { + BString out_string(field->String()); + + parent->TruncateString(&out_string, fTruncate, width + 2 - basePoint); + field->SetClippedString(out_string.String()); + field->SetWidth(width - basePoint); + } + + if(basePoint>0){ + + DrawBar(parent,rect,field->GetPercentage(),field->Bar()); + } + rect.left +=basePoint; + DrawString(field->ClippedString(), parent, rect); +} + + + +void +FileStatusColumn::DrawBar(BView* parent,BRect rect,int number,BBitmap* fBar) +{ + + + parent->PushState(); + parent->SetDrawingMode( B_OP_ALPHA ); + parent->SetBlendingMode( B_PIXEL_ALPHA, B_ALPHA_OVERLAY); + + BRect graphRect(rect); + graphRect.right = graphRect.left+99; + graphRect.top +=2; + graphRect.bottom = graphRect.top + 11; + + parent->DrawBitmap(fBack,graphRect); //BPoint(rect.right,rect.top)); + + + BRect sourceRect(fBar->Bounds()); + sourceRect.right = sourceRect.left + number; + + BRect destRect(graphRect); + destRect.right = destRect.left + number; + parent->DrawBitmap(fBar,sourceRect,destRect); //sourceRect,destRect); + + parent->PopState(); + +} + + +//-------------------------------------------------------------------- + +int FileStatusColumn::CompareFields(BField* field1, BField* field2) +{ + return(ICompare(((FileStatusField*)field1)->String(), + (((FileStatusField*)field2)->String()))); +} + + +//-------------------------------------------------------------------- + +bool FileStatusColumn::AcceptsField(const BField *field) const +{ + return static_cast(dynamic_cast(field)); +} + diff --git a/sources-experimental/FileStatusColumn.h b/sources-experimental/FileStatusColumn.h new file mode 100644 index 0000000..3717d66 --- /dev/null +++ b/sources-experimental/FileStatusColumn.h @@ -0,0 +1,77 @@ +#ifndef _FileStatusColumn_H +#define _FileStatusColumn_H + +#include "ColumnListView.h" +#include "ColumnTypes.h" +#include +#include +#include +#include "FileStatus.h" + + +//===================================================================== +// Field and column classes a FileStatus. + +class FileStatusField : public BField +{ + public: + FileStatusField (FileStatus status); + + void SetFileStatus(FileStatus file); + void SetFilePercentage(int per,float speed = 0); + + void SetString (const char* string); + const char* String () const; + void SetClippedString (const char* string); + const char* ClippedString (); + void SetWidth (float); + float Width (); + FileStatus GetFileStatus(){ return fStatus;} + int GetPercentage(){return fPercentage;} + //bool HasChanged() { return fChanged; } + //void SetChanged(bool val) { fChanged = val;} + BBitmap* Bar(){ return fBar; } + private: + + void SwapBitmap(); + + float fWidth; + BString fString; + BString fClippedString; + BString fOriginalStatus; + FileStatus fStatus; + int fPercentage; + BBitmap *fBar; + +}; + +class FileStatusColumn : public BTitledColumn +{ + public: + FileStatusColumn (const char *title, + float width, + float minWidth, + float maxWidth, + uint32 truncate, + alignment align = B_ALIGN_LEFT); + virtual void DrawField (BField* field, + BRect rect, + BView* parent); + virtual int CompareFields (BField* field1, + BField* field2); + virtual bool AcceptsField (const BField* field) const; + + + //void SwapBitmap(); + + + + + private: + void DrawBar(BView* parent,BRect rect,int perc,BBitmap* fBar); + uint32 fTruncate; + //BBitmap* fBar; + +}; + +#endif diff --git a/sources-experimental/GreenBoxTextRender.cpp b/sources-experimental/GreenBoxTextRender.cpp new file mode 100644 index 0000000..74d4f1a --- /dev/null +++ b/sources-experimental/GreenBoxTextRender.cpp @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#include "GreenBoxTextRender.h" + + + + +GreenBoxTextRender::GreenBoxTextRender(){ + fFont = *be_fixed_font; + fBackColor = greyBox; +}; + +GreenBoxTextRender::GreenBoxTextRender(BFont font,const rgb_color color){ + fFont = font; + fBackColor = color; +}; + +GreenBoxTextRender::~GreenBoxTextRender(){ +} + +void +GreenBoxTextRender::Render(BView *target,const char* txt,int16 num,BPoint pos,BRect rect){ + target->SetFont(&fFont); + target->DrawString(txt,num,pos); + +} + +void +GreenBoxTextRender::GetHeight(font_height *height){ + fFont.GetHeight(height); + height->ascent += 2; + height->descent +=2; +} + +void +GreenBoxTextRender::GetEscapements(const char charArray[], int32 numChars,float escapementArray[]){ + fFont.GetEscapements(charArray,numChars,escapementArray); +} + +float +GreenBoxTextRender::Size(float maxwidth){ + return fFont.Size(); +} + + + void + GreenBoxTextRender::MarginAfterTheText(BView *target,rgb_color view_color, BRect rect){ + // Margin after fText + target->SetDrawingMode (B_OP_COPY); + //rect.right -=5; + target->SetLowColor (fBackColor); + target->FillRect (rect, B_SOLID_LOW); + } diff --git a/sources-experimental/GreenBoxTextRender.h b/sources-experimental/GreenBoxTextRender.h new file mode 100644 index 0000000..0dfb021 --- /dev/null +++ b/sources-experimental/GreenBoxTextRender.h @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + + +#ifndef _GreenBoxTextRender_H_ +#define _GreenBoxTextRender_H_ + +#include +#include +#include "TextRender.h" + +const rgb_color greyBox = {255,234,130,255}; //200,203,235 255,234,130 185,185,185 233,233,223 + +class GreenBoxTextRender : public TextRender +{ + public: + GreenBoxTextRender(); + GreenBoxTextRender(BFont font,const rgb_color color); + virtual ~GreenBoxTextRender(); + + void Render(BView *target,const char*,int16 num,BPoint pos,BRect rect); + void GetHeight(font_height *height); + void GetEscapements(const char charArray[], int32 numChars,float escapementArray[]); + float Size(float maxwidth); + // + void MarginAfterTheText(BView *target,rgb_color view_color, BRect rect); + + + private: + BFont fFont; + rgb_color fBackColor; +}; +#endif diff --git a/sources-experimental/GroupItem.cpp b/sources-experimental/GroupItem.cpp new file mode 100644 index 0000000..f6cda03 --- /dev/null +++ b/sources-experimental/GroupItem.cpp @@ -0,0 +1,24 @@ +#include "GroupItem.h" +#include "SubscriptionColumn.h" + +#define ALTEZZA_SMALL 16 + +GroupItem::GroupItem(const char* label, GroupItem* parentGroup):BRow(ALTEZZA_SMALL) { + SetField( new PositionableField(label), 0 ); + f_Parent = parentGroup; +} + +BString +GroupItem::GroupName(){ + return ((PositionableField*)GetField(0))->String(); +} + +void +GroupItem::SetGroupName(BString name){ + ((PositionableField*)GetField(0))->SetString(name.String()); +} + +GroupItem* +GroupItem::GetParentItem(){ + return f_Parent; +} diff --git a/sources-experimental/GroupItem.h b/sources-experimental/GroupItem.h new file mode 100644 index 0000000..c04baca --- /dev/null +++ b/sources-experimental/GroupItem.h @@ -0,0 +1,23 @@ +#ifndef _GroupItem_H_ +#define _GroupItem_H_ + +#include "ColumnListView.h" +#include "ColumnTypes.h" + + +class GroupItem : public BRow { + + public: + GroupItem(const char* label, GroupItem* parentGroup); + + BString GroupName(); + void SetGroupName(BString); + + GroupItem* GetParentItem(); + + private: + + GroupItem* f_Parent; +}; + +#endif diff --git a/sources-experimental/HelpTextView.h b/sources-experimental/HelpTextView.h new file mode 100644 index 0000000..8853ccf --- /dev/null +++ b/sources-experimental/HelpTextView.h @@ -0,0 +1,58 @@ +#include +#include +//#include "HelpView.h" + + +class HelpTextView : public BView +{ + public: + HelpTextView(BRect frame, char *name, BString testo, BPoint posizione, int grandezza_font, BFont tipo); + virtual void AttachedToWindow(); + virtual void Draw(BRect updateRect); + BString fText; + BPoint point; + BFont font; + int size; + + + + + + + + + +}; + +HelpTextView::HelpTextView(BRect rect, char *name, BString testo, BPoint posizione,int grandezza_font, BFont tipo) + : BView(rect, name, B_FOLLOW_ALL, B_WILL_DRAW) +{ +fText=testo; +point=posizione; +size=grandezza_font; +font=tipo; + + + SetViewColor(159,181,202); + +} + +void HelpTextView::AttachedToWindow() +{ + + SetFont(&font, B_FONT_FAMILY_AND_STYLE); + SetFontSize(size); +} + + +void HelpTextView::Draw(BRect updateRect) +{ + MovePenTo(BPoint(point)); + SetHighColor(0,0,0); + SetLowColor(159,181,202); + + + DrawString(fText.String()); + +} + diff --git a/sources-experimental/HelpWindow.cpp b/sources-experimental/HelpWindow.cpp new file mode 100644 index 0000000..da11340 --- /dev/null +++ b/sources-experimental/HelpWindow.cpp @@ -0,0 +1,168 @@ +#include "HelpWindow.h" + + +#include +#include +#include + +#include +#include +#include "BPLocale.h" +#include + +#include "libfish/HelpViewer.h" +#include "Utils.h" + + + + + +HelpWindow::HelpWindow() : + BWindow(BRect(300,100,780,475),_T("Getting Started"), B_TITLED_WINDOW,B_NOT_RESIZABLE| B_NOT_ZOOMABLE|B_ASYNCHRONOUS_CONTROLS|B_WILL_DRAW){ + + BRect rect(Bounds()); + rect.bottom *= 0.87; + + AddChild(hv=new HelpViewer(rect)); + + rect.top = rect.bottom+1; + rect.bottom = Bounds().bottom; + BBox *box; + AddChild(box=new BBox(rect,"")); + + BFont font(be_plain_font); + + + BRect arect; + arect = box->Bounds(); + arect.InsetBy(33, 20); + arect.top = arect.bottom - 17; + arect.left = arect.right - font.StringWidth(_T("Next")) - 35; //anche qui va il _T() altrimenti considera sempre la dimensione di Next e non della stringa tradotta + next = new BButton(arect, "", _T("Next"), new BMessage('next')); + next->SetFont(&font); + box->AddChild(next); + + arect.right = arect.left - 17; + arect.left = arect.right - font.StringWidth(_T("Prev")) - 35; + back= new BButton(arect, "", _T("Prev"), new BMessage('prev')); + back->SetFont(&font); + box->AddChild(back); + + arect = box->Bounds(); + arect.InsetBy(33, 20); + arect.top = arect.bottom - 17; + arect.right = arect.left + font.StringWidth(_T("Index")) + 35; + BButton *index= new BButton(arect, "", _T("Index"), new BMessage('inde')); + box->AddChild(index); + + + rgb_color black = {0,0,0,255}; + rgb_color white = {255,255,255,255}; + hv->SetForeColor(black) ; + hv->SetBackColor(white); + + + BString where(GetAppRelativePath()); + #ifdef ZETA + where << "/help.xml"; + #else + where << "/helpR5.xml"; + #endif + hv->LoadFile(where.String()); + hv->SetGotoHandler(this); + hv->SetOpenUrlHandler(be_app); + + Selected = -1; + SetPage(0); + +} + + +void +HelpWindow::SetPage(BString id){ + if(Lock()){ + hv->SearchSetPage(id); + Unlock(); + } +} + +void +HelpWindow::SetPage(int newindex){ + + if(Selected == newindex) return; + if(newindex >= hv->CountPage()) return; + + Selected = newindex; + hv->SetPage(Selected); + + next->SetEnabled(true); + back->SetEnabled(true); + + if(Selected == hv->CountPage() - 1) + { + + next->SetEnabled(false); + } + + if(Selected == 0) + { + back->SetEnabled(false); + } + +} + +/* +bool +HelpWindow::QuitRequested() +{ + be_app->PostMessage(B_QUIT_REQUESTED); + return true; +} +*/ +void +HelpWindow::MessageReceived(BMessage* message) +{ + switch(message->what) + { + case 'inde': + SetPage(BString("index")); + break; + case 'next': + SetPage(Selected+1); + break; + case 'prev': + SetPage(Selected-1); + break; + case HELPVIEWER_GOTO: + { + + int32 newindex; + if(message->FindInt32("selected",&newindex)==B_OK){ + + if(Selected == newindex) return; + if(newindex >= hv->CountPage()) return; + Selected = newindex; + + + next->SetEnabled(true); + back->SetEnabled(true); + if(Selected == hv->CountPage() - 1) + { + next->SetEnabled(false); + } + if(Selected == 0) + { + back->SetEnabled(false); + } + } + + } + break; + default: + BWindow::MessageReceived(message); + break; + + } +} + +//. diff --git a/sources-experimental/HelpWindow.h b/sources-experimental/HelpWindow.h new file mode 100644 index 0000000..b33df32 --- /dev/null +++ b/sources-experimental/HelpWindow.h @@ -0,0 +1,31 @@ +#ifndef HelpWindow_H +#define HelpWindow_H + +#include + +class HelpViewer; +class BButton; + +class HelpWindow: public BWindow +{ + + + + public: + HelpWindow(); + void MessageReceived(BMessage* message); + void SetPage(BString id); + + + private: + + int Selected; + void SetPage(int i); + HelpViewer* hv; + BButton *back; + BButton *next; +}; + +#endif + +//sas diff --git a/sources-experimental/IABPChannel.cpp b/sources-experimental/IABPChannel.cpp new file mode 100644 index 0000000..3772b74 --- /dev/null +++ b/sources-experimental/IABPChannel.cpp @@ -0,0 +1,294 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +//actions for channels + +//#include "SubscriptionListItem.h" +#include "IABPChannel.h" +#include "MainWindow.h" +#include "MainController.h" +#include +#include "ChannelSettingsWindow.h" + +//extern BMessage podder_settings; + +#define LOCKWINDOW if(fView->Lock()){ +#define UNLOCKWINDOWERROR { fView->Unlock(); return B_ERROR; } +#define UNLOCKWINDOW fView->Unlock();} + +//------------------------------------------------------------------------------------------------------------------- + + +IABPChannelAddRequest::IABPChannelAddRequest(MainController* controller, MainWindow* view ):IActionBP(controller,view){ + + SetIcon(IAction::SIZE_16,LoadIcon("emblem-add.png")); + SetIcon(IAction::SIZE_48,LoadIcon("add-channel-file.png")); + SetIcon(IAction::SIZE_48_PRESSED,LoadIcon("add-channel-file-down.png")); + + SetLabel(_T("Add Channel")); + +} + +BString +IABPChannelAddRequest::GetDescription(){ + return _T("Add the podcast to the Subscriptions list"); +} + + +status_t +IABPChannelAddRequest::Perform(BMessage*){ + AddWindow *url = new AddWindow(); + url->Show(); + return B_OK; +} + +char +IABPChannelAddRequest::Shortcut(uint32 *modifiers) const { + if(modifiers) + *modifiers = B_COMMAND_KEY | B_SHIFT_KEY; + return 'A'; +} + +//------------------------------------------------------------------------------------------------------------------- + +IABPChannelRemove::IABPChannelRemove(MainController* controller ,MainWindow* view):IActionBP(controller,view){ + + SetIcon(IAction::SIZE_16,LoadIcon("delete-micro.png")); + SetIcon(IAction::SIZE_48,LoadIcon("delete-channel-file.png")); + SetIcon(IAction::SIZE_48_PRESSED,LoadIcon("delete-channel-file-down.png")); + + SetLabel(_T("Remove Channel")); + +} + +BString +IABPChannelRemove::GetDescription(){ + return _T("Delete the podcast from the Subscriptions list"); +} + + +status_t +IABPChannelRemove::Perform(BMessage*){ + + + + SubscriptionListItem* row=fView->GetSelectedSubscription(); + if(!row) return B_ERROR; + + + //TODO: studiare la disposizione dei pulsanti! + + BString text; + + text << _TT("alert2a"); + text << row->GetTitle(); + text << _TT("alert2b"); + + BPAlert* remove = new BPAlert("Remove a Channel", text.String(),_T("Delete"),_T("Archive"),_T("Cancel"),B_WIDTH_AS_USUAL,LoadIcon("delete-channel-file.png")); + int32 result=remove->Go(); + + LOCKWINDOW + if(result==1) + fController->ArchiveChannel(row->fRef); + else + if(result==0){ + BPAlert* wait = new BPAlert("Remove a Channel", "\nRemoving..",NULL,NULL,NULL,B_WIDTH_AS_USUAL,LoadIcon("delete-channel-file.png")); + fView->UpdateIfNeeded(); + wait->Go(NULL); + + status_t result = fController->DeleteChannel(row->fRef); + + wait->PostMessage(B_QUIT_REQUESTED); + + if(result !=B_OK){ + wait = new BPAlert("Remove a Channel", "\nAn error occured while removing!",_T("Ok"),NULL,NULL,B_WIDTH_AS_USUAL,LoadIcon("delete-channel-file.png")); + + wait->Go(); + } + + + } + UNLOCKWINDOW + + return B_OK; +} + +char +IABPChannelRemove::Shortcut(uint32 *modifiers) const { + if(modifiers) + *modifiers = B_COMMAND_KEY | B_SHIFT_KEY; + return 'R'; +} + +//------------------------------------------------------------------------------------------------------------------- + +IABPChannelCheck::IABPChannelCheck(MainController* controller,MainWindow* view):IActionBP(controller,view){ + + SetIcon(IAction::SIZE_16,LoadIcon("refresh-micro.png")); + SetIcon(IAction::SIZE_48,LoadIcon("refresh-channel-file.png")); + SetIcon(IAction::SIZE_48_PRESSED,LoadIcon("refresh-channel-file-down.png")); + + SetLabel(_T("Check Channel")); + +} + +BString +IABPChannelCheck::GetDescription(){ + return _T("Check the selected podcast for new items"); +} + + +status_t +IABPChannelCheck::Perform(BMessage*){ + LOCKWINDOW + SubscriptionListItem* row=fView->GetSelectedSubscription(); + if(!row) UNLOCKWINDOWERROR + + fController->CheckChannel(row->fRef); + UNLOCKWINDOW + return B_OK; +} + +char +IABPChannelCheck::Shortcut(uint32 *modifiers) const { + if(modifiers) + *modifiers = B_COMMAND_KEY | B_SHIFT_KEY; + return 'C'; +} + +//------------------------------------------------------------------------------------------------------------------- + +IABPChannelWWW::IABPChannelWWW(MainController* controller,MainWindow* view):IActionBP(controller,view){ + + SetIcon(IAction::SIZE_16,LoadIcon("www-micro.png")); + SetIcon(IAction::SIZE_48,LoadIcon("www-channel-file.png")); + SetIcon(IAction::SIZE_48_PRESSED,LoadIcon("www-channel-file-down.png")); + + SetLabel(_T("Open Homepage")); + +} + +BString +IABPChannelWWW::GetDescription(){ + return _T("Show the podcast homepage"); +} + + +status_t +IABPChannelWWW::Perform(BMessage*){ + + SubscriptionListItem* row=fView->GetSelectedSubscription(); + if(!row || row->GetWeblink()=="" ) return B_ERROR; + + fController->OpenURL(row->GetWeblink()); + return B_OK; +} + +char +IABPChannelWWW::Shortcut(uint32 *modifiers) const { + if(modifiers) + *modifiers = B_COMMAND_KEY | B_SHIFT_KEY; + return 'H'; +} + +//------------------------------------------------------------------------------------------------------------------- + + +IABPChannelEnclosureFolder::IABPChannelEnclosureFolder(MainController* controller,MainWindow* view):IActionBP(controller,view){ + SetIcon(IAction::SIZE_16,LoadIcon("folder")); + + SetLabel(_T("Open Enclosures folder")); + +} + +BString +IABPChannelEnclosureFolder::GetDescription(){ + return _T("Open Enclosures folder"); +} + + +status_t +IABPChannelEnclosureFolder::Perform(BMessage*){ + LOCKWINDOW + SubscriptionListItem* row=fView->GetSelectedSubscription(); + if(row) + fController->FolderSelectedChannel(row->fRef); + UNLOCKWINDOW + return B_OK; +} + +char +IABPChannelEnclosureFolder::Shortcut(uint32 *modifiers) const { + if(modifiers) + *modifiers = B_COMMAND_KEY ; + return 'O'; +} + + +//------------------------------------------------------------------------------------------------------------------- + +IABPChannelCheckAll::IABPChannelCheckAll(MainController* controller,MainWindow* view):IActionBP(controller,view){ + + SetIcon(IAction::SIZE_16,LoadIcon("refresh-mini-all.png")); + //SetIcon(IAction::SIZE_48,LoadIcon("refresh-channel-file.png")); + //SetIcon(IAction::SIZE_48_PRESSED,LoadIcon("refresh-channel-file-down.png")); + + SetLabel(_T("Check All Channels")); + +} + +BString +IABPChannelCheckAll::GetDescription(){ + return _T("Check all the podcasts for new items"); +} + + +status_t +IABPChannelCheckAll::Perform(BMessage*){ + fView->PostMessage(CHECK_ALL); + return B_OK; +} + +char +IABPChannelCheckAll::Shortcut(uint32 *modifiers) const { + if(modifiers) + *modifiers = B_COMMAND_KEY | B_SHIFT_KEY; + return 'N'; +} + +//------------------------------------------------------------------------------------------------------------------- + +IABPChannelShowImage::IABPChannelShowImage(MainController* controller,MainWindow* view):IActionBP(controller,view){ + SetIcon(IAction::SIZE_16,LoadIcon("image")); + //SetIcon(IAction::SIZE_48,LoadIcon("refresh-channel-file.png")); + //SetIcon(IAction::SIZE_48_PRESSED,LoadIcon("refresh-channel-file-down.png")); + SetLabel(_T("Show Channel Image")); +} + +BString +IABPChannelShowImage::GetDescription(){ + return _T("Show Channel Image"); +} + + +status_t +IABPChannelShowImage::Perform(BMessage*){ + LOCKWINDOW + SubscriptionListItem* row=fView->GetSelectedSubscription(); + if(row) + fController->ShowChannelImage(row->fRef); + //if(!row->extraSetting) row->extraSetting=new BMessage(); + //ChannelSettingsWindow* csw=new ChannelSettingsWindow(row->extraSetting,fView); + //csw->Show(); + + UNLOCKWINDOW + return B_OK; +} + +char +IABPChannelShowImage::Shortcut(uint32 *modifiers) const { + return 0; +} diff --git a/sources-experimental/IABPChannel.h b/sources-experimental/IABPChannel.h new file mode 100644 index 0000000..fa251cc --- /dev/null +++ b/sources-experimental/IABPChannel.h @@ -0,0 +1,128 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#ifndef _IABPChannel_h_ +#define _IABPChannel_h_ + +#include "IActionBP.h" +#include "Utils.h" +#include "AddWindow.h" + +#include "BPLocale.h" + +//request for the AddWindow + +//------------------------------------------------------------------------------------------------------------------- +class IABPChannelAddRequest : public IActionBP +{ + public: + + IABPChannelAddRequest(MainController* controller = NULL,MainWindow* view = NULL); + + BString GetDescription(); + + status_t Perform(BMessage*); + + char Shortcut(uint32 *modifiers = NULL) const; + +}; + +//------------------------------------------------------------------------------------------------------------------- +class IABPChannelRemove : public IActionBP +{ + public: + + IABPChannelRemove(MainController* controller = NULL,MainWindow* view = NULL); + + BString GetDescription(); + + status_t Perform(BMessage*); + + char Shortcut(uint32 *modifiers = NULL) const; +}; + +//------------------------------------------------------------------------------------------------------------------- +class IABPChannelCheck : public IActionBP +{ + public: + + IABPChannelCheck(MainController* controller = NULL,MainWindow* view = NULL); + + BString GetDescription(); + + status_t Perform(BMessage*); + + char Shortcut(uint32 *modifiers = NULL) const; + +}; + +//------------------------------------------------------------------------------------------------------------------- + +class IABPChannelWWW: public IActionBP +{ + public: + + IABPChannelWWW(MainController* controller = NULL,MainWindow* view = NULL); + + BString GetDescription(); + + status_t Perform(BMessage*); + + char Shortcut(uint32 *modifiers = NULL) const; + +}; + +//------------------------------------------------------------------------------------------------------------------- + +class IABPChannelEnclosureFolder: public IActionBP +{ + public: + + IABPChannelEnclosureFolder(MainController* controller = NULL,MainWindow* view = NULL); + + BString GetDescription(); + + status_t Perform(BMessage*); + + char Shortcut(uint32 *modifiers = NULL) const; + +}; + +//------------------------------------------------------------------------------------------------------------------- + +class IABPChannelCheckAll: public IActionBP +{ + public: + + IABPChannelCheckAll(MainController* controller = NULL,MainWindow* view = NULL); + + BString GetDescription(); + + status_t Perform(BMessage*); + + char Shortcut(uint32 *modifiers = NULL) const; + +}; + +//------------------------------------------------------------------------------------------------------------------- + +class IABPChannelShowImage: public IActionBP +{ + public: + + IABPChannelShowImage(MainController* controller = NULL,MainWindow* view = NULL); + + BString GetDescription(); + + status_t Perform(BMessage*); + + char Shortcut(uint32 *modifiers = NULL) const; + +}; + + + +#endif diff --git a/sources-experimental/IABPDownload.cpp b/sources-experimental/IABPDownload.cpp new file mode 100644 index 0000000..4d2db53 --- /dev/null +++ b/sources-experimental/IABPDownload.cpp @@ -0,0 +1,202 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +//actions for items + +#include "IABPDownload.h" +#include "MainWindow.h" +#include "MainController.h" + +#define LOCKWINDOW if(fView->Lock()){ +#define UNLOCKWINDOWERROR { fView->Unlock(); return B_ERROR; } +#define UNLOCKWINDOW fView->Unlock();} + + +IABPDownloadRemove::IABPDownloadRemove(MainController* controller,MainWindow* view):IActionBP(controller,view){ + + SetIcon(IAction::SIZE_16,LoadIcon("emblem-remove.png")); + //SetIcon(IAction::SIZE_48,LoadIcon("emblem-delete.png")); + //SetIcon(IAction::SIZE_48_PRESSED,LoadIcon("emblem-delete-down.png")); + + SetLabel(_T("Remove from this list")); +} + +BString +IABPDownloadRemove::GetDescription(){ + return _T(""); +} + + +status_t +IABPDownloadRemove::Perform(BMessage*){ + + LOCKWINDOW + DownloadListItem* row=fView->GetSelectedDownload(); + if(row) + fController->RemoveDownload(row->fRef); + UNLOCKWINDOW + return B_OK; +} + +char +IABPDownloadRemove::Shortcut(uint32 *modifiers) const { + return 0; +} + +//------------------------------------------------------------------------------------------------------------------- + + +IABPDownloadStop::IABPDownloadStop(MainController* controller, MainWindow* view):IActionBP(controller,view){ + + SetIcon(IAction::SIZE_16,LoadIcon("stopped-micro.png")); + SetIcon(IAction::SIZE_48,LoadIcon("emblem-stop.png")); + SetIcon(IAction::SIZE_48_PRESSED,LoadIcon("emblem-stop-down.png")); + + SetLabel(_T("Stop download")); +} + +BString +IABPDownloadStop::GetDescription(){ + return _T("Stop the item download"); +} + + +status_t +IABPDownloadStop::Perform(BMessage*){ + + LOCKWINDOW + DownloadListItem* row=fView->GetSelectedDownload(); + if(row) + fController->StopDownloadItem(row->fRef); + UNLOCKWINDOW + + return B_OK; +} + +char +IABPDownloadStop::Shortcut(uint32 *modifiers) const { + /*if(modifiers) + *modifiers = B_COMMAND_KEY; + return 'S'; + */ + return 0; +} + +//------------------------------------------------------------------------------------------------------------------- + + +IABPDownloadDownload::IABPDownloadDownload(MainController* controller,MainWindow* view):IActionBP(controller,view){ + + SetIcon(IAction::SIZE_16,LoadIcon("download-micro.png")); + SetIcon(IAction::SIZE_48,LoadIcon("emblem-download.png")); + SetIcon(IAction::SIZE_48_PRESSED,LoadIcon("emblem-download-down.png")); + + SetLabel(_T("(Re)start download")); +} + +BString +IABPDownloadDownload::GetDescription(){ + return _T("Download the selected episode"); +} + + +status_t +IABPDownloadDownload::Perform(BMessage*){ + LOCKWINDOW + DownloadListItem* row=fView->GetSelectedDownload(); + if(row) + fController->DownloadItem(row->fRef); + UNLOCKWINDOW + return B_OK; +} + + +char +IABPDownloadDownload::Shortcut(uint32 *modifiers) const { + /*if(modifiers) + *modifiers = B_COMMAND_KEY; + return 'D';*/ + return (char)NULL; +} + + +//------------------------------------------------------------------------------------------------------------------- + + +IABPDownloadPlay::IABPDownloadPlay(MainController* controller,MainWindow* view):IActionBP(controller,view){ + + SetIcon(IAction::SIZE_16,LoadIcon("play-micro.png")); + SetIcon(IAction::SIZE_48,LoadIcon("emblem-play.png")); + SetIcon(IAction::SIZE_48_PRESSED,LoadIcon("emblem-play-down.png")); + + SetLabel(_T("Play enclosure")); +} + +BString +IABPDownloadPlay::GetDescription(){ + return _T("Play the selected episode"); +} + + +status_t +IABPDownloadPlay::Perform(BMessage*){ + LOCKWINDOW + DownloadListItem* row=fView->GetSelectedDownload(); + if(row) + fController->PlayItem(row->fRef); + UNLOCKWINDOW + + return B_OK; +} + +char +IABPDownloadPlay::Shortcut(uint32 *modifiers) const { + /*if(modifiers) + *modifiers = B_COMMAND_KEY; + return 'E'; + */ + + return (char)NULL; +} + + +//------------------------------------------------------------------------------------------------------------------- + +IABPDownloadFindItem::IABPDownloadFindItem(MainController* controller,MainWindow* view):IActionBP(controller,view){ + + SetIcon(IAction::SIZE_16,LoadIcon("emblem-jump.png")); + //SetIcon(IAction::SIZE_48,LoadIcon("www-channel-file.png")); + //SetIcon(IAction::SIZE_48_PRESSED,LoadIcon("www-channel-file-down.png")); + + SetLabel(_T("Find this Item")); + +} + +BString +IABPDownloadFindItem::GetDescription(){ + return _T(""); +} + + +status_t +IABPDownloadFindItem::Perform(BMessage*){ + LOCKWINDOW + DownloadListItem* row=fView->GetSelectedDownload(); + if(row) + fController->FindItem(row->fRef); + UNLOCKWINDOW + return B_OK; +} + + +char +IABPDownloadFindItem::Shortcut(uint32 *modifiers) const { + //if(modifiers) + // *modifiers = B_COMMAND_KEY; + return (char)NULL; +} + + diff --git a/sources-experimental/IABPDownload.h b/sources-experimental/IABPDownload.h new file mode 100644 index 0000000..cf16448 --- /dev/null +++ b/sources-experimental/IABPDownload.h @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#ifndef _IABPDownload_h_ +#define _IABPDownload_h_ + +#include "IActionBP.h" +#include "Utils.h" +#include "BPLocale.h" + + +//------------------------------------------------------------------------------------------------------------------- +class IABPDownloadRemove : public IActionBP +{ + public: + + IABPDownloadRemove(MainController* controller = NULL,MainWindow* view = NULL); + + BString GetDescription(); + + status_t Perform(BMessage*); + + char Shortcut(uint32 *modifiers = NULL) const; + +}; + +//------------------------------------------------------------------------------------------------------------------- +class IABPDownloadStop : public IActionBP +{ + public: + + IABPDownloadStop(MainController* controller = NULL,MainWindow* view = NULL); + + BString GetDescription(); + + status_t Perform(BMessage*); + + char Shortcut(uint32 *modifiers = NULL) const; + +}; + +//------------------------------------------------------------------------------------------------------------------- +class IABPDownloadDownload : public IActionBP +{ + public: + + IABPDownloadDownload(MainController* controller = NULL,MainWindow* view = NULL); + + BString GetDescription(); + + status_t Perform(BMessage*); + + char Shortcut(uint32 *modifiers = NULL) const; +}; + +//------------------------------------------------------------------------------------------------------------------- +class IABPDownloadPlay: public IActionBP +{ + public: + + IABPDownloadPlay(MainController* controller = NULL,MainWindow* view = NULL); + + BString GetDescription(); + + status_t Perform(BMessage*); + + char Shortcut(uint32 *modifiers = NULL) const; + +}; + +//------------------------------------------------------------------------------------------------------------------- + +class IABPDownloadFindItem: public IActionBP +{ + public: + + IABPDownloadFindItem(MainController* controller = NULL,MainWindow* view = NULL); + + BString GetDescription(); + + status_t Perform(BMessage*); + + char Shortcut(uint32 *modifiers = NULL) const; + +}; + +//------------------------------------------------------------------------------------------------------------------- +/* +class IABPDownloadEnclosureFolder: public IActionBP +{ + public: + + IABPDownloadEnclosureFolder(MainController* controller = NULL,MainWindow* view = NULL); + + BString GetDescription(); + + status_t Perform(BMessage*); + + char Shortcut(uint32 *modifiers = NULL) const; + +}; +*/ +#endif diff --git a/sources-experimental/IABPGroup.cpp b/sources-experimental/IABPGroup.cpp new file mode 100644 index 0000000..7a047b0 --- /dev/null +++ b/sources-experimental/IABPGroup.cpp @@ -0,0 +1,186 @@ +/* + * Copyright (C) 2007 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +//actions for groups + +#include "IABPGroup.h" +#include "MainWindow.h" +#include "MainController.h" +#include "TextControlFloater.h" + +#include + +#define LOCKWINDOW if(fView->Lock()){ +#define UNLOCKWINDOWERROR { fView->Unlock(); return B_ERROR; } +#define UNLOCKWINDOW fView->Unlock();} + + + +//------------------------------------------------------------------------------------------------------------------- + +IABPGroupCheck::IABPGroupCheck(MainController* controller,MainWindow* view):IActionBP(controller,view){ + + SetIcon(IAction::SIZE_16,LoadIcon("refresh-micro.png")); + //SetIcon(IAction::SIZE_48,LoadIcon("refresh-channel-file.png")); + //SetIcon(IAction::SIZE_48_PRESSED,LoadIcon("refresh-channel-file-down.png")); + + SetLabel(_T("Check Channels of Group")); + +} + +BString +IABPGroupCheck::GetDescription(){ + return _T("Check the podcasts of the selected group for new items"); +} + + +status_t +IABPGroupCheck::Perform(BMessage*){ + LOCKWINDOW + GroupItem* group=fView->GetSelectedGroup(); + if(!group) UNLOCKWINDOWERROR + int32 count = fView->CountSubscriptionOfGroup(group); + for(int i=0;iGetSubscriptionOfGroup(i,group); + if(row) + fController->CheckChannel(row->fRef); + } + UNLOCKWINDOW + return B_OK; +} + +char +IABPGroupCheck::Shortcut(uint32 *modifiers) const { + return 0; +// if(modifiers) +// *modifiers = B_COMMAND_KEY | B_SHIFT_KEY; +// return 'C'; +} + +//------------------------------------------------------------------------------------------------------------------- + +IABPGroupAdd::IABPGroupAdd(MainController* controller,MainWindow* view):IActionBP(controller,view){ + + SetIcon(IAction::SIZE_16,LoadIcon("emblem-add.png")); + SetLabel(_T("Add a Group")); + +} + +BString +IABPGroupAdd::GetDescription(){ + return _T("Add a new Group"); +} + + +status_t +IABPGroupAdd::Perform(BMessage*){ + LOCKWINDOW + fController->AddNewGroup(NULL); + UNLOCKWINDOW + return B_OK; +} + +char +IABPGroupAdd::Shortcut(uint32 *modifiers) const { + return 0; +} + + +//------------------------------------------------------------------------------------------------------------------- + +IABPGroupRename::IABPGroupRename(MainController* controller,MainWindow* view):IActionBP(controller,view){ + + SetIcon(IAction::SIZE_16,LoadIcon("emblem-add.png")); //fix this icon.. + SetLabel(_T("Rename a Group")); + +} + +BString +IABPGroupRename::GetDescription(){ + return _T("Rename the selected Group"); +} + + +status_t +IABPGroupRename::Perform(BMessage*){ + LOCKWINDOW + GroupItem* group=fView->GetSelectedGroup(); + if(!group) UNLOCKWINDOWERROR + BRect rect; + if(fView->GetScreenGroupRect(group,&rect)){ + BMessage *info=new BMessage(GROUP_NAME_CHANGE); + info->AddString("oldname",group->GroupName()); + new TextControlFloater(rect,B_ALIGN_LEFT,be_plain_font,group->GroupName().String(),BMessenger(fView),info); + } + UNLOCKWINDOW + return B_OK; +} + +char +IABPGroupRename::Shortcut(uint32 *modifiers) const { + return 0; +} + +//------------------------------------------------------------------------------------------------------------------- + + +IABPGroupRemove::IABPGroupRemove(MainController* controller,MainWindow* view):IActionBP(controller,view){ + + SetIcon(IAction::SIZE_16,LoadIcon("delete-micro.png")); + //SetIcon(IAction::SIZE_48,LoadIcon("emblem-delete.png")); + //SetIcon(IAction::SIZE_48_PRESSED,LoadIcon("emblem-delete-down.png")); + + SetLabel(_T("Remove a Group")); +} + +BString +IABPGroupRemove::GetDescription(){ + return _T("Remove a group and delete all the channels"); +} + + +status_t +IABPGroupRemove::Perform(BMessage*){ + + GroupItem* group=fView->GetSelectedGroup(); + if(!group) return B_ERROR; + + int32 count = fView->CountSubscriptionOfGroup(group); + + LOCKWINDOW + + if(count>0) { + BString text; + text << _TT("alert1_fix.."); + text << "\n\n" << count << " " << "channels" << "\n"; + + BPAlert* remove = new BPAlert("Remove an Group", text.String(),_T("Delete"),_T("Cancel"),NULL,B_WIDTH_AS_USUAL,LoadIcon("emblem-delete.png")); + int32 result=remove->Go(); //sync.. + + if(result==0){ + BPAlert* wait = new BPAlert("Remove a Group", "\nRemoving..",NULL,NULL,NULL,B_WIDTH_AS_USUAL,LoadIcon("delete-32.png")); + wait->Go(NULL); //async.. + + for(int i=0;iGetSubscriptionOfGroup(i,group); + if(row) + fController->DeleteChannel(row->fRef); + } + wait->PostMessage(B_QUIT_REQUESTED); + } + } + + fController->RemoveGroup(group->GroupName()); + + UNLOCKWINDOW + + return B_OK; +} + +char +IABPGroupRemove::Shortcut(uint32 *modifiers) const { + return 0; +} diff --git a/sources-experimental/IABPGroup.h b/sources-experimental/IABPGroup.h new file mode 100644 index 0000000..6b491b8 --- /dev/null +++ b/sources-experimental/IABPGroup.h @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2007 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#ifndef _IABPGroup_h_ +#define _IABPGroup_h_ + +#include "IActionBP.h" +#include "Utils.h" +#include "BPLocale.h" + +#define GROUP_NAME_CHANGE 'grnc' + +//------------------------------------------------------------------------------------------------------------------- +class IABPGroupCheck : public IActionBP +{ + public: + + IABPGroupCheck(MainController* controller = NULL,MainWindow* view = NULL); + + BString GetDescription(); + + status_t Perform(BMessage*); + + char Shortcut(uint32 *modifiers = NULL) const; + +}; + +//------------------------------------------------------------------------------------------------------------------- +class IABPGroupAdd : public IActionBP +{ + public: + + IABPGroupAdd(MainController* controller = NULL,MainWindow* view = NULL); + + BString GetDescription(); + + status_t Perform(BMessage*); + + char Shortcut(uint32 *modifiers = NULL) const; + +}; + +//------------------------------------------------------------------------------------------------------------------- +class IABPGroupRename : public IActionBP +{ + public: + + IABPGroupRename(MainController* controller = NULL,MainWindow* view = NULL); + + BString GetDescription(); + + status_t Perform(BMessage*); + + char Shortcut(uint32 *modifiers = NULL) const; + +}; + +//------------------------------------------------------------------------------------------------------------------- +class IABPGroupRemove : public IActionBP +{ + public: + + IABPGroupRemove(MainController* controller = NULL,MainWindow* view = NULL); + + BString GetDescription(); + + status_t Perform(BMessage*); + + char Shortcut(uint32 *modifiers = NULL) const; + +}; + +#endif diff --git a/sources-experimental/IABPItem.cpp b/sources-experimental/IABPItem.cpp new file mode 100644 index 0000000..de858ae --- /dev/null +++ b/sources-experimental/IABPItem.cpp @@ -0,0 +1,258 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +//actions for items + +#include "IABPItem.h" +#include "MainWindow.h" +#include "MainController.h" + +#define LOCKWINDOW if(fView->Lock()){ +#define UNLOCKWINDOWERROR { fView->Unlock(); return B_ERROR; } +#define UNLOCKWINDOW fView->Unlock();} + +//------------------------------------------------------------------------------------------------------------------- + + +IABPItemRemove::IABPItemRemove(MainController* controller,MainWindow* view):IActionBP(controller,view){ + + SetIcon(IAction::SIZE_16,LoadIcon("delete-micro.png")); + SetIcon(IAction::SIZE_48,LoadIcon("emblem-delete.png")); + SetIcon(IAction::SIZE_48_PRESSED,LoadIcon("emblem-delete-down.png")); + + SetLabel(_T("Remove Item")); +} + +BString +IABPItemRemove::GetDescription(){ + return _T("Delete the item and the enclosure"); +} + + +status_t +IABPItemRemove::Perform(BMessage*){ + + EpisodeListItem* row=fView->GetSelectedEpisode(); + if(!row) return B_ERROR; + + BString firstTitle(row->GetTitle() ); + + BList selection; + selection.AddItem((void*)row); + while(row != NULL){ + row=fView->GetSelectedEpisode(row); + if(row) + selection.AddItem((void*)row); + } + + + BString text; + text << _TT("alert1"); + if(selection.CountItems() == 1) + text << "\n\n" << firstTitle << "\n"; + else + text << "\n\n" << selection.CountItems() << " " << "episodes\n"; + + BPAlert* remove = new BPAlert("Remove an Item", text.String(),_T("Delete"),_T("Cancel"),NULL,B_WIDTH_AS_USUAL,LoadIcon("emblem-delete.png")); + int32 result=remove->Go(); //sync.. + + LOCKWINDOW + + EpisodeListView* elv= fView->GetEpisodeListView(); + int32 removed=0; + + if(result==0){ + + BPAlert* wait = new BPAlert("Remove a Item", "\nRemoving..",NULL,NULL,NULL,B_WIDTH_AS_USUAL,LoadIcon("delete-32.png")); + wait->Go(NULL); //async.. + + for(int i=0;iDeleteEpisode(row->fRef)) removed--; + elv->RemoveRow(row); //FIX: nnn c'e' un metodo in fView? + delete row; //goodbye + } + + wait->PostMessage(B_QUIT_REQUESTED); + + elv->DeselectAll(); + SubscriptionListItem* sub=fView->GetSelectedSubscription(); + if(sub) { + sub->AddNewCount(removed); + fController->SetSelectedItem(NULL,&sub->fRef); + } + else + fController->SetSelectedItem(NULL,NULL); + } + + UNLOCKWINDOW + return B_OK; +} + +char +IABPItemRemove::Shortcut(uint32 *modifiers) const { + if(modifiers) + *modifiers = B_COMMAND_KEY; + return 'R'; +} + +//------------------------------------------------------------------------------------------------------------------- + + +IABPItemStop::IABPItemStop(MainController* controller,MainWindow* view):IActionBP(controller,view){ + + SetIcon(IAction::SIZE_16,LoadIcon("stopped-micro.png")); + SetIcon(IAction::SIZE_48,LoadIcon("emblem-stop.png")); + SetIcon(IAction::SIZE_48_PRESSED,LoadIcon("emblem-stop-down.png")); + + SetLabel(_T("Stop download")); +} + +BString +IABPItemStop::GetDescription(){ + return _T("Stop the item download"); +} + + +status_t +IABPItemStop::Perform(BMessage*){ + + LOCKWINDOW + + EpisodeListItem* row=fView->GetSelectedEpisode(); + while(row != NULL){ + fController->StopDownloadItem(row->fRef); + row=fView->GetSelectedEpisode(row); + } + + UNLOCKWINDOW + return B_OK; +} + +char +IABPItemStop::Shortcut(uint32 *modifiers) const { + if(modifiers) + *modifiers = B_COMMAND_KEY; + return 'S'; +} + +//------------------------------------------------------------------------------------------------------------------- + + +IABPItemDownload::IABPItemDownload(MainController* controller,MainWindow* view):IActionBP(controller,view){ + + SetIcon(IAction::SIZE_16,LoadIcon("download-micro.png")); + SetIcon(IAction::SIZE_48,LoadIcon("emblem-download.png")); + SetIcon(IAction::SIZE_48_PRESSED,LoadIcon("emblem-download-down.png")); + + SetLabel(_T("(Re)start download")); +} + +BString +IABPItemDownload::GetDescription(){ + return _T("Download the selected episode"); +} + + +status_t +IABPItemDownload::Perform(BMessage*){ + + LOCKWINDOW + EpisodeListItem* row=fView->GetSelectedEpisode(); + while(row != NULL){ + fController->DownloadItem(row->fRef,row); + row=fView->GetSelectedEpisode(row); + } + UNLOCKWINDOW + return B_OK; +} + + +char +IABPItemDownload::Shortcut(uint32 *modifiers) const { + if(modifiers) + *modifiers = B_COMMAND_KEY; + return 'D'; +} + + +//------------------------------------------------------------------------------------------------------------------- + + +IABPItemPlay::IABPItemPlay(MainController* controller,MainWindow* view):IActionBP(controller,view){ + + SetIcon(IAction::SIZE_16,LoadIcon("play-micro.png")); + SetIcon(IAction::SIZE_48,LoadIcon("emblem-play.png")); + SetIcon(IAction::SIZE_48_PRESSED,LoadIcon("emblem-play-down.png")); + + SetLabel(_T("Play enclosure")); +} + +BString +IABPItemPlay::GetDescription(){ + return _T("Play the selected episode"); +} + + +status_t +IABPItemPlay::Perform(BMessage*){ + + LOCKWINDOW + EpisodeListItem* row=fView->GetSelectedEpisode(); + while(row != NULL){ + fController->PlayItem(row->fRef); + row=fView->GetSelectedEpisode(row); + } + UNLOCKWINDOW + + return B_OK; +} + +char +IABPItemPlay::Shortcut(uint32 *modifiers) const { + if(modifiers) + *modifiers = B_COMMAND_KEY; + return 'E'; +} + + +//------------------------------------------------------------------------------------------------------------------- + +IABPItemWWW::IABPItemWWW(MainController* controller,MainWindow* view):IActionBP(controller,view){ + + SetIcon(IAction::SIZE_16,LoadIcon("www-micro.png")); + SetIcon(IAction::SIZE_48,LoadIcon("www-channel-file.png")); + SetIcon(IAction::SIZE_48_PRESSED,LoadIcon("www-channel-file-down.png")); + + SetLabel(_T("Open Web Page")); + +} + +BString +IABPItemWWW::GetDescription(){ + return _T("Show the news homepage"); +} + + +status_t +IABPItemWWW::Perform(BMessage*){ + + EpisodeListItem* row=fView->GetSelectedEpisode(); + while(row != NULL){ + fController->WWWItem(row->fRef); + row=fView->GetSelectedEpisode(row); + } + return B_OK; +} + + +char +IABPItemWWW::Shortcut(uint32 *modifiers) const { + if(modifiers) + *modifiers = B_COMMAND_KEY; + return 'H'; +} + diff --git a/sources-experimental/IABPItem.h b/sources-experimental/IABPItem.h new file mode 100644 index 0000000..c59199f --- /dev/null +++ b/sources-experimental/IABPItem.h @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#ifndef _IABPItem_h_ +#define _IABPItem_h_ + +#include "IActionBP.h" +#include "Utils.h" +#include "BPLocale.h" + + +//------------------------------------------------------------------------------------------------------------------- +class IABPItemRemove : public IActionBP +{ + public: + + IABPItemRemove(MainController* controller = NULL,MainWindow* view = NULL); + + BString GetDescription(); + + status_t Perform(BMessage*); + + char Shortcut(uint32 *modifiers = NULL) const; + +}; + +//------------------------------------------------------------------------------------------------------------------- +class IABPItemStop : public IActionBP +{ + public: + + IABPItemStop(MainController* controller = NULL,MainWindow* view = NULL); + + BString GetDescription(); + + status_t Perform(BMessage*); + + char Shortcut(uint32 *modifiers = NULL) const; + +}; + +//------------------------------------------------------------------------------------------------------------------- +class IABPItemDownload : public IActionBP +{ + public: + + IABPItemDownload(MainController* controller = NULL,MainWindow* view = NULL); + + BString GetDescription(); + + status_t Perform(BMessage*); + + char Shortcut(uint32 *modifiers = NULL) const; +}; + +//------------------------------------------------------------------------------------------------------------------- +class IABPItemPlay: public IActionBP +{ + public: + + IABPItemPlay(MainController* controller = NULL,MainWindow* view = NULL); + + BString GetDescription(); + + status_t Perform(BMessage*); + + char Shortcut(uint32 *modifiers = NULL) const; + +}; + +//------------------------------------------------------------------------------------------------------------------- + +class IABPItemWWW: public IActionBP +{ + public: + + IABPItemWWW(MainController* controller = NULL,MainWindow* view = NULL); + + BString GetDescription(); + + status_t Perform(BMessage*); + + char Shortcut(uint32 *modifiers = NULL) const; + +}; + +//------------------------------------------------------------------------------------------------------------------- + +class IABPItemEnclosureFolder: public IActionBP +{ + public: + + IABPItemEnclosureFolder(MainController* controller = NULL,MainWindow* view = NULL); + + BString GetDescription(); + + status_t Perform(BMessage*); + + char Shortcut(uint32 *modifiers = NULL) const; + +}; + +#endif diff --git a/sources-experimental/IAction.h b/sources-experimental/IAction.h new file mode 100644 index 0000000..4b7d893 --- /dev/null +++ b/sources-experimental/IAction.h @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#ifndef _IAction_h_ +#define _IAction_h_ + +#include "Action.h" +#include + +class IAction : public Action +{ + public: + + enum IconType { + SIZE_16 = 0, + SIZE_48, + SIZE_48_PRESSED, + //.... add other there! + SIZE_HOWMANY + }; + + IAction():Action(){ memset(fIcons,0, sizeof(BBitmap*) * SIZE_HOWMANY); }; + + virtual ~IAction(){}; + + BBitmap* GetIcon(IconType type){ return fIcons[type]; } + void SetIcon(IconType type,BBitmap* icon){ fIcons[type]=icon; } + + BString GetLabel() { return fLabel;} + void SetLabel(BString label){ fLabel=label;} + + BMessage * CopyMessage() { return new BMessage(*fMessage);} + BMessage * GetMessage() { return fMessage;} + void SetMessage(BMessage* msg){ fMessage=msg;} + + virtual BString GetDescription(){ return "";}; + + virtual char Shortcut(uint32 *) const { return 0; } + + private: + BBitmap* fIcons[SIZE_HOWMANY]; + BString fLabel; + BMessage* fMessage; +}; + +#endif diff --git a/sources-experimental/IActionBP.h b/sources-experimental/IActionBP.h new file mode 100644 index 0000000..3a32eef --- /dev/null +++ b/sources-experimental/IActionBP.h @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#ifndef _IActionBP_h_ +#define _IActionBP_h_ + +#include "IAction.h" + +class MainController; +class MainWindow; + +class IActionBP : public IAction +{ + public: + + IActionBP(MainController* controller = NULL,MainWindow* view = NULL):IAction(){ + fController=controller; + fView=view; + }; + + virtual ~IActionBP(){}; + + + protected: + MainController* fController; + MainWindow* fView; + +}; + +#endif diff --git a/sources-experimental/IActionManager.h b/sources-experimental/IActionManager.h new file mode 100644 index 0000000..0c39ca2 --- /dev/null +++ b/sources-experimental/IActionManager.h @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#ifndef _IActionManager_H_ +#define _IActionManager_H_ + +#include "IAction.h" + +#include +#include +#include + +#define PERFORM_ACTION 'peac' + +class IActionManager { + + public: + + IActionManager(int maxSize){ + fActions=(IAction**)malloc(maxSize*sizeof(Action*)); + memset(fActions,0,maxSize*sizeof(Action*)); + } + virtual ~IActionManager(){ + free(fActions); + } + + void SetAction(int pos,IAction* action){ + fActions[pos]=action; + } + IAction* GetAction(int pos){ + return fActions[pos]; + } + + static BMessage* MessageForAction(int pos){ + BMessage* msg=new BMessage(PERFORM_ACTION); + msg->AddInt16("action_position",pos); + return msg; + } + + static BHandler* TargetForAction(int /*pos*/){ + return be_app; + } + + virtual void Perform(BMessage* msg) { + int16 pos; + if(msg->FindInt16("action_position",&pos)!=B_OK) return; + + IAction *action=GetAction(pos); + if(!action) return; + + action->Perform(msg); + } + + + + void FireAction(int pos){ + be_app->PostMessage(MessageForAction(pos),TargetForAction(pos)); + } + private: + + IAction** fActions; + +}; +#endif diff --git a/sources-experimental/IActionManagerBP.cpp b/sources-experimental/IActionManagerBP.cpp new file mode 100644 index 0000000..a2521b5 --- /dev/null +++ b/sources-experimental/IActionManagerBP.cpp @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#include "IActionManagerBP.h" +#include "IABPChannel.h" +#include "IABPItem.h" +#include "IABPDownload.h" +#include "IABPGroup.h" + + +IActionManagerBP::IActionManagerBP():IActionManager(IACTION_COUNT){ +} + +void +IActionManagerBP::init(MainController* c,MainWindow* w){ + + + SetAction(IACTION_CHANNEL_ADD_REQUEST,new IABPChannelAddRequest()); + SetAction(IACTION_CHANNEL_REMOVE, new IABPChannelRemove(c,w)); + SetAction(IACTION_CHANNEL_CHECK, new IABPChannelCheck(c,w)); + SetAction(IACTION_CHANNEL_WWW, new IABPChannelWWW(c,w)); + SetAction(IACTION_CHANNEL_ENCLOSURE_FOLDER,new IABPChannelEnclosureFolder(c,w)); + SetAction(IACTION_CHANNEL_CHECK_ALL, new IABPChannelCheckAll(c,w)); + SetAction(IACTION_CHANNEL_SHOW_IMAGE, new IABPChannelShowImage(c,w)); + + SetAction(IACTION_ITEM_REMOVE,new IABPItemRemove(c,w)); + SetAction(IACTION_ITEM_STOP,new IABPItemStop(c,w)); + SetAction(IACTION_ITEM_DOWNLOAD,new IABPItemDownload(c,w)); + SetAction(IACTION_ITEM_PLAY,new IABPItemPlay(c,w)); + SetAction(IACTION_ITEM_WWW,new IABPItemWWW(c,w)); + + + SetAction(IACTION_DOWNLOAD_PLAY,new IABPDownloadPlay(c,w)); + SetAction(IACTION_DOWNLOAD_DOWNLOAD,new IABPDownloadDownload(c,w)); + SetAction(IACTION_DOWNLOAD_STOP,new IABPDownloadStop(c,w)); + SetAction(IACTION_DOWNLOAD_FIND_ITEM,new IABPDownloadFindItem(c,w)); + SetAction(IACTION_DOWNLOAD_REMOVE,new IABPDownloadRemove(c,w)); + + SetAction(IACTION_GROUP_CHECK,new IABPGroupCheck(c,w)); + SetAction(IACTION_GROUP_ADD,new IABPGroupAdd(c,w)); + SetAction(IACTION_GROUP_RENAME,new IABPGroupRename(c,w)); + SetAction(IACTION_GROUP_REMOVE,new IABPGroupRemove(c,w)); + + for(int i=0;iSetMessage(IActionManager::MessageForAction(i)); +} +IActionManagerBP::~IActionManagerBP(){ + //delete all off them! +} + + +//details.. +void +IActionManagerBP::SetAction(pb_actions pos,IActionBP* action){ + IActionManager::SetAction(pos,action); +} + +IActionBP* +IActionManagerBP::GetAction(pb_actions pos){ + return (IActionBP*)IActionManager::GetAction(pos); +} + +IActionBP* +IActionManagerBP::GetAction(int pos){ + return (IActionBP*)IActionManager::GetAction(pos); +} + diff --git a/sources-experimental/IActionManagerBP.h b/sources-experimental/IActionManagerBP.h new file mode 100644 index 0000000..ec6dabc --- /dev/null +++ b/sources-experimental/IActionManagerBP.h @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#ifndef _IActionManagerBP_H_ +#define _IActionManagerBP_H_ + +#include "IActionBP.h" + +#include "IActionManager.h" + +enum pb_actions { + ACTION_CHANNEL, + IACTION_CHANNEL_ADD_REQUEST = 0, + IACTION_CHANNEL_REMOVE, + IACTION_CHANNEL_CHECK, + IACTION_CHANNEL_WWW, + IACTION_CHANNEL_ENCLOSURE_FOLDER, + IACTION_CHANNEL_CHECK_ALL, + IACTION_CHANNEL_SHOW_IMAGE, + + IACTION_ITEM_REMOVE, + IACTION_ITEM_STOP, + IACTION_ITEM_DOWNLOAD, + IACTION_ITEM_PLAY, + IACTION_ITEM_WWW, + + IACTION_DOWNLOAD_PLAY, + IACTION_DOWNLOAD_DOWNLOAD, + IACTION_DOWNLOAD_STOP, + IACTION_DOWNLOAD_FIND_ITEM, + IACTION_DOWNLOAD_REMOVE, + + IACTION_GROUP_CHECK, + IACTION_GROUP_ADD, + IACTION_GROUP_RENAME, + IACTION_GROUP_REMOVE, + + //Don't remove this! + IACTION_COUNT + }; + + +class IActionManagerBP : public IActionManager { + + public: + + + IActionManagerBP(); + ~IActionManagerBP(); + + + void init(MainController*,MainWindow*); + + + + IActionBP* GetAction(pb_actions pos); + + IActionBP* GetAction(int pos); + + private: + void SetAction(pb_actions pos,IActionBP* action); + +}; +#endif diff --git a/sources-experimental/IActionMenuItem.cpp b/sources-experimental/IActionMenuItem.cpp new file mode 100644 index 0000000..9d61c9e --- /dev/null +++ b/sources-experimental/IActionMenuItem.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#include "IActionMenuItem.h" + +IActionMenuItem::IActionMenuItem(IAction* action) +:IconMenuItem(action->GetIcon(IAction::SIZE_16), + action->GetLabel().String(), + "", + action->CopyMessage(), + false) +{ + //done. :) + uint32 mod; + const char charz = action->Shortcut(&mod); + SetShortcut(charz,mod); +}; + + +//-- diff --git a/sources-experimental/IActionMenuItem.h b/sources-experimental/IActionMenuItem.h new file mode 100644 index 0000000..c8e7dc8 --- /dev/null +++ b/sources-experimental/IActionMenuItem.h @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#ifndef IActionMenuItem_H_ +#define IActionMenuItem_H_ + +#include "IconMenuItem.h" +#include "IAction.h" + +class IActionMenuItem : public IconMenuItem { + + public: + IActionMenuItem(IAction*); + +}; + +#endif diff --git a/sources-experimental/IconMenuItem.cpp b/sources-experimental/IconMenuItem.cpp new file mode 100644 index 0000000..92df3bc --- /dev/null +++ b/sources-experimental/IconMenuItem.cpp @@ -0,0 +1,107 @@ +//------------------------------------------------------------------------------ +// I N C L U D E S +//------------------------------------------------------------------------------ + +#include "IconMenuItem.h" + +const float kIconTextPadding = 5.0; +const float kEdgePadding = 4.0; +const float kTickSpacing = 4.0; + +//------------------------------------------------------------------------------ +// I M P L E M E N T A T I O N +//------------------------------------------------------------------------------ + +IconMenuItem::IconMenuItem(BBitmap* icon, const char *label, const char *extra, + BMessage *msg, bool ownIcon) : + BMenuItem(label, msg), + fIcon(icon), + fExtra(extra), + fLabel(label), + fOwnIcon(ownIcon), + fCreatedIcon(false) { + + if (fIcon == NULL) { + fCreatedIcon = true; + fIcon = new BBitmap(BRect(0, 0, 15, 15), B_COLOR_8_BIT, true); + char *bits = (char *)fIcon->Bits(); + int32 length = fIcon->BitsLength(); + for (int32 i = 0; i < length; i++) bits[i] = B_TRANSPARENT_MAGIC_CMAP8; + }; + + be_plain_font->GetHeight(&fFontHeight); + fFontHeightTotal = fFontHeight.ascent + fFontHeight.descent + fFontHeight.leading; + + _CalculateOffsets(); +}; + +IconMenuItem::~IconMenuItem() { + if ((fOwnIcon == true) || (fCreatedIcon == true)) delete fIcon; +}; + +void IconMenuItem::_CalculateOffsets(void) { + fBounds = fIcon->Bounds(); + + if (fFontHeightTotal > fBounds.Height()) fBounds.bottom = fFontHeightTotal; + fBounds.bottom += kEdgePadding; + + float width = be_plain_font->StringWidth(fLabel.String()); + + fBounds.right += width + kIconTextPadding + kTickSpacing + kEdgePadding; +}; + +void IconMenuItem::GetContentSize(float* width, float* height) { +// BMenuItem::GetContentSize(width, height); +// *width += 20; +// *height += 3; + *width = fBounds.Width(); + *height = fBounds.Height(); +} + +void IconMenuItem::DrawContent() { + + BPoint drawPoint(ContentLocation()); + drawPoint.x += 20; + Menu()->MovePenTo(drawPoint); + BMenuItem::DrawContent(); + + BPoint where(ContentLocation()); + where.y = Frame().top; + + /*if (IsEnabled()) + Menu()->SetDrawingMode(B_OP_OVER); + else + Menu()->SetDrawingMode(B_OP_BLEND); + */ + drawing_mode mode=Menu()->DrawingMode(); + Menu()->SetDrawingMode(B_OP_ALPHA); + Menu()->DrawBitmapAsync(fIcon, where); + Menu()->SetDrawingMode(mode); + /*BRect b = Frame(); + BMenu *parent = Menu(); + BPoint loc = parent->PenLocation(); + + //test code: clean the canvas before using + //parent->PushState(); + + //parent->SetLowColor(parent->ViewColor()); + parent->FillRect(b,B_SOLID_LOW); + + parent->SetDrawingMode(B_OP_ALPHA); + + b.OffsetBy(0, kEdgePadding); + b.left = loc.x; + + BRect iconPos = b; + iconPos.right = b.left + fIcon->Bounds().Width(); + iconPos.bottom = iconPos.top + fIcon->Bounds().Height(); + parent->DrawBitmap(fIcon, iconPos); + + parent->MovePenTo(loc.x + fIcon->Bounds().Width() + kEdgePadding, + loc.y + fFontHeight.ascent + kEdgePadding); + parent->SetDrawingMode( B_OP_OVER ); + //parent->SetLowColor(parent->ViewColor()); + parent->DrawString(fLabel.String()); + //parent->PopState(); + */ +}; diff --git a/sources-experimental/IconMenuItem.h b/sources-experimental/IconMenuItem.h new file mode 100644 index 0000000..20ea36d --- /dev/null +++ b/sources-experimental/IconMenuItem.h @@ -0,0 +1,48 @@ +#ifndef ICON_MENU_ITEM_H +#define ICON_MENU_ITEM_H + +//------------------------------------------------------------------------------ +// I N C L U D E S +//------------------------------------------------------------------------------ + +#include +#include +#include +#include + +//------------------------------------------------------------------------------ +// D E C L A R A T I O N S +//------------------------------------------------------------------------------ + +class BBitmap; +class BRect; + +class IconMenuItem : public BMenuItem { + public: + IconMenuItem(BBitmap* icon, const char *label, + const char *extra, BMessage *msg = NULL, bool ownIcon = true); + + virtual ~IconMenuItem(); + + const char *Extra(void) { return fExtra.String(); }; + + protected: + virtual void GetContentSize(float* width, float* height); + virtual void DrawContent(); + + private: + void _CalculateOffsets(void); + + BBitmap *fIcon; + BString fExtra; + BString fLabel; + BRect fBounds; + + float fFontHeightTotal; + font_height fFontHeight; + + bool fOwnIcon; + bool fCreatedIcon; +}; + +#endif diff --git a/sources-experimental/IconTextItem.cpp b/sources-experimental/IconTextItem.cpp new file mode 100644 index 0000000..0aaedc5 --- /dev/null +++ b/sources-experimental/IconTextItem.cpp @@ -0,0 +1,77 @@ +#include "IconTextItem.h" + +const float kEdgeOffset = 2.0; +const rgb_color kHighlight = {140, 140, 140, 255}; + +IconTextItem::IconTextItem(const char *text, BBitmap *icon) + : fIcon(NULL), + fIconHeight(0), + fIconWidth(0) { + fText = text; + fIcon = icon; +}; + +IconTextItem::~IconTextItem(void) { + delete fIcon; +}; + +void IconTextItem::DrawItem(BView *owner, BRect frame, bool complete) { + if (IsSelected() || complete) { + rgb_color color; + rgb_color origHigh; + + origHigh = owner->HighColor(); + + if (IsSelected()) { + color = kHighlight; + } else { + color = owner->ViewColor(); + }; + + owner->SetHighColor(color); + BRect fr(frame); + owner->FillRect(fr); + owner->SetHighColor(origHigh); + } + + if (fIcon) { + owner->SetDrawingMode(B_OP_ALPHA); + owner->DrawBitmap(fIcon, BPoint(frame.left + kEdgeOffset,frame.bottom - kEdgeOffset - fIconHeight) + fSpiaz); + owner->SetDrawingMode(B_OP_COPY); + }; + + if (IsSelected()) owner->SetDrawingMode(B_OP_OVER); + + owner->MovePenTo(frame.left + kEdgeOffset + fIconWidth + kEdgeOffset + 5, frame.bottom - fFontOffset); + owner->DrawString(fText.String()); +}; + +const char *IconTextItem::Text(void) const { + return fText.String(); +}; + +const BBitmap *IconTextItem::Icon(void) const { + return fIcon; +}; + +void IconTextItem::Update(BView */*owner*/, const BFont *font) { + font_height fontHeight; + font->GetHeight(&fontHeight); + fFontHeight = fontHeight.descent + fontHeight.leading + fontHeight.ascent; + + if (fIcon) { + fIconHeight = fIcon->Bounds().Height() + 1; + fIconWidth = fIcon->Bounds().Width(); + + if (fIconHeight > fFontHeight) { + SetHeight(fIconHeight + (kEdgeOffset * 2)); + fFontOffset = ((fIconHeight - fFontHeight) / 2) + (kEdgeOffset * 2); + } else { + SetHeight(fFontHeight + (kEdgeOffset * 2)); + fFontOffset = kEdgeOffset; + }; + } else { + SetHeight(fFontHeight + (kEdgeOffset * 2)); + fFontOffset = kEdgeOffset; + }; +}; diff --git a/sources-experimental/IconTextItem.h b/sources-experimental/IconTextItem.h new file mode 100644 index 0000000..b7bbd55 --- /dev/null +++ b/sources-experimental/IconTextItem.h @@ -0,0 +1,34 @@ +#ifndef ICONTEXTITEM_H +#define ICONTEXTITEM_H + +#include +#include +#include +#include +#include + + +class IconTextItem : public BListItem { + public: + + IconTextItem(const char *text, BBitmap *icon = NULL); + ~IconTextItem(void); + + virtual void DrawItem(BView *owner, BRect frame, bool complete); + virtual void Update(BView *owner, const BFont *font); + const char *Text(void) const; + const BBitmap *Icon(void) const; + + void SetSpiaz(BPoint p){ fSpiaz = p;} + + private: + BBitmap *fIcon; + BString fText; + float fFontHeight; + float fIconHeight; + float fIconWidth; + float fFontOffset; + BPoint fSpiaz; +}; + +#endif diff --git a/sources-experimental/IconTextRender.h b/sources-experimental/IconTextRender.h new file mode 100644 index 0000000..6984d55 --- /dev/null +++ b/sources-experimental/IconTextRender.h @@ -0,0 +1,73 @@ +#ifndef _IconTextRender_H_ +#define _IconTextRender_H_ + +#include "TextRender.h" +#include "Bitmap.h" +#include +#include + +#include +#include +#include +#include + +#define kIconSpace 3.0 + +class IconTextRender : public TextRender +{ + public: + + IconTextRender():TextRender(){ + fHeight = 0; // icon->Bounds().Height() + 1; + fWidth = 0; + }; + + virtual ~IconTextRender() {}; + + void Render(BView *target,const char* txt,int16 num,BPoint /*pos*/,BRect r) { + + BBitmap *pointer =NULL; + BString key(txt,num); + + if( fKeyBit.FindPointer(key.String(),(void**)&pointer) !=B_OK ) { + return; + } + if(!pointer) return; + + target->SetDrawingMode( B_OP_ALPHA ); + target->DrawBitmapAsync( pointer,BPoint(r.left + kIconSpace, r.top )); + //target->DrawBitmapAsync( pointer,BPoint(r.left + kIconSpace, r.top + ((r.Height()/2.0) - 8) )); //- fHeight + (fHeight/4) + 2) + target->SetDrawingMode( B_OP_OVER ); + }; + + + void + AddIcon(const char* key,BBitmap* icon){ + fKeyBit.AddPointer(key,icon); + } + + float Size(float/* maxwidth*/){ return fWidth + 1 + kIconSpace + kIconSpace;} + + void GetHeight(font_height *h){ + h->ascent=fHeight/2; + h->descent=fHeight/2; + h->leading=0; + }; + + void + GetEscapements(const char * /*charArray*/, int32 numChars,float escapementArray[]) { + escapementArray[0]=1; + for(int i=1;i +#include + + +#include "Utils.h" +#include "IActionBP.h" +#include "IActionManagerBP.h" + +ImageButton::ImageButton( BRect rect, const char * name, BMessage * msg,BBitmap * bitmap = NULL, BBitmap * bitmap_down = NULL , const char * label = NULL) +: BControl(rect,name,label,msg,B_FOLLOW_NONE,B_WILL_DRAW) +{ + fBitmap = bitmap; + eBitmap = bitmap_down; + fMouseUp = false; + fMouseDown = false; + fMouseOver = false; + fDrawBackground = true; + fInset = BPoint(4,2); + SetViewColor(B_TRANSPARENT_COLOR); + #ifdef ZETA + if(label) SetToolTipText(label); + SetDoubleBuffering(true); + #endif +} + + +ImageButton::ImageButton( BRect rect, const char* name, IAction* action) +: BControl(rect,name,action->GetLabel().String(),action->CopyMessage(),B_FOLLOW_NONE,B_WILL_DRAW) +{ + + fBitmap = action->GetIcon(IActionBP::SIZE_48); + eBitmap = action->GetIcon(IActionBP::SIZE_48_PRESSED); //bitmap_down; + fMouseUp = false; + fMouseDown = false; + fMouseOver = false; + fDrawBackground = true; + fInset = BPoint(4,2); + + SetTarget(IActionManager::TargetForAction(0)); + #ifdef ZETA + SetToolTipText(action->GetDescription().String()); + SetDoubleBuffering(true); + #endif + SetViewColor(B_TRANSPARENT_COLOR); + +} + + +ImageButton::~ImageButton(){ +} + +void +ImageButton::MouseDown( BPoint /*where*/ ) +{ + SetMouseEventMask( B_POINTER_EVENTS, B_LOCK_WINDOW_FOCUS ); + + fMouseDown = true; + + Invalidate(); +} + +void +ImageButton::MouseMoved( BPoint /*where*/, uint32 transition, const BMessage * /*msg*/ ) +{ + switch ( transition ) + { + case B_ENTERED_VIEW: + + fMouseOver = true; + Invalidate(); + break; + case B_EXITED_VIEW: + + fMouseOver = false; + Invalidate(); + break; + } + +} + +void +ImageButton::MouseUp( BPoint where ) +{ + if ( fMouseDown && Bounds().Contains(where) ){ + Invoke(); + } + + fMouseDown = false; + + Invalidate(); +} + +void +ImageButton::SetBitmap(BBitmap* bitmap) +{ + fBitmap = bitmap; +} + +void +ImageButton::DrawbackgroundColor(bool draw) +{ + fDrawBackground = draw; +} + +void +ImageButton::Draw( BRect ) +{ + BRect plain(Bounds()); + plain.InsetBy(fInset.x,fInset.y); + plain.bottom--; + BBitmap* draw=fBitmap; + + SetDrawingMode( B_OP_ALPHA ); //can be moved? + + if ( fMouseDown ) { + SetHighColor( 242,227,0); + draw=eBitmap; + } + else + SetHighColor( 255,255,255); + + if (fDrawBackground) + FillRect( plain ); + + if (draw) + DrawBitmap(draw, BPoint( 0,0 )); +} diff --git a/sources-experimental/ImageButton.h b/sources-experimental/ImageButton.h new file mode 100644 index 0000000..1859430 --- /dev/null +++ b/sources-experimental/ImageButton.h @@ -0,0 +1,37 @@ +#ifndef ImageButton_H +#define ImageButton_H + +#include +#include +#include + +class IAction; + +class ImageButton : public BControl +{ + public: + + ImageButton( BRect rect, const char * name, BMessage * msg, BBitmap * bitmap, BBitmap * bitmap_down, const char * label ); + ImageButton( BRect rect, const char* name, IAction* action); + virtual ~ImageButton(); + + virtual void MouseDown( BPoint ); + virtual void MouseMoved( BPoint, uint32, const BMessage * ); + virtual void MouseUp( BPoint ); + + virtual void Draw( BRect ); + + void SetInsetPoint(BPoint p) { fInset = p;} + + void SetBitmap(BBitmap*); + void DrawbackgroundColor(bool); + + private: + bool fMouseDown, fMouseOver, fMouseUp; + BBitmap * fBitmap; + BBitmap * eBitmap; + BPoint fInset; + bool fDrawBackground; +}; + +#endif diff --git a/sources-experimental/ItemProperty.h b/sources-experimental/ItemProperty.h new file mode 100644 index 0000000..fac48d7 --- /dev/null +++ b/sources-experimental/ItemProperty.h @@ -0,0 +1,54 @@ +#ifndef _ItemProperty_H_ +#define _ItemProperty_H_ + +//revision 0.1 // 20 sett 2005 + +enum ItemProperty { + + IP_SYSTEM_ID_LOW, // a system id is a 64bit number. + IP_SYSTEM_ID_HIGH, // you need 2 key (of int32) to store/retrive the value. + + ITEM_TITLE, // "title" + ITEM_PUBDATE, // "pubDate" + ITEM_GUID, // "guid" + ITEM_LINK, // "link"//? + ITEM_AUTHOR, + ITEM_BLOCK, + ITEM_CATEGORY, + ITEM_DURATION, + ITEM_EXPLICIT, // "Yes" or "No" + ITEM_KEYWORDS, + ITEM_SUBTITLE, //-------| + ITEM_DESCRIPTION, //-------| Are these the same info? + ITEM_SUMMARY, //-------| + ITEM_ENCLOSURE_URL, + ITEM_ENCLOSURE_TYPE, + ITEM_ENCLOSURE_LENGTH, + ITEM_ENCLOSURE_LOCALPATH, + ITEM_ENCLOSURE_FILE_STATUS, //see FileStatus.h + ITEM_ENCLOSURE_FILE_PERCENTAGE, + ITEM_ENCLOSURE_DOWNLOAD_SPEED, + ITEM_ENCLOSURE_DOWNLOADED, + + CHANNEL_URL, //feed url! + CHANNEL_TITLE, + CHANNEL_DESCRIPTION, + CHANNEL_RSS_FILE_STATUS, //see FileStatus.h + CHANNEL_NEWITEMS, + CHANNEL_WEBLINK, // channel home page! + CHANNEL_COPYRIGHT, + CHANNEL_BLOCK, + CHANNEL_CATEGORY, + CHANNEL_EXPLICIT, + CHANNEL_KEYWORDS, + CHANNEL_OWNER, + CHANNEL_SUBTITLE, + CHANNEL_SUMMARY, + CHANNEL_IMAGE_URL, + CHANNEL_IMAGE_LOCALPATH, //NOT USED! + CHANNEL_IMAGE_DATA, +}; + + + +#endif diff --git a/sources-experimental/ItemRunView.h b/sources-experimental/ItemRunView.h new file mode 100644 index 0000000..55e4af2 --- /dev/null +++ b/sources-experimental/ItemRunView.h @@ -0,0 +1,100 @@ +#ifndef ItemRunView_H_ +#define ItemRunView_H_ + +#include "runview/RunView.h" +#include "BitmapView.h" +#include + +#define BORDER_SIZE 5 + +class ItemRunView : public RunView { + + public: + + ItemRunView(BRect r, + const char * n, + Theme * t, + uint32 a, + uint32 b) + :RunView(r,n,t,a,b){ + fImage=NULL; + AddChild(viewer = new BitmapView(BRect(1,1,2,2),NULL)); + LoadBitmap(NULL); + } + + void TextResized(BRect r) + { + //printf("Bottom line %f (value %f)\n",r.bottom,r.top); + if(fImage) + viewer->MoveTo(BORDER_SIZE,r.bottom - r.top + BORDER_SIZE); + } + + + void FrameResized (float w , float h) + { + w = w -BORDER_SIZE*2; //BORDER! + + if(fImage) + { + if(fImage->Bounds().Width() > w) + viewer->ResizeTo(w, w *proportion ); + else + viewer->ResizeTo(fImage->Bounds().Width(), fImage->Bounds().Height()); + } + RunView::FrameResized(w+2*BORDER_SIZE,h); + } + + + float ExtraTextSize() + { + + if(!viewer->IsHidden()) + return viewer->Bounds().Height() + BORDER_SIZE; + else + return 0; + } + + + void LoadBitmap(const char* filename) + { + + if(fImage) + delete fImage; + + fImage = NULL; + + if(filename!=NULL) + fImage = BTranslationUtils::GetBitmap(filename); + + + viewer->SetBitmap(fImage); + + if(fImage) + { + if(viewer->IsHidden()) viewer->Show(); + proportion = fImage->Bounds().Height() / fImage->Bounds().Width(); + float w = Bounds().Width() - BORDER_SIZE*2; + + if(fImage->Bounds().Width() > w) { + viewer->ResizeTo(w, w * proportion ); + } + else + viewer->ResizeTo(fImage->Bounds().Width(), fImage->Bounds().Height()); + } + else + { + if(!viewer->IsHidden()) viewer->Hide(); + } + + + } + + private: + BitmapView* viewer; + BBitmap* fImage; + float proportion; + +}; + +#endif + diff --git a/sources-experimental/Jamfile b/sources-experimental/Jamfile new file mode 100644 index 0000000..05eeb8f --- /dev/null +++ b/sources-experimental/Jamfile @@ -0,0 +1,117 @@ + +SubDir TOP sources ; + +SubDirHdrs $(OBJECTS_DIR) sources ; + +if $(OSPLAT) = X86 { + C++FLAGS += -Wno-sign-compare -Wno-overloaded-virtual ; +} + +if ZETA in $(DEFINES) { + echo "ZETA VERSION (NO MORE SUPPORTED)" ; + BP_LIBS = libs/libfunky.a libs/librunview.a libs/libfish.a libs/libclv.a libs/libcurl.a libs/libxml2.a be root translation tracker iconv ssl crypto z ; + LINKLIBS = -lsocket -lbind -lzeta ; + + +} else { + echo "Haiku VERSION (compiled for net_server)" ; + BP_LIBS = libs/libfunky.a libs/librunview.a libs/libfish.a libs/libclv.a curl xml2 be root translation tracker iconv ssl crypto z ; + LINKLIBS = -lnetwork -lstdc++ ; +} + +echo "Extra library" ; +echo $(LINKLIBS) ; + +SAVED_DEFINES = $(DEFINES) ; + +DEFINES = $(SAVED_DEFINES) ; +#DEFINES += ZETA ; + +SubDirSysHdrs /boot/home/config/include ; +SubDirSysHdrs $(TOP)/include/ ; +SubDirSysHdrs $(TOP)/include/r5-only ; +SubDirSysHdrs $(TOP)/include/curl ; +SubDirSysHdrs $(TOP)/include/runview ; +SubDirSysHdrs $(TOP)/include/lbxml ; +SubDirSysHdrs $(TOP)/include/libfunky ; +SubDirSysHdrs $(TOP)/include/libclv ; +SubDirSysHdrs $(TOP)/include/libfish ; +SubDirSysHdrs $(TOP)/sources/ ; + +LINKFLAGS += -L/boot/home/config/lib ; +#LINKFLAGS += -L$(TOP)/libs/ ; +LINKFLAGS += -L/boot/develop/headers/be ; + + +# +Application BePodder : + ActionAsync.cpp + ActionAsyncWrapper.cpp + ActionDelete.cpp + ActionDownload.cpp + ActionHTTPContent.cpp + AddWindow.cpp + AttributeDumper.cpp + AttributeExtractor.cpp + BitmapWindow.cpp + BPAlert.cpp + BPEpisode.cpp + BPSettingsWindow.cpp + ChannelSettingsWindow.cpp + Cursors.cpp + DirectoryWindow.cpp + DownloadListItem.cpp + DownloadListView.cpp + DownloadManager.cpp + ElementNotifier.cpp + EntryIterator.cpp + EpisodeListItem.cpp + EpisodeListView.cpp + Extractor.cpp + FileStatusColumn.cpp + GreenBoxTextRender.cpp + GroupItem.cpp + HelpWindow.cpp + htmlparse.cpp + IABPChannel.cpp + IABPDownload.cpp + IABPGroup.cpp + IABPItem.cpp + IActionManagerBP.cpp + IActionMenuItem.cpp + IconMenuItem.cpp + IconTextItem.cpp + ImageButton.cpp + Logger.cpp + Main.cpp + MainController.cpp + MainWindow.cpp + MemoryArchive.cpp + MyColumnTypes.cpp + NodeWalker.cpp + Notifier.cpp + OPMLParser.cpp + PercentageView.cpp + PercentageWindow.cpp + QueueFileDownload.cpp + QueueMultiActions.cpp + R5Locale.cpp + RssChannel.cpp + RssItem.cpp + SectionSelector.cpp + SettingsWindow.cpp + SplitPane.cpp + StackedView.cpp + StripeView.cpp + SubscriptionColumn.cpp + SubscriptionListItem.cpp + SubscriptionListView.cpp + TextControlFloater.cpp + TheApp.cpp + TitleTextRender.cpp + XMLChannelExtractor.cpp + XMLItemExtractor.cpp + : $(BP_LIBS) + ; +# + diff --git a/sources-experimental/Logger.cpp b/sources-experimental/Logger.cpp new file mode 100644 index 0000000..5e22e70 --- /dev/null +++ b/sources-experimental/Logger.cpp @@ -0,0 +1,153 @@ +#include "Logger.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define LogName "bepodder.log" + +log_importance g_verbosity_level = liQuiet; + +bool _has_checked_for_tty = false; + +void +check_for_tty() +{ + if ( _has_checked_for_tty ) + return; + + _has_checked_for_tty = true; + + if ( !isatty(STDOUT_FILENO) ) + { // redirect output to ~/im_kit.log if not run from Terminal + BPath path; + + if (find_directory(B_USER_DIRECTORY,&path,true,NULL) != B_OK) + // This should never fail.. + return; + + path.Append(LogName); + + close(STDOUT_FILENO); + open( path.Path(), O_WRONLY|O_CREAT|O_APPEND|O_TEXT); + chmod( path.Path(), 0x600 ); + } +} + +bool _has_loaded_log_level = false; + +void +load_log_level() +{ + /* + if ( _has_loaded_log_level ) + return; + + _has_loaded_log_level = true; + + BMessage settings; + if ( im_load_client_settings("im_server", &settings) != B_OK ) + { + printf("load_log_level: im_server settings not found\n"); + return; + } + + const char * level=NULL; + if ( settings.FindString("log_level", &level) == B_OK ) + { + // check for the various levels.. + if ( strcmp(level, "Debug") == 0 ) { + g_verbosity_level = liDebug; + } else + if ( strcmp(level, "Low") == 0 ) { + g_verbosity_level = liLow; + } else + if ( strcmp(level, "Medium") == 0 ) { + g_verbosity_level = liMedium; + } else + if ( strcmp(level, "High") == 0 ) { + g_verbosity_level = liHigh; + } else + if ( strcmp(level, "Quiet") == 0 ) { + g_verbosity_level = liQuiet; + } else + g_verbosity_level = liHigh; + } + */ +} + +const char * gLogLevelText[] = { + "debug", + "low", + "medium", + "high" +}; + +// Note: if you change something in this LOG, +// make sure to change the LOG below as the code +// unfortunately isn't shared. :/ +void LOG(const char * module, log_importance level, const char *message, const BMessage *msg, ...) { + va_list varg; + va_start(varg, msg); + char buffer[2048]; + vsprintf(buffer, message, varg); + + load_log_level(); + + if ( level > liHigh ) + { + level = liHigh; + } + + if ( level < g_verbosity_level ) + return; + + check_for_tty(); + + char timestr[64]; + time_t now = time(NULL); + strftime(timestr,sizeof(timestr),"%Y-%m-%d %H:%M", localtime(&now) ); + + printf("%s %s (%s): %s\n", module, timestr, gLogLevelText[level], buffer); + if ( msg ) + { + printf("BMessage for last message:\n"); + msg->PrintToStream(); + } + + fflush(stdout); +} + +void LOG(const char * module, log_importance level, const char *message, ...) { + va_list varg; + va_start(varg, message); + char buffer[2048]; + vsprintf(buffer, message, varg); + + load_log_level(); + + if ( level > liHigh ) + { + level = liHigh; + } + + if ( level < g_verbosity_level ) + return; + + check_for_tty(); + + char timestr[64]; + time_t now = time(NULL); + strftime(timestr,sizeof(timestr),"%Y-%m-%d %H:%M", localtime(&now) ); + + printf("%s %s (%s): %s\n", module, timestr, gLogLevelText[level], buffer); + + fflush(stdout); +} diff --git a/sources-experimental/Logger.h b/sources-experimental/Logger.h new file mode 100644 index 0000000..27d31e8 --- /dev/null +++ b/sources-experimental/Logger.h @@ -0,0 +1,41 @@ +#ifndef HELPERS_H +#define HELPERS_H + +#include +#include +#include +#include + +#define TRACE_CLASS Tracer tr(__PRETTY_FUNCTION__) +class Tracer +{ + private: + BString str; + + public: + Tracer( const char * _str ) + : str(_str) + { + printf("%s\n",str.String()); + }; + ~Tracer() + { + printf("-%s\n",str.String() ); + }; +}; + +enum log_importance { + liDebug = 0, // debug + liLow, // lots and lots of messages + liMedium, // enough to follow what's happening + liHigh, // general idea + liQuiet = 100 // Don't say a word. Don't use this when calling LOG(), it's for reducing output. +}; + +extern void LOG( const char * module, log_importance level, const char * msg, const BMessage *, ...); +extern void LOG( const char * module, log_importance level, const char * msg, ...); + +// if level < g_verbosity_level then LOG() doesn't print the msg +extern log_importance g_verbosity_level; + +#endif diff --git a/sources-experimental/Main.cpp b/sources-experimental/Main.cpp new file mode 100644 index 0000000..f7573fe --- /dev/null +++ b/sources-experimental/Main.cpp @@ -0,0 +1,19 @@ + +#include "TheApp.h" +#include + +int +main() +{ +#ifndef ZETA + int i = access ( "/boot/beos/system/lib/libzeta.so", F_OK ); + if ( i == 0 ){ + system("alert \"This version is for BeOS.R5/Haiku not for ZETA\nPlease download the right version!\""); + return 0; + } +#endif + + TheApp app("application/x-vnd.xeD.BePodder"); + app.Run(); + return 0; +} diff --git a/sources-experimental/MainController.cpp b/sources-experimental/MainController.cpp new file mode 100644 index 0000000..e3a4aba --- /dev/null +++ b/sources-experimental/MainController.cpp @@ -0,0 +1,1907 @@ +#include "MainController.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "AttributeExtractor.h" +#include "AttributeDumper.h" +#include "MemoryArchive.h" +#include "XMLChannelExtractor.h" + +#include "AttributeMap.h" +#include "ItemProperty.h" + +#include "curl/curl.h" + +#include "Utils.h" +#include "DownloadManager.h" +#include "MainWindow.h" +#include "Logger.h" + +#include "ActionDelete.h" +#include "DownloadListItem.h" +#include "Setting.h" +#include "BPSettingsWindow.h" +#include "BitmapWindow.h" + +#include "BPLocale.h" +#include "EntryIterator.h" + +#include "AutoFiletypeMap.h" + +#include "BPEpisode.h" + +DownloadManager* download_manager; + +//#include "LicenceInfo.h" +//extern LicenceInfo linfo; + +//messages: +#define DOWNLOAD_ITEM 'invD' +#define DOWNLOAD_CHANNEL 'addu' + +#define VLC_SIGNATURE "application/x-vnd.videolan-vlc" +#define SOUNDPLAY_SIGNATURE "application/x-vnd.marcone-soundplay" + +#ifdef ZETA + #define MEDIAPLAYER_SIGNATURE "application/x-vnd.YT-MediaPlayer" +#else + #define MEDIAPLAYER_SIGNATURE "application/x-vnd.Haiku-MediaPlayer" + // THIS SHOULD BE FIXED! "application/x-vnd.Be.MediaPlayer" +#endif + + + + + + +//a tendere qui dovrebbe essere +//instaziato il model +MainController::MainController(MainWindow* view, MainModel* model){ + fView = view; + fModel = model; + download_manager = new DownloadManager(fView); + check_time = 0; + check_timer = NULL; + check_onstart = false; + //extraParams.SetTo(""); +} + +void +MainController::LoadSettings(const char* type,BMessage* data){ + + + + BString stype(type); + if(stype.Compare(SETTINGS_PROXY) == 0 ){ + download_manager->LoadProxySetting(data); + + } + else + if(stype.Compare(SETTINGS_DOWNLOAD) == 0 ){ + download_manager->LoadDownloadSetting(data); + } + else + if(stype.Compare(SETTINGS_FILETYPE) == 0){ + + browser_id = 2; //System Default. + player_id = 3; //Auto. + int32 ret; + if(data->FindInt32("browser_index",&ret) == B_OK) + browser_id = ret; + + if(data->FindInt32("player_index",&ret) == B_OK) + player_id = ret; + + } + else + if(stype.Compare(SETTINGS_CHANNELS) == 0 ){ + //one second: 1 000 000; + bigtime_t minute = 1000000 * 60; + + if(check_timer!=NULL) + delete check_timer; + + switch(data->FindInt32("check_time_index")) + { + case 0: + check_time=0; + break; + case 1: + check_time= minute * 5 ; //5 mins + break; + case 2: + check_time= minute * 15 ; //15 mins + break; + case 3: + check_time= minute * 30; //30 mins + break; + case 4: + check_time=minute * 60; //1h + break; + case 5: + check_time= minute * 120; //2h + break; + } + + check_onstart = data->FindBool("check_startup"); + + printf("Check every %lld microseconds..\n",check_time); + + if(check_time>0) + check_timer= new BMessageRunner(fView,new BMessage(CHECK_ALL),check_time); + + + } + + +} + +/* +void +MainController::DownloadSelectedItem(){ + + //ANNOTAZIONI: se si lascia solo DownloadItem(REF) si può pensare alla multiselezione. + + EpisodeListItem* sel = fView->GetSelectedEpisode(); + if(!sel) return; + + + if(DownloadItem( sel->fRef,sel )==B_OK) { + } + + //QUI: inserire il collegamento con SEL e Refresh dell' episodio. +} +*/ +status_t +MainController::DownloadItem(entry_ref ref,EpisodeListItem* epi) { + + //start a item download. + //------------------------------------------------------------------ + + //download view (only if there's already one) + DownloadListItem* item=fModel->findDownload(ref); + + BString enclosure_path; + BString enclosure_link; + BString enclosure_type = ""; + FileStatus status; + + if(item) + { + enclosure_path=item->fRss.EnclosureLocalPath(); + enclosure_link=item->fRss.EnclosureLink(); + enclosure_type=item->fRss.FileType(); + status=item->fRss.GetFileStatus(); + } + else + { + BPEpisode bpe(&ref); + if(bpe.InitCheck()!=B_OK) return B_ERROR; + enclosure_path=bpe.EnclosureLocalPath(); + enclosure_link=bpe.EnclosureLink(); + enclosure_type=bpe.EnclosureType(); + status= bpe.GetStatus(); + } + + if(enclosure_path == "" || enclosure_link == "") return B_ERROR; + + + + bool resume = false; + + if( status == NOT_DOWNLOADED || + status == STOPPED ) + { + + resume = (status == STOPPED ); + + BPath path(&ref); + if(path.GetParent(&path)!=B_OK) return B_ERROR; + + BDirectory dir; + path.Append("enclosures"); + + if(dir.SetTo(path.Path()) == B_ENTRY_NOT_FOUND) + if(dir.CreateDirectory(path.Path(),&dir)!=B_OK) return B_ERROR; + + + if(dir.InitCheck()!=B_OK) return B_ERROR; + + path.Append(enclosure_path.String()); + + entry_ref enclosure_ref; + get_ref_for_path(path.Path(),&enclosure_ref); + ActionDownload *ac=new ActionDownload(enclosure_link,enclosure_ref,resume, enclosure_type); + + ac->SetRef("episode_ref",&ref); + + + + + if( item ==NULL) { + item = new DownloadListItem(NULL); + AttributeExtractor an; + //HERE: we have to move data from ref to item->fRss. + an.SetNotifier(&item->fRss); + BNode bpe(&ref); + an.Parse(&bpe); + + item->fRef=ref; + fModel->addDownload(ref,item); + + if(epi) + item->LinkToEpisode(epi); + + fView->AddDownload(item); + + } + + ac->SetExtraData(item->fRss.Guid()); + item->fRss.SetFileStatus(ENQUEQUED); + download_manager->Enqueue(DownloadManager::ITEMS_QUEUE,ac); + + return B_OK; + } + + return B_OK; +} + +void +MainController::InfoDownloadItem(BMessage* msg){ + + entry_ref ref; + if( msg->FindRef("episode_ref",&ref) != B_OK) return; + + DownloadListItem* item=fModel->findDownload(ref); + if(!item) return; + + ActionDownload::Status status = (ActionDownload::Status)msg->FindInt32("status"); + + RssItem* rss = &item->fRss; + if(!rss) return; + + switch(status){ + case ActionDownload::OK_DOWNLOADED: + { + + AttributeDumper dumper(&ref); + + rss->AddElementListener(&dumper); + rss->SetFileStatus(DOWNLOADED);//actually save the rss-file + rss->RemoveElementListener(&dumper); + + //FIX: test questo if. + if(fModel->fSelectedItem.InitCheck()==B_OK && fModel->fSelectedItem == BNode(&ref) ) { + UpdateSelected(); + } + } + break; + case ActionDownload::OK_CONNECTING: + rss->SetFileStatus(CONNECTING); + break; + case ActionDownload::OK_PROGRESS: + { + + int32 perc; + if(msg->FindInt32("percentage_progress",&perc)==B_OK) { + item->fRss.SetDownloadSpeed(msg->FindFloat("download_speed")); + item->fRss.SetFilePercentage(perc); + } + + rss->SetFileStatus(DOWNLOADING); + + //item->SetFilePercentageAndSpeed(perc,msg->FindFloat("download_speed")); + } + break; + + case ActionDownload::ERROR_PERFORMING: + { + + int32 error=msg->FindInt32("curl_error"); + + switch(error){ + case CURLE_COULDNT_CONNECT: + case CURLE_HTTP_PORT_FAILED: + case CURLE_COULDNT_RESOLVE_HOST: + rss->SetFileStatus(CANT_CONNECT); + break; + case CURLE_HTTP_NOT_FOUND: + rss->SetFileStatus(NOT_FOUND); + break; + + case CURLE_WRITE_ERROR: + { + bool stopped = msg->FindBool("should_stop"); + + if(stopped){ + AttributeDumper dumper(&ref); + rss->AddElementListener(&dumper); + rss->SetFileStatus(STOPPED); //actually save the rss-file + rss->RemoveElementListener(&dumper); + } + + if(item->fShouldMeRemoved) + RealRemoveDownload(item); + + } + break; + + case CURLE_BAD_DOWNLOAD_RESUME: + case CURLE_ABORTED_BY_CALLBACK: + + default: + rss->SetFileStatus(ERROR); + break; + } + } + break; + + case ActionDownload::ERROR_CURL_INIT: + case ActionDownload::ERROR_OPENFILE: + default: + rss->SetFileStatus(ERROR); + break; + } +} + + +status_t +MainController::StopDownloadItem(entry_ref ref){ + + DownloadListItem* item=fModel->findDownload(ref); + if(!item) return B_ERROR; + + BString guid(item->fRss.Guid()); + if(guid == "") return B_ERROR; + + FileStatus status = item->fRss.GetFileStatus(); + + //------------------------------------------------------------------ + + if(status== DOWNLOADING){ + download_manager->TryStopCurrentAction(DownloadManager::ITEMS_QUEUE,"extra",guid); + } + else + if(status == ENQUEQUED){ + bool result=download_manager->RemoveFromQueue(DownloadManager::ITEMS_QUEUE,"extra",guid); + if(result) + item->fRss.SetFileStatus(NOT_DOWNLOADED); //this iclude also refresh of donwload item AND (if linked) the episodeListItem. + } + + return B_OK; +} + + + +status_t +MainController::PlayItem(entry_ref ref){ + + BPEpisode bpe(&ref); + + if(bpe.InitCheck()!=B_OK) return B_ERROR; + + BString enclosure_path(bpe.EnclosureLocalPath()); + + if(enclosure_path == "" ) + WWWItem(ref); + + //------------------------------------------------------------------ + BPath path(&ref); + if(path.GetParent(&path)!=B_OK) return B_ERROR; + + BDirectory dir; + path.Append("enclosures"); + + if(dir.SetTo(path.Path()) == B_ENTRY_NOT_FOUND) return B_ERROR; + + path.Append(enclosure_path.String()); + + BString filetype(bpe.EnclosureType()); + OpenFile(path.Path(),filetype); + + return B_OK; +} + +void +MainController::ShowChannelImage(entry_ref ref){ + + //TODO: add image extractor from FileAttribute. (?) + + //new style + BNode dir(&ref); + if(dir.InitCheck()!=B_OK ) return; + + char* buffer; + int32 size; + status_t err = ReadAttributeData(&dir,ATTR_IMAGE,&buffer,&size); + + if(err !=B_OK ) return; + + BMessage iconMsg; + + if (iconMsg.Unflatten(buffer) != B_OK) { + free(buffer); + return ; + }; + BBitmap* icon = new BBitmap(&iconMsg); + if(!icon) { + free(buffer); + return; + } + + (new BitmapWindow(icon))->Show(); +} + + +void +MainController::SetSelectedItem(entry_ref* ref,entry_ref *nref){ + + //debugger("SEL"); + + if(BNode(ref) == fModel->fSelectedItem && + BDirectory(nref) == fModel->fSelectedChannel ) { + return; + } + + if(nref) + fModel->fSelectedChannel.SetTo(nref); + else + fModel->fSelectedChannel.Unset(); + + if(ref) + fModel->fSelectedItem.SetTo(ref); + else + fModel->fSelectedItem.Unset(); + + + SubscriptionListItem* row=fView->GetSelectedSubscription(); + if(!row) return; + + EpisodeListItem* sel = fView->GetSelectedEpisode(); + + if(sel && sel->IsNew()){ + BPEpisode bpe(&sel->fRef); + bpe.AddElementListener(sel); + BString enclosure(bpe.EnclosureLink()); + if(enclosure != "") + bpe.SetStatus(NOT_DOWNLOADED); + else + bpe.SetStatus(NO_ENCLOSURE); + + row->AddNewCount(-1); + fView->RefreshSubscription(row); + } + + UpdateSelected(); +} + +void +MainController::UpdateSelected() { + + //reloads the MemoryArchive and update view. + MemoryArchive* archive=&fModel->fCurrentSelectedItem; + + archive->MakeEmpty(); + + AttributeExtractor extractor; + freeNotifier.AddElementListener(archive); + extractor.SetNotifier(&freeNotifier); + + if(fModel->fSelectedChannel.InitCheck()==B_OK){ + extractor.Parse(&fModel->fSelectedChannel,true); + } + + if(fModel->fSelectedItem.InitCheck()==B_OK) { + extractor.Parse(&fModel->fSelectedItem,true); + } + + freeNotifier.RemoveElementListener(archive); + fView->ShowDescription(archive); +} + + +/* +void +MainController::SetSelectedChannel(BString url){ + + ChannelInfo* ci = fModel->fChInfo.ValueFor(url); + if(!ci) return; + + if(!ci->row) return; + + EpisodeListView* dx_list= ci->elv; + if(!dx_list) return; + + EpisodeListItem* sel = (EpisodeListItem*)dx_list->CurrentSelection(); + + fModel->fCurrentSelectedChannel.MakeEmpty(); + MemoryArchive* archive=&fModel->fCurrentSelectedChannel; + + AttributeExtractor extractor; + freeNotifier.AddElementListener(archive); + extractor.SetNotifier(&freeNotifier); + + + if(ci->row!=NULL){ + BDirectory dir(&ci->nref); + if(dir.InitCheck()==B_OK){ + extractor.Parse(&dir,true); + } + } + + freeNotifier.RemoveElementListener(archive); + //fView->ShowDescription(archive); +} +*/ + +status_t +MainController::FindItem(entry_ref ref){ + + //FIX DA CONTROLLARE + + BPath path(&ref); + path.GetParent(&path); + entry_ref parent; + get_ref_for_path(path.Path(),&parent); + + int32 count=fModel->fChInfo.CountItems(); + SubscriptionListItem* row=NULL; + + for(int i=0;ifChInfo.ValueAt(i); + BDirectory dir(&row->fRef); + if( BNode(&dir,NULL) == BNode(&parent)) + break; + else + row=NULL; + } + + if(!row) return B_ERROR; + + EpisodeListView* dx_list= fView->GetEpisodeListView(); + if(!dx_list) return B_ERROR; + + + // FIX come faccio a selezionare questo? + // dovrei fare una bella cosa: se è la view visibile allora lo seleziono, + // altrimenti bisogna notificare a fView di selezionare il canale E di preparare quel ref per essere + // il selezionato. + + //dx_list->DeselectAll(); + //dx_list->AddToSelection(sel); + fView->SelectSubscription(row); + return B_OK; +} + + +void +MainController::WWWItem(entry_ref ref){ + + BPEpisode bpe(&ref); + + BString link=bpe.EnclosureLink(); + if(link == "") return; + + OpenURL(link); +} + +bool +MainController::DeleteEpisode(entry_ref ref){ + + //FIX: da testare! + + DownloadListItem* item = fModel->findDownload(ref); + + if(item){ + StopDownloadItem(ref); + RealRemoveDownload(item); + } + + //cancellare l'enclosure + BPEpisode bpe(&ref); + FileStatus status=bpe.GetStatus(); + BString enclosure_path=bpe.EnclosureLocalPath(); + if(enclosure_path != ""){ + BPath path(&ref); + if(path.GetParent(&path)==B_OK){ + path.Append("enclosures"); + path.Append(enclosure_path.String()); + unlink(path.Path()); + } + } + + //cancellare l' file-item + BPath file_item(&ref); + unlink(file_item.Path()); + + //FIX: attenzione questo metodo non 'tocca' + // la grafica (fView) perchè lo fa invece la action.. + // si discosta dal resto.. ma è sbagliato, o forse anche + // altre action dovrebbero essere così 'agressive' ? + return (status == NEW ); +} + + +status_t +MainController::RemoveDownload(entry_ref ref){ + + DownloadListItem* dli=fModel->findDownload(ref); + if(!dli || dli->fShouldMeRemoved) return B_ERROR; + + dli->fShouldMeRemoved=true; + StopDownloadItem(ref); + return B_OK; +} + +void +MainController::RealRemoveDownload(DownloadListItem* dli){ + dli->Unlink(); + fModel->removeDownload(dli->fRef); + fView->RemoveDownload(dli); + delete dli; +} + + +const MemoryArchive* +MainController::GetSelectedItem(){ + return &fModel->fCurrentSelectedItem; +} + +void +MainController::FolderSelectedChannel(entry_ref nref){ + + //use preferred application. + BString app = PathFolderChannel(nref); + const char *args[] = { app.String(), 0 }; + be_roster->Launch("application/x-vnd.Be-directory", 1, const_cast(args)); + printf("trying to open %s\n", app.String()); +} + + +BString +MainController::PathFolderChannel(entry_ref nref){ + + SubscriptionListItem* row=fModel->fChInfo.ValueFor(nref); + if(!row) return "impossible"; + + BPath path(&row->fRef); + path.Append("enclosures"); + + BEntry check(path.Path()); + if(check.InitCheck()== B_OK && !check.Exists()) + path.SetTo(&row->fRef); + + return path.Path(); +} + +void +MainController::DownloadChannel(BMessage* msg){ + + BString url; + if(msg->FindString("url",&url)!=B_OK || url == "" ) return; + + //FIX test di url già presente! + int32 count=fModel->fChInfo.CountItems(); + for(int32 i=0;ifChInfo.ValueAt(i)->GetURL().ICompare(url)==B_OK) return; //URL già presente! + + /*if(!linfo.Valid() && count > 10) + { + + BString text(_T("You can only add up to 10 channels in this unregistred BePodder version.\n Please register your copy\n")); + BPAlert* about = new BPAlert("Sorry", text.String() ,_T("Web Site"),_T("Close"),NULL,B_WIDTH_AS_USUAL,LoadIcon("logo-64.png")); + int ret=about->Go(); + if(ret==0){ + OpenURL("http://www.funkyideasoft.com/bepodder.html"); + } + return; + }*/ + + + AttributeDumper dumper(&fModel->archive_ref,true); + entry_ref nref; + dumper.GetEntryRef(&nref); + + SubscriptionListItem* row= new SubscriptionListItem(nref); + fView->AddSubscription(row,NULL); + fView->ScrollToSubscripion(row); + row->SetPreferredPosition(fView->IndexOfSubscription(row)); + + RssChannel* channel = &row->fChannel; + channel->AddElementListener(&dumper); //in order to save as attribute + + channel->SetTitle(url.String()); + channel->SetURL(url.String()); + channel->SetFileStatus(NOT_DOWNLOADED); + + channel->RemoveElementListener(&dumper); + + fModel->fChInfo.AddItem(nref,row); + CheckChannel(nref); +} + +void +MainController::InfoDownloadChannel(BMessage* msg){ + + //info di download di un channel. + + + entry_ref nref; + + if(msg->FindRef("channel_ref",&nref)!=B_OK) return; + + + SubscriptionListItem* row = fModel->fChInfo.ValueFor(nref); + if(!row) return; + + + RssChannel* channel= &row->fChannel; + + + ActionDownload::Status status = (ActionDownload::Status)msg->FindInt32("status"); + + //LOG("MainController",liDebug,"InfoChannel status %ld",status); + + + switch(status){ + + + + case ActionDownload::OK_DOWNLOADED: + { + + MemoryArchive c_archive; + AttributeDumper dumper(&row->fRef); + + channel->AddElementListener(&dumper); //update the channel file. + channel->AddElementListener(&c_archive); //temp info in memory. + + channel->SetFileStatus(DOWNLOADED); + + BString path; + msg->FindString("path",&path); + + XMLChannelExtractor ext; + ext.SetNotifier(channel); + BList *list = ext.Parse(path.String()); + + if(!list) { + + channel->SetFileStatus(BAD_FORMAT); + channel->RemoveElementListener(&dumper); + channel->RemoveElementListener(&c_archive); + + fView->RefreshSubscription(row); + return; //check (delete di qualcosa?) + } + + + // come procedere (non mi delizia la cosa) + // abbiamo N files nella directory e K file nella lista. + // scorriamo UNA VOLTA gli N file e leggiamo l'attributo GUID. + // lo confrontiamo con tutti gli elementi K. + // se match, lo eliminiamo dalla lista se no lo lasciamo. + BDirectory dir(&row->fRef); + EntryListBase *result = new CachedDirectoryEntryList(dir); + + result->Rewind(); + entry_ref ref; + + //FIX: + /* + bool delNew=false; + bool delOld=false; + + if(row->extraSetting) { + BMessage del; + if(row->extraSetting->FindMessage("channel_setting",&del) == B_OK){ + del.FindBool("what_delete_new",&delNew); + del.FindBool("what_delete_read",&delOld); + del.PrintToStream(); + } + } + + int32 removed=0; + bool forceUpdate=false; + */ + + while( list->CountItems() > 0 && result->GetNextRef(&ref) == B_OK ){ + + BPEpisode bpe(&ref); + + //qui ho diritto di vita o di morte sul file selezionato.. prima cosa riepilogo i settaggi che ho: + //bene, già qui abbiamo un problema: come ottengo quello che non ho? + //bha proviamo un pò.. + //debugger(";)"); + //if( (delNew && bpe.GetStatus() == NEW ) || + /*if (delOld && bpe.GetStatus() != DOWNLOADED ) { + + + if(DeleteEpisode(ref)) removed--; + forceUpdate = true; + + }*/ + + + BString guid(bpe.Guid()); + if(guid != "") { + int32 newCount = list->CountItems(); + for(int i=newCount - 1 ;i >= 0 ;i--){ + MemoryArchive *ma =(MemoryArchive*)list->ItemAt(i); + if(ma->GetDataString(ITEM_GUID).Compare(guid) == 0) { + list->RemoveItem(ma); + delete ma; + // break; // meglio toglierlo in caso nella lista esistano + elementi con lo stesso GUID (raro) + } + } + + + + } + } + + //FIX if(removed!=0) + // row->AddNewCount(removed); + + + int added=0; + + while(list->CountItems()){ + + MemoryArchive *ma =(MemoryArchive*)list->ItemAt(0); + //we have it, removes from the list: + list->RemoveItem(ma); + + + BString guid(ma->GetDataString(ITEM_GUID)); + + RssItem fake; + EpisodeListItem *ep=NULL; + + //new EPISODE file: + AttributeDumper dumper(&row->fRef,false); + fake.AddElementListener(&dumper); + + + if(row == fView->GetSelectedSubscription()) { + ep=new EpisodeListItem(); + fake.AddElementListener(ep); + } + + ma->FillListener(&fake); //save to file + + fake.RemoveElementListener(&dumper); + + if(ep){ + fake.RemoveElementListener(ep); + dumper.GetEntryRef(&ep->fRef); + fView->GetEpisodeListView()->AddRow(ep,0,(BRow*)NULL); + + } + added++; + } + + delete list; + + channel->RemoveElementListener(&dumper); + channel->RemoveElementListener(&c_archive); + + if(added > 0) { + row->SetIsNew(true); + channel->SetKeyInt32(CHANNEL_NEWITEMS,added); +//FIX:ask? dx_list->Refresh(); + } + + //we can check for an image link and maybe add the the LowPrority queue. + + BString imageLink(c_archive.GetDataString(CHANNEL_IMAGE_URL)); + if(imageLink != "" && !row->HasOwnImage()) + { + + BDirectory dir; //channel + if(dir.SetTo(&row->fRef)!=B_OK) return; + + BPath path(&dir,NULL); //path to channel + + path.Append("image"); + + entry_ref ref; + get_ref_for_path(path.Path(),&ref); + + ActionDownload* ac= new ActionDownload(imageLink,ref,false, "image"); + + ac->SetRef("channel_ref",&row->fRef); + ac->SetExtraData("image"); + + //low->AddAction(ac); + download_manager->Enqueue(DownloadManager::EXTRA_QUEUE,ac); + } + + //final touch; if this channel is the selected one then update Info panel + if(row == fView->GetSelectedSubscription()){ + //FIX + /* if(forceUpdate) { + è sbagliato tra laltro (mi sembra!) + fModel->fSelectedChannel.Unset(); + fModel->fSelectedItem.Unset(); + SwitchChannel(&row->fRef); + } + else*/ + fView->ShowDescription(&fModel->fCurrentSelectedItem); + + } + + + } + break; + case ActionDownload::OK_PROGRESS: + { + channel->SetFileStatus(DOWNLOADING); + int32 perc = 0; + if(msg->FindInt32("percentage_progress",&perc)==B_OK) + { + row->SetFilePercentage(perc); + } + } + break; + case ActionDownload::OK_CONNECTING: + channel->SetFileStatus(CONNECTING); + break; + case ActionDownload::ERROR_PERFORMING: + { + int32 error=msg->FindInt32("curl_error"); + + + switch(error){ + case CURLE_COULDNT_CONNECT: + case CURLE_HTTP_PORT_FAILED: + case CURLE_COULDNT_RESOLVE_HOST: + channel->SetFileStatus(CANT_CONNECT); + break; + case CURLE_HTTP_NOT_FOUND: + channel->SetFileStatus(NOT_FOUND); + break; + default: + channel->SetFileStatus(ERROR); + break; + } + } + break; + default: + channel->SetFileStatus(ERROR); //TODO: more verbose. + break; + + } //end switch + + fView->RefreshSubscription(row); +} + + +void +MainController::ParseArchive() +{ + //if(!linfo.Valid()) + // be_app->PostMessage('lic2',be_app); + + + BPath path(GetAppRelativePath().String()); + path.Append("archive"); + + BEntry e(path.Path(),true); + + if(e.InitCheck() !=B_OK) { + be_app->PostMessage(B_QUIT_REQUESTED); + printf("No valid archive directory! (%s) \n",path.Path()); + return; + } + + //se la directory non esiste cerca di crearla. + + if(!e.Exists()){ + BDirectory archive; + if( archive.CreateDirectory(path.Path(),&archive) != B_OK) { + be_app->PostMessage(B_QUIT_REQUESTED); + printf("Can't create archive directory! (%s) \n",path.Path()); + return; + } + } + + e.GetRef(&(fModel->archive_ref)); + + uint32 flags=0; + + if(fView->Lock()){ + flags = fView->Flags(); + fView->SetFlags( flags | B_NOT_RESIZABLE); + fView->Unlock(); + } + + bigtime_t start = real_time_clock_usecs(); + + + BDirectory dir(&fModel->archive_ref); + + //LOAD GROUPS: + + BMessage groups; + ReadAttributeMessage(&dir,ATTR_GROUPS,&groups); + LoadGroupSetting(&groups); + + //LOAD CACHE: + + BMessage cache; + ReadAttributeMessage(&dir,ATTR_CACHE,&cache); + + BEntry entry; + while(dir.GetNextEntry(&entry) == B_OK) + if(entry.InitCheck()==B_OK && entry.IsDirectory()){ + + /*if(!linfo.Valid() && fModel->fChInfo.CountItems() > 10) + break; + else*/ + CreateChannelItem(&entry,&cache); + } + + bigtime_t stop = real_time_clock_usecs(); + + printf("Parsing time %lld secs. \n",(stop-start)/1000000); + + cache.MakeEmpty(); + + WriteAttributeMessage(&dir,ATTR_CACHE,&cache); + + if(fView->Lock()){ + fView->SetFlags( flags ); + fView->Unlock(); + } + + if(check_onstart) + fView->PostMessage(new BMessage(CHECK_ALL)); + +} + +int32 +CountNewItems(entry_ref nref){ + + BDirectory dir(&nref); + dir.Rewind(); + const char* name="bp:item_status"; + int32 total = 0; + + entry_ref ref; + while(dir.GetNextRef(&ref) == B_OK) { + BNode node(&ref); + + status_t status = node.InitCheck(); + if (status < B_OK) continue; + int32 dest; + if( ReadAttributeInt32(&node,name,&dest) == B_OK && dest==8) + total++; + } + return total; +} + + +void +MainController::CreateChannelItem(BEntry* e,BMessage* cache) +{ + BNode node(e); + + if(!CheckMIME(MIME_CHANNEL,&node)) return; + + entry_ref nref; + e->GetRef(&nref); + + SubscriptionListItem *row=new SubscriptionListItem(nref); + + //parsing degli attribute.. + + AttributeExtractor an; + an.SetNotifier(&row->fChannel); + an.Parse(&node); + + //--- c'e' L'url? se no delete di tutto e ciao! ---// + + if(row->GetURL() == "") { + delete row; + return; + } + + + //check delle info di cache.. + time_t when=1; + time_t now=0; + if(node.GetModificationTime(&now)!=B_OK) now=0; + + BString key=row->GetURL(); + key << "_count"; + int32 count; + + if( cache->FindInt32(key.String(),&count)!=B_OK || + cache->FindInt32(row->GetURL().String(),&when)!=B_OK || when!=now) { + printf("Recaching for.. %s\n",row->GetURL().String()); + count=CountNewItems(row->fRef); + } + + row->AddNewCount(count); + + BMessage data; + if( ReadAttributeMessage(&node,ATTR_COLUMNS_STATE,&data) == B_OK) + row->columnsState = new BMessage(data); + + data.MakeEmpty(); + GroupItem* group=NULL; + if( ReadAttributeMessage(&node,ATTR_EXTRA_STATE,&data) == B_OK) + group=LoadExtraState(&data,row); + + + if(fView->Lock()){ + fView->SetSortingSubscriptions(true); + fView->AddSubscription(row,group); + fModel->fChInfo.AddItem(row->fRef,row); + fView->SetSortingSubscriptions(false); + fView->Unlock(); + } + +} + +void +MainController::OpenFile(const char* filename,BString filetype){ + + entry_ref ref; + get_ref_for_path(filename,&ref); + + BMessage refs(B_REFS_RECEIVED); + refs.AddRef("refs",&ref); + + + int b = -1; + + BString alert; + + if(player_id ==3) //auto + { + b = FindBestApplication(&ref,alert); + + if(alert != "") { + BPAlert *pop= new BPAlert("BePodder", alert.String() ,_T("Ok"),NULL,NULL,B_WIDTH_AS_USUAL,LoadIcon("logo-64.png")); + pop->Go(); + } + } + else + { + + if(filetype == "" || (filetype.FindFirst("audio/") >= 0 ) + || (filetype.FindFirst("video/") >= 0 ) ) + b = player_id; + } + + switch(b){ + case -1: + //use preferred application. + be_roster->Launch(&ref); + break; + case 0: + if(be_roster->Launch(MEDIAPLAYER_SIGNATURE,&refs)!=B_OK) + AlertBadPlayer(MEDIAPLAYER); + break; + case 1: + if(be_roster->Launch(SOUNDPLAY_SIGNATURE,&refs) !=B_OK) + AlertBadPlayer(SOUNDPLAY); + break; + case 2: + if(be_roster->Launch(VLC_SIGNATURE,&refs) !=B_OK) + AlertBadPlayer(VLC); + break; + default: + break; + }; +} + + +void +MainController::AlertBadPlayer(int32 p_id){ + + BString text(_T("Can't open the selected file with:\n\n")); + BString url; + + if ( p_id == MEDIAPLAYER) + { + text << "MediaPlayer"; + url.SetTo("http://www.haiku-os.com/"); + } + else + if ( p_id ==VLC) + { + text << "VideoLAN"; + url.SetTo("http://www.bebits.com/app/2119"); + } + else + if(p_id==SOUNDPLAY) + { + text << "SoundPlay"; + url.SetTo("http://www.bebits.com/app/156"); + } + + text << _T("\n\nPlease check if the application is installed in the right way.\n"); + + + BPAlert *pop= new BPAlert("BePodder", text.String() ,_T("Download it!"),_T("Close"),NULL,B_WIDTH_AS_USUAL,LoadIcon("logo-64.png")); + int32 ret=pop->Go(); + if(ret==0) + OpenURL(url); + + + +} + + +void +MainController::OpenURL(BString link){ + + BString app("text/html"); + + if ( browser_id == 0 ) //Firefox. + { + app.SetTo("application/Firefox"); + entry_ref ff; + if(be_roster->FindApp("application/Firefox",&ff) == B_OK) { + + BString path(BPath(&ff).Path()); + path.RemoveLast("-bin"); + path << " " << link << " &"; + system(path.String()); + } + else + if(be_roster->FindApp("application/x-vnd.Mozilla-Firefox",&ff) == B_OK) { + + BString path(BPath(&ff).Path()); + path.RemoveLast("-bin"); + path << " " << link << " &"; + system(path.String()); + } + else // Net+ + { + app.SetTo("application/x-vnd.Be-NPOS"); + const char *args[] = { link.String(), 0 }; + be_roster->Launch (app.String(), 1, const_cast(args)); + } + + + } + else + if ( browser_id == 2 ) // Default + { + app.SetTo("text/html"); + const char *args[] = { link.String(), 0 }; + be_roster->Launch (app.String(), 1, const_cast(args)); + } + + else // Net+ + { + app.SetTo("application/x-vnd.Be-NPOS"); + const char *args[] = { link.String(), 0 }; + be_roster->Launch (app.String(), 1, const_cast(args)); + } +} + +void +MainController::SaveGroupSetting(BMessage* grp){ + for(int32 i=0;i< fModel->fGroups.CountItems();i++) { + GroupItem* group=fModel->fGroups.ValueAt(i); + grp->AddString("group_name",group->GroupName()); + grp->AddBool("group_expanded",group->IsExpanded()); + } +} + +void +MainController::LoadGroupSetting(BMessage* grp){ + int i=0; + BString name; + bool expanded; + + while(grp->FindString("group_name",i,&name)==B_OK){ + grp->FindBool("group_expanded",i++,&expanded); + + AddSavedGroup(name.String(),expanded); + //FIX APPLY EXPAND OR NOT! + } +} + + +void +MainController::SaveColumnsState(BMessage* msg){ + + EpisodeListView* elv=fView->GetEpisodeListView(); + + msg->MakeEmpty(); + msg->AddRect("view_rect",elv->Bounds()); + + int32 count = elv->CountColumns(); + + for(int i=0;iColumnAt(i); + msg->AddFloat("width",col->Width()); + msg->AddBool("visible",col->IsVisible()); + msg->AddInt32("position",col->LogicalFieldNum()); + } + + BMessage superstate; + elv->SaveState(&superstate); + msg->AddMessage("state",&superstate); + +} + +void +MainController::LoadColumnsState(BMessage* msg){ + + EpisodeListView* elv=fView->GetEpisodeListView(); + elv->SetEditMode(true); + + BRect bounds = msg->FindRect("view_rect"); + if(bounds.top!=0 || bounds.left!=0 || bounds.right <= bounds.left) return; // safety? + + int32 count = elv->CountColumns(); + + for(int i=0;iFindInt32("position",i,&position) != B_OK) + position = i; + + BColumn *col = (BColumn*) elv->ColumnAt(position); + elv->SetColumnVisible(col,false); + + float w; + if(msg->FindFloat("width",i,&w)==B_OK) + col->SetWidth(w); + + bool visible; + + if(msg->FindBool("visible",i,&visible)== B_OK) + elv->SetColumnVisible(col,visible); + else + elv->SetColumnVisible(col,true); + + } + + + BMessage superstate; + if(msg->FindMessage("state",&superstate)==B_OK) + elv->LoadState(&superstate); + + + elv->GetTitleView()->ScrollTo(BPoint(bounds.Width(),0)); + elv->GetTitleView()->ScrollTo(BPoint(0,0)); + elv->GetScrollView()->ScrollTo(BPoint(0,0)); + + elv->SetEditMode(false); + +} + +void +MainController::SaveExtraState(BMessage* msg, SubscriptionListItem* row){ + + int32 index = fView->IndexOfSubscription(row); + msg->AddInt32("preferred_index", index); + BString group=fView->GroupOf(row); + + if(group !="") + msg->AddString("group_name", group); +} + +GroupItem* +MainController::LoadExtraState(BMessage* msg, SubscriptionListItem* row){ + int32 index = -1; + if(msg->FindInt32("preferred_index",&index) !=B_OK) index=-1; + row->SetPreferredPosition(index); + + BString group; + if(msg->FindString("group_name", &group)==B_OK) + return AddSavedGroup(group.String(),true); + + return NULL; +} + +void +MainController::ArchiveChannel(entry_ref nref){ + TRACE_CLASS; + + SubscriptionListItem* row = fModel->fChInfo.ValueFor(nref); + if(!row) return; + + BDirectory dir(&row->fRef); + BNodeInfo(&dir).SetType(MIME_ARCHIVED_CHANNEL); + + //remove from gui. + RemoveChannelFromUI(nref,row); +} + +status_t +MainController::DeleteChannel(entry_ref nref){ + + //FIX DA TESTARE + + //cancellare e togliere tutti i download che hanno un ref nel canale. + + SubscriptionListItem* row = fModel->fChInfo.ValueFor(nref); + if(!row) return B_ERROR; + + BDirectory dir(&nref); + EntryListBase *result = new CachedDirectoryEntryList(dir); + + result->Rewind(); + entry_ref ref; + + + while(result->GetNextRef(&ref) == B_OK ){ + DownloadListItem* item = fModel->findDownload(ref); + if(item) + RealRemoveDownload(item); + } + + + BPath path(&nref); + BString filename(path.Path()); + + //do it + LOG("MainController",liDebug,"Unlinking %s",filename.String()); + + ActionDelete del(filename,true); + status_t ret = del.Perform(NULL); + + if(ret !=B_OK ){ + LOG("MainController",liDebug,"Error %s",strerror(errno)); + return B_ERROR; + } + + RemoveChannelFromUI(nref,row); + return B_OK; +} + +void +MainController::RemoveChannelFromUI(entry_ref nref,SubscriptionListItem* row){ + fModel->fChInfo.RemoveItemFor(nref); + fView->RemoveSubscription(row); +// fView->RefreshSubscriptionLists(); //maybe not needed but it's ok.. +} + +void +MainController::CheckChannel(entry_ref nref){ + + SubscriptionListItem* row = fModel->fChInfo.ValueFor(nref); + if(!row) return; + + if( row->GetFileStatus()==ENQUEQUED || + row->GetFileStatus()==CONNECTING) return; + + BDirectory dir(&row->fRef); + + BPath apath(&dir,NULL); + apath.Append("rss.xml"); + + entry_ref ref; + get_ref_for_path(apath.Path(),&ref); + + BString url(row->GetURL()); + /* + check channel url. + replace pcast:// and feed:// + */ + if(url.FindFirst("pcast://") == 0) + url.ReplaceFirst("pcast://","http://"); + else + if(url.FindFirst("feed://") == 0) + url.ReplaceFirst("feed://","http://"); + + + ActionDownload* ac= new ActionDownload(url,ref,false, ""); + ac->SetActionID(real_time_clock_usecs()); + ac->SetRef("channel_ref",&row->fRef); + + //let's go.. + row->SetFileStatus(ENQUEQUED); + download_manager->Enqueue(DownloadManager::CHANNELS_QUEUE,ac); + + fView->RefreshSubscription(row); + +} + +void +MainController::CheckAllChannel(){ + + //the fView should be locked! + if(!fView->IsLocked()) return; + + int32 count =fModel->fChInfo.CountItems(); + + for(int i=0;ifChInfo.ValueAt(i); + if(row) + CheckChannel(row->fRef); + } + + +} + +void +MainController::InfoExtraDownload(BMessage* msg){ + + entry_ref nref; + if( msg->FindRef("channel_ref",&nref) != B_OK) return; + + SubscriptionListItem* row = fModel->fChInfo.ValueFor(nref); + if(!row) return; + + + RssChannel* channel=&row->fChannel; + if(!channel) return; + + ActionDownload::Status status = (ActionDownload::Status)msg->FindInt32("status"); + switch(status){ + + case ActionDownload::OK_DOWNLOADED: + { + entry_ref ref; + BString extra; + + msg->FindRef("entry",&ref); + msg->FindString("extra",&extra); + + if(extra.ICompare("image") == 0) + { + + BBitmap *logo = BTranslationUtils::GetBitmap(&ref); + if(!logo) return; + + + // what to do with this image? + AttributeDumper dump(&row->fRef); + row->fChannel.AddElementListener(&dump); + row->fChannel.SetKey(CHANNEL_IMAGE_DATA,(void*)logo,sizeof(BBitmap*)); + row->fChannel.RemoveElementListener(&dump); + delete logo; + + + } + + fView->RefreshSubscription(row); + } + default:break; + } +} + + +void +MainController::StoreStates(){ + + int32 count = fModel->fChInfo.CountItems(); + + BMessage cache; + BDirectory dir(&fModel->archive_ref); + + for(int i=0;ifChInfo.ValueAt(i); + if(!row) continue; + + BDirectory node(&row->fRef); + if(node.InitCheck()!=B_OK) continue; + + //do: write attribute! + + if(row->columnsState) + WriteAttributeMessage(&node,ATTR_COLUMNS_STATE,row->columnsState); + + + //now I can create the extra 'state' + BMessage extra; + SaveExtraState(&extra,row); + WriteAttributeMessage(&node,ATTR_EXTRA_STATE,&extra); + + //caching modification time... + time_t when; + if(node.GetModificationTime(&when)==B_OK) { + BString key=row->GetURL(); + cache.AddInt32(key.String(),when); + key << "_count"; + cache.AddInt32(key.String(),row->GetNewCount()); + } + } + + WriteAttributeMessage(&dir,ATTR_CACHE,&cache); + + + //STORE GROUPS: + BMessage groups; + SaveGroupSetting(&groups); + WriteAttributeMessage(&dir,ATTR_GROUPS,&groups); +} + +void +MainController::QuitRequested() { + + BList removed(5); + download_manager->RemoveQueue(DownloadManager::ITEMS_QUEUE,&removed); + + for(int i=0; i< removed.CountItems(); i++){ + + ActionDownload* down = (ActionDownload*) ( removed.ItemAt(i) ); + + entry_ref ref; + if(down->GetRef("entry_ref",&ref)!=B_OK) continue; + + BPEpisode bpe(&ref); + bpe.SetStatus(STOPPED); + + //FIX: forse bisogna scollegare l'item grafico? bho ma chi se ne frega.. stiamo quittando.. + } + + removed.MakeEmpty(); + + StoreStates(); +} + +void +MainController::AddNewGroup(const char* label){ + + GroupItem* gi=NULL; + BString text(label); + + int extra=0; + + do + { + text.SetTo(label); + + if(label==NULL) + text << _T("Group") << " " << fModel->fGroups.CountItems()+(extra++); + else + if(extra>0) + text << " " << extra; + + gi=fModel->fGroups.ValueFor(text); + extra++; + + } while(gi); + + //we have the name + + GroupItem* group=new GroupItem(text.String(), NULL); + fModel->fGroups.AddItem(text,group); + fView->AddGroup(group,true); +} + +void +MainController::RemoveGroup(BString name) { + GroupItem* new_g=fModel->fGroups.ValueFor(name); + if(!new_g) return; + + fView->RemoveGroup(new_g); + fModel->fGroups.RemoveItemFor(name); +} + +void +MainController::RenameGroup(BString oldname,BString newname) { + GroupItem* new_g=fModel->fGroups.ValueFor(newname); + if(new_g) return; + + GroupItem* old_g=fModel->fGroups.ValueFor(oldname); + if(!old_g) return; + + old_g->SetGroupName(newname); + + fModel->fGroups.RemoveItemFor(oldname); + fModel->fGroups.AddItem(newname,old_g); +} + + +GroupItem* +MainController::AddSavedGroup(BString text,bool expanded){ + + if(text == "") return NULL; + + GroupItem* gi=fModel->fGroups.ValueFor(text); + if(gi) return gi; //already present. + + GroupItem* group = new GroupItem(text.String(), NULL); + fModel->fGroups.AddItem(text,group); + + if(fView->Lock()){ + fView->AddGroup(group,expanded); + fView->Unlock(); + } + + return group; +} + +void +MainController::UnlinkDownloadItems(){ + int32 count=fModel->fDownloadList.CountItems(); + for(int i=0;ifDownloadList.ValueAt(i)->Unlink(); +} + +void +MainController::SwitchChannel(entry_ref* href) { + + //MainWindow DEVE essere Locked. + if(!fView->IsLocked()) return; + + SubscriptionListItem* row = NULL; + + if(href){ + + row = fModel->fChInfo.ValueFor(*href); + if( BDirectory(&row->fRef) == fModel->fSelectedChannel) return; + } + + + if(fModel->fSelectedChannel.InitCheck()==B_OK){ + + //giro del cazzo: + BEntry e; + entry_ref oldref; + fModel->fSelectedChannel.GetEntry(&e); + e.GetRef(&oldref); + + SubscriptionListItem* oldRow = fModel->fChInfo.ValueFor(oldref); + if(oldRow){ + //------> Save info on the ROW!.. + oldRow->SetIsNew(false); + if(!oldRow->columnsState) + oldRow->columnsState=new BMessage(); + + oldRow->columnsState->MakeEmpty(); + SaveColumnsState(oldRow->columnsState); + //FIX: manca salvataggio ultimo episode selezionato e anche scrollposition verticale! + //oldRow->lastSelected = fModel->fSelectedItem; + } + + } + + + UnlinkDownloadItems(); + fView->ClearEpisodeListView(); + +// RssChannel* channel=&row->fChannel; +// if(!channel) return; + + + //recall saved columns infos + if(row){ + + if(row->columnsState) + LoadColumnsState(row->columnsState); + + fValidThreads.clear(); + SetSelectedItem(NULL,&row->fRef); + ParseChannel(row->fRef); + } else { + + fValidThreads.clear(); + SetSelectedItem(NULL,NULL); + } + + +} + +void +MainController::ParseChannel(entry_ref ref) { + //crea thread, + // e via si parte. + + ParseParams *params = new ParseParams; + params->nref = ref; + params->fController = this; + + + thread_id addPosesThread = spawn_thread(&MainController::ParsingThread, "parser",B_DISPLAY_PRIORITY, params); + + if (addPosesThread >= B_OK) { + fValidThreads.insert(addPosesThread); + resume_thread(addPosesThread); + } + else + delete params; + + +} + +int32 +MainController::ParsingThread(void* data) { + //codice del thread. se + ParseParams *params = (ParseParams*)data; + MainController *fController=params->fController; + entry_ref ref = params->nref; + + + thread_id threadID = find_thread(NULL); + + BDirectory dir(&ref); + BEntry entry; + + while(dir.GetNextEntry(&entry) == B_OK && fController->fView->Lock() ) { + + if(fController->IsValidThread(threadID)){ + fController->AddEpisode(entry); + } + + fController->fView->Unlock(); + } + + delete params; + fController->fValidThreads.erase(threadID); + return 0; +} + + +bool +MainController::IsValidThread(thread_id currentThread) const { + return fValidThreads.find(currentThread) != fValidThreads.end(); +} + +void +MainController::AddEpisode(BEntry entry) { + + AttributeExtractor an; + + BNode item(&entry); + if(entry.InitCheck()==B_OK && !entry.IsDirectory() && CheckMIME(MIME_ITEM,&item) ) { + + RssItem fake; + + EpisodeListItem *ep=new EpisodeListItem(); + entry.GetRef(&ep->fRef); + fake.AddElementListener(ep); + + an.SetNotifier(&fake); + an.Parse(&item); + + + + //if the Rss doesn't have a UID? + if(fake.Guid() == "") { + delete ep; + return; + } + + DownloadListItem* dwn=fModel->fDownloadList.ValueFor(ep->fRef); + if(dwn) + { + dwn->LinkToEpisode(ep); + dwn->fRss.SetFileStatus(dwn->fRss.GetFileStatus()); + //TODO: altre info? + dwn->fRss.SetDownloadSpeed(dwn->GetLastSpeed()); + dwn->fRss.SetFilePercentage(dwn->GetPercentage()); + + } + else + { + + // check for percentage. + off_t total=ep->GetEnclosureSize(); + if(fake.GetFileStatus() == STOPPED && total>0){ + BPath path(&entry); + path.GetParent(&path); + path.Append("enclosure"); + path.Append(fake.EnclosureLocalPath().String()); + off_t size = 0; + entry.SetTo(path.Path()); + if(entry.InitCheck()==B_OK && entry.GetSize(&size)==B_OK && total>size ){ + fake.SetFilePercentage((int32)((size * 100/ total ))); + } + } + // end check for percentage. + } + + fView->AddEpisodeListItem(ep); + fake.RemoveElementListener(ep); //safety. + } +} diff --git a/sources-experimental/MainController.h b/sources-experimental/MainController.h new file mode 100644 index 0000000..e9db168 --- /dev/null +++ b/sources-experimental/MainController.h @@ -0,0 +1,136 @@ +#ifndef _MainController_ +#define _MainController_ + +#include "MainModel.h" +#include "Notifier.h" +#include + +class MainWindow; +class BMessageRunner; +class EpisodeListView; + +class MainController { + + public: + MainController(MainWindow* view, MainModel* model); + + //directory parser. + + void ParseArchive(); + + void CreateChannelItem(BEntry*,BMessage*); + + void InfoDownloadItem(BMessage* msg); + + void SetSelectedItem(entry_ref* ref,entry_ref *nref); //** cambiare nome! loadInfoItem(ref) **// + + const MemoryArchive* GetSelectedItem(); //anche questo è da eliminare.. chi lo usa?? + + /*** generic ***/ + + void WWWItem(entry_ref); + + bool DeleteEpisode(entry_ref); //true if the episode was NEW + + status_t PlayItem(entry_ref); + + status_t DownloadItem(entry_ref,EpisodeListItem* e=NULL); + + status_t StopDownloadItem(entry_ref); + + status_t FindItem(entry_ref); + + status_t RemoveDownload(entry_ref); + + + /***** Channels ***********/ + + + void ShowChannelImage(entry_ref); + void DownloadChannel(BMessage* msg); + void InfoDownloadChannel(BMessage* msg); + void FolderSelectedChannel(entry_ref nref); + + BString PathFolderChannel(entry_ref nref); + void ArchiveChannel(entry_ref nref); + status_t DeleteChannel(entry_ref nref); + + void CheckChannel(entry_ref nref); + void CheckAllChannel(); + void SwitchChannel(entry_ref* nref); + + + //groups + + void AddNewGroup(const char* label); + void RenameGroup(BString oldname,BString newname); + void RemoveGroup(BString name); + + void InfoExtraDownload(BMessage* msg); + + + + void OpenURL(BString link); + + void OpenFile(const char* filename,BString filetype); + + void QuitRequested(); + + void LoadSettings(const char* type,BMessage* data); + + private: + + void SaveGroupSetting(BMessage*); + void LoadGroupSetting(BMessage*); + void StoreStates(); + void RealRemoveDownload(DownloadListItem*); + void UpdateSelected(); + + void UnlinkDownloadItems(); + + GroupItem* AddSavedGroup(BString,bool); + + void RemoveChannelFromUI(entry_ref nref,SubscriptionListItem*); + + void LoadColumnsState(BMessage* msg); + void SaveColumnsState(BMessage* msg); + + + GroupItem* LoadExtraState(BMessage* msg, SubscriptionListItem*); + void SaveExtraState(BMessage* msg, SubscriptionListItem*); + + void AlertBadPlayer(int32 player_id); + + + MainWindow* fView; + MainModel* fModel; + Notifier freeNotifier; //di comodo! + + int32 player_id; + int32 browser_id; + + // timer + BMessageRunner* check_timer; + bigtime_t check_time; + bool check_onstart; + //BString extraParams; + + + void AddEpisode(BEntry); + + struct ParseParams { + entry_ref nref; + MainController* fController; + }; + + //void SaveCurrentChannelInfo(); + //MIX + BString selectedChannel; + std::set fValidThreads; + + bool IsValidThread(thread_id currentThread) const; + void ParseChannel(entry_ref nref); + static int32 ParsingThread(void* data); +}; + +#endif diff --git a/sources-experimental/MainModel.h b/sources-experimental/MainModel.h new file mode 100644 index 0000000..10403b2 --- /dev/null +++ b/sources-experimental/MainModel.h @@ -0,0 +1,63 @@ +#ifndef _MainModel_ +#define _MainModel_ + +#include +#include + +#include "SubscriptionListItem.h" +#include "DownloadListItem.h" +#include "MemoryArchive.h" +#include "GroupItem.h" + +#include "KeyMap.h" + +class MainModel { + + public: + + //the full 'list of channels: + KeyMap fChInfo; + + //the archive folder + entry_ref archive_ref; + + //groups + KeyMap fGroups; + + //current selected ITEM & CHANNEL + MemoryArchive fCurrentSelectedItem; + BNode fSelectedItem; + BDirectory fSelectedChannel; + + + // DOWNLOADS: + + // entry_ref (of the episode) <--> Object + KeyMap fDownloadList; + + void addDownload(entry_ref ref,DownloadListItem* obj) + { + fDownloadList.AddItem(ref,obj); + } + + DownloadListItem* findDownload(entry_ref ref) + { + bool found=false; + + DownloadListItem* obj=fDownloadList.ValueFor(ref,&found); + if(found) + return obj; + + return NULL; + } + + void removeDownload(entry_ref ref) + { + bool found; + fDownloadList.ValueFor(ref,&found); + if(found) + fDownloadList.RemoveItemFor(ref); + } +}; + +#endif diff --git a/sources-experimental/MainWindow.cpp b/sources-experimental/MainWindow.cpp new file mode 100644 index 0000000..a3420b6 --- /dev/null +++ b/sources-experimental/MainWindow.cpp @@ -0,0 +1,1504 @@ +#include "MainWindow.h" +#include "Application.h" +#include "BPSettingsWindow.h" +#include "AddWindow.h" +#include "DirectoryWindow.h" +#include "HelpWindow.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include "BPLocale.h" +#include + +#include "ColumnListView.h" +#include "ColumnTypes.h" + +#include "EpisodeListItem.h" +#include "SubscriptionListItem.h" + +#include "SplitPane.h" +#include "Utils.h" + +#include "IActionMenuItem.h" + +#include "MemoryArchive.h" +#include "htmlparse.h" +#include "ImageButton.h" +#include +#include "DownloadManager.h" + +#include "IconTextRender.h" +#include "TitleTextRender.h" +#include "GreenBoxTextRender.h" +//#include "BitmapTextRender.h" + +#include "curl/curl.h" +#include + +//#include "runview/RunView.h" +#include "ItemRunView.h" +#include "runview/Theme.h" + +#include "RVActionBP.h" +#include "RVActionBPOpenURL.h" + +#include "SectionSelector.h" + +#include "DownloadListView.h" +#include "DownloadListItem.h" +#include "MainController.h" +#include "IActionManagerBP.h" +#include "GroupItem.h" + +#include "IABPGroup.h" +#include "OPMLParser.h" + +#ifdef ZETA +#include +#endif + +//messages: + #define DOWNLOAD_ITEM 'invD' + #define DOWNLOAD_CHANNEL 'addu' + + + #define ITEM_SELECTED 'selD' + #define CHANGE_WORKSPACE 'wsch' + #define SET_FULLSCREEN 'full' + #define SHOW_SETTINGS 'setp' + #define SHOW_TOOLBAR 'notb' + #define SECTION_SELECTED 'sese' + + #define SHOW_HELP 'help' + #define WEB_PAGE 'webp' + + #define SHOW_DIRECTORY 'dish' + + #define IMPORT_OPML 'imop' + #define EXPORT_OPML 'exop' + #define PARSE_OPML 'paop' + +// file size: + const int64 kKB_SIZE = 1024; + const int64 kMB_SIZE = 1048576; + const int64 kGB_SIZE = 1073741824; + const int64 kTB_SIZE = kGB_SIZE * kKB_SIZE; + +//misc UI: + #define CHANNELS_BAR_X 7 + #define ITEMS_BAR_X 280 + #define BAR_Y 12 + + +// Singletons: + +//#include "LicenceInfo.h" +//extern LicenceInfo linfo; + +extern IActionManagerBP action_manager; + + +MainWindow::MainWindow() +: BWindow(BRect(100,100,970,607), "BePodder", B_DOCUMENT_WINDOW, B_ASYNCHRONOUS_CONTROLS){ + + #ifdef ZETA + AddIcon("folder",new BBitmap(GetTrackerIcon("application/x-vnd.Be-directory",16))); + AddIcon("image",new BBitmap(GetTrackerIcon("image/png",16))); + #else + BBitmap* folder=new BBitmap(BRect(0,0,15,15), 0, B_CMAP8); + BBitmap* image=new BBitmap(BRect(0,0,15,15), 0, B_CMAP8); + + BMimeType type("application/x-vnd.Be-directory"); + type.GetIcon(folder,B_MINI_ICON); + + BMimeType type2("image"); + type2.GetIcon(image,B_MINI_ICON); + + AddIcon("folder",folder); + AddIcon("image",image); + + #endif +} + +void +MainWindow::init(MainController* controller){ + + + SetController(controller); + + + rgb_color bgcolor = ui_color(B_PANEL_BACKGROUND_COLOR); +#ifdef ZETA + SetWindowColor(bgcolor); +#endif + + BRect rect(Bounds()); + rect.top = CreateMenuBar() + 1; + + view=new BBox(rect,NULL, B_FOLLOW_ALL, B_WILL_DRAW,B_NO_BORDER); +// view->SetViewColor(bgcolor); + AddChild(view); + + + + const BFont *font = be_plain_font; + rect = BRect(0,0,47,31); + + fChannelMenu = new BPopUpMenu("ChannelMenu"); + fChannelMenu->SetFont(font); + + + + const int COUNT = 4; + const int ChannelBar[COUNT] = + { + IACTION_CHANNEL_ADD_REQUEST, + IACTION_CHANNEL_REMOVE, + IACTION_CHANNEL_CHECK, + IACTION_CHANNEL_WWW + }; + + channelView=new BView(BRect(CHANNELS_BAR_X,BAR_Y,CHANNELS_BAR_X+47+66*(COUNT-1),BAR_Y+31),"",B_FOLLOW_NONE,B_WILL_DRAW); + channelView->SetViewColor(bgcolor); + view->AddChild(channelView); + + + //automatic for the people + int i; + for(i=0;iAddChild(tasto1); + rect.OffsetBy(66,0); + + fChannelMenu->AddItem(new IActionMenuItem(action_manager.GetAction(ChannelBar[i]))); + channels->AddItem(new IActionMenuItem(action_manager.GetAction(ChannelBar[i]))); + } + + //extras :) + fChannelMenu->AddSeparatorItem(); + fChannelMenu->AddItem(new IActionMenuItem(action_manager.GetAction(IACTION_CHANNEL_ENCLOSURE_FOLDER))); + fChannelMenu->AddItem(new IActionMenuItem(action_manager.GetAction(IACTION_CHANNEL_CHECK_ALL))); + fChannelMenu->AddSeparatorItem(); + fChannelMenu->AddItem(new IActionMenuItem(action_manager.GetAction(IACTION_CHANNEL_SHOW_IMAGE))); + fChannelMenu->SetTargetForItems(be_app); + + channels->AddSeparatorItem(); + channels->AddItem(new IActionMenuItem(action_manager.GetAction(IACTION_CHANNEL_ENCLOSURE_FOLDER))); + channels->AddItem(new IActionMenuItem(action_manager.GetAction(IACTION_CHANNEL_CHECK_ALL))); + channels->AddSeparatorItem(); + channels->AddItem(new IActionMenuItem(action_manager.GetAction(IACTION_CHANNEL_SHOW_IMAGE))); + channels->SetTargetForItems(be_app); + + rect = BRect(0,0,47,31); + rect.OffsetBy(338,0); + + fItemMenu = new BPopUpMenu("ItemMenu"); + fItemMenu->SetFont(font); + + const int COUNT2 = 4; + const int ItemBar[COUNT2] = + { + IACTION_ITEM_PLAY, + IACTION_ITEM_DOWNLOAD, + IACTION_ITEM_STOP, + IACTION_ITEM_REMOVE, + }; + + itemsView=new BView(BRect(ITEMS_BAR_X,BAR_Y,ITEMS_BAR_X+382+66*(COUNT2-1),BAR_Y+31),"",B_FOLLOW_LEFT_RIGHT,B_WILL_DRAW); + itemsView->SetViewColor(bgcolor); + //itemsView->SetDoubleBuffering(true); + view->AddChild(itemsView); + + //automatic for the people + for(i=0;iAddChild(tasto1); + rect.OffsetBy(66,0); + + + fItemMenu->AddItem(new IActionMenuItem(action_manager.GetAction(ItemBar[i]))); + items->AddItem(new IActionMenuItem(action_manager.GetAction(ItemBar[i]))); + } + + //extras :) + fItemMenu->AddSeparatorItem(); + fItemMenu->AddItem(new IActionMenuItem(action_manager.GetAction(IACTION_ITEM_WWW))); + fItemMenu->AddItem(new IActionMenuItem(action_manager.GetAction(IACTION_CHANNEL_ENCLOSURE_FOLDER))); + + items->AddSeparatorItem(); + items->AddItem(new IActionMenuItem(action_manager.GetAction(IACTION_ITEM_WWW))); + items->AddItem(new IActionMenuItem(action_manager.GetAction(IACTION_CHANNEL_ENCLOSURE_FOLDER))); + + fItemMenu->SetTargetForItems(be_app); + items->SetTargetForItems(be_app); + + // GROUPS MENU + + fGroupMenu = new BPopUpMenu("GroupsMenu"); + fGroupMenu->SetFont(font); + const int COUNT4 = 4; + const int groupBar[COUNT4] = + { + IACTION_GROUP_CHECK, + IACTION_GROUP_ADD, + IACTION_GROUP_RENAME, + IACTION_GROUP_REMOVE, + }; + + + //automatic for the people + for(i=0;iAddItem(new IActionMenuItem(action_manager.GetAction(groupBar[i]))); + groups->AddItem(new IActionMenuItem(action_manager.GetAction(groupBar[i]))); + } + + groups->SetTargetForItems(be_app); + fGroupMenu->SetTargetForItems(be_app); + + //DOWNLOAD MENU + + + fDownloadMenu = new BPopUpMenu("DownMenu"); + fDownloadMenu->SetFont(font); + + const int COUNT3 = 5; + const int downBar[COUNT3] = + { + IACTION_DOWNLOAD_PLAY, + IACTION_DOWNLOAD_STOP, + IACTION_DOWNLOAD_DOWNLOAD, + IACTION_DOWNLOAD_FIND_ITEM, + IACTION_DOWNLOAD_REMOVE + }; + + + //automatic for the people + for(i=0;iAddItem(new IActionMenuItem(action_manager.GetAction(downBar[i]))); + } + + fDownloadMenu->SetTargetForItems(be_app); + + + //BButton *tasto8= new BButton(BRect(725,11,835,41),"Send","Please feedback :)",new BMessage('send')); + //view->AddChild(tasto8); + //tasto8->SetToolTipText(_T("Submit bug and idea")); + + + //--------------------------------------------------------451 + + //fStack = new StackedView(BRect(451,52,840,300),"name",B_FOLLOW_ALL, B_WILL_DRAW|B_NAVIGABLE); + + theStack = new EpisodeListView(BRect(451,52,840,300)); + + BMessage* msg=new BMessage(DOWNLOAD_ITEM); + theStack->SetInvocationMessage(msg); + + msg=new BMessage(ITEM_SELECTED); + msg->AddInt32("buttons",0); + theStack->SetSelectionMessage(msg); + + + sx_list=new SubscriptionListView(BRect(0,0,210,377)); + + + + + + + fSelector=new SectionSelector(BRect(0,0,100,100),new BMessage(SECTION_SELECTED)); + fSelector->SetTarget(this); + + BRect k = Bounds(); + + dxsplit =new SplitPane(BRect(451,52,860,477),theStack,fSelector,B_FOLLOW_ALL); + dxsplit->SetViewInsetBy(BPoint(0,0)); + dxsplit->SetAlignment(B_HORIZONTAL); + dxsplit->SetViewColor(bgcolor); + dxsplit->SetBarPosition(BPoint(k.Width()/2.0f-170, k.Height()/2.0f+38)); + dxsplit->SetMinSizeOne(BPoint(0,84)); + dxsplit->SetMinSizeTwo(BPoint(0,161)); + + split =new SplitPane(BRect(10,52,860,477),sx_list,dxsplit,B_FOLLOW_ALL); + split->SetViewInsetBy(BPoint(0,0)); + split->SetViewColor(bgcolor); + split->SetBarPosition(BPoint(k.Width()/2.0f-170, k.Height()/2.0f)); + split->SetMinSizeOne(BPoint(200,0)); + split->SetMinSizeTwo(BPoint(200,0)); + + view->AddChild(split); + + BView* fakeView=new BView(fSelector->Bounds(),"fakeView",B_FOLLOW_ALL,B_WILL_DRAW); + fakeView->AddChild(down_list=new DownloadListView(fakeView->Bounds())); + + fSelector->AddSection("info0.png",CreateItemInfoView(), _T("Show Episode info") ); + fSelector->AddSection("info1.png",CreateChannelInfoView(), _T("Show Subscription info")); + fSelector->AddSection("info2.png",fakeView, _T("Show Downloads info") ); + fSelector->Select(0); +} + +BView* +MainWindow::CreateItemInfoView(){ + //RUN VIEW-------------------------------------------------------- + + Theme *fTheme = new Theme("ItemInfo_view", MAX_COLORS + 1, MAX_COLORS + 1, MAX_FONTS + 1); + + fTheme->WriteLock(); + fTheme->SetForeground(C_URL, 0, 13, 180); //0, 100, 180 + fTheme->SetBackground(C_URL, 255, 255, 255); + fTheme->SetForeground(C_TEXT, 0, 0, 0); + fTheme->SetBackground(C_TEXT, 255, 255, 255); + fTheme->SetForeground(C_SELECTION, 255, 255, 255); + fTheme->SetBackground(C_SELECTION, 0, 0, 0); + + fTheme->SetForeground(C_ACTION,greyBox.red,greyBox.green,greyBox.blue); + fTheme->SetBackground(C_ACTION,greyBox.red,greyBox.green,greyBox.blue); + + IconTextRender *itr; + fTheme->SetTextRender(F_EMOTICON,itr=new IconTextRender()); + + itr->AddIcon("folder ",LoadIcon("folder")); + itr->SetIconSize(16.0,16.0); + + fTheme->SetTextRender(F_ACTION,new TitleTextRender()); + fTheme->SetTextRender(F_TIMESTAMP,new GreenBoxTextRender()); + + + + // fTheme->SetTextRender(F_STYLE_0,btr = new BitmapTextRender()); + + fTheme->WriteUnlock(); + + BRect scrollRect(0,0,100,100 ); + + fItemText = new ItemRunView(scrollRect, "text", fTheme,B_FOLLOW_ALL_SIDES, B_WILL_DRAW | B_NAVIGABLE); + +#ifdef ZETA + fItemText->SetViewUIColor(B_UI_DOCUMENT_BACKGROUND_COLOR); + fItemText->SetLowUIColor(B_UI_DOCUMENT_BACKGROUND_COLOR); + fItemText->SetHighUIColor(B_UI_DOCUMENT_TEXT_COLOR); +#endif + + BScrollView *fTextScroll = new BScrollView("scroller", fItemText,B_FOLLOW_ALL_SIDES, 0,false, true, B_PLAIN_BORDER); + + + fItemText->AddAction("bepodder",new RVActionBP()); + fItemText->SetDefaultOpenURLAction(new RVActionBPOpenURL(fController)); + + return fTextScroll; +} + +BView* +MainWindow::CreateChannelInfoView(){ + + Theme *fTheme = new Theme("ChannelInfo_view", MAX_COLORS + 1, MAX_COLORS + 1, MAX_FONTS + 1); + + fTheme->WriteLock(); + + fTheme->SetForeground(C_URL, 0, 13, 180); //blue? //0, 100, 180 + fTheme->SetBackground(C_URL, 255, 255, 255); //white + + fTheme->SetForeground(C_TEXT, 0, 0, 0); + fTheme->SetBackground(C_TEXT, 255, 255, 255); + + fTheme->SetForeground(C_SELECTION, 255, 255, 255); + fTheme->SetBackground(C_SELECTION, 0, 0, 0); + + fTheme->SetForeground(C_ACTION,greyBox.red,greyBox.green,greyBox.blue); + fTheme->SetBackground(C_ACTION,greyBox.red,greyBox.green,greyBox.blue); + + IconTextRender *itr; + fTheme->SetTextRender(F_EMOTICON,itr=new IconTextRender()); + + BBitmap* bitmap = LoadIcon("feed.png"); + itr->AddIcon("feed ",bitmap); + itr->SetIconSize(bitmap->Bounds().Height(),bitmap->Bounds().Width()); + + fTheme->SetTextRender(F_ACTION,new TitleTextRender()); + fTheme->SetTextRender(F_TIMESTAMP,new GreenBoxTextRender()); + + fTheme->WriteUnlock(); + + BRect scrollRect(0,0,100,100 ); + + fChannelText = new RunView(scrollRect, "channel ", fTheme,B_FOLLOW_ALL_SIDES, B_WILL_DRAW | B_NAVIGABLE); +#ifdef ZETA + fChannelText->SetViewUIColor(B_UI_DOCUMENT_BACKGROUND_COLOR); + fChannelText->SetLowUIColor(B_UI_DOCUMENT_BACKGROUND_COLOR); + fChannelText->SetHighUIColor(B_UI_DOCUMENT_TEXT_COLOR); +#endif + BScrollView *fTextScroll = new BScrollView("scroller2", fChannelText,B_FOLLOW_ALL_SIDES, 0,false, true, B_PLAIN_BORDER); + + fChannelText->AddAction("bepodder",new RVActionBP()); + fChannelText->SetDefaultOpenURLAction(new RVActionBPOpenURL(fController)); + + return fTextScroll; + + +} + +float +MainWindow::CreateMenuBar(){ + + BMenuBar *poddermenubar = new BMenuBar(BRect(0,0,1,1),"Poddermenubar"); //,B_FOLLOW_RIGHT | B_FOLLOW_TOP,B_ITEMS_IN_ROW,true); + + + BMenu *podderfile = new BMenu(_T("File"),B_ITEMS_IN_COLUMN); + poddermenubar->AddItem(podderfile); + + BMenuItem* importOmpl = new BMenuItem(_T("Import OPML..") , new BMessage(IMPORT_OPML), 0, 0); + podderfile->AddItem(importOmpl); + + + BMenuItem *podderaboutitem = new BMenuItem(_T("About..."),new BMessage(B_ABOUT_REQUESTED),0,0); + podderaboutitem->SetTarget(be_app); + podderfile->AddItem(podderaboutitem); + + BMenuItem *quititem = new BMenuItem(_T("Quit"),new BMessage(B_QUIT_REQUESTED),'Q',0); + quititem->SetTarget(be_app); + podderfile->AddItem(quititem); + + BMenu *settingsfile = new BMenu(_T("Settings"),B_ITEMS_IN_COLUMN); + poddermenubar->AddItem(settingsfile); + + BMenuItem *podderpreferencesitem = new BMenuItem(_T("Preferences..."),new BMessage(SHOW_SETTINGS),'P',0); + settingsfile->AddItem(podderpreferencesitem); + + groups = new BMenu(_T("Groups"),B_ITEMS_IN_COLUMN); + poddermenubar->AddItem(groups); + + channels = new BMenu(_T("Subscriptions"),B_ITEMS_IN_COLUMN); + poddermenubar->AddItem(channels); + + items = new BMenu(_T("Episodes"),B_ITEMS_IN_COLUMN); + poddermenubar->AddItem(items); + + BMenu *directoryfile = new BMenu(_T("Lists"),B_ITEMS_IN_COLUMN); + poddermenubar->AddItem(directoryfile); + + + AddDirectoryItem(directoryfile,_T("Podcast List"),"http://www.funkyideasoft.com/directories/bepodder_podcasts.opml.tar.gz",'L'); + AddDirectoryItem(directoryfile,_T("Videoblog List"),"http://www.funkyideasoft.com/directories/bepodder_videoblog.opml.tar.gz",'M'); + AddDirectoryItem(directoryfile,_T("Imagefeeds List"),"http://www.funkyideasoft.com/directories/bepodder_imagefeeds.opml.tar.gz",'I'); + AddDirectoryItem(directoryfile,_T("Newsfeeds List"),"http://www.funkyideasoft.com/directories/bepodder_newsfeeds.opml.tar.gz",'N'); + AddDirectoryItem(directoryfile,_T("BitTorrentfeeds List"),"http://www.funkyideasoft.com/directories/bepodder_bittorrentfeeds.opml.tar.gz",'B'); + AddDirectoryItem(directoryfile,_T("Internationalfeeds List"),"http://www.funkyideasoft.com/directories/bepodder_internationalfeeds.opml.tar.gz",'J'); + + BMenu *podderview = new BMenu(_T("View"),B_ITEMS_IN_COLUMN); + poddermenubar->AddItem(podderview); + + fullscreenitem = new BMenuItem(_T("Full Screen"),new BMessage(SET_FULLSCREEN),'F',0); + podderview->AddItem(fullscreenitem); + fullscreenitem->SetMarked(false); + + notoolbar= new BMenuItem(_T("Toolbar"),new BMessage(SHOW_TOOLBAR),'T',0); + podderview->AddItem(notoolbar); + notoolbar->SetMarked(true); + + + ChannelSize = new BMenu(_T("Subscriptions View")); + podderview->AddItem(ChannelSize); + ChannelSize->SetRadioMode(true); + + BMenuItem* temp; + + temp= new BMenuItem(_T("Big Items"),new BMessage('bigg')); + ChannelSize->AddItem(temp); + temp->SetMarked(true); + + temp=new BMenuItem(_T("Small Items"),new BMessage('smal')); + ChannelSize->AddItem(temp); + temp->SetMarked(false); + + ChannelSize->SetEnabled(true); //linfo.Valid()); + + //-------------------------------------------------------------------------------------------------------------- + + + setworkspace= new BMenu(_T("Move BePodder on workspace:")); + podderview->AddItem(setworkspace); + + for(int i=0;iAddItem(workspace1 = new BMenuItem(text.String(), new BMessage(CHANGE_WORKSPACE), 0)); + if(i == current_workspace() ) + workspace1->SetMarked(true); + } + + + BMenu *helpfile = new BMenu(_T("Help"),B_ITEMS_IN_COLUMN); + poddermenubar->AddItem(helpfile); + + + BMessage *msg=new BMessage(SHOW_HELP); + BMenuItem *helpitem1 = new BMenuItem(_T("Getting Started"),msg,'G',0); + helpfile->AddItem(helpitem1); + + msg=new BMessage(SHOW_HELP); + msg->AddString("page","shortcuts"); + BMenuItem *shortcutitem = new BMenuItem(_T("Keyboard Shortcuts"),msg,'K',0); + helpfile->AddItem(shortcutitem); + + BMessage *webmsg=new BMessage(WEB_PAGE); + //full url (introduction.html) + BString where(GetAppRelativePath()); + where << "/tutorial/introduction.html"; + where.Prepend("file://"); + + webmsg->AddString("url",where.String()); + helpfile->AddItem( new BMenuItem(_T("Tutorials"),webmsg,0,0)); + + + helpfile->AddSeparatorItem(); + + webmsg=new BMessage(WEB_PAGE); + webmsg->AddString("url","http://www.funkyideasoft.com/support.html"); + helpfile->AddItem( new BMenuItem(_T("Online Support"),webmsg,0,0)); + + helpfile->AddSeparatorItem(); + BMenuItem* updates; + helpfile->AddItem(updates=new BMenuItem(_T("Check for updates"),new BMessage('ckup'),0,0)); + updates->SetTarget(be_app); + + AddChild(poddermenubar); + poddermenubar->ResizeToPreferred(); + + return poddermenubar->Bounds().bottom; + +} + +void +MainWindow::AddDirectoryItem(BMenu* directoryfile,const char *name,const char* url,char shortcut) { + + BMessage* msg=new BMessage(SHOW_DIRECTORY); + msg->AddString("name",name); + msg->AddString("url",url); + + directoryfile->AddItem(new BMenuItem(name,msg,shortcut,0)); +} + +void +MainWindow::SaveSetting(BMessage* data){ + + BRect rect(Frame()); + + if(fullscreenitem->IsMarked()) + rect = podderrect; + + data->AddFloat("window_x",rect.left); + data->AddFloat("window_y",rect.top); + data->AddFloat("window_w",rect.Width()); + data->AddFloat("window_h",rect.Height()); + + //splits + BMessage split_state; + split->GetState(split_state); + data->AddMessage("bar_position_state",&split_state); + + split_state.MakeEmpty(); + dxsplit->GetState(split_state); + data->AddMessage("dxbar_position_state",&split_state); + + //toolbar (visible?) + data->AddBool("toolbar_visible",notoolbar->IsMarked()); + + //fullscreen (on?) + data->AddBool("fullscreen",fullscreenitem->IsMarked()); + + + //default Subscription Items size: + data->AddInt32("channel_size",sx_list->ItemSize()); + + //debug.. + //data->PrintToStream(); + + +} + + +void +MainWindow::LoadSetting(BMessage* data){ + + //data->PrintToStream(); + + float x,y; + if(data->FindFloat("window_x",&x)==B_OK && data->FindFloat("window_y",&y)==B_OK){ + MoveTo(x,y); + podderrect.left=x; + podderrect.top=y; + } + if(data->FindFloat("window_w",&x)==B_OK && data->FindFloat("window_h",&y)==B_OK){ + ResizeTo(x,y); + podderrect.right=podderrect.left + x - 1; + podderrect.bottom=podderrect.top + y - 1; + } + + //fullscreen (on?) + bool result; + if(data->FindBool("fullscreen",&result) == B_OK){ + if(result) + SetFullscreen(result); + } + + //toolbar (visible?) + if(data->FindBool("toolbar_visible",&result) == B_OK){ + if(!result) + SetToolbarVisible(result); + } + + //splits + BMessage split_state; + if(data->FindMessage("bar_position_state",&split_state) == B_OK){ + split->SetState(&split_state); + } + split_state.MakeEmpty(); + if(data->FindMessage("dxbar_position_state",&split_state) == B_OK){ + dxsplit->SetState(&split_state); + } + + int32 size; + //default Subscription Items size: + if(data->FindInt32("channel_size",&size) == B_OK){ + sx_list->SetItemSize((SubscriptionSize)size); + ChannelSize->ItemAt(size)->SetMarked(true); + } + + ChannelSize->SetEnabled(true);//linfo.Valid()); +} + + +void MainWindow::MessageReceived(BMessage* msg) +{ + + + switch(msg->what) + { + + case 'bigg': + sx_list->SetItemSize(BIG); + break; + case 'smal': + sx_list->SetItemSize(SMALL); + break; + + case SHOW_SETTINGS: + { + BPSettingsWindow *Settings = new BPSettingsWindow(); + Settings->Show(); + } + break; + case SHOW_DIRECTORY: + { + BString name; + BString url; + msg->FindString("name",&name); + msg->FindString("url",&url); + DirectoryWindow *Directory = new DirectoryWindow(name.String(),url); + Directory->Show(); + } + break; + + case WEB_PAGE: + { + BString url; + if(msg->FindString("url",&url) == B_OK) + fController->OpenURL(url.String()); + } + break; + case SHOW_HELP: + { + + BPAlert *alert = new BPAlert("BePodder",_T("Loading Help..."),NULL,NULL,NULL,B_WIDTH_AS_USUAL, LoadIcon("enqueued-32.png")); + alert->Go(NULL); + + HelpWindow *help1 = new HelpWindow(); + help1->Show(); + + BString page; + if(msg->FindString("page",&page)==B_OK) + help1->SetPage(page); + + alert->PostMessage(B_QUIT_REQUESTED); + } + break; + + case SET_FULLSCREEN: + SetFullscreen(!fullscreenitem->IsMarked()); + break; + + case CHANGE_WORKSPACE: + { + msg->PrintToStream(); + uint32 index=(uint32)msg->FindInt32("index"); + + uint32 space = 0x1UL; + space <<= index; + + SetWorkspaces(space); + if( setworkspace->FindMarked() ) setworkspace->FindMarked()->SetMarked(false); + if(setworkspace->ItemAt(index)) setworkspace->ItemAt(index)->SetMarked(true); + } + break; + + case CHECK_ALL: + fController->CheckAllChannel(); + break; + + case ARCHIVE_PARSE: + { + //show the alert + BPAlert *alert = new BPAlert("BePodder",_TT("alert3"),NULL,NULL,NULL,B_WIDTH_AS_USUAL, LoadIcon("enqueued-32.png")); + alert->Go(NULL); + + + fController->ParseArchive(); + + if(sx_list->CountRows()>0) { + sx_list->AddToSelection(sx_list->RowAt(0)); + SubscriptionListItem* row=dynamic_cast(sx_list->RowAt(0)); + if(row) + fController->SetSelectedItem( NULL,&row->fRef); + } + //close the alert + alert->PostMessage(B_QUIT_REQUESTED); + + } + break; + + case DOWNLOAD_CHANNEL: + fController->DownloadChannel(msg); + break; + + case DOWNLOAD_CHANNEL_INFO: + fController->InfoDownloadChannel(msg); + break; + + case DOWNLOAD_ITEM_INFO: + fController->InfoDownloadItem(msg); + break; + + case CHANNEL_SELECTED: + { + SubscriptionListItem* row=dynamic_cast(sx_list->CurrentSelection()); + if(row) + SelectedSubscription(row,msg->FindInt32("buttons")); + + GroupItem* group=dynamic_cast(sx_list->CurrentSelection()); + if(group) + SelectGroup(group,msg->FindInt32("buttons")); + } + break; + + case ITEM_SELECTED: + { + + SubscriptionListItem* row=GetSelectedSubscription(); + if(!row) return; + + EpisodeListItem* episode=GetSelectedEpisode(); + if(!episode) return; + + fController->SetSelectedItem(&episode->fRef,&row->fRef); + + + EpisodeListView *elv=theStack; //FIX FOR GROUP MANAGE + if(!elv) return; + + if(msg->FindInt32("buttons")==B_SECONDARY_MOUSE_BUTTON){ + + BPoint point; + uint32 state; + elv->GetScrollView()->GetMouse(&point,&state); + + BPoint p2 = elv->GetScrollView()->ConvertToScreen(point); + p2.x -= 5.0; + p2.y -= 5.0; + + + if(fItemMenu->FindMarked()) + fItemMenu->FindMarked()->SetMarked(false); + + elv->SelectionMessage()->ReplaceInt32("buttons",0); + fItemMenu->Go(p2, true, true, true); + + } + } + break; + + case DOWNLOAD_SELECTED: + { + + if(msg->FindInt32("buttons")==B_SECONDARY_MOUSE_BUTTON){ + + BPoint point; + uint32 state; + down_list->GetScrollView()->GetMouse(&point,&state); + + BPoint p2 = down_list->GetScrollView()->ConvertToScreen(point); + p2.x -= 5.0; + p2.y -= 5.0; + + + if(fDownloadMenu->FindMarked()) + fDownloadMenu->FindMarked()->SetMarked(false); + + fDownloadMenu->Go(p2, true, true, true); + + } + + down_list->ResetSelectionMessage(); + } + break; + case SECTION_SELECTED: + ShowDescription((MemoryArchive*)fController->GetSelectedItem()); + break; + case DOWNLOAD_INVOKED: + action_manager.FireAction(IACTION_DOWNLOAD_DOWNLOAD); + break; + case DOWNLOAD_ITEM: + action_manager.FireAction(IACTION_ITEM_DOWNLOAD); + break; + + case DOWNLOAD_EXTRA_INFO: + fController->InfoExtraDownload(msg); + break; + + case SHOW_TOOLBAR: + SetToolbarVisible(!notoolbar->IsMarked()); + break; + + case GROUP_NAME_CHANGE: + { + BString oldname; + BString newname; + if( msg->FindString("oldname",&oldname) ==B_OK && + msg->FindString("_value",&newname)==B_OK ) + fController->RenameGroup(oldname,newname); + } + break; + + case IMPORT_OPML: + { + // select the OPML file, + BFilePanel *filePanel = new BFilePanel(B_OPEN_PANEL); + filePanel->SetMessage(new BMessage(PARSE_OPML)); + filePanel->SetTarget(BMessenger(this)); + filePanel->Show(); + //try to parse + + //foreach add to the window + } + case PARSE_OPML: + { + entry_ref ref; + + if(msg->FindRef("refs",&ref) == B_OK) + { + OPMLParser parser; + OPMLTree* tree = parser.Parse(BPath(&ref).Path()); + + if(!tree) return; //should never happen! + + RecursiveParseOpml(tree); + + +// BPAlert *alert = new BPAlert("BePodder",,_T("Error"),_T("Close"),NULL,B_WIDTH_AS_USUAL, LoadIcon("logo-64.png")); +// if(alert->Go()==0) +// fController->OpenURL("http://www.funkyideasoft.com/downloads.html"); + } + msg->PrintToStream(); + } + break; + + default: + BWindow :: MessageReceived(msg); + break; + } +} + +void MainWindow::RecursiveParseOpml(OPMLTree* branch) +{ + if(branch->foglie) + { + //it's a group. + for(int32 i=branch->foglie->CountItems() -1 ; i>=0 ; i--){ + OPMLTree* subfoglia = branch->foglie->ItemAt(i); + //fController->AddNewGroup(branch->description.String()); + RecursiveParseOpml(subfoglia); + } + + } + else + { + //it's a link + BMessage msg('addu'); + msg.AddString("url", branch->link); + BMessenger(this).SendMessage(&msg); + printf("sending url %s\n", branch->link.String()); + } +} + +//----------------------------------- + +/* +EpisodeListView* +MainWindow::CreateEpisodeListView(BString url){ + +// Lock(); +// BRect rect = fStack->Bounds(); +// Unlock(); +// +// //BRect rect(0,0,0,0); +// +// EpisodeListView* elv=new EpisodeListView(rect); +// +// BMessage* msg=new BMessage(DOWNLOAD_ITEM); +// msg->AddString("url",url); +// elv->SetInvocationMessage(msg); +// +// msg=new BMessage(ITEM_SELECTED); +// msg->AddString("url",url); +// msg->AddInt32("buttons",0); +// elv->SetSelectionMessage(msg); + + return theStack; +}*/ +/* +void +MainWindow::AddEpisodeListView(EpisodeListView* elv){ + //fStack->AddView(elv); +} +*/ +void +MainWindow::AddEpisodeListItem(EpisodeListItem* ep){ + theStack->AddRow(ep); +} + + +void +MainWindow::AddSubscription(SubscriptionListItem* row,GroupItem* grp){ + sx_list->AddRow(row ,sx_list->CountRows(),grp); +} + +void +MainWindow::ScrollToSubscripion(SubscriptionListItem* row){ + sx_list->ScrollTo(row); //auto-scroll to new item. +} + + void +MainWindow::RefreshSubscriptionLists(){ + sx_list->Refresh(); +} + +void +MainWindow::RefreshSubscription(SubscriptionListItem* row) { + sx_list->UpdateRow(row); +} + +void +MainWindow::AddGroup(GroupItem* group,bool expanded){ + sx_list->AddGroup(group); + sx_list->ExpandOrCollapse(group,expanded); +} + +BString +MainWindow::GroupOf(SubscriptionListItem* row){ + BRow *parent=NULL; + sx_list->FindParent(row,&parent,NULL); + if(!parent) return NULL; + + GroupItem* grp=dynamic_cast(parent); + if(!grp) return NULL; + + return grp->GroupName(); +} + + + +void +MainWindow::RemoveSubscription(SubscriptionListItem* row){ + + sx_list->DeselectAll(); + sx_list->RemoveRow(row); + if(sx_list->CountRows() > 0) + { + sx_list->AddToSelection(sx_list->RowAt(0)); + sx_list->SelectionChanged(); + } + else + ClearEpisodeListView(); + + delete row; +} + + +EpisodeListView* +MainWindow::GetEpisodeListView(){ + return theStack; +} + + +EpisodeListItem* +MainWindow::GetSelectedEpisode(EpisodeListItem* prev){ //indipendentemente dalla view su cui è posto! + return dynamic_cast(theStack->CurrentSelection(prev)); +} + + +void +MainWindow::RefreshEpisode(EpisodeListItem* row) { + theStack->UpdateRow(row); +} + + +void +MainWindow::SelectSubscription(int i){ + + Lock(); + if(sx_list->CountRows()>0) { + SubscriptionListItem* sel=dynamic_cast(sx_list->RowAt(i)); + SelectSubscription(sel); + } + Unlock(); +} + +void +MainWindow::SelectSubscription(SubscriptionListItem* sel){ + sx_list->DeselectAll(); + sx_list->AddToSelection(sel); + SelectedSubscription(sel); +} + +void +MainWindow::ClearEpisodeListView() { + theStack->Clear(); +} + +void +MainWindow::SelectedSubscription(SubscriptionListItem* row, int32 bottons){ + + if(!row) return; + + row->SetIsNew(false); + + fController->SwitchChannel(&row->fRef); + + if(bottons==B_SECONDARY_MOUSE_BUTTON){ + + BPoint point; + uint32 state; + sx_list->GetScrollView()->GetMouse(&point,&state); + + BPoint p2 = sx_list->GetScrollView()->ConvertToScreen(point); + p2.x -= 5.0; + p2.y -= 5.0; + + + if(fChannelMenu->FindMarked()) + fChannelMenu->FindMarked()->SetMarked(false); + + sx_list->SelectionMessage()->ReplaceInt32("buttons",0); + fChannelMenu->Go(p2, true, true, true); + } +} + +void +MainWindow::SelectGroup(GroupItem* grp, int32 bottons){ + + if(!grp) return; + + fController->SwitchChannel(NULL); + + if(bottons==B_SECONDARY_MOUSE_BUTTON){ + + BPoint point; + uint32 state; + sx_list->GetScrollView()->GetMouse(&point,&state); + + BPoint p2 = sx_list->GetScrollView()->ConvertToScreen(point); + p2.x -= 5.0; + p2.y -= 5.0; + + + if(fGroupMenu->FindMarked()) + fGroupMenu->FindMarked()->SetMarked(false); + + sx_list->SelectionMessage()->ReplaceInt32("buttons",0); + fGroupMenu->Go(p2, true, true, true); + } +} + +void +MainWindow::RemoveGroup(GroupItem* group){ + sx_list->RemoveRow(group); + delete group; +} + + + + +SubscriptionListItem* +MainWindow::GetSelectedSubscription(){ + return dynamic_cast(sx_list->CurrentSelection()); +} + +GroupItem* +MainWindow::GetSelectedGroup(){ + return dynamic_cast(sx_list->CurrentSelection()); +} + +bool +MainWindow::GetScreenGroupRect(GroupItem *row, BRect *outRect) { + BRect rect; + if(!sx_list->GetRowRect((const BRow *)row, &rect) ) return false; + *outRect= sx_list->GetScrollView()->ConvertToScreen(rect); + return true; + +} + +int32 +MainWindow::CountSubscriptionOfGroup(GroupItem* grp){ + return sx_list->CountRows(grp); +} + +SubscriptionListItem* +MainWindow::GetSubscriptionOfGroup(int32 i,GroupItem* grp){ + return dynamic_cast(sx_list->RowAt(i,grp)); +} + + +DownloadListItem* +MainWindow::GetSelectedDownload(){ + return dynamic_cast(down_list->CurrentSelection()); +} + +int32 +MainWindow::IndexOfSubscription(SubscriptionListItem* item){ + return sx_list->IndexOf((BRow*)item); +} + +void +MainWindow::SetSortingSubscriptions(bool value){ + sx_list->SetSortingEnabled(value); + sx_list->SetSortColumn(sx_list->ColumnAt(0),true,true); +} + +void +MainWindow::AddDownload(DownloadListItem* down){ + down_list->AddRow(down,(long int)0); +} + +void +MainWindow::RemoveDownload(DownloadListItem* item){ + down_list->RemoveRow(item); + delete item; +} + + + +bool +MainWindow::QuitRequested() { + be_app->PostMessage(B_QUIT_REQUESTED); + return false; +} + + +void +MainWindow::ShowDescription(MemoryArchive* archive){ + + + switch(fSelector->Selected()){ + case 0: + ShowItemDescription(archive); + break; + case 1: + ShowChannelDescription(archive); + break; + + default:break; + }; + +} + + +void +MainWindow::ShowItemDescription(MemoryArchive* archive){ + + + fItemText->Clear(); + ((ItemRunView*)fItemText)->LoadBitmap(NULL); + + BString itemTitle(archive->GetDataString(CHANNEL_TITLE) ); + BString webLink(archive->GetDataString(CHANNEL_WEBLINK)); + + if(itemTitle !="" ) + { + if( webLink != "" ) + fItemText->AppendURL(itemTitle.String(),webLink.String(),C_ACTION,F_TEXT); + else + fItemText->Append( itemTitle.String(),C_TEXT,C_ACTION,F_TIMESTAMP ); + } + time_t *curtime = 0; + if(archive->GetData(ITEM_PUBDATE,(const void**)&curtime) >0){ + + char dateString[256]; + tm time_data; + time_t datetime=*curtime; + localtime_r(&datetime, &time_data); + + //"%A, %B %d %Y, %I:%M:%S %p" + strftime(dateString, 256, "%a, %B %d %Y, %I:%M:%S %p", &time_data); + + fItemText->Append(" - ",C_TEXT,C_ACTION,F_TIMESTAMP); + fItemText->Append(dateString,C_TEXT,C_ACTION,F_TIMESTAMP); + } + else + fItemText->Append(" ",C_TEXT,C_ACTION,F_TIMESTAMP); + + fItemText->Append("\n",C_TEXT,C_TEXT,F_TEXT); + + if(archive->GetDataString(ITEM_TITLE) !="") + fItemText->Append(archive->GetDataString(ITEM_TITLE).String(),C_TEXT,C_TEXT,F_ACTION); + + if(archive->GetDataString(ITEM_LINK) != ""){ + fItemText->AppendURL(" [www]",archive->GetDataString(ITEM_LINK) .String(),F_TEXT); + } + fItemText->Append("\n",C_TEXT,C_TEXT,F_TEXT); + + const void* buffer = NULL; + ssize_t m_size = archive->GetData(ITEM_DESCRIPTION,&buffer); + + if( m_size>0){ + //do what you need to do. + char* copybuffer=(char*)malloc(m_size); + memcpy(copybuffer,buffer,m_size); + + m_size = parse_html(copybuffer,m_size); + BString data(copybuffer,m_size); + fItemText->Append(data.String(),C_TEXT,C_TEXT,F_TEXT); + + free(copybuffer); + } + BString url = archive->GetDataString(ITEM_ENCLOSURE_URL); + if( url != ""){ + + + + fItemText->Append("\n\n",C_TEXT,C_TEXT,F_TEXT); + + BString action("action://bepodder("); + action << (int)IACTION_CHANNEL_ENCLOSURE_FOLDER << ")"; + + fItemText->AppendURL("folder ",action.String(),C_ACTION,F_EMOTICON); + fItemText->AppendURL(_T("Enclosure: "),action.String(),C_ACTION,F_TEXT); + + BString local(archive->GetDataString(ITEM_ENCLOSURE_LOCALPATH)); + //path.Append(local.String()); + //folder_url.SetTo(path.Path()); + //fItemText->AppendURL(local.String(),folder_url.String(),C_ACTION,F_TEXT); + + BString bottom; + bottom << local; + + BString filetype(archive->GetDataString(ITEM_ENCLOSURE_TYPE) ); + if( filetype !="") + bottom << " (" << filetype<< ") " ; + + + off_t* len=0; + if( archive->GetData(ITEM_ENCLOSURE_LENGTH,(const void**)&len)>0 && len>0 ){ + off_t size=*len; + char str[256]; + if (size < kKB_SIZE) + { + sprintf(str, "%Ld bytes", size); + } + else + { + const char* suffix; + float float_value; + if (size >= kTB_SIZE) + { + suffix = "TB"; + float_value = (float)size / kTB_SIZE; + } + else if (size >= kGB_SIZE) + { + suffix = "GB"; + float_value = (float)size / kGB_SIZE; + } + else if (size >= kMB_SIZE) + { + suffix = "MB"; + float_value = (float)size / kMB_SIZE; + } + else + { + suffix = "KB"; + float_value = (float)size / kKB_SIZE; + } + + sprintf(str, "%.2f %s", float_value, suffix); + // strip off an insignificant zero so we don't get readings + // such as 1.00 + char *period = 0; + char *tmp (NULL); + for (tmp = str; *tmp; tmp++) + { + if (*tmp == '.') + period = tmp; + } + if (period && period[1] && period[2] == '0') + // move the rest of the string over the insignificant zero + for (tmp = &period[2]; *tmp; tmp++) + *tmp = tmp[1]; + } + bottom << " [" << str << "]" ; + } + fItemText->Append(bottom.String(),C_TEXT,C_ACTION,F_TIMESTAMP); + //fItemText->Append(" test.mp3 1234Kb (audio/mp3) downloaded",C_TEXT,C_ACTION,F_TIMESTAMP); + + + + // AUTO_SHOWER IMAGE. + //SE: filestatus = DOWNLOADED, SE filetype inzia on image/, SE localpath != "" allora carica e mostra... + + + FileStatus status = (FileStatus)archive->GetDataInt32(ITEM_ENCLOSURE_FILE_STATUS); + if( status == DOWNLOADED && + filetype.FindFirst("image/")==0 && + local != "" ) + { + fItemText->Append("\n",C_TEXT,C_TEXT,F_TEXT); + //Fullpath: + SubscriptionListItem* row=GetSelectedSubscription(); + if(row){ + BString fullPath=fController->PathFolderChannel(row->fRef); + fullPath << "/" << local; + ((ItemRunView*)fItemText)->LoadBitmap(fullPath.String()); + } + } + + + } + + fItemText->Append("\n",C_TEXT,C_TEXT,F_TEXT); + fItemText->ScrollTo(0,0); + +} + +void +MainWindow::ShowChannelDescription(MemoryArchive* archive){ + + //int fItemText; + + fChannelText->Clear(); + fChannelText->Append("\n",C_TEXT,C_TEXT,F_TEXT); + + if(archive->GetDataString(CHANNEL_TITLE) != "") + fChannelText->Append(archive->GetDataString(CHANNEL_TITLE).String(),C_TEXT,C_TEXT,F_ACTION); + + if(archive->GetDataString(CHANNEL_WEBLINK) != ""){ + fChannelText->AppendURL(" [www]",archive->GetDataString(CHANNEL_WEBLINK) .String(),F_TEXT); + } + fChannelText->Append("\n",C_TEXT,C_TEXT,F_TEXT); + + const void * buffer = NULL; + ssize_t size = archive->GetData(CHANNEL_DESCRIPTION,&buffer); + + if( size>0){ + char* copybuffer=(char*)malloc(size); + memcpy(copybuffer,buffer,size); + + size = parse_html(copybuffer,size); + BString data(copybuffer,size); + fChannelText->Append(data.String(),C_TEXT,C_TEXT,F_TEXT); + + free(copybuffer); + } + + size = archive->GetData(CHANNEL_IMAGE_DATA,(const void**)&buffer); + + if( size>0){ + BString action("action://bepodder("); + action << (int)IACTION_CHANNEL_SHOW_IMAGE << ")"; + fChannelText->Append("\n\n",C_TEXT,C_TEXT,F_TEXT); + fChannelText->AppendURL(_T("Show channel Image"),action.String(),C_TEXT,F_TEXT); + //free(buffer); + } + + fChannelText->Append("\n\n",C_TEXT,C_TEXT,F_TEXT); + fChannelText->AppendURL("feed ",archive->GetDataString(CHANNEL_URL) .String(),C_TEXT,F_EMOTICON); //? Icon ?? + fChannelText->AppendURL("XML Feed Link",archive->GetDataString(CHANNEL_URL) .String(),F_TEXT); + fChannelText->Append("\n",C_TEXT,C_TEXT,F_TEXT); + + fChannelText->Append("\n",C_TEXT,C_TEXT,F_TEXT); + fChannelText->ScrollTo(0,0); + + +} + +void +MainWindow::SetFullscreen(bool fullscreen){ + + BRect wrect(Bounds()); + if (!fullscreen) { + fullscreenitem->SetMarked(false); + wrect = podderrect; + SetFlags(Flags() & ~(B_NOT_RESIZABLE | B_NOT_MOVABLE)); + } + else { + fullscreenitem->SetMarked(true); + BScreen screen; + podderrect = Frame(); + wrect = screen.Frame(); + //BRect frect(Bounds()); + SetFlags(Flags() | B_NOT_RESIZABLE | B_NOT_MOVABLE); + } + + MoveTo(wrect.left, wrect.top); + ResizeTo(wrect.Width(), wrect.Height()); + + BRect frect(Bounds()); + dxsplit->SetBarPosition(BPoint(frect.Width()/2.0f-170, frect.Height()/2)); +} + +void +MainWindow::SetToolbarVisible(bool visible){ + + BPoint point(0,42); + if(!visible) { + notoolbar->SetMarked(false); + view->ScrollTo(point); + split->ResizeBy(point.x,point.y); + dxsplit->SetBarPosition(dxsplit->GetBarPosition()+=point); + + if(!itemsView->IsHidden()) + itemsView->Hide(); + if(!channelView->IsHidden()) + channelView->Hide(); + + } else { + + + notoolbar->SetMarked(true); + view->ScrollTo(BPoint(0,0)); + split->ResizeBy(point.x,-point.y); + dxsplit->SetBarPosition(dxsplit->GetBarPosition()-=point); + + if(itemsView->IsHidden()) + itemsView->Show(); + if(channelView->IsHidden()) + channelView->Show(); + } + + +} + diff --git a/sources-experimental/MainWindow.h b/sources-experimental/MainWindow.h new file mode 100644 index 0000000..aeb0bfa --- /dev/null +++ b/sources-experimental/MainWindow.h @@ -0,0 +1,169 @@ +#ifndef MainWindow_H +#define MainWindow_H + +#include +#include +#include +#include +#include +#include +//#include +#include "StackedView.h" +#include + + +#include "SubscriptionListView.h" +#include "DownloadListView.h" +#include "EpisodeListView.h" +#include "EpisodeListItem.h" + +#include "BPAlert.h" + +class SubscriptionListItem; +class SplitPane; +class RunView; + +#define ARCHIVE_PARSE 'pars' +#define CHECK_ALL 'chal' + +class MemoryArchive; +class MainController; +class DownloadListItem; +class SectionSelector; +class GroupItem; +class OPMLTree; + +class MainWindow: public BWindow +{ + + + + public: + MainWindow(); + void init(MainController* controller); + + void MessageReceived(BMessage* message); + bool QuitRequested(); + + + void AddGroup(GroupItem*,bool expanded); + BString GroupOf(SubscriptionListItem* row); + + + void AddEpisodeListItem(EpisodeListItem* ep); + + void ClearEpisodeListView(); + + void AddSubscription(SubscriptionListItem* row,GroupItem* grp); + + void ScrollToSubscripion(SubscriptionListItem* row); + + void RefreshSubscriptionLists(); + void RefreshSubscription(SubscriptionListItem* row); + + void RemoveSubscription(SubscriptionListItem* row); + + EpisodeListView* GetEpisodeListView(); + EpisodeListItem* GetSelectedEpisode(EpisodeListItem* prev = NULL); //indipendentemente dalla view su cui è posto! + + + void RefreshEpisode(EpisodeListItem* row); + + void ShowDescription(MemoryArchive* archive); + + void SetController(MainController* c){ fController = c;} + + SubscriptionListItem* GetSelectedSubscription(); + + GroupItem* GetSelectedGroup(); + bool GetScreenGroupRect(GroupItem *row, BRect *outRect); + + void RemoveGroup(GroupItem*); + + int32 CountSubscriptionOfGroup(GroupItem*); + + SubscriptionListItem* GetSubscriptionOfGroup(int32,GroupItem*); + + + DownloadListItem* GetSelectedDownload(); + + int32 IndexOfSubscription(SubscriptionListItem* item); + + void SetSortingSubscriptions(bool value); + + + void SelectSubscription(int i); + void SelectSubscription(SubscriptionListItem* elv); + + void SelectedSubscription(SubscriptionListItem* elv, int32 bottons = -1); + + void SelectGroup(GroupItem*, int32 bottons = -1); + //void SelectEpisode(EpisodeListView* view, EpisodeListItem* item); + + + void AddDownload(DownloadListItem*); + void RemoveDownload(DownloadListItem*); + + + + void SaveSetting(BMessage* data); + void LoadSetting(BMessage* data); + private: + float CreateMenuBar(); + BView* CreateItemInfoView(); + BView* CreateChannelInfoView(); + + void ShowItemDescription(MemoryArchive* archive); + void ShowChannelDescription(MemoryArchive* archive); + + + void SetFullscreen(bool); + void SetToolbarVisible(bool); + + + void AddDirectoryItem(BMenu*,const char *name,const char* url,char shortcut); + + void RecursiveParseOpml(OPMLTree* branch); + + + MainController* fController; + + BMenuItem* notoolbar; + BMenuItem* fullscreenitem; + BMenu* setworkspace; + BMenu* ChannelSize; + + BMenu* channels; + BMenu* items; + BMenu* groups; + + BView* channelView; //toolbar + BView* itemsView; //toolbar + + + + SubscriptionListView *sx_list; + DownloadListView *down_list; + + BBox *view; //the main view. + + StackedView *fStack; + EpisodeListView *theStack; + + RunView *fItemText; + RunView *fChannelText; + + SplitPane *split,*dxsplit; + + BPopUpMenu* fChannelMenu; + BPopUpMenu* fItemMenu; + BPopUpMenu* fDownloadMenu; + BPopUpMenu* fGroupMenu; + + SectionSelector* fSelector; + + BRect podderrect; + +}; + +#endif diff --git a/sources-experimental/MemoryArchive.cpp b/sources-experimental/MemoryArchive.cpp new file mode 100644 index 0000000..5540889 --- /dev/null +++ b/sources-experimental/MemoryArchive.cpp @@ -0,0 +1,156 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#include "MemoryArchive.h" +#include + + + +MemoryArchive & MemoryArchive::operator=(const MemoryArchive &msg){ + this->fData = msg.fData; + return *this; +} + +void +MemoryArchive::SetKey(ItemProperty key,void* data,ssize_t numBytes) { + + BString superkey("key_"); + superkey << key; + + if(fData.HasData(superkey.String(),B_ANY_TYPE)) + fData.ReplaceData(superkey.String(),B_ANY_TYPE,data,numBytes); + else + fData.AddData(superkey.String(),B_ANY_TYPE,data,numBytes); +} + +void +MemoryArchive::SetKeyString(ItemProperty key,const char* data){ + size_t len = strlen(data); + char copy[ len + 1]; + + strncpy(copy,data,len); + copy[len] = '\0'; + SetKey(key,(void*)copy, len+1); +} + +void +MemoryArchive::SetKeyInt32(ItemProperty key,int32 data){ + SetKey(key,(void*)&data,sizeof(int32)); +} + +ssize_t +MemoryArchive::GetData(ItemProperty key,const void** data){ + BString superkey("key_"); + superkey << key; + ssize_t numBytes = 0; + fData.FindData(superkey.String(),B_ANY_TYPE,0,data,&numBytes); + + return numBytes; +} + +BString +MemoryArchive::GetDataString(ItemProperty key){ + + void* data=NULL; + ssize_t ret = GetData(key,(const void**)&data); + + if(ret>0) + { + BString str((const char*)data,ret); + //if(data) free(data); + return str; + } + else + return NULL; + + + } + +int32 +MemoryArchive::GetDataInt32(ItemProperty key){ + + void* data = NULL; + ssize_t ret = GetData(key,(const void**)&data); + + if(ret == sizeof(int32) ) + { + int32 num = *((int32*)data); + //if(data) free(data); + return num; + } + else + return 0; + + + } + +int32 +MemoryArchive::CountData(){ + return fData.CountNames(B_ANY_TYPE); +} + +void +MemoryArchive::KeyModified(int32 key, void* data, ssize_t numBytes){ + SetKey((ItemProperty)key,data,numBytes); +} + +void +MemoryArchive::FillListener(Notifier* fListener){ +#ifdef ZETA + //now update all my info! (is always true?) + void *cookie = NULL; + char *name; + uint32 type=0; + int32 count = 0; + + while (fData.GetNextName(&cookie, (const char**)&name,NULL,NULL) == B_OK) { + + void* data = NULL; + ssize_t numBytes; + if(fData.FindData(name,B_ANY_TYPE,0,(const void**)&data,&numBytes)==B_OK) + { + //FIX MANCA SSIZE_T! (unmangling the name..) + BString uname(name); + uname.RemoveAll("key_"); + int32 key = atol(uname.String()); + + fListener->SetKey((ItemProperty)key,data,numBytes); + //if(data && numBytes>0)free(data); + } + } +#else + //now update all my info! (is always true?) + //void *cookie = NULL; + char *name; + uint32 type=0; + int32 count = fData.CountNames(B_ANY_TYPE); + + for(int i=0;iSetKey((ItemProperty)key,data,numBytes); + //if(data && numBytes>0)free(data); + } + } +#endif +} + +void +MemoryArchive::MakeEmpty(){ + fData.MakeEmpty(); +} +//-- + diff --git a/sources-experimental/MemoryArchive.h b/sources-experimental/MemoryArchive.h new file mode 100644 index 0000000..fec7198 --- /dev/null +++ b/sources-experimental/MemoryArchive.h @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#ifndef _MemoryArchive_H_ +#define _MemoryArchive_H_ + +#include "Archive.h" +#include "Notifier.h" +#include + +class MemoryArchive : public Archive { + + public: + + virtual ~MemoryArchive(){} + + MemoryArchive &operator=(const MemoryArchive &msg); + + // from Store + void SetKey(ItemProperty key,void* data,ssize_t size); + void SetKeyString(ItemProperty key,const char* data); + void SetKeyInt32(ItemProperty key,int32 data); + + + //from Retriver + ssize_t GetData(ItemProperty key,const void** data); + int32 CountData(); + BString GetDataString(ItemProperty key); + int32 GetDataInt32(ItemProperty key); + + //utility function.. (MOVE?) + void FillListener(Notifier*); + + //from ElementListener + void KeyModified(int32 key, void* data, ssize_t numBytes); + + + void MakeEmpty(); + + private: + + BMessage fData; + +}; +#endif + +//.. diff --git a/sources-experimental/MyColumnTypes.cpp b/sources-experimental/MyColumnTypes.cpp new file mode 100644 index 0000000..43fb48b --- /dev/null +++ b/sources-experimental/MyColumnTypes.cpp @@ -0,0 +1,208 @@ +#include "MyColumnTypes.h" +#include "ColumnTypes.h" +#include +#include + +#include "Utils.h" + +#define kTEXT_MARGIN 8 + +//===================================================================== + +BPositiveIntegerColumn::BPositiveIntegerColumn(const char* title, float width, float minWidth, + float maxWidth, alignment align) + :BTitledColumn(title, width, minWidth, maxWidth, align) +{ + SetWantsEvents(true); +} + + +//-------------------------------------------------------------------- + +void BPositiveIntegerColumn::DrawField(BField *field, BRect rect, BView* parent) +{ + char formatted[256]; + float width = rect.Width() - (2 * kTEXT_MARGIN); + BString string; + + int value=(int)((BIntegerField*)field)->Value(); + + if(value<=0) return; + + sprintf(formatted, "%d", value ); + + string = formatted; + parent->TruncateString(&string, B_TRUNCATE_MIDDLE, width + 2); + DrawString(string.String(), parent, rect); +} + + +//-------------------------------------------------------------------- + +int BPositiveIntegerColumn::CompareFields(BField *field1, BField *field2) +{ + return (((BIntegerField*)field1)->Value() - ((BIntegerField*)field2)->Value()); +} + + + + + void + BPositiveSizeColumn::MouseMoved(BColumnListView *parent, BRow *row, BField *field, + BRect field_rect, BPoint point, uint32 buttons, int32 code, const BMessage *msg ){ + + + } + + + +//-------------------------------------------------------------------- + +BPositiveSizeColumn::BPositiveSizeColumn (const char* title, + float width, + float minWidth, + float maxWidth, + alignment align): + BSizeColumn(title,width,minWidth,maxWidth,align){} + +void +BPositiveSizeColumn::DrawField(BField* field, + BRect rect, + BView* parent) +{ + off_t value=(int)((BSizeField*)field)->Size(); + if(value<=0) return; + BSizeColumn::DrawField(field,rect,parent); +} + +//-------------------------------------------------------------------- + +BPositiveDateColumn::BPositiveDateColumn (const char* title, + float width, + float minWidth, + float maxWidth, + alignment align ): + BDateColumn(title,width,minWidth,maxWidth,align){} + +void +BPositiveDateColumn::DrawField(BField* field, + BRect rect, + BView* parent) +{ + time_t value=(int)((BDateField*)field)->UnixTime(); + if(value<=0) return; + BDateColumn::DrawField(field,rect,parent); +} + + +//-------------------------------------------------------------------- + +BPositiveGraphColumn ::BPositiveGraphColumn(const char* name, + float width, + float minWidth, + float maxWidth, + alignment align): + BIntegerColumn(name,width,minWidth,maxWidth,align) +{ + fBar=LoadIcon("fullbar.png"); + fBack=LoadIcon("graybar.png"); +} + +void +BPositiveGraphColumn ::DrawField(BField* field, + BRect rect, + BView* parent) +{ + int number=(int)((BIntegerField*)field)->Value(); + if(number<=0) return; + + parent->PushState(); + + if (number > 100) + number = 100; + else if (number < 0) + number = 0; + + BRect graphRect(rect); + graphRect.top += 2; + graphRect.bottom = graphRect.top + 11; + graphRect.right = graphRect.left + 99; + + parent->DrawBitmap(fBack,graphRect); //BPoint(rect.right,rect.top)); + + + if (number > 0) { + BRect sourceRect(fBar->Bounds()); + sourceRect.right = sourceRect.left + number; + + BRect destRect(graphRect); + destRect.right = destRect.left + number; + parent->DrawBitmap(fBar,sourceRect,destRect); //sourceRect,destRect); + } + + char numstr[256]; + sprintf(numstr, "%d%%", number); + + float width = be_plain_font->StringWidth(numstr); + parent->MovePenTo(rect.left + rect.Width() / 2 - width / 2, rect.bottom - FontHeight()); + parent->DrawString(numstr); + + + //BGraphColumn::DrawField(field,rect,parent); + parent->PopState(); +} + +BMyBitmapColumn::BMyBitmapColumn (const char* title, + float width, + float minWidth, + float maxWidth, + alignment align): + BTitledColumn(title, width, minWidth, maxWidth, align) + {} + +int BMyBitmapColumn::CompareFields(BField *field1, BField *field2){ + return (((BBitmapField*)field1)->Bitmap() - ((BBitmapField*)field2)->Bitmap()); +} + +void +BMyBitmapColumn::DrawField(BField* field, + BRect rect, + BView* parent){ + + + parent->PushState(); + + BBitmapField *bitmapField = static_cast(field); + const BBitmap *bitmap = bitmapField->Bitmap(); + + if (bitmap != NULL) + { + float x = 0.0; + float y; + BRect r = bitmap->Bounds(); + + y = rect.top; //rect.top + ((rect.Height() - r.Height()) / 2); + + /*switch (Alignment()) + { + case B_ALIGN_LEFT: + x = rect.left + kTEXT_MARGIN; + break; + + case B_ALIGN_CENTER: + x = rect.left + ((rect.Width() - r.Width()) / 2); + break; + + case B_ALIGN_RIGHT: + x = rect.right - kTEXT_MARGIN - r.Width(); + break; + }*/ + x = rect.left; + parent->SetDrawingMode(B_OP_ALPHA); + parent->DrawBitmap(bitmap, BPoint(x,y)); + parent->SetDrawingMode(B_OP_OVER); + } + parent->PopState(); + } + + diff --git a/sources-experimental/MyColumnTypes.h b/sources-experimental/MyColumnTypes.h new file mode 100644 index 0000000..544cd1d --- /dev/null +++ b/sources-experimental/MyColumnTypes.h @@ -0,0 +1,99 @@ +#ifndef _MyColumnType_H +#define _MyColumnType_H + +#include "ColumnListView.h" +#include "ColumnTypes.h" +#include +#include +#include + + +//-------------------------------------------------------------------- +// DrawString only if the value is positive. + +class BPositiveIntegerColumn : public BTitledColumn +{ + public: + BPositiveIntegerColumn (const char* title, + float width, + float minWidth, + float maxWidth, + alignment align = B_ALIGN_LEFT); + void DrawField (BField* field, + BRect rect, + BView* parent); + int CompareFields (BField* field1, + BField* field2); + + + +}; + +class BPositiveSizeColumn : public BSizeColumn +{ + public: + BPositiveSizeColumn (const char* title, + float width, + float minWidth, + float maxWidth, + alignment align = B_ALIGN_LEFT); + void DrawField (BField* field, + BRect rect, + BView* parent); + + //test code: + void MouseMoved(BColumnListView *parent, BRow *row, BField *field,BRect field_rect, BPoint point, uint32 buttons, int32 code, const BMessage *msg = NULL); + +}; + +class BPositiveDateColumn : public BDateColumn +{ + public: + BPositiveDateColumn (const char* title, + float width, + float minWidth, + float maxWidth, + alignment align = B_ALIGN_LEFT); + void DrawField (BField* field, + BRect rect, + BView* parent); +}; + +class BPositiveGraphColumn : public BIntegerColumn +{ + public: + BPositiveGraphColumn(const char* name, + float width, + float minWidth, + float maxWidth, + alignment align = B_ALIGN_LEFT); + void DrawField (BField* field, + BRect rect, + BView* parent); + + private: + BBitmap* fBar; + BBitmap* fBack; +}; + + +class BMyBitmapColumn : public BTitledColumn +{ + public: + BMyBitmapColumn (const char* title, + float width, + float minWidth, + float maxWidth, + alignment align = B_ALIGN_LEFT); + void DrawField (BField* field, + BRect rect, + BView* parent); + + int CompareFields(BField* field1, + BField* field2); + +}; + + +#endif + diff --git a/sources-experimental/NodeWalker.cpp b/sources-experimental/NodeWalker.cpp new file mode 100644 index 0000000..ab9db90 --- /dev/null +++ b/sources-experimental/NodeWalker.cpp @@ -0,0 +1,695 @@ +/* +Open Tracker License + +Terms and Conditions + +Copyright (c) 1991-2000, Be Incorporated. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice applies to all licensees +and shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of Be Incorporated shall not be +used in advertising or otherwise to promote the sale, use or other dealings in +this Software without prior written authorization from Be Incorporated. + +Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks +of Be Incorporated in the United States and other countries. Other brand product +names are registered trademarks or trademarks of their respective holders. +All rights reserved. +*/ + +#include +#include +#include +#include +#include + +#include "NodeWalker.h" + + + +TWalker::~TWalker() +{ +} + +// all the following calls are pure viruals, should not get called +status_t +TWalker::GetNextEntry(BEntry *, bool ) +{ + TRESPASS(); + return B_ERROR; +} + +status_t +TWalker::GetNextRef(entry_ref *) +{ + TRESPASS(); + return B_ERROR; +} + +int32 +TWalker::GetNextDirents(struct dirent *, size_t, int32) +{ + TRESPASS(); + return 0; +} + + +status_t +TWalker::Rewind() +{ + TRESPASS(); + return B_ERROR; +} + +int32 +TWalker::CountEntries() +{ + TRESPASS(); + return -1; +} + + +TNodeWalker::TNodeWalker(bool includeTopDirectory) + : fDirs(20), + fTopIndex(-1), + fTopDir(0), + fIncludeTopDir(includeTopDirectory), + fOriginalIncludeTopDir(includeTopDirectory), + fJustFile(0), + fOriginalJustFile(0) +{ +} + + +TNodeWalker::TNodeWalker(const char *path, bool includeTopDirectory) + : fDirs(20), + fTopIndex(-1), + fTopDir(0), + fIncludeTopDir(includeTopDirectory), + fOriginalIncludeTopDir(includeTopDirectory), + fJustFile(0), + fOriginalDirCopy(path), + fOriginalJustFile(0) +{ + if (fOriginalDirCopy.InitCheck() != B_OK) { + // not a directory, set up walking a single file + fJustFile = new BEntry(path); + if (fJustFile->InitCheck() != B_OK) { + delete fJustFile; + fJustFile = NULL; + } + fOriginalJustFile = fJustFile; + } else { + fTopDir = new BDirectory(fOriginalDirCopy); + fTopIndex++; + fDirs.AddItem(fTopDir); + } +} + + +TNodeWalker::TNodeWalker(const entry_ref *ref, bool includeTopDirectory) + : fDirs(20), + fTopIndex(-1), + fTopDir(0), + fIncludeTopDir(includeTopDirectory), + fOriginalIncludeTopDir(includeTopDirectory), + fJustFile(0), + fOriginalDirCopy(ref), + fOriginalJustFile(0) +{ + if (fOriginalDirCopy.InitCheck() != B_OK) { + // not a directory, set up walking a single file + fJustFile = new BEntry(ref); + if (fJustFile->InitCheck() != B_OK) { + delete fJustFile; + fJustFile = NULL; + } + fOriginalJustFile = fJustFile; + } else { + fTopDir = new BDirectory(fOriginalDirCopy); + fTopIndex++; + fDirs.AddItem(fTopDir); + } +} + + +TNodeWalker::TNodeWalker(const BDirectory *dir, bool includeTopDirectory) + : fDirs(20), + fTopIndex(-1), + fTopDir(0), + fIncludeTopDir(includeTopDirectory), + fOriginalIncludeTopDir(includeTopDirectory), + fJustFile(0), + fOriginalDirCopy(*dir), + fOriginalJustFile(0) +{ + fTopDir = new BDirectory(*dir); + fTopIndex++; + fDirs.AddItem(fTopDir); +} + + +TNodeWalker::TNodeWalker() + : fDirs(20), + fTopIndex(-1), + fTopDir(0), + fIncludeTopDir(false), + fOriginalIncludeTopDir(false), + fJustFile(0), + fOriginalJustFile(0) +{ +} + +TNodeWalker::TNodeWalker(const char *path) + : fDirs(20), + fTopIndex(-1), + fTopDir(0), + fIncludeTopDir(false), + fOriginalIncludeTopDir(false), + fJustFile(0), + fOriginalDirCopy(path), + fOriginalJustFile(0) +{ + if (fOriginalDirCopy.InitCheck() != B_OK) { + // not a directory, set up walking a single file + fJustFile = new BEntry(path); + if (fJustFile->InitCheck() != B_OK) { + delete fJustFile; + fJustFile = NULL; + } + fOriginalJustFile = fJustFile; + } else { + fTopDir = new BDirectory(fOriginalDirCopy); + fTopIndex++; + fDirs.AddItem(fTopDir); + } +} + +TNodeWalker::TNodeWalker(const entry_ref *ref) + : fDirs(20), + fTopIndex(-1), + fTopDir(0), + fIncludeTopDir(false), + fOriginalIncludeTopDir(false), + fJustFile(0), + fOriginalDirCopy(ref), + fOriginalJustFile(0) +{ + if (fOriginalDirCopy.InitCheck() != B_OK) { + // not a directory, set up walking a single file + fJustFile = new BEntry(ref); + if (fJustFile->InitCheck() != B_OK) { + delete fJustFile; + fJustFile = NULL; + } + fOriginalJustFile = fJustFile; + } else { + fTopDir = new BDirectory(fOriginalDirCopy); + fTopIndex++; + fDirs.AddItem(fTopDir); + } +} + +TNodeWalker::TNodeWalker(const BDirectory *dir) + : fDirs(20), + fTopIndex(-1), + fTopDir(0), + fIncludeTopDir(false), + fOriginalIncludeTopDir(false), + fJustFile(0), + fOriginalDirCopy(*dir), + fOriginalJustFile(0) +{ + fTopDir = new BDirectory(*dir); + fTopIndex++; + fDirs.AddItem(fTopDir); +} + +TNodeWalker::~TNodeWalker() +{ + delete fOriginalJustFile; + + for (;;) { + BDirectory *directory = fDirs.RemoveItemAt(fTopIndex--); + if (directory == NULL) + break; + delete directory; + } +} + +status_t +TNodeWalker::PopDirCommon() +{ + ASSERT(fTopIndex >= 0); + + // done with the old dir, pop it + fDirs.RemoveItemAt(fTopIndex); + fTopIndex--; + delete fTopDir; + fTopDir = NULL; + + if (fTopIndex == -1) + // done + return B_ENTRY_NOT_FOUND; + + // point to the new top dir + fTopDir = fDirs.ItemAt(fTopIndex); + + return B_OK; +} + +void +TNodeWalker::PushDirCommon(const entry_ref *ref) +{ + fTopDir = new BDirectory(ref); + // OK to ignore error here. Will + // catch at next call to GetNextEntry + fTopIndex++; + fDirs.AddItem(fTopDir); +} + +status_t +TNodeWalker::GetNextEntry(BEntry *entry, bool traverse) +{ + if (fJustFile) { + *entry = *fJustFile; + fJustFile = 0; + return B_OK; + } + + if (!fTopDir) + // done + return B_ENTRY_NOT_FOUND; + + // If requested to include the top directory, return that first. + if (fIncludeTopDir) { + fIncludeTopDir = false; + return fTopDir->GetEntry(entry); + } + + // Get the next entry. + status_t err = fTopDir->GetNextEntry(entry, traverse); + + if (err != B_OK) { + err = PopDirCommon(); + if (err != B_OK) + return err; + return GetNextEntry(entry, traverse); + } + // See if this entry is a directory. If it is then push it onto the + // stack + entry_ref ref; + err = entry->GetRef(&ref); + + if (err == B_OK && fTopDir->Contains(ref.name, B_DIRECTORY_NODE)) + PushDirCommon(&ref); + + return err; +} + +status_t +TNodeWalker::GetNextRef(entry_ref *ref) +{ + if (fJustFile) { + fJustFile->GetRef(ref); + fJustFile = 0; + return B_OK; + } + + if (!fTopDir) + // done + return B_ENTRY_NOT_FOUND; + + // If requested to include the top directory, return that first. + if (fIncludeTopDir) { + fIncludeTopDir = false; + BEntry entry; + status_t err = fTopDir->GetEntry(&entry); + if (err == B_OK) + err = entry.GetRef(ref); + return err; + } + + // Get the next entry. + status_t err = fTopDir->GetNextRef(ref); + if (err != B_OK) { + err = PopDirCommon(); + if (err != B_OK) + return err; + return GetNextRef(ref); + } + // See if this entry is a directory. If it is then push it onto the + // stack + + if (fTopDir->Contains(ref->name, B_DIRECTORY_NODE)) + PushDirCommon(ref); + + return B_OK; +} + +static int32 +build_dirent(const BEntry *source, struct dirent *ent, + size_t size, int32 count) +{ + entry_ref ref; + source->GetRef(&ref); + + size_t recordLength = strlen(ref.name) + sizeof(dirent); + if (recordLength > size || count <= 0) + // can't fit in buffer, bail + return 0; + + // info about this node + ent->d_reclen = static_cast(recordLength); + strcpy(ent->d_name, ref.name); + ent->d_dev = ref.device; + ent->d_ino = ref.directory; + + // info about the parent + BEntry parent; + source->GetParent(&parent); + if (parent.InitCheck() == B_OK) { + entry_ref parentRef; + parent.GetRef(&parentRef); + ent->d_pdev = parentRef.device; + ent->d_pino = parentRef.directory; + } else { + ent->d_pdev = 0; + ent->d_pino = 0; + } + + return 1; +} + +int32 +TNodeWalker::GetNextDirents(struct dirent *ent, size_t size, int32 count) +{ + if (fJustFile) { + if (!count) + return 0; + + // simulate GetNextDirents by building a single dirent structure + int32 result = build_dirent(fJustFile, ent, size, count); + fJustFile = 0; + return result; + } + + if (!fTopDir) + // done + return 0; + + // If requested to include the top directory, return that first. + if (fIncludeTopDir) { + fIncludeTopDir = false; + BEntry entry; + if (fTopDir->GetEntry(&entry) < B_OK) + return 0; + + return build_dirent(fJustFile, ent, size, count); + } + + // Get the next entry. + int32 result = fTopDir->GetNextDirents(ent, size, count); + + if (!result) { + status_t err = PopDirCommon(); + if (err != B_OK) + return 0; + + return GetNextDirents(ent, size, count); + } + + // push any directories in the returned entries onto the stack + for (int32 i = 0; i < result; i++) { + if (fTopDir->Contains(ent->d_name, B_DIRECTORY_NODE)) { + entry_ref ref(ent->d_dev, ent->d_ino, ent->d_name); + PushDirCommon(&ref); + } + ent = (dirent *)((char *)ent + ent->d_reclen); + } + + return result; +} + +status_t +TNodeWalker::Rewind() +{ + if (fOriginalJustFile) { + // single file mode, rewind by pointing to the original file + fJustFile = fOriginalJustFile; + return B_OK; + } + + // pop all the directories and point to the initial one + for (;;) { + BDirectory *directory = fDirs.RemoveItemAt(fTopIndex--); + if (!directory) + break; + delete directory; + } + + fTopDir = new BDirectory(fOriginalDirCopy); + fTopIndex = 0; + fIncludeTopDir = fOriginalIncludeTopDir; + fDirs.AddItem(fTopDir); + // rewind the directory + return fTopDir->Rewind(); +} + +int32 +TNodeWalker::CountEntries() +{ + // should not be calling this + TRESPASS(); + return -1; +} + +TVolWalker::TVolWalker(bool knowsAttributes, bool writable, bool includeTopDirectory) + : TNodeWalker(includeTopDirectory), + fKnowsAttr(knowsAttributes), + fWritable(writable) +{ + + /* + Get things initialized. Find first volume, or find the first volume + that supports attributes. + */ + NextVolume(); +} + +TVolWalker::~TVolWalker() +{ +} + +status_t +TVolWalker::NextVolume() +{ + status_t err; + + // The stack of directoies should be empty. + ASSERT(fTopIndex == -1); + ASSERT(fTopDir == NULL); + + do { + err = fVolRoster.GetNextVolume(&fVol); + if (err != B_OK) + break; + } while ((fKnowsAttr && !fVol.KnowsAttr()) || (fWritable && fVol.IsReadOnly())); + + if (err == B_OK) { + // Get the root directory to get things started. There's always + // a root directory for a volume. So if there is an error then it + // means that something is really bad, like the system is out of + // memory. In that case don't worry about truying to skip to the + // next volume. + fTopDir = new BDirectory(); + err = fVol.GetRootDirectory(fTopDir); + fIncludeTopDir = fOriginalIncludeTopDir; + fTopIndex = 0; + fDirs.AddItem(fTopDir); + } + + return err; +} + +status_t +TVolWalker::GetNextEntry(BEntry *entry, bool traverse) +{ + if (!fTopDir) + return B_ENTRY_NOT_FOUND; + + // Get the next entry. + status_t err = _inherited::GetNextEntry(entry, traverse); + + while (err != B_OK) { + // We're done with the current volume. Go to the next one + err = NextVolume(); + if (err != B_OK) + break; + err = GetNextEntry(entry, traverse); + } + + return err; +} + +status_t +TVolWalker::GetNextRef(entry_ref *ref) +{ + if (!fTopDir) + return B_ENTRY_NOT_FOUND; + + // Get the next ref. + status_t err = _inherited::GetNextRef(ref); + + while (err != B_OK) { + // We're done with the current volume. Go to the next one + err = NextVolume(); + if (err != B_OK) + break; + err = GetNextRef(ref); + } + + return err; +} + +int32 +TVolWalker::GetNextDirents(struct dirent *ent, size_t size, int32 count) +{ + if (!fTopDir) + return B_ENTRY_NOT_FOUND; + + // Get the next dirent. + status_t err = _inherited::GetNextDirents(ent, size, count); + + while (err != B_OK) { + // We're done with the current volume. Go to the next one + err = NextVolume(); + if (err != B_OK) + break; + err = GetNextDirents(ent, size, count); + } + + return err; +} + +status_t +TVolWalker::Rewind() +{ + fVolRoster.Rewind(); + return NextVolume(); +} + +TQueryWalker::TQueryWalker(const char *predicate) + : TWalker(), fQuery(), fVolRoster(), fVol() +{ + fPredicate = strdup(predicate); + NextVolume(); +} + +TQueryWalker::~TQueryWalker() +{ + free((char*) fPredicate); + fPredicate = NULL; +} + +status_t +TQueryWalker::GetNextEntry(BEntry *entry, bool traverse) +{ + status_t err; + + do { + err = fQuery.GetNextEntry(entry, traverse); + if (err == B_ENTRY_NOT_FOUND) { + if (NextVolume() != B_OK) + break; + } + } while (err == B_ENTRY_NOT_FOUND); + + return err; +} + +status_t +TQueryWalker::GetNextRef(entry_ref *ref) +{ + status_t err; + + for (;;) { + err = fQuery.GetNextRef(ref); + if (err != B_ENTRY_NOT_FOUND) + break; + + err = NextVolume(); + if (err != B_OK) + break; + } + + return err; +} + +int32 +TQueryWalker::GetNextDirents(struct dirent *ent, size_t size, int32 count) +{ + int32 result; + + for (;;) { + result = fQuery.GetNextDirents(ent, size, count); + if (result != 0) + return result; + + if (NextVolume() != B_OK) + return 0; + } + + return result; +} + +status_t +TQueryWalker::NextVolume() +{ + status_t err; + do { + err = fVolRoster.GetNextVolume(&fVol); + if (err) + break; + } while (!fVol.KnowsQuery()); + + + if (err == B_OK) { + err = fQuery.Clear(); + err = fQuery.SetVolume(&fVol); + err = fQuery.SetPredicate(fPredicate); + err = fQuery.Fetch(); + } + + return err; +} + +int32 +TQueryWalker::CountEntries() +{ + // should not be calling this + TRESPASS(); + return -1; +} + +status_t +TQueryWalker::Rewind() +{ + fVolRoster.Rewind(); + return NextVolume(); +} diff --git a/sources-experimental/NodeWalker.h b/sources-experimental/NodeWalker.h new file mode 100644 index 0000000..71aeb9b --- /dev/null +++ b/sources-experimental/NodeWalker.h @@ -0,0 +1,143 @@ +#ifndef WALKER_H +#define WALKER_H + +#ifndef _BE_BUILD_H +#include +#endif +#include +#include +#include +#include +#include +#include +#include + +#include "ObjectList.h" + + + +class TWalker : public BEntryList { + // adds a virtual destructor that is severely missing in BEntryList + // BEntryList should never be used polymorphically because of that + +public: + virtual ~TWalker(); + + virtual status_t GetNextEntry(BEntry *, bool traverse = false) = 0; + virtual status_t GetNextRef(entry_ref *) = 0; + virtual int32 GetNextDirents(struct dirent *, size_t, + int32 count = INT_MAX) = 0; + virtual status_t Rewind() = 0; + virtual int32 CountEntries() = 0; +}; + +class TNodeWalker : public TWalker { +// TNodeWalker supports iterating a single volume, starting from a specified +// entry; if passed a non-directory entry it returns just that one entry +public: + TNodeWalker(bool includeTopDirectory); + TNodeWalker(const char *path, bool includeTopDirectory); + TNodeWalker(const entry_ref *ref, bool includeTopDirectory); + TNodeWalker(const BDirectory *dir, bool includeTopDirectory); + virtual ~TNodeWalker(); + + // Backwards compatibility with Tracker compiled for R5 (remove when this + // gets integrated into the official release). + TNodeWalker(); + TNodeWalker(const char *path); + TNodeWalker(const entry_ref *ref); + TNodeWalker(const BDirectory *dir); + + virtual status_t GetNextEntry(BEntry *, bool traverse = false); + virtual status_t GetNextRef(entry_ref *); + virtual int32 GetNextDirents(struct dirent *, size_t, + int32 count = INT_MAX); + virtual status_t Rewind(); + +protected: + status_t PopDirCommon(); + void PushDirCommon(const entry_ref *); + +private: + virtual int32 CountEntries(); + // don't know how to do that, have just a fake stub here + +protected: + BObjectList fDirs; + int32 fTopIndex; + BDirectory *fTopDir; + bool fIncludeTopDir; + bool fOriginalIncludeTopDir; + +private: + BEntry *fJustFile; + BDirectory fOriginalDirCopy; + BEntry *fOriginalJustFile; + // keep around to support Rewind +}; + +class TVolWalker : public TNodeWalker { +// TNodeWalker supports iterating over all the mounted volumes; +// non-attribute and read-only volumes may optionaly be filtered out +public: + TVolWalker(bool knows_attr = true, bool writable = true, + bool includeTopDirectory = true); + virtual ~TVolWalker(); + + virtual status_t GetNextEntry(BEntry *, bool traverse = false); + virtual status_t GetNextRef(entry_ref *); + virtual int32 GetNextDirents(struct dirent *, size_t, + int32 count = INT_MAX); + virtual status_t Rewind(); + + virtual status_t NextVolume(); + // skips to the next volume + // Note: it would be cool to return const BVolume * + // that way a subclass could implement a volume filter - + // it would just override, call inherited for as long as there + // are volumes and it does not like them + // we would have to give up the status_t then, which might be + // ok + +private: + BVolumeRoster fVolRoster; + BVolume fVol; + bool fKnowsAttr; + bool fWritable; + + typedef TNodeWalker _inherited; +}; + +class TQueryWalker : public TWalker { +public: + TQueryWalker(const char *predicate); + virtual ~TQueryWalker(); + + // Does an in-fix walk of all entries + virtual status_t GetNextEntry(BEntry *, bool traverse = false); + virtual status_t GetNextRef(entry_ref *); + virtual int32 GetNextDirents(struct dirent *, size_t, + int32 count = INT_MAX); + + virtual status_t NextVolume(); + // skips to the next volume + virtual status_t Rewind(); + +private: + virtual int32 CountEntries(); + // can't count + + BQuery fQuery; + BVolumeRoster fVolRoster; + BVolume fVol; + bigtime_t fTime; + const char *fPredicate; + + typedef TQueryWalker _inherited; +}; + + + +#endif // WALKER_H + + diff --git a/sources-experimental/Notifier.cpp b/sources-experimental/Notifier.cpp new file mode 100644 index 0000000..df39664 --- /dev/null +++ b/sources-experimental/Notifier.cpp @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#include "Notifier.h" +#include + + +Notifier::Notifier() {} +Notifier::~Notifier(){} + + +void +Notifier::SetKey(ItemProperty key,void* data,ssize_t numBytes) { + NotifyListener(key,data,numBytes); +} + +void +Notifier::SetKeyString(ItemProperty key,const char* data){ + + size_t len = strlen(data); + char copy[ len + 1]; + strncpy(copy,data,len); + copy[len] = '\0'; + SetKey(key,(void*)copy, len+1); + //SetKey(key,(void*)data,strlen(data)); + +} + +void +Notifier::SetKeyInt32(ItemProperty key,int32 data){ + SetKey(key,(void*)&data,sizeof(int32)); +} + +void +Notifier::AddElementListener(ElementListener* list){ + fListeners.AddItem((void*)list); +} + +void +Notifier::RemoveElementListener(ElementListener* list){ + fListeners.RemoveItem((void*)list); +} + + +void +Notifier::NotifyListener(ItemProperty key,void* data,ssize_t size) +{ + ElementListener* fListener=NULL; + for(int l=0; lKeyModified(key,data,size); + } +} + +//-- diff --git a/sources-experimental/Notifier.h b/sources-experimental/Notifier.h new file mode 100644 index 0000000..1874e11 --- /dev/null +++ b/sources-experimental/Notifier.h @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#ifndef Notifier_H_ +#define Notifier_H_ + +#include + +#include "ElementListener.h" +#include "ItemProperty.h" + +class Notifier +{ + +public: + Notifier(); + virtual ~Notifier(); + + + void AddElementListener(ElementListener*); + void RemoveElementListener(ElementListener*); + + + + virtual void SetKey(ItemProperty key,void* data,ssize_t size); + void SetKeyString(ItemProperty key,const char* data); + void SetKeyInt32(ItemProperty key,int32 data); + + void NotifyListener(ItemProperty key,void* data,ssize_t size); + + private: + BList fListeners; + +}; +#endif + +//-- diff --git a/sources-experimental/OPMLParser.cpp b/sources-experimental/OPMLParser.cpp new file mode 100644 index 0000000..53169fe --- /dev/null +++ b/sources-experimental/OPMLParser.cpp @@ -0,0 +1,240 @@ +#include "OPMLParser.h" +#include "curl/curl.h" + +#include "Logger.h" + + +OPMLTree* +OPMLParser::Parse(BString filename){ + + + OPMLTree* list=NULL; + + xmlParserCtxtPtr ctxt = xmlNewParserCtxt(); + xmlDocPtr doc = xmlCtxtReadFile(ctxt, filename.String(), NULL, XML_PARSE_RECOVER); + xmlXPathContextPtr pathCtxt = xmlXPathNewContext(doc); + + //testing code! + xmlXPathObjectPtr itemNode = xmlXPathEvalExpression((const xmlChar *)"/opml/head/title", pathCtxt); + if (itemNode == NULL) { + xmlFreeParserCtxt(ctxt); + xmlXPathFreeContext(pathCtxt); + xmlXPathFreeObject(itemNode); + return NULL; + }; + //only one channel per rss file! + if(itemNode->nodesetval == NULL || itemNode->nodesetval->nodeNr !=1){ + xmlFreeParserCtxt(ctxt); + xmlXPathFreeContext(pathCtxt); + xmlXPathFreeObject(itemNode); + //LOG("OPMLParser", liDebug ,"No title in opml file.."); + return NULL; + }; + + //LOG("OPMLParser", liDebug ,"OPML title: %s",XML_GET_CONTENT(itemNode->nodesetval->nodeTab[0]->children)); + BString opml_name((const char*)XML_GET_CONTENT(itemNode->nodesetval->nodeTab[0]->children)); + + + + if (pathCtxt != NULL) { + xmlXPathObjectPtr itemNode = xmlXPathEvalExpression((const xmlChar *)"/opml/body/outline", pathCtxt); + if (itemNode == NULL) { + xmlFreeParserCtxt(ctxt); + xmlXPathFreeContext(pathCtxt); + xmlXPathFreeObject(itemNode); + return NULL; + }; + + + + xmlNodeSetPtr items = itemNode->nodesetval; + + if (items == NULL || items->nodeNr < 1 ) { + xmlFreeParserCtxt(ctxt); + xmlXPathFreeContext(pathCtxt); + xmlXPathFreeObject(itemNode); + return NULL; + }; + + + //the root + list = new OPMLTree; + list->description = opml_name; + list->foglie = new OPMLList(items->nodeNr); + + for (int32 i = 0; i < items->nodeNr; i++) { + ParseOutline(list, items->nodeTab[i]); + } + + xmlXPathFreeObject(itemNode); + }; + + xmlFreeParserCtxt(ctxt); + xmlXPathFreeContext(pathCtxt); + + return list; +} + +int +OPMLParser::ParseOutlineFolder(OPMLTree* root,xmlNodePtr node) +{ + return 0; +} + +int +OPMLParser::ParseOutline(OPMLTree* aroot,xmlNodePtr node){ + + xmlNode *cur_node = NULL; + cur_node = node; + { + + if (cur_node->type == XML_ELEMENT_NODE) + { + BString bname((const char*)cur_node->name); + + if(bname.ICompare("outline") == 0){ + + OPMLTree* subtree = new OPMLTree; + aroot->foglie->AddItem(subtree); + + subtree->foglie = NULL; + + //guardiamo le properties: + xmlAttr *attr = cur_node->properties; + xmlAttr *cur_attr = NULL; + + for (cur_attr = attr; cur_attr; cur_attr = cur_attr->next) { + BString battr((const char*)cur_attr->name); + if(battr.ICompare("text") == 0) { + xmlNodePtr node = cur_attr->children; + BString imageURL ; + imageURL << (const char*)node->content; + subtree->description.SetTo(imageURL); + } + else + if(battr.ICompare("xmlUrl") == 0 || battr.ICompare("url") == 0) { + xmlNodePtr node = cur_attr->children; + BString imageURL ; + imageURL << (const char*)node->content; + subtree->link.SetTo(imageURL); + } + + } //for attributes + + + +// printf("--> Name %s\n", subtree->description.String()); + if (cur_node->children) + { + subtree->foglie = new OPMLList(10); + // printf("--> childs!\n"); + + xmlNode *cur_child = NULL; + for (cur_child = cur_node->children; cur_child; cur_child = cur_child->next) + { + ParseOutline(subtree, cur_child); + } +// printf("--> End Name %s -- %ld\n", subtree->description.String(), subtree->foglie->CountItems()); + // + } + } + } + } + return 0; +} +/* +int +OPMLParser::ParseOutline(OPMLTree* aroot,xmlNodePtr node){ + + xmlNode *cur_node = NULL; + + for (cur_node = node; cur_node; cur_node = cur_node->next) { + + if (cur_node->type == XML_ELEMENT_NODE) + { + printf("-->DEBUG %s\n", (const char*)cur_node->name); + BString bname((const char*)cur_node->name); + + if(bname.ICompare("outline") == 0){ + if(aroot->foglie == NULL) aroot->foglie = new OPMLList(10); + + //LOG("OPMLParser", liDebug ,"New CHILD for [%s]",aroot->description.String()); + + OPMLTree* tree = new OPMLTree; + tree->foglie = NULL; + aroot->foglie->AddItem(tree); + + //guardiamo le properties: + xmlAttr *attr = cur_node->properties; + xmlAttr *cur_attr = NULL; + + for (cur_attr = attr; cur_attr; cur_attr = cur_attr->next) { + BString battr((const char*)cur_attr->name); + if(battr.ICompare("text") == 0) { + xmlNodePtr node = cur_attr->children; + BString imageURL ; + imageURL << (const char*)node->content; + tree->description.SetTo(imageURL); + + //LOG("OPMLParser", liDebug ,"\ttext: %s",tree->description.String()); + } + else + if(battr.ICompare("xmlUrl") == 0 || battr.ICompare("url") == 0) { + xmlNodePtr node = cur_attr->children; + BString imageURL ; + imageURL << (const char*)node->content; + tree->link.SetTo(imageURL); + + //LOG("OPMLParser", liDebug ,"\tlink: %s",tree->link.String()); + } + + } //for attributes + + // ok se non ho 'link' proseguo ricorsivamente altrimenti se ho un link + // significa che sono ad una foglia.. + //if(tree->link != "") return 0; + + + if (cur_node->children) + ParseOutline(tree, cur_node->children); + + + } + + } + } + return 0; +} +*/ +void +OPMLParser::PrintToStream(OPMLTree* tree,int tab) +{ + for(int i=0;idescription.String()); + + if(tree->foglie) + { + for(int i=0;ifoglie->CountItems();i++) + PrintToStream(tree->foglie->ItemAt(i),tab+1); + } +} + +void +OPMLParser::DeleteOPMLTree(OPMLTree* tree){ + + if(tree->foglie) + { + for(int i=0;ifoglie->CountItems();i++) + DeleteOPMLTree(tree->foglie->ItemAt(i)); + + tree->foglie->MakeEmpty(); + delete tree->foglie; + + } + + delete tree; + +} + diff --git a/sources-experimental/OPMLParser.h b/sources-experimental/OPMLParser.h new file mode 100644 index 0000000..890e07b --- /dev/null +++ b/sources-experimental/OPMLParser.h @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#ifndef OPMLParser_H_ +#define OPMLParser_H_ + +#include +#include + +#include "libxml/tree.h" +#include "libxml/xpath.h" +#include "libxml/xpathInternals.h" +#include "libxml/parserInternals.h" +#include "libxml/debugXML.h" + +struct OPMLTree; + +typedef BObjectList OPMLList; + +struct OPMLTree { + BString description; + BString link; + OPMLList *foglie; +}; + + + +class OPMLParser +{ + + public: + OPMLTree* Parse(BString filename); + + void DeleteOPMLTree(OPMLTree*); //recursive delete + + void PrintToStream(OPMLTree*,int tab); + private: + int ParseOutline(OPMLTree* root,xmlNodePtr node); + int ParseOutlineFolder(OPMLTree* root,xmlNodePtr node); + +}; +#endif diff --git a/sources-experimental/PercentageView.cpp b/sources-experimental/PercentageView.cpp new file mode 100644 index 0000000..67a3819 --- /dev/null +++ b/sources-experimental/PercentageView.cpp @@ -0,0 +1,75 @@ + #include "PercentageView.h" + #include + #include "Utils.h" + + BBitmap* empty = NULL ; + BBitmap* bar1 = NULL ; + BBitmap* bar2 = NULL ; + + +PercentageView::PercentageView(BRect rect):BView(rect,"percentageView",B_FOLLOW_NONE,B_WILL_DRAW){ + + if(!empty) + empty = LoadIcon("graybar.png"); + if(!bar1) + bar1 = LoadIcon("fullbar1.png"); + if(!bar2) + bar2 = LoadIcon("fullbar2.png"); + + bar = bar1; + + fPercentage = 0; +} + +void +PercentageView::AttachedToWindow(){ + if(Parent()) + SetViewColor(Parent()->ViewColor()); +} + +void +PercentageView::SetPercentage(int32 percentage){ + + if(percentage<0) percentage=0; + if(percentage>100) percentage=100; + + fPercentage=percentage; + + if(bar == bar1) + bar = bar2; + else + bar = bar1; + + Invalidate(); +} + +void +PercentageView::ResizeToPreferred(){ + + ResizeTo(99,11); + +} + +void +PercentageView::Draw(BRect) +{ + + SetDrawingMode( B_OP_ALPHA ); + + BRect graphRect(Bounds()); + graphRect.right = graphRect.left+99; + //graphRect.top +=2; + graphRect.bottom = graphRect.top + 11; + + if(empty) DrawBitmap(empty,graphRect); //BPoint(rect.right,rect.top)); + + if(fPercentage >0) { + + BRect sourceRect(bar->Bounds()); + sourceRect.right = sourceRect.left + fPercentage; + + BRect destRect(graphRect); + destRect.right = destRect.left + fPercentage; + if(bar) DrawBitmap(bar,sourceRect,destRect); //sourceRect,destRect); + } +} diff --git a/sources-experimental/PercentageView.h b/sources-experimental/PercentageView.h new file mode 100644 index 0000000..62d212e --- /dev/null +++ b/sources-experimental/PercentageView.h @@ -0,0 +1,29 @@ +#ifndef PercentageView_H_ +#define PercentageView_H_ + +#include + +class BBitmap; + +class PercentageView : public BView { + + public: + PercentageView(BRect); + + void SetPercentage(int32); + + int32 GetPercentage(); + + void Draw(BRect rect); + + void AttachedToWindow(); + void ResizeToPreferred(); + + private: + int32 fPercentage; + BBitmap* bar ; + +}; + +#endif +//-- diff --git a/sources-experimental/PercentageWindow.cpp b/sources-experimental/PercentageWindow.cpp new file mode 100644 index 0000000..abef0a9 --- /dev/null +++ b/sources-experimental/PercentageWindow.cpp @@ -0,0 +1,96 @@ +#include "PercentageWindow.h" + +#include "StripeView.h" +#include "BPAlert.h" +#include "PercentageView.h" + +#include +#include + +#define DEFAULT_RECT BRect(0, 0, 310, 75) + +static const int kTextIconOffsetSpace = 30; + +PercentageWindow::PercentageWindow(const char* title,const char* text,BBitmap* icon) : BWindow(DEFAULT_RECT, title, B_MODAL_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE){ + + // Set up the "_master_" view + + StripeView* masterView = new StripeView(Bounds()); + AddChild(masterView); + masterView->SetBitmap(icon); + + kTextIconOffset = 0; + + if(masterView->Bitmap()) + kTextIconOffset = masterView->Bitmap()->Bounds().right + kTextIconOffsetSpace; + + + //ok, un String + //il percentage (a 0) con testo percentuale + float maxW; + + BStringView* string=new BStringView(BRect(kTextIconOffset,6,0,0),"_text",text); + masterView->AddChild(string); + string->ResizeToPreferred(); + maxW=string->Frame().right + 6; + + BRect rect(string->Frame()); + + rect.top=string->Frame().bottom+6; + + pw=new PercentageView(rect); + masterView->AddChild(pw); + pw->ResizeToPreferred(); + + rect=pw->Frame(); + rect.left=rect.right+6; + + + perc=new BStringView(rect,"_percentage","100%"); + masterView->AddChild(perc); + perc->ResizeToPreferred(); + if(perc->Frame().right + 6 > maxW) + maxW=perc->Frame().right + 6; + + perc->SetText("0%"); + + maxW +=kTextIconOffsetSpace; + + //if(maxW>Bounds().right) + ResizeTo(maxW,Bounds().bottom); + + SetLook(B_FLOATING_WINDOW_LOOK); + + MoveTo(BPAlert::AlertPosition(Frame().Width(), Frame().Height())); +} + +void +PercentageWindow::SetPercentage(int p){ + + + BString text; + text << p << "%"; + + if(Lock()){ + perc->SetText(text.String()); + pw->SetPercentage(p); + Unlock(); + } + +} + +bool +PercentageWindow::QuitRequested(){ + if(fLooper) + BMessenger(fLooper).SendMessage(fMsg); + + return true; +} + + +void +PercentageWindow::Go(BLooper* lop,int32 msg){ + fLooper = lop; + fMsg=msg; + Show(); +} diff --git a/sources-experimental/PercentageWindow.h b/sources-experimental/PercentageWindow.h new file mode 100644 index 0000000..91400f6 --- /dev/null +++ b/sources-experimental/PercentageWindow.h @@ -0,0 +1,29 @@ +#ifndef _PercentageWindow_H_ +#define _PercentageWindow_H_ + +#include +#include +#include +#include + +class BStringView; + class PercentageView; + +class PercentageWindow : public BWindow { + + public: + PercentageWindow(const char* title,const char* text,BBitmap* icon=NULL); + void Go(BLooper* lop=NULL,int32 msg=0); + void SetPercentage(int perc); + bool QuitRequested(); + + private: + BLooper* fLooper; + int32 fMsg; + int kTextIconOffset; + BStringView* perc; + PercentageView* pw; + +}; + +#endif diff --git a/sources-experimental/QueueActions.cpp b/sources-experimental/QueueActions.cpp new file mode 100644 index 0000000..2a524ad --- /dev/null +++ b/sources-experimental/QueueActions.cpp @@ -0,0 +1,153 @@ +#include "QueueActions.h" + +#include + +#include + +#define CHKLOCK if(!IsLocked()) debugger("\nQueueActions must me locked!\n"); + +QueueActions::QueueActions(const char* name){ + BString n(name); + n << "'s enemy"; + + + fID = spawn_thread(QueueActions::ManageTheQueue,n.String(),B_NORMAL_PRIORITY,this); + printf("Thread ready [%s] %ld\n",n.String(),fID); + + fLock = create_sem(1,name); + fLocked = false; + fCurrentAction = NULL; +} + +QueueActions::~QueueActions(){ + if(Lock()){ + suspend_thread(fID); + exit_thread(fID); + delete_sem(fLock); + } +} + + +bool +QueueActions::Lock(){ + status_t value = acquire_sem(fLock) ; + if(value==B_NO_ERROR){ + fLocked = true; + } + return (value == B_NO_ERROR); +} + +void +QueueActions::Unlock(){ + fLocked = false; + release_sem(fLock); +} + +void +QueueActions::AddAction(Action* a){ + + //FIX! + //esiste già un azione con lo stesso ID??? + + if(Lock()){ + printf("adding %ld - Action name %s\n",fID,a->GetDescription().String()); + fList.AddItem(a); + if(fList.CountItems() == 1) //Auto-start thread + resume_thread(fID); + + Unlock(); + } +} + +Action* +QueueActions::CurrentAction(){ + CHKLOCK; + return fCurrentAction; +} + +void +QueueActions::SetCurrentAction(Action* action){ + CHKLOCK; + fCurrentAction = action; +} + +int32 +QueueActions::CountActions(){ + CHKLOCK; + return fList.CountItems(); +} + +Action* +QueueActions::ActionAt(int32 pos){ + CHKLOCK; + fList.ItemAt(pos); +} + +void +QueueActions::RemoveActionAt(int32 pos){ + CHKLOCK; + fList.RemoveItemAt(pos); +} + +bool +QueueActions::IsLocked(){ + return fLocked; +} + + +int32 +QueueActions::ManageTheQueue(void* data) { + + QueueActions *qa=(QueueActions*)data; + + printf("Thread started %ld\n",qa->fID); + + while(true){ + + Action *last=NULL; + + if(qa->Lock()) { + + printf("Thread executing PID %ld Count %ld\n",qa->fID,qa->fList.CountItems()); + if(qa->fList.CountItems()>0){ + // remove and delete the action. + last=qa->fList.ItemAt(0); + qa->fList.RemoveItemAt(0); + qa->SetCurrentAction(last); + + } else { + + last=NULL; + qa->SetCurrentAction(last); + } + + qa->Unlock(); + } + + if(last) + { + // pop the action + qa->ActionReadyToPerform(last); + // perform the action + BMessage err; + status_t status = last->Perform(&err); + // do post-perform! + + qa->ActionPerformed(last,status,&err); + + if(qa->Lock()){ + qa->SetCurrentAction(NULL); + delete last; + qa->Unlock(); + } + + } + else { + + printf("Thread suspend PID %ld Count %ld\n",qa->fID,qa->fList.CountItems()); + suspend_thread(qa->fID); + } + + } //while + +} diff --git a/sources-experimental/QueueActions.h b/sources-experimental/QueueActions.h new file mode 100644 index 0000000..2472ec9 --- /dev/null +++ b/sources-experimental/QueueActions.h @@ -0,0 +1,54 @@ +#ifndef QueueActions_H_ +#define QueueActions_H_ + +#include + +#define QA_ADD_ACTION 'qaaa' + +#include "Action.h" +#include + +#include + +class QueueActions { + +public: + + QueueActions(const char* name); + virtual ~QueueActions(); + + void AddAction(Action* ); + + //BEFORE CALLING CurrentAction, you MUST Lock() the Queue! + Action* CurrentAction(); + int32 CountActions(); + Action* ActionAt(int32 pos); + void RemoveActionAt(int32 pos); + + + bool Lock(); + void Unlock(); + bool IsLocked(); + + protected: + + static int32 ManageTheQueue(void*); + + virtual void ActionReadyToPerform(Action*) = 0; + virtual void ActionPerformed(Action*,status_t,BMessage*) = 0; + + + + private: + + + + void SetCurrentAction(Action*); + + thread_id fID; + sem_id fLock; + BObjectList fList; + Action* fCurrentAction; + bool fLocked; +}; +#endif diff --git a/sources-experimental/QueueFileDownload.cpp b/sources-experimental/QueueFileDownload.cpp new file mode 100644 index 0000000..a504db1 --- /dev/null +++ b/sources-experimental/QueueFileDownload.cpp @@ -0,0 +1,40 @@ +#include "QueueFileDownload.h" +#include "ActionDownload.h" +#include "Messenger.h" + +void +QueueFileDownload::ActionReadyToPerform(Action* action) +{ + ActionAsync* ad=dynamic_cast(action); + if(!ad) return; + + ad->SetTargetAndWhat(fLooper,fMsg); + +} + +void +QueueFileDownload::ActionPerformed(Action* action,status_t state,BMessage* msg) +{ + + //ActionAsync* ad=dynamic_cast(action); + //if(!ad) return; + + BMessage notify(*msg); + notify.what = fMsg; + + if(fLooper) + BMessenger(fLooper).SendMessage(¬ify); + + return; +} + +void +QueueFileDownload::SuppressAction(Action* action) { + ActionDownload* ad=dynamic_cast(action); + if(!ad) return; + + ad->SetShouldStop(true); +} + +//-- + diff --git a/sources-experimental/QueueFileDownload.h b/sources-experimental/QueueFileDownload.h new file mode 100644 index 0000000..84be4f2 --- /dev/null +++ b/sources-experimental/QueueFileDownload.h @@ -0,0 +1,27 @@ +#ifndef QueueFileDownload_H_ +#define QueueFileDownload_H_ + +#include "QueueMultiActions.h" +#include + + +class QueueFileDownload : public QueueMultiActions { + +public: + + QueueFileDownload(const char* name,int howMany,BLooper* target,uint32 msg):QueueMultiActions(name,howMany){ + fMsg=msg; + fLooper=target; + }; + + + protected: + void ActionPerformed(Action*,status_t,BMessage*); + void ActionReadyToPerform(Action*); + void SuppressAction(Action*); + + private: + BLooper* fLooper; + uint32 fMsg; +}; +#endif diff --git a/sources-experimental/QueueMultiActions.cpp b/sources-experimental/QueueMultiActions.cpp new file mode 100644 index 0000000..208934a --- /dev/null +++ b/sources-experimental/QueueMultiActions.cpp @@ -0,0 +1,238 @@ +#include "QueueMultiActions.h" + +#include +#include + + +#define CHKLOCK if(!IsLocked()) debugger("\nQueueMultiActions must me locked!\n"); + +QueueMultiActions::QueueMultiActions(const char* name,int count){ + + fCount = count; + if(count > MAX_MULTI) + debugger("wrong number of multi download settings"); + + for(int j=0;jqa=this; + tok->index=i; + fID[i] = spawn_thread(QueueMultiActions::ManageTheQueue,n.String(),B_NORMAL_PRIORITY,tok); + printf("Thread ready [%s] %ld\n",n.String(),fID[i]); + + } + + + + fLock = create_sem(1,name); + fLocked = false; + +} + +QueueMultiActions::~QueueMultiActions(){ + if(Lock()){ + + for(int i=0;iMAX_MULTI) { + Unlock(); + return; + } + + if(fProposedCount > fCount){ + + for(int i=fCount;iqa=this; + tok->index=i; + fID[i] = spawn_thread(QueueMultiActions::ManageTheQueue,n.String(),B_NORMAL_PRIORITY,tok); + printf("Thread ready [%s] %ld\n",n.String(),fID[i]); + } + } + } + else + { + //uhm what to do? + for(int i=fProposedCount;iGetDescription().String()); + fList.AddItem(a); + if(fList.CountItems() <= fCount) //Auto-start thread + { + for(int i=0;iqa; + int index = tok->index; + + //printf("Thread started %ld\n",qa->fID[index]); + + while(true){ + + Action *last=NULL; + + if(qa->Lock()) { + + // printf("Thread executing PID %ld Count %ld\n",qa->fID[index],qa->fList.CountItems()); + if(qa->fList.CountItems()>0){ + // remove and delete the action. + last=qa->fList.ItemAt(0); + qa->fList.RemoveItemAt(0); + qa->SetCurrentAction(last,index); + + } else { + + last=NULL; + qa->SetCurrentAction(last,index); + } + + qa->Unlock(); + } + + if(last) + { + // pop the action + qa->ActionReadyToPerform(last); + // perform the action + BMessage err; + status_t status = last->Perform(&err); + // do post-perform! + + qa->ActionPerformed(last,status,&err); + + if(qa->Lock()){ + qa->SetCurrentAction(NULL,index); + delete last; + qa->Unlock(); + } + + } else { + + //printf("Thread suspend PID %ld Count %ld\n",qa->fID[index],qa->fList.CountItems()); + suspend_thread(qa->fID[index]); + } + + //Check my life? + if(qa->Lock()){ + if( index >= qa->fCount){ + qa->KIllThread(index); + qa->Unlock(); + // printf("Thread died PID %ld\n",qa->fID[index]); + return 0; //bye-bye world! + } + qa->Unlock(); + } + + } //while + +} diff --git a/sources-experimental/QueueMultiActions.h b/sources-experimental/QueueMultiActions.h new file mode 100644 index 0000000..399b95a --- /dev/null +++ b/sources-experimental/QueueMultiActions.h @@ -0,0 +1,67 @@ +#ifndef QueueMultiActions_H_ +#define QueueMultiActions_H_ + +#include +#include +#include + + +#include "Action.h" + +#define MAX_MULTI 5 + +class QueueMultiActions { + +public: + + QueueMultiActions(const char* name, int count); + virtual ~QueueMultiActions(); + + void AddAction(Action* ); + + //BEFORE CALLING CurrentAction, you MUST Lock() the Queue! + Action* CurrentAction(int index); + + int32 CountActions(); + int CountThreads() { return fCount; } + + Action* ActionAt(int32 pos); + void RemoveActionAt(int32 pos); + + + void SetDownloadCount(int count); + + + bool Lock(); + void Unlock(); + bool IsLocked(); + + protected: + + static int32 ManageTheQueue(void*); + + virtual void ActionReadyToPerform(Action*) = 0; + virtual void ActionPerformed(Action*,status_t,BMessage*) = 0; + virtual void SuppressAction(Action*) = 0; + + + private: + struct token + { + int index; + QueueMultiActions* qa; + }; + + + void SetCurrentAction(Action*,int index); + void KIllThread(int id); + + Action* fCurrentAction[MAX_MULTI]; + thread_id fID[MAX_MULTI]; + sem_id fLock; + BObjectList fList; + bool fLocked; + int fCount; + BString fName; +}; +#endif diff --git a/sources-experimental/R5Locale.cpp b/sources-experimental/R5Locale.cpp new file mode 100644 index 0000000..67a6f77 --- /dev/null +++ b/sources-experimental/R5Locale.cpp @@ -0,0 +1,26 @@ +#include "R5Locale.h" +#include "BePodder_R5.h" +#include "Message.h" + +#define ADD(KEY,VALUE) language->AddString(KEY,VALUE); + +BMessage *language=NULL; + +void +init(){ + language=new BMessage(); + for(int i=0;iFindString(key,&data)==B_OK){ + return data; + } + + return key; +} \ No newline at end of file diff --git a/sources-experimental/RVActionBP.h b/sources-experimental/RVActionBP.h new file mode 100644 index 0000000..f82b6fe --- /dev/null +++ b/sources-experimental/RVActionBP.h @@ -0,0 +1,29 @@ +#ifndef _RVActionBP_h_ +#define _RVActionBP_h_ + +#include "RVAction.h" +#include "IActionManagerBP.h" + +extern IActionManagerBP action_manager; + +#include + +class RVActionBP : public RVAction +{ + public: + + virtual ~RVActionBP(){}; + + virtual status_t Perform(BString param){ + int pos = atoi(param.String()); + if(pos>0) + action_manager.FireAction(pos); + return B_OK; + } + virtual BString GetDescription(){ + return "RVActionBP"; + } + +}; + +#endif diff --git a/sources-experimental/RVActionBPOpenURL.h b/sources-experimental/RVActionBPOpenURL.h new file mode 100644 index 0000000..9a9b7d2 --- /dev/null +++ b/sources-experimental/RVActionBPOpenURL.h @@ -0,0 +1,28 @@ +#ifndef _RVActionBPOpenURL_h_ +#define _RVActionBPOpenURL_h_ + +#include "RVAction.h" +#include "MainController.h" +#include + +class RVActionBPOpenURL : public RVAction +{ + public: + + RVActionBPOpenURL(MainController* controller){ fController=controller;}; + virtual ~RVActionBPOpenURL(){ }; + + virtual status_t Perform(BString param){ + fController->OpenURL(param); + return B_OK; + } + virtual BString GetDescription(){ + return "RVActionBPOpenURL"; + } + + private: + MainController* fController; + +}; + +#endif diff --git a/sources-experimental/Retriver.h b/sources-experimental/Retriver.h new file mode 100644 index 0000000..1476963 --- /dev/null +++ b/sources-experimental/Retriver.h @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#ifndef _Retriver_H_ +#define _Retriver_H_ + +#include "ItemProperty.h" +#include + +class Retriver { + + public: + + virtual ssize_t GetData(ItemProperty key,const void** data) = 0; + virtual int32 CountData()= 0; + virtual BString GetDataString(ItemProperty key)= 0; + virtual int32 GetDataInt32(ItemProperty key)= 0; + +}; + +#endif + +//.. diff --git a/sources-experimental/RssChannel.cpp b/sources-experimental/RssChannel.cpp new file mode 100644 index 0000000..b0d3fa7 --- /dev/null +++ b/sources-experimental/RssChannel.cpp @@ -0,0 +1,12 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#include "RssChannel.h" +RssChannel::RssChannel(){ + SetKeyInt32(CHANNEL_NEWITEMS,0); +} + +//-- diff --git a/sources-experimental/RssChannel.h b/sources-experimental/RssChannel.h new file mode 100644 index 0000000..3de0b15 --- /dev/null +++ b/sources-experimental/RssChannel.h @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#ifndef _RssChannel_H_ +#define _RssChannel_H_ + +#include "Notifier.h" +#include "FileStatus.h" + +class RssChannel : public Notifier { + + public: + RssChannel(); + void SetTitle(const char* data) { SetKeyString(CHANNEL_TITLE,data); }; + void SetURL(const char* data) { SetKeyString(CHANNEL_URL ,data); }; + void SetFileStatus(FileStatus fs){ SetKeyInt32(CHANNEL_RSS_FILE_STATUS,(int32)fs); } + +}; +#endif diff --git a/sources-experimental/RssItem.cpp b/sources-experimental/RssItem.cpp new file mode 100644 index 0000000..37afec6 --- /dev/null +++ b/sources-experimental/RssItem.cpp @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#include "RssItem.h" +#include + +#include "FileStatus.h" +#include +//#include "curl/curl.h" + +//#include "MemoryArchive.h" + +RssItem::RssItem(){ + SetKeyInt32(ITEM_ENCLOSURE_FILE_STATUS,0); +} +void +RssItem::SetKey(ItemProperty key,void* data,ssize_t size){ + + switch(key){ + case ITEM_ENCLOSURE_FILE_STATUS: + fStatus = *((FileStatus*)data); + break; + case ITEM_GUID: + fGuid.SetTo((const char*)data,size); + break; + case ITEM_ENCLOSURE_URL: + fEnclosureLink.SetTo((const char*)data,size); + break; + case ITEM_ENCLOSURE_LOCALPATH: + fEnclosurePath.SetTo((const char*)data,size); + break; + case ITEM_ENCLOSURE_TYPE: + fType.SetTo((const char*)data, size); + break; + default:break; + } + Notifier::SetKey(key,data,size); +} +//.-. diff --git a/sources-experimental/RssItem.h b/sources-experimental/RssItem.h new file mode 100644 index 0000000..cebabd8 --- /dev/null +++ b/sources-experimental/RssItem.h @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#ifndef _RssItem_H_ +#define _RssItem_H_ + +#include "Notifier.h" +#include "FileStatus.h" + + +class RssItem : public Notifier { + public: + RssItem(); + + //from Notifier + void SetKey(ItemProperty key,void* data,ssize_t size); + + //mine: + void SetTitle(const char* data) { SetKeyString(ITEM_TITLE,data); }; + void SetAuthor(const char* data) { SetKeyString(ITEM_AUTHOR,data); }; + + void SetGuid(const char* data) { SetKeyString(ITEM_GUID,data); fGuid.SetTo(data); } + void SetFileStatus(FileStatus fs){ SetKeyInt32(ITEM_ENCLOSURE_FILE_STATUS,(int32)fs); fStatus = fs; } + void SetFilePercentage(int32 per){ SetKeyInt32(ITEM_ENCLOSURE_FILE_PERCENTAGE,(int32)per); } + void SetDownloadSpeed(float speed){ SetKey(ITEM_ENCLOSURE_DOWNLOAD_SPEED,(void*)&speed,sizeof(float)); } + + //which are the essential? + //the idea: crate a 'minimal' Store! and use GetData..(); + + BString Guid() { return fGuid; } + BString EnclosureLink() { return fEnclosureLink; } + BString EnclosureLocalPath() { return fEnclosurePath; } + BString FileType() { return fType; } + + FileStatus GetFileStatus(){ return fStatus; }; + + private: + BString fGuid; + BString fEnclosureLink; + BString fEnclosurePath; + BString fType; + FileStatus fStatus; +}; +#endif diff --git a/sources-experimental/SectionSelector.cpp b/sources-experimental/SectionSelector.cpp new file mode 100644 index 0000000..7bf86fc --- /dev/null +++ b/sources-experimental/SectionSelector.cpp @@ -0,0 +1,243 @@ +#include "SectionSelector.h" +#include "Utils.h" + +#define CURVE 2 + +#define NUM_PART 4 +#define PART_SIZE 100. + +#define BORDER 0 +#define TABSIZE 20 +#define W 41 +#define TAB_SPACE 3 +#define TOP_START 0 +#define BOTTOM_SPACE 3 + +#define kTEXT_MARGIN 8 + +const rgb_color back = ui_color(B_PANEL_BACKGROUND_COLOR); //{ 255,255,255,255}; +const rgb_color line = { 255, 255, 255, 255}; +const rgb_color sel = { 242,227, 0,255}; + +class SmartSelector : public BView { + + public: + SmartSelector(BRect rect,BBitmap* icon,SectionSelector* boss,int id):BView(rect,"",B_FOLLOW_NONE,B_WILL_DRAW){ + fPressed = false; + fIcon=icon; + fBoss = boss; + fId = id; + SetViewColor(B_TRANSPARENT_COLOR); + } + + void Draw(BRect r){ + + if(fPressed) + SetHighColor(sel); + else + SetHighColor(line); + + BRect rect(Bounds()); + //rect.InsetBy(1,1); + FillRect(rect); + + if(fIcon){ + SetDrawingMode(B_OP_ALPHA); + DrawBitmap(fIcon); + } + } + + void SetPressed(bool value){ + fPressed = value; + Invalidate(); + } + + void MouseUp(BPoint p){ + + if(!fPressed){ + fBoss->Select(fId); + fBoss->Invoke(); + } + + } + + private: + bool fPressed; + BBitmap* fIcon; + SectionSelector* fBoss; + int fId; + +}; + + + +SectionSelector::SectionSelector(BRect r,BMessage* msg):BControl(r,"","",msg,B_FOLLOW_ALL_SIDES,B_WILL_DRAW){ + + fSelected = -1; + width = r.right; + //sel = tint_color(back,B_DARKEN_4_TINT); + //SetViewColor(B_TRANSPARENT_COLOR); + count=0; +} + + +void +SectionSelector::AddSection(const char* iconName,BView* view,const char* tooltip){ + if(count < MAX_ITEM){ + Section *sec=new Section; + + sec->view = view; + + float prevPos = count * (W+TAB_SPACE); + + float width = W; + + BRect rect = BRect(prevPos, + TOP_START, + prevPos + W - 1, + TOP_START + TABSIZE - 1); + + + sec->tab = new SmartSelector(rect,LoadIcon(iconName),this,count); + #ifdef ZETA + sec->tab->SetToolTipText(tooltip); + #endif + + AddChild(sec->tab); + + + fStack[count++]=sec; + + BRect b(Bounds()); + + view->MoveTo(BORDER,TABSIZE + BORDER + BOTTOM_SPACE); + + AddChild(view); + view->ResizeTo(b.right - 2*BORDER,b.bottom- 2*BORDER - TABSIZE - BOTTOM_SPACE); + + view->Hide(); + } +} + + +void +SectionSelector::Draw(BRect r){ + + //if( ! r.Intersects( BRect(0,0,Bounds().right,TABSIZE) ) return; + + //BControl::Draw(r); + //for(int i=0;i= MAX_ITEM) return; + + BRect r(fStack[i]->rect); + //SetHighColor(back); + //FillRect(r); + + + if(i==fSelected){ + SetHighColor(sel); + } + else + { + SetHighColor(line); + } + + BRect newR(0,0,W - 2 ,TABSIZE - 2); + newR.OffsetTo(r.left + GAP_TAB + TAB_SPACE + 1,r.top + TOP_START + 1); + FillRect(newR); + + + + + //SetHighColor(line); + //DrawString(fStack[i]->name.String(),this,r); + if(fStack[i]->icon){ + SetDrawingMode(B_OP_ALPHA); + DrawBitmap(fStack[i]->icon,BPoint(r.left + GAP_TAB + TAB_SPACE ,r.top + TOP_START)); + } +} + +*/ + +void +SectionSelector::Select(int index){ + + if(index == fSelected) return; + + int oldsel=fSelected; + + fSelected =index; + + if(oldsel>=0) { + fStack[oldsel]->view->Hide(); + ((SmartSelector*)fStack[oldsel]->tab)->SetPressed(false); + } + + fStack[index]->view->Show(); + ((SmartSelector*)fStack[index]->tab)->SetPressed(true); + + +} +/*void +SectionSelector::MouseUp(BPoint p){ + + + for(int i=0;irect.Contains(p)) + { + if(i != fSelected){ + Select(i); + Invoke(); + } + return; + } + + } +} + +*/ + + +void +SectionSelector::DrawString(const char* string, BView* parent, BRect rect) +{ + float width = rect.Width() - (2 * kTEXT_MARGIN); + float y; + BFont font; + font_height finfo; + + GetFont(&font); + font.GetHeight(&finfo); + + y = rect.top + ((rect.Height() - (finfo.ascent + finfo.descent + finfo.leading)) / 2) + + (finfo.ascent + finfo.descent) - 2; + +/* switch (Alignment()) + { + case B_ALIGN_LEFT: + parent->MovePenTo(rect.left + kTEXT_MARGIN, y); + break; + + case B_ALIGN_CENTER:*/ + parent->MovePenTo(rect.left + kTEXT_MARGIN + ((width - font.StringWidth(string)) / 2), y); + /* break; + + case B_ALIGN_RIGHT: + parent->MovePenTo(rect.right - kTEXT_MARGIN - font.StringWidth(string), y); + break; + }*/ + parent->DrawString(string); +} + +//.. diff --git a/sources-experimental/SectionSelector.h b/sources-experimental/SectionSelector.h new file mode 100644 index 0000000..d1e0c97 --- /dev/null +++ b/sources-experimental/SectionSelector.h @@ -0,0 +1,47 @@ +#include + +#define MAX_ITEM 5 + +class SectionSelector : public BControl +{ + public: + SectionSelector(BRect,BMessage* msg); + + void Draw(BRect); + // void MouseUp(BPoint); + + void AddSection(const char* iconName,BView* tabView,const char* tooltip); + + void Select(int index); + + + int Selected(){ return fSelected; }; + + protected: + + const char* NameOf(int index); + + private: + + struct Section { + + //BRect rect; + //BBitmap* icon; + BView* view; + BView* tab; + }; + + void DrawString(const char* string, BView* parent, BRect rect); + void DrawPart(int index); + + // BRect RectFor(int i); + + int fSelected; + float width; + int count; + + Section* fStack[MAX_ITEM]; + +}; + +//-- diff --git a/sources-experimental/SettingsWindow.cpp b/sources-experimental/SettingsWindow.cpp new file mode 100644 index 0000000..164ed97 --- /dev/null +++ b/sources-experimental/SettingsWindow.cpp @@ -0,0 +1,176 @@ +#include "SettingsWindow.h" +#include "SettingsTextView.h" + +#include +#include +#include "BPLocale.h" +#include +#include +#include +#include +#include "PBox.h" +#include + + + +SettingsWindow::SettingsWindow(BMessage* setting,BHandler* handler,int32 applyMsg) : + BWindow(BRect(250,100,750,350),_T("Preferences"), B_FLOATING_WINDOW_LOOK,B_MODAL_APP_WINDOW_FEEL,B_NOT_RESIZABLE| B_NOT_ZOOMABLE|B_ASYNCHRONOUS_CONTROLS) +{ + fApplyWhatMsg = applyMsg; + fSetting = setting; + fHandler = handler; + fSelected = NULL; + + rgb_color bgcolor = ui_color(B_PANEL_BACKGROUND_COLOR); + + BBox *bgbox=new BBox(Bounds(),"back",B_FOLLOW_ALL,B_WILL_DRAW,B_PLAIN_BORDER); + AddChild(bgbox); + + BRect rect, arect, brect ; + + rect = Bounds(); + rect.InsetBy(5, 5); + rect.bottom -= 50; + + bgView=new BView(BRect(rect),NULL, B_FOLLOW_ALL, B_WILL_DRAW); + bgView->SetViewColor(bgcolor); //255,0,0); + bgbox->AddChild(bgView); + + arect = rect; + arect.right = arect.left + 100; + arect.bottom = rect.bottom - 10; + slist=new BListView(arect,"preferences_list",B_SINGLE_SELECTION_LIST,B_FOLLOW_ALL,B_WILL_DRAW); + + slist->SetSelectionMessage(new BMessage('list')); + BScrollView *scroll=new BScrollView("scrolling", slist, B_FOLLOW_ALL, 0, false, false); + bgView->AddChild(scroll); + slist->Select(0); + slist->MakeFocus(true); + + brect=Bounds(); + brect.InsetBy(5, 5); + brect.top = rect.bottom + 10; + + BView *bottomView=new BView(brect,NULL, B_FOLLOW_BOTTOM, B_WILL_DRAW); + bottomView->SetViewColor(bgcolor); + bgbox->AddChild(bottomView); + + // eliminare bottone close ---------------- + + BFont font(be_plain_font); + arect = bottomView->Bounds(); + arect.InsetBy(10, 10); + arect.top = arect.bottom - 20; + arect.left = arect.right - font.StringWidth(_T("Cancel")) - 30; + BButton *apply = new BButton(arect, "", _T("Save"), new BMessage('apla')); + bottomView->AddChild(apply); + + + + arect.right = arect.left - 20; + arect.top = arect.bottom - 20; + arect.left = arect.right - font.StringWidth(_T("Save")) - 30; + + BButton *close = new BButton(arect, "", _T("Cancel"), new BMessage(B_QUIT_REQUESTED)); + bottomView->AddChild(close); + + + dxrect = bgView->Bounds(); + + trect = dxrect; + trect.InsetBy(0,5); + trect.left += 5; + trect.right -= 123; + trect.top += 1; + trect.bottom -= 135; + + dxrect.top += 2; + dxrect.bottom -= 2; + dxrect.left += 115; + dxrect.right -= 2; + + + + + MoveTo(BAlert::AlertPosition(Bounds().Width(),Bounds().Height())); +} + + + + + +void +SettingsWindow::Select(int i){ + + if(fSelected) + fSelected->Hide(); + + + BBox* newb=fBoxList.ItemAt(i); + + if(newb){ + newb->Show(); + fSelected=newb; + } + else + fSelected = NULL; + + if(slist->CurrentSelection()!=i) + slist->Select(i); +} + +void +SettingsWindow::AddBox(const char* name, BBox* box){ + box->ResizeTo(dxrect.Width(),dxrect.Height()); + box->MoveTo(dxrect.left,dxrect.top); + slist->AddItem(new BStringItem(name)); + bgView->AddChild(box); + box->Hide(); + fBoxList.AddItem(box); +} + + +bool +SettingsWindow::QuitRequested(){ + return true; +} + + +void +SettingsWindow::SaveSettings(){ + for(int i=0;i(fBoxList.ItemAt(i)); + + if(pb) + { + BMessage data; + pb->GetData(&data); + //data.PrintToStream(); + GetSetting()->RemoveData(pb->GetSettingsName()); + GetSetting()->AddMessage(pb->GetSettingsName(),&data); + } + } +} + +void +SettingsWindow::MessageReceived(BMessage *mess){ + switch(mess->what) { + + case 'list': + Select(mess->FindInt32("index")); + break; + + case 'apla': + SaveSettings(); + if(fHandler) + BMessenger(fHandler).SendMessage(fApplyWhatMsg); + Quit(); + break; + default: + BWindow::MessageReceived(mess); + break; + } +} + + + diff --git a/sources-experimental/SettingsWindow.h b/sources-experimental/SettingsWindow.h new file mode 100644 index 0000000..a7357f5 --- /dev/null +++ b/sources-experimental/SettingsWindow.h @@ -0,0 +1,53 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define APPLY_SETTINGS 'apse' + + +class SettingsWindow: public BWindow +{ + + + + + public: + SettingsWindow(BMessage*,BHandler*,int32); + + virtual void MessageReceived(BMessage*); + virtual bool QuitRequested(); + + BMessage* GetSetting(){ return fSetting; } + + protected: + + + void Select(int i); + void AddBox(const char*,BBox*); + + private: + + void SaveSettings(); + + BListView *slist; + BView *bgView; + BView *dxview; + + BObjectList fBoxList; + BBox* fSelected; + BRect dxrect,trect; + + BMessage* fSetting; + BHandler* fHandler; + int32 fApplyWhatMsg; + }; diff --git a/sources-experimental/SplitPane.cpp b/sources-experimental/SplitPane.cpp new file mode 100644 index 0000000..a7bb37d --- /dev/null +++ b/sources-experimental/SplitPane.cpp @@ -0,0 +1,747 @@ +/******************************************************* +* SplitPane© +* +* SplitPane is a usefull UI component. It alows the +* use to ajust two view Horizontaly or Vertacly so +* that they are a desired size. This type of Pane +* shows up most comonly in Mail/News Readers. +* +* @author YNOP (ynop@acm.org) +* @version beta +* @date Dec. 10 1999 +* +* (note: modified by jaf@lcsaudio.com 6/20/00) +* +*******************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "SplitPane.h" +#include "Cursors.h" +#include + +BCursor* h_arrow=NULL; +BCursor* v_arrow=NULL; + +#include "ImageButton.h" + +#define MIRROR 'mirr' +#define ROTATE 'rott' + +#include "Utils.h" + +//const pattern test = {(255,0,0,255,0,0,255,0)}; +/******************************************************* +* Setup the main view. Add in all the niffty components +* we have made and get things rolling +*******************************************************/ +SplitPane::SplitPane(BRect frame, BView *one, BView *two,uint32 Mode):BView(frame, "", Mode,B_WILL_DRAW|B_FRAME_EVENTS){ + BRect b = Bounds(); + + PaneOne = one; + PaneTwo = two; + + prevSize.Set(0.0f,0.0f); // used for resizing when resizeOne(X|Y) is true --jaf + resizeOneX = resizeOneY = false; + align = B_VERTICAL; // Most people use it this way + pos.Set(b.Width()/2.0f, b.Height()/2.0f); // Center is a good start place + thickness.Set(10.0f,10.0f); + jump.Set(1.0f,1.0f); // 1 makes a smother slide + VOneDetachable = false; + VTwoDetachable = false; + pad.Set(3.0f,3.0f); + MinSizeOne.Set(0,0); + MinSizeTwo.Set(0,0); + poslocked = false; // free movement + alignlocked = false; // free alignment + Draggin = false; + attached = false; + swapPanes = false; + + WinOne = NULL; + WinTwo = NULL; + + + AddChild(one); + AddChild(two); + + rotateH = LoadIcon("rotateH"); + mirrorH = LoadIcon("mirrorH"); + rotateV = LoadIcon("rotateV"); + mirrorV = LoadIcon("mirrorV"); + + AddChild(rotate = new ImageButton(BRect(0,0,8,8), "",new BMessage(ROTATE), NULL, NULL,NULL)); + AddChild(mirror = new ImageButton(BRect(5,5,14,14), "",new BMessage(MIRROR), NULL, NULL,NULL)); + + rotate->DrawbackgroundColor(false); + mirror->DrawbackgroundColor(false); + + if(!h_arrow) + h_arrow = new BCursor(c_h_resize_cursor); + if(!v_arrow) + v_arrow = new BCursor(c_v_resize_cursor); +} + +/******************************************************* +* When ready grap the parents color and refreash. +*******************************************************/ +void SplitPane::AttachedToWindow(){ + BView::AttachedToWindow(); + rotate->SetTarget(this); + mirror->SetTarget(this); + attached = true; + Update(); +} + +/******************************************************* +* If we are being resized. Fix the stuff we need to fix +*******************************************************/ +void SplitPane::FrameResized(float w, float h){ +// if bar is on the left side follow left +// else if it is on the right side follow the right +// Need to implements smart follow still + BView::FrameResized(w,h); + Update(); + Invalidate(); +} + +/******************************************************* +* The main draw stuff here. basicly just the slider +*******************************************************/ +void SplitPane::Draw(BRect /*f*/){ + + SetHighColor(160,160,160); + + if(align == B_VERTICAL){ + SetHighColor(255,255,255); + FillRect(BRect(pos.x+thickness.x/2,Bounds().top+pad.x+1,pos.x+thickness.x/2,Bounds().bottom-pad.x-1)) ;// 145 + + SetHighColor(145,145,145); + FillRect(BRect(pos.x+thickness.x/2-1,Bounds().top+pad.x+1,pos.x+thickness.x/2-1,Bounds().bottom-pad.x-1)); // 96 + }else{ + SetHighColor(255,255,255);// SetHighColor(145,145,145); + FillRect(BRect(Bounds().left+pad.y+1,pos.y+thickness.y/2,Bounds().right-pad.y-1,pos.y+thickness.y/2)) ;// 145 + + SetHighColor(145,145,145); //SetHighColor(96,96,96); + FillRect(BRect(Bounds().left+pad.y+1,pos.y+thickness.y/2-1,Bounds().right-pad.y-1,pos.y+thickness.y/2-1)); // 96 + } +} + +/******************************************************* +* Keeps Modes for both panles uptodate and acctually +* is the func that sets the location of the slider +*******************************************************/ +void SplitPane::Update(){ + Window()->Lock(); + + BView * p1 = swapPanes ? PaneTwo : PaneOne; + BView * p2 = swapPanes ? PaneOne : PaneTwo; + + const BPoint & ms1 = swapPanes ? MinSizeTwo : MinSizeOne; + const BPoint & ms2 = swapPanes ? MinSizeOne : MinSizeTwo; + + if(align == B_VERTICAL){ + if ((resizeOneX)&&(prevSize.x > 0)) pos.x += Bounds().Width()-prevSize.x; + p1->SetResizingMode((resizeOneX ? B_FOLLOW_LEFT_RIGHT : B_FOLLOW_LEFT)|B_FOLLOW_TOP_BOTTOM); + p2->SetResizingMode((resizeOneX ? B_FOLLOW_RIGHT : B_FOLLOW_LEFT_RIGHT)|B_FOLLOW_TOP_BOTTOM); + if(pos.x > (Bounds().Width()-thickness.x-ms2.x)){ + if(!poslocked){ + pos.x = Bounds().Width()-thickness.x-ms2.x; + } + } + if(pos.x < ms1.x){ + if(!poslocked){ + pos.x = ms1.x; + } + } + }else{ + if ((resizeOneY)&&(prevSize.y > 0)) pos.y += Bounds().Height()-prevSize.y; + p1->SetResizingMode((resizeOneY ? B_FOLLOW_TOP_BOTTOM : B_FOLLOW_TOP) | B_FOLLOW_LEFT_RIGHT); + p2->SetResizingMode((resizeOneY ? B_FOLLOW_BOTTOM : B_FOLLOW_TOP_BOTTOM) | B_FOLLOW_LEFT_RIGHT); + if(pos.y > (Bounds().Height()-thickness.y-ms2.y)){ + if(!poslocked){ + pos.y = Bounds().Height()-thickness.y-ms2.y; + } + } + if(pos.y < ms1.y){ + if(!poslocked){ + pos.y = ms1.y; + } + } + } + + // store our new size so we can do a diff next time we're called + prevSize = BPoint(Bounds().Width(), Bounds().Height()); + + if(p1){ + if(!WinOne){ + if(align == B_VERTICAL){ + p1->MoveTo(pad.x,Bounds().top+pad.x); + p1->ResizeTo(pos.x-pad.x, Bounds().Height()-pad.x-pad.x); // widht x height + }else{ + p1->MoveTo(pad.y,Bounds().top+pad.y); + p1->ResizeTo(Bounds().Width()-pad.y-pad.y, pos.y-pad.y-pad.y); // widht x height + } + } + } + if(p2){ + if(!WinTwo){ + if(align == B_VERTICAL){ + p2->MoveTo(pos.x+thickness.x,Bounds().top+pad.x); + p2->ResizeTo(Bounds().Width()-(pos.x+thickness.x)-pad.x, Bounds().Height()-pad.x-pad.x); + }else{ + p2->MoveTo(Bounds().left+pad.y,pos.y+thickness.y); + p2->ResizeTo(Bounds().Width()-pad.y-pad.y, Bounds().Height()-pos.y-pad.y-thickness.y); + } + } + } + + //vertical-case! + if(align == B_VERTICAL){ + rotate->MoveTo(pos.x + 1 , Bounds().top + pad.x + 1); + mirror->MoveTo(pos.x + 1 , Bounds().top + pad.x + 16); + rotate->SetBitmap(rotateV); + mirror->SetBitmap(mirrorV); + }else{ + rotate->MoveTo(Bounds().right-pad.y - 10, pos.y + 1); + mirror->MoveTo(Bounds().right-pad.y - 25, pos.y + 1); + rotate->SetBitmap(rotateH); + mirror->SetBitmap(mirrorH); + } + + Window()->Unlock(); +} + +/******************************************************* +* Hook for when we click. This takes care of all the +* little stuff - Like where is the mouse and what is +* going on. +*******************************************************/ +void SplitPane::MouseDown(BPoint where){ + Window()->Lock(); + BMessage *currentMsg = Window()->CurrentMessage(); + if (currentMsg->what == B_MOUSE_DOWN) { + uint32 buttons = 0; + currentMsg->FindInt32("buttons", (int32 *)&buttons); + uint32 modifiers = 0; + currentMsg->FindInt32("modifiers", (int32 *)&modifiers); + uint32 clicks = 0; + currentMsg->FindInt32("clicks",(int32*)&clicks); + + if (buttons & B_TERTIARY_MOUSE_BUTTON) { + swapPanes = !swapPanes; + Update(); + Invalidate(); + } + else if (buttons & B_SECONDARY_MOUSE_BUTTON){ + if(!alignlocked){ + switch(align){ + case B_VERTICAL: + align = B_HORIZONTAL; + break; + case B_HORIZONTAL: + align = B_VERTICAL; + break; + } + Update(); + Invalidate(); + } + } + else if ((buttons & B_PRIMARY_MOUSE_BUTTON) && (!Draggin) && (IsInDraggerBounds(where))) { + if(!poslocked){ + Draggin= true; // this is so we can drag + here = where; + } + SetMouseEventMask(B_POINTER_EVENTS,B_LOCK_WINDOW_FOCUS); + } + } + Window()->Unlock(); +} + +bool SplitPane::IsInDraggerBounds(BPoint pt) const +{ + BView * p1 = swapPanes ? PaneTwo : PaneOne; + BView * p2 = swapPanes ? PaneOne : PaneTwo; + + // this block should go in FrameResized .. think about it + return (align == B_VERTICAL) + ? ((pt.x > p1->Frame().right)&&(pt.x < p2->Frame().left)) + : ((pt.y > p1->Frame().bottom)&&(pt.y < p2->Frame().top)); +} + +/******************************************************* +* If we unclick then stop dragging or whatever it is +* we are doing +*******************************************************/ +void SplitPane::MouseUp(BPoint /*where*/){ + Draggin = false; // stop following mouse +} + +/******************************************************* +* If the mouse moves while we dragg. Then follow it +* Also Invalidate so we update the views +*******************************************************/ +void SplitPane::MouseMoved(BPoint where,uint32 transition,const BMessage */*m*/){ + const BPoint & ms1 = swapPanes ? MinSizeTwo : MinSizeOne; + const BPoint & ms2 = swapPanes ? MinSizeOne : MinSizeTwo; + + + + if(Draggin){ + + float minVal; + switch(align){ + case B_HORIZONTAL: + SetViewCursor (h_arrow); + pos.y = (where.y)-(thickness.y/2); + minVal = ms1.y; + break; + case B_VERTICAL: + SetViewCursor (v_arrow); + pos.x = (where.x)-(thickness.x/2); + minVal = ms1.x; + break; + } + + /* + // This code figures out which jump we are closest + // to and if needed we "snap" to that. + int c = Bounds().IntegerWidth() / pos; + Jump * c ... hmmm this is not right at all + */ + + switch(align){ + case B_HORIZONTAL: + if (pos.y < ms1.y) pos.y = ms1.y; + break; + case B_VERTICAL: + if (pos.x < ms1.x) pos.x = ms1.x; + break; + } + + if(align == B_VERTICAL){ + if(pos.x > (Bounds().Width() - thickness.x - ms2.x)){ + pos.x = (Bounds().Width() - thickness.x - ms2.x + 1); + } + }else{ + if(pos.y > (Bounds().Height() - thickness.y - ms2.y)){ + pos.y = (Bounds().Height() - thickness.y - ms2.y + 1); + } + } + + Update(); + + Invalidate(); + } + else{ + switch ( transition ) + { + case B_ENTERED_VIEW: + case B_INSIDE_VIEW: + switch(align){ + case B_HORIZONTAL: + SetViewCursor (h_arrow); + break; + case B_VERTICAL: + SetViewCursor (v_arrow); + break; + } + + break; + case B_EXITED_VIEW: + SetViewCursor (B_CURSOR_SYSTEM_DEFAULT); + break; + } + +} +} + +/******************************************************* +* If you already have a view One, but want to change +* if for some odd reason. This should work. +*******************************************************/ +void SplitPane::AddChildOne(BView *v){ + RemoveChild(PaneOne); + PaneOne = v; + AddChild(PaneOne); +} + +/******************************************************* +* If you already have a view Two, and want to put +* another view there, this is what to use. +*******************************************************/ +void SplitPane::AddChildTwo(BView *v){ + RemoveChild(PaneTwo); + PaneTwo = v; + AddChild(PaneTwo); +} + +/******************************************************* +* Sets is we are horizontal or Vertical. We use the +* standard B_HORIZONTAL and B_VERTICAL flags for this +*******************************************************/ +void SplitPane::SetAlignment(uint a){ + align = a; + if(attached){ + Update(); + } + Invalidate(); +} + +/******************************************************* +* Returns wheather the slider is horizontal or vertical +*******************************************************/ +uint SplitPane::GetAlignment() const { + return align; +} + +/******************************************************* +* Sets whether to swap the positions of our panes. +*******************************************************/ +void SplitPane::SetSwapped(bool sp){ + swapPanes = sp; + if(attached){ + Update(); + } + Invalidate(); +} + +/******************************************************* +* Returns wheather the child panes are swapped. +*******************************************************/ +bool SplitPane::GetSwapped() const { + return swapPanes; +} + +/******************************************************* +* Sets the location of the bar. (we do no bounds +* checking for you so if its off the window thats +* your problem) +*******************************************************/ +void SplitPane::SetBarPosition(BPoint p){ + pos = p; + if(attached){ + Update(); + } + Invalidate(); +} + +/******************************************************* +* Returns about where the bar is ... +*******************************************************/ +BPoint SplitPane::GetBarPosition() const { + return pos; +} + +/******************************************************* +* Sets how thick the bar should be. +*******************************************************/ +void SplitPane::SetBarThickness(BPoint t){ + thickness = t; + if(attached){ + Update(); + } + Invalidate(); +} + +/******************************************************* +* Retuns to us the thickness of the slider bar +*******************************************************/ +BPoint SplitPane::GetBarThickness() const { + return thickness; +} + +/******************************************************* +* Sets the amount of jump the bar has when it is +* moved. This can also be though of as snap. The bar +* will start at 0 and jump(snap) to everry J pixels. +*******************************************************/ +void SplitPane::SetJump(BPoint j){ + jump = j; + if(attached){ + Update(); + } +} + +/******************************************************* +* Lets you know what the jump is .. see SetJump +*******************************************************/ +BPoint SplitPane::GetJump() const { + return jump; +} + +/******************************************************* +* Do we have a View One or is it NULL +*******************************************************/ +bool SplitPane::HasViewOne() const { + if(PaneOne) return true; + return false; +} + +/******************************************************* +* Do we have a View Two .. or is it NULL too +*******************************************************/ +bool SplitPane::HasViewTwo() const { + if(PaneTwo) return true; + return false; +} + +/******************************************************* +* Sets wheather View one is detachable from the +* slider view and from the app. This will creat a +* window that is detached (floating) from the app. +*******************************************************/ +void SplitPane::SetViewOneDetachable(bool b){ + VOneDetachable = b; +} + +/******************************************************* +* Sets view tow detachable or not +*******************************************************/ +void SplitPane::SetViewTwoDetachable(bool b){ + VTwoDetachable = b; +} + +/******************************************************* +* Returns whether the view is detachable +*******************************************************/ +bool SplitPane::IsViewOneDetachable() const { + return VOneDetachable; +} + +/******************************************************* +* Returns if this view is detachable +*******************************************************/ +bool SplitPane::IsViewTwoDetachable() const { + return VTwoDetachable; +} + +/******************************************************* +* Tells the view if the user is alowed to open the +* configuration window for the slider. +*******************************************************/ +void SplitPane::SetEditable(bool /*b*/){ + //ADD CODE HERE YNOP +} + +/******************************************************* +* Tells use if the split pane is user editable +*******************************************************/ +bool SplitPane::IsEditable() const { + return true; //ADD SOME MORE CODE HERE +} + +/******************************************************* +* Sets the inset that the view has. +*******************************************************/ +void SplitPane::SetViewInsetBy(BPoint p){ + pad = p; + if(attached){ + Update(); + } + Invalidate(); +} + +/******************************************************* +* Returns to use the padding around the views +*******************************************************/ +BPoint SplitPane::GetViewInsetBy() const { + return pad; +} + +/******************************************************* +* This sets the minimum size that View one can be. +* if the user trys to go past this .. we just stop +* By default the minimum size is set to 0 (zero) so +* the user can put the slider anywhere. +*******************************************************/ +void SplitPane::SetMinSizeOne(const BPoint & p){ + MinSizeOne = p; +} + +/******************************************************* +* Gives us the minimum size that one can be. +*******************************************************/ +BPoint SplitPane::GetMinSizeOne() const { + return MinSizeOne; +} + +/******************************************************* +* This sets the Minimum size that the second view +* can be. +*******************************************************/ +void SplitPane::SetMinSizeTwo(const BPoint & p){ + MinSizeTwo = p; +} + +/******************************************************* +* Lets us know what that minimum size is. +*******************************************************/ +BPoint SplitPane::GetMinSizeTwo() const { + return MinSizeTwo; +} + +/******************************************************* +* Locks the bar from being moved by the User. The +* system can still move the bar (via SetBarPosition) +*******************************************************/ +void SplitPane::SetBarLocked(bool b){ + poslocked = b; +} + +/******************************************************* +* Returns to use if the bar is in a locked state or +* not. +*******************************************************/ +bool SplitPane::IsBarLocked() const { + return poslocked; +} + +/******************************************************* +* Locks the alignment of the bar. The user can no +* longer toggle between Horizontal and Vertical +* Slider bar. Again you can still progomaticly set +* the position how ever you want. +*******************************************************/ +void SplitPane::SetBarAlignmentLocked(bool b){ + alignlocked = b; +} + +/******************************************************* +* Lets us know about the lock state of the bar +*******************************************************/ +bool SplitPane::IsBarAlignmentLocked() const { + return alignlocked; +} + +/******************************************************* +* Locks the alignment of the bar. The user can no +* longer toggle between Horizontal and Vertical +* Slider bar. Again you can still progomaticly set +* the position how ever you want. +*******************************************************/ +void SplitPane::SetResizeViewOne(bool x, bool y){ + resizeOneX = x; + resizeOneY = y; + if(attached){ + Update(); + } + Invalidate(); +} + +/******************************************************* +* Lets us know about the lock state of the bar +*******************************************************/ +void SplitPane::GetResizeViewOne(bool & rx, bool & ry) const { + rx = resizeOneX; + ry = resizeOneY; +} + + +/******************************************************* +* Gets the Total state of the bar, alignment, size, +* position and many other things that are required +* to fully capture the state of the SplitPane. +* We pack all of this into a cute little BMessage +* so that it is esally expandable and can be saved +* off easyaly too. The SplitPane System does not +* however save the state for you. Your program must +* grab the state and save it in its config file. +*******************************************************/ +void SplitPane::GetState(BMessage & state) const { + state.AddBool("onedetachable",VOneDetachable); + state.AddBool("twodetachable",VTwoDetachable); + state.AddInt32("align",align); + state.AddPoint("pos",pos); + state.AddPoint("thick",thickness); + state.AddPoint("jump",jump); + state.AddPoint("pad",pad); + state.AddPoint("minsizeone",MinSizeOne); + state.AddPoint("minsizetwo",MinSizeTwo); + state.AddBool("poslock",poslocked); + state.AddBool("alignlock",alignlocked); + state.AddBool("resizeonex", resizeOneX); + state.AddBool("resizeoney", resizeOneY); + state.AddBool("swap", swapPanes); +} + +/******************************************************* +* Sets the state of the SplitPane from a BMessage +* like the one recived from GetState(). +* This is one of three ways the user can rebuild the +* state of the SplitPane. The second is to simply +* send the SplitPane the state message, it is the +* same as calling SetState but it ashyncronouse. +* The third way is to use all the Get/Set methouds +* for each element of the SplitPane, this way is +* long and boarding. I suggest you just send the +* View a message :) +*******************************************************/ +void SplitPane::SetState(BMessage *state){ + BPoint pt; + int32 i; + + if(state->FindBool("onedetachable",&VOneDetachable) != B_NO_ERROR) VOneDetachable = false; + if(state->FindBool("towdetachable",&VTwoDetachable) != B_NO_ERROR) VTwoDetachable = false; + if(state->FindInt32("align",&i) == B_NO_ERROR) align = i; + if(state->FindPoint("pos",&pt) == B_NO_ERROR) pos = pt; + if(state->FindPoint("thick",&pt) == B_NO_ERROR) thickness = pt; + if(state->FindPoint("jump",&pt) == B_NO_ERROR) jump = pt; + if(state->FindPoint("pad",&pt) == B_NO_ERROR) pad = pt; + if(state->FindBool("poslock",&poslocked) != B_NO_ERROR) poslocked = false; + if(state->FindBool("alignlock",&alignlocked) != B_NO_ERROR) alignlocked = false; + if(state->FindBool("resizeonex",&resizeOneX) != B_NO_ERROR) resizeOneX = false; + if(state->FindBool("resizeoney",&resizeOneY) != B_NO_ERROR) resizeOneY = false; + if(state->FindBool("swap",&swapPanes) != B_NO_ERROR) swapPanes = false; + + if (attached) { + Update(); + Invalidate(); + } +} + +/******************************************************* +* Ok, hmm what does this do. NOT MUCH. if we get a +* STATE message then lets set the state. This is here +* to provide a asyncronuse way of seting the state and +* also to make life easyer. +*******************************************************/ +void SplitPane::MessageReceived(BMessage *msg){ + switch(msg->what){ + case SPLITPANE_STATE: + SetState(msg); + break; + case MIRROR: + { + swapPanes = !swapPanes; + Update(); + Invalidate(); + } + break; + case ROTATE: + { + if(!alignlocked){ + switch(align){ + case B_VERTICAL: + align = B_HORIZONTAL; + break; + case B_HORIZONTAL: + align = B_VERTICAL; + break; + } + Update(); + Invalidate(); + } + } + break; + default: + BView::MessageReceived(msg); + break; + } +} diff --git a/sources-experimental/SplitPane.h b/sources-experimental/SplitPane.h new file mode 100644 index 0000000..a89b459 --- /dev/null +++ b/sources-experimental/SplitPane.h @@ -0,0 +1,137 @@ +/******************************************************* +* SplitPane© +* +* SplitPane is a usefull UI component. It alows the +* use to ajust two view Horizontaly or Vertacly so +* that they are a desired size. This type of Pane +* shows up most comonly in Mail/News Readers. +* +* @author YNOP (ynop@acm.org) +* @version beta +* @date Dec. 10 1999 +*******************************************************/ +#ifndef _SPLIT_PANE_VIEW_H +#define _SPLIT_PANE_VIEW_H + +#include +#include +#include + + +class ImageButton; + +#define SPLITPANE_STATE 'spst' + +/* jaf: All BPoint arguments represent the value to use when in + * B_VERTICAL alignment followed by the value to use when in + * B_HORIZONTAL alignment. + */ +class SplitPane : public BView { + public: + SplitPane(BRect,BView*,BView*,uint32); + + void AddChildOne(BView*); + void AddChildTwo(BView*); + + void SetAlignment(uint); + uint GetAlignment() const; + + void SetSwapped(bool); + bool GetSwapped() const; + + void SetBarPosition(BPoint pos); + BPoint GetBarPosition() const; + + void SetBarThickness(BPoint); + BPoint GetBarThickness() const; + + void SetJump(BPoint); + BPoint GetJump() const; + + bool HasViewOne() const; + bool HasViewTwo() const; + + void SetViewOneDetachable(bool); + void SetViewTwoDetachable(bool); + + bool IsViewOneDetachable() const; + bool IsViewTwoDetachable() const; + + void SetEditable(bool); + bool IsEditable() const; + + void SetViewInsetBy(BPoint); + BPoint GetViewInsetBy() const; + + void SetMinSizeOne(const BPoint & size); + BPoint GetMinSizeOne() const; + + void SetMinSizeTwo(const BPoint & size); + BPoint GetMinSizeTwo() const; + + void GetState(BMessage & writeTo) const; + void SetBarLocked(bool); + + bool IsBarLocked() const; + void SetBarAlignmentLocked(bool); + + bool IsBarAlignmentLocked() const; + void SetState(BMessage*); + + void SetResizeViewOne(bool whileInVertAlign, bool whileInHorizAlign); + void GetResizeViewOne(bool & returnWhileInVertAlign, bool & returnWhileInHorizAlign) const; + + virtual void Draw(BRect); + virtual void AttachedToWindow(); + virtual void FrameResized(float,float); + virtual void MouseDown(BPoint); + virtual void MouseUp(BPoint); + virtual void MouseMoved(BPoint,uint32,const BMessage*); + virtual void MessageReceived(BMessage*); + + private: + bool IsInDraggerBounds(BPoint pt) const; + void Update(); + + BView *PaneOne; + BView *PaneTwo; + + ImageButton* rotate; + ImageButton* mirror; + + BBitmap* rotateH; + BBitmap* mirrorH; + BBitmap* rotateV; + BBitmap* mirrorV; + + //State info + bool VOneDetachable; + bool VTwoDetachable; + uint align; + BPoint pos; + BPoint thickness; + BPoint jump; + BPoint pad; + BPoint MinSizeOne; + BPoint MinSizeTwo; + bool poslocked; + bool alignlocked; + bool resizeOneX; // added by jaf; determines which child view gets + bool resizeOneY; // resized when SplitPane view is resized + bool swapPanes; + + //end State info + + bool Draggin; + BPoint here; + bool attached; + BPoint prevSize; + + BWindow *WinOne; + BWindow *WinTwo; + +// BWindow *ConfigWindow; +}; + + +#endif diff --git a/sources-experimental/StackedView.cpp b/sources-experimental/StackedView.cpp new file mode 100644 index 0000000..3d1b9a2 --- /dev/null +++ b/sources-experimental/StackedView.cpp @@ -0,0 +1,63 @@ + #include "StackedView.h" + +StackedView::StackedView(BRect _frame,const char* _name, + uint32 _resize, + uint32 _flags): + BView(_frame,_name,_resize,_flags){ + fSelected = NULL; +} + +uint32 +StackedView::AddView(BView* _view){ + fStackedViewList.AddItem(_view); + + _view->MoveTo(0,0); + _view->ResizeTo(Bounds().Width(),Bounds().Height()); + + AddChild(_view); + if(fSelected!=NULL) _view->Hide(); + else fSelected = _view; + return 0; +} + +BView* +StackedView::RemoveView(BView& _view){ + fStackedViewList.RemoveItem(&_view); + return NULL; +} + +uint32 +StackedView::CountViews() const { + return fStackedViewList.CountItems(); +} + +void +StackedView::SetSelectedIndex(uint32 _index){ + BView* at=fStackedViewList.ItemAt(_index); + if(fSelected) fSelected->Hide(); + if(at) at->Show(); + fSelected = at; + + +} + +void +StackedView::AttachedToWindow(){ + + if(Parent()) + SetViewColor(Parent()->ViewColor()); + for(int i=0;iMoveTo(0,0); + at->ResizeTo(Bounds().Width(),Bounds().Height()); + } + +} + +void +StackedView::SetSelectedView(BView& _view){ + int32 index = fStackedViewList.IndexOf(&_view); + if(index >=0) + SetSelectedIndex(index); +} + diff --git a/sources-experimental/StackedView.h b/sources-experimental/StackedView.h new file mode 100644 index 0000000..9fe39c9 --- /dev/null +++ b/sources-experimental/StackedView.h @@ -0,0 +1,57 @@ +#ifndef _StackedView_h_ +#define _StackedView_h_ + +#include "ObjectList.h" +#include + +class StackedView : public BView +{ + public: + + StackedView(BRect _frame, + const char* _name, + uint32 _resize, + uint32 _flags); + //virtual ~StackedView(); + + uint32 CountViews() const; + //uint32 IndexOf(const BView& _view) const; + //bool HasView(const BView& _view) const; + + //BView& EditViewAt(uint32 _index); + //const BView& ViewAt(uint32 _index) const; + + uint32 AddView(BView* _view); + //uint32 InsertView(BView* _view, uint32 _index); + + //BView* RemoveView(uint32 _index); + BView* RemoveView(BView& _view); + + //BView* ReplaceView(uint32 _index, BView* _view); + + void SetSelectedIndex(uint32 _index); + void SetSelectedView(BView& _view); + + //uint32 GetSelectedIndex() const; + BView* GetSelectedView() { return fSelected; } + + //bool GetAutoResize() const; + //void SetAutoResize(bool _autoResize); + + //bool DoesLazyAttach() const; + //void SetLazyAttach(bool _lazy); + + virtual void AttachedToWindow(); + //virtual void SelectionChanged(uint32 _index); + + private: + // status_t IndexFor(const BView& _view, uint32& _index) const; + // void CheckBounds(uint32 _index) const; + + private: + + BObjectList fStackedViewList; + BView* fSelected; +}; +#endif +//-- diff --git a/sources-experimental/Store.h b/sources-experimental/Store.h new file mode 100644 index 0000000..b7f0fdd --- /dev/null +++ b/sources-experimental/Store.h @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#ifndef _Store_H_ +#define _Store_H_ + +#include "ItemProperty.h" +#include + +class Store { + + public: + + virtual void SetKey(ItemProperty key,void* data,ssize_t size) = 0; + + virtual void SetKeyString(ItemProperty key,const char* data) = 0; + virtual void SetKeyInt32(ItemProperty key,int32 data) = 0; + +}; + +#endif + +//.. diff --git a/sources-experimental/StripeView.cpp b/sources-experimental/StripeView.cpp new file mode 100644 index 0000000..d8b19a3 --- /dev/null +++ b/sources-experimental/StripeView.cpp @@ -0,0 +1,55 @@ +#include "StripeView.h" + +static const int kIconStripeWidth = 30; + +StripeView::StripeView(BRect frame) + : BView(frame, "StripeView", B_FOLLOW_ALL_SIDES, B_WILL_DRAW), + fIconBitmap(NULL) +{ + SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); +} + + +StripeView::StripeView(BMessage* archive) + : BView(archive), + fIconBitmap(NULL) +{ +} + + +StripeView::~StripeView(){} + + +StripeView* +StripeView::Instantiate(BMessage* archive) +{ + if (!validate_instantiation(archive, "StripeView")) + return NULL; + + return new StripeView(archive); +} + + +status_t +StripeView::Archive(BMessage* archive, bool deep) +{ + return BView::Archive(archive, deep); +} + + +void +StripeView::Draw(BRect updateRect) +{ + // Here's the fun stuff + if (fIconBitmap) { + BRect StripeRect = Bounds(); + StripeRect.right = kIconStripeWidth; + SetHighColor(tint_color(ViewColor(), B_DARKEN_1_TINT)); + FillRect(StripeRect); + + + SetDrawingMode(B_OP_ALPHA); + DrawBitmapAsync(fIconBitmap, BPoint(18, 6)); + SetDrawingMode(B_OP_COPY); + } +} diff --git a/sources-experimental/StripeView.h b/sources-experimental/StripeView.h new file mode 100644 index 0000000..6f7e050 --- /dev/null +++ b/sources-experimental/StripeView.h @@ -0,0 +1,29 @@ +#ifndef _StripeView_H_ +#define _StripeView_H_ + +#include + +class StripeView : public BView { + public: + StripeView(BRect frame); + StripeView(BMessage* archive); + ~StripeView(); + + static StripeView* Instantiate(BMessage* archive); + status_t Archive(BMessage* archive, bool deep = true); + + virtual void Draw(BRect updateRect); + + // These functions (or something analogous) are missing from libbe.so's + // dump. I can only assume that the bitmap is a public var in the + // original implementation -- or BPAlert is a friend of StripeView. + // Neither one is necessary, since I can just add these. + void SetBitmap(BBitmap* Icon) { fIconBitmap = Icon; } + BBitmap* Bitmap() { return fIconBitmap; } + + private: + BBitmap* fIconBitmap; +}; + +#endif +//- diff --git a/sources-experimental/SubscriptionColumn.cpp b/sources-experimental/SubscriptionColumn.cpp new file mode 100644 index 0000000..adddb5e --- /dev/null +++ b/sources-experimental/SubscriptionColumn.cpp @@ -0,0 +1,321 @@ +#include "SubscriptionColumn.h" +#include "BPLocale.h" +#include +#include +#include +#include "Colors.h" + +#ifdef ZETA + #include +#endif + +#define kTEXT_MARGIN 8 + +SubscriptionColumn::SubscriptionColumn(const char* title, float width, float minWidth, + float maxWidth, uint32 trunc, alignment align) + :BStringColumn(title, width, minWidth, maxWidth, align), + fTruncate(trunc) +{ + SetWantsEvents(true); + lastDest = NULL; +} + +//-------------------------------------------------------------------- + +void SubscriptionColumn::DrawField(BField* _field, BRect rect, BView* parent){ + + SubscriptionField* field = dynamic_cast(_field); + + if(field){ + + switch(field->Size()){ + case BIG: + DrawBigField(field,rect,parent); + break; + case SMALL: + DrawSmallField(field,rect,parent); + break; + } + } + else + BStringColumn::DrawField(_field,rect,parent); + +} + +void +SubscriptionColumn::DrawSmallField(SubscriptionField* field, BRect rect, BView* parent) +{ + parent->PushState(); + rect.left += kTEXT_MARGIN; + + float width = rect.Width() - (2 * kTEXT_MARGIN); + + BString out_string(field->String()); + + + + + if( field->GetNewCount() >0) + out_string << " (" << field->GetNewCount() << ")"; + else + out_string << " "; //really don't like maybe we should find a better solution? to avoid the (1) bug + + if (width != field->Width() || out_string.Compare(field->String()) !=0 ) + { + parent->TruncateString(&out_string, fTruncate, width + 2); + field->SetClippedString(out_string.String()); + field->SetWidth(width); + } + + SetFileStatusColor(field->GetFileStatus(),parent); + + DrawString(field->ClippedString(), parent, rect); + parent->PopState(); +} + +void +SubscriptionColumn::DrawBigField(SubscriptionField* field, BRect rect, BView* parent) +{ + //SubscriptionField* field = static_cast(_field); + + const BBitmap *bitmap = field->GetBitmap(); + + parent->PushState(); + + if (bitmap != NULL) + { + float x = 0.0; + float y; + BRect r = bitmap->Bounds(); + + y = rect.top + ((rect.Height() - r.Height()) / 2) - 1; + + switch (Alignment()) + { + case B_ALIGN_LEFT: + x = rect.left ; // + kTEXT_MARGIN; + break; + + case B_ALIGN_CENTER: + x = rect.left + ((rect.Width() - r.Width()) / 2); + break; + + case B_ALIGN_RIGHT: + x = rect.right - kTEXT_MARGIN - r.Width(); + break; + } + parent->SetDrawingMode(B_OP_ALPHA); + parent->DrawBitmap(bitmap, BPoint(x, y)); + parent->SetDrawingMode(B_OP_OVER); + } + + rect.left += 45.0; //55.0; + + float width = rect.Width() - (2 * kTEXT_MARGIN); + + if (width != field->Width()) + { + BString out_string(field->String()); + + parent->TruncateString(&out_string, fTruncate, width + 2); + field->SetClippedString(out_string.String()); + field->SetWidth(width); + } + + float hei=rect.Height() /2.0; + hei -= 3; + rect.top +=3; + + rect.bottom = rect.top + hei; //+ 30; //19 + DrawString(field->ClippedString(), parent, rect); + + //debug: parent->StrokeRect(rect); + rect.top = rect.bottom; + rect.bottom = rect.top + hei; //19; //19 + parent->SetHighColor(0,0,0); //(125,125,125) + + DrawString("", parent, rect); + //debug: parent->StrokeRect(rect); + + if(field->GetNewCount()>0) + { + + BString tot; + + if(field->GetNewCount()==1) + tot << _T("1 new item"); + else { + #ifdef ZETA + tot << _TPS("%d new items").Replace("%d",BFormatter("%d", field->GetNewCount())); + #else + tot << field->GetNewCount() << " new items"; + #endif + } + tot << " "; + parent->DrawString(tot.String()); + } + + DrawStatus(field->GetFileStatus(),parent,field->GetFilePercentage()); + + parent->PopState(); +} + +void +SubscriptionColumn::DrawStatus(FileStatus status,BView* parent,int32 perc){ + + SetFileStatusColor(status,parent); + + switch(status){ + + case ERROR: + parent->DrawString(_T("error")); + break; + case NOT_DOWNLOADED: + parent->DrawString(_T("not down")); + break; + case ENQUEQUED: + parent->DrawString(_T("enquequed")); + break; + case DOWNLOADING: + parent->DrawString(_T("downloading")); + if(perc>=0 && perc<=100){ + BString sp(" "); + sp << perc << "%"; + parent->DrawString(sp.String()); + } + break; + case DOWNLOADED: + break; + case STOPPED: + break; + case CONNECTING: + parent->DrawString(_T("connecting")); + break; + case NOT_FOUND: + parent->DrawString(_T("not found")); + break; + case CANT_CONNECT: + parent->DrawString(_T("can't connect")); + break; + case BAD_FORMAT: + parent->DrawString(_T("invalid format")); + break; + default: + break; + } + + + +} + +void +SubscriptionColumn::SetFileStatusColor(FileStatus status,BView* parent){ + switch(status){ + + case ERROR: + parent->SetHighColor(230,0,0); + // parent->SetLowColor(125,0,0); + + break; + case NOT_DOWNLOADED: + + break; + case ENQUEQUED: + parent->SetHighColor(20,20,220); + break; + case DOWNLOADING: + parent->SetHighColor(0,99,12); //(0,255,0) + //parent->SetLowColor(0,49,12); //(0.125.0) + + break; + case DOWNLOADED: + + break; + case STOPPED: + + break; + case CONNECTING: + parent->SetHighColor(83,118,75); //57,93,0); + //parent->SetLowColor(57,93,0); //(0.125.0) + + break; + case NOT_FOUND: + parent->SetHighColor(230,0,0); + // parent->SetLowColor(125,0,0); + + break; + case CANT_CONNECT: + parent->SetHighColor(230,0,0); + // parent->SetLowColor(125,0,0); + + break; + case BAD_FORMAT: + parent->SetHighColor(230,0,0); + // parent->SetLowColor(125,0,0); + + break; + default: + break; + } +// parent->SetLowColor(parent->HighColor()); +} + +//-------------------------------------------------------------------- + +int SubscriptionColumn::CompareFields(BField* field1, BField* field2) { + int32 index1 = ((PositionableField*)field1)->GetPreferredPosition(); + int32 index2 = ((PositionableField*)field2)->GetPreferredPosition(); + return ( index1 - index2 ); +} + + +//-------------------------------------------------------------------- + +bool SubscriptionColumn::AcceptsField(const BField *field) const { + return static_cast(dynamic_cast(field)); +} + + +void +SubscriptionColumn::MouseMoved(BColumnListView *parent, BRow *row, BField *field, + BRect field_rect, BPoint point, uint32 buttons, int32 code){ + + if(parent && parent->Window()){ + BMessage* msg = parent->Window()->CurrentMessage(); + int32 what; + if(msg && msg->FindInt32("_msg_data_",&what)==B_OK) { + + + + BRect re; + BRow* dest=parent->RowAt(point); + parent->GetRowRect(dest,&re); + + /* + casi possibili di update vecchio + a) !=NULL + b) != nuovo + c) == nuovo E !contine + */ + + if(lastDest && ( ( lastDest != dest ) || ( dest && lastDest == dest && !re.Contains(point) ) )) + parent->UpdateRow(lastDest); + + + if(dest && dest != row && re.Contains(point) && lastDest != dest ){ + parent->ScrollView()->PushState(); + parent->ScrollView()->SetHighColor(White); + parent->ScrollView()->SetHighColor(200,0,0,125); + parent->ScrollView()->SetDrawingMode(B_OP_ALPHA); + parent->ScrollView()->FillRect(re); + parent->ScrollView()->PopState(); + } + + if(re.Contains(point)) + lastDest=dest; + else + lastDest = NULL; + } + } +} + diff --git a/sources-experimental/SubscriptionColumn.h b/sources-experimental/SubscriptionColumn.h new file mode 100644 index 0000000..58fea08 --- /dev/null +++ b/sources-experimental/SubscriptionColumn.h @@ -0,0 +1,114 @@ +#ifndef SubscriptionColumn_H +#define SubscriptionColumn_H + +#include "ColumnTypes.h" +#include "FileStatus.h" + +enum SubscriptionSize { + BIG, + SMALL + }; + + +class PositionableField : public BStringField { + + public: + + PositionableField(const char* txt):BStringField(txt){ + SetPreferredPosition(-1); + SetSize(SMALL); + }; + + void SetSize(SubscriptionSize size) { fSize=size; } + SubscriptionSize Size(){ return fSize;} + + void SetPreferredPosition(int c) { fPosition=c;} + int GetPreferredPosition() { return fPosition; } + + + + private: + + int fPosition; + SubscriptionSize fSize; + +}; + +class SubscriptionField : public PositionableField { + + public: + + SubscriptionField(const char* txt,int32):PositionableField(txt){ + SetNewCount(0); + SetBitmapPointer(NULL); + fMyBitmap =NULL; + fPercentage = 0; + SetFileStatus(DOWNLOADED); + SetSize(BIG); + }; + + + void SetBitmapPointer(BBitmap* bit){ fBitmap=bit; } + void SetBitmapPersonal(BBitmap* bit){ + if(fMyBitmap) delete fMyBitmap; + fMyBitmap=bit; + SetBitmapPointer(bit); + } + + FileStatus GetFileStatus(){ return fStatus;}; + void SetFileStatus(FileStatus status){ fStatus = status; }; + void SetFilePercentage(int perc){ fPercentage = perc; } + int32 GetFilePercentage(){ return fPercentage; } + + void SetNewCount(int32 count){ fNewCount=count;} + void AddNewCount(int32 add){ fNewCount +=add; } + int32 GetNewCount(){ return fNewCount; } + + BBitmap* GetBitmap() { return fBitmap; } + private: + BBitmap* fBitmap; + BBitmap* fMyBitmap; + FileStatus fStatus; + int32 fNewCount; + int32 fPercentage; + //int fPosition; + //SubscriptionSize fSize; + +}; + +class SubscriptionColumn : public BStringColumn { + + public: + SubscriptionColumn (const char *title, + float width, + float maxWidth, + float minWidth, + uint32 truncate, + alignment align = B_ALIGN_LEFT); + void DrawField (BField* field, + BRect rect, + BView* parent); + void DrawBigField (SubscriptionField* field, + BRect rect, + BView* parent); + void DrawSmallField (SubscriptionField* field, + BRect rect, + BView* parent); + + virtual int CompareFields (BField* field1, + BField* field2); + bool AcceptsField (const BField* field) const; + + + void DrawStatus(FileStatus status,BView* parent,int32 perc); + void SetFileStatusColor(FileStatus status,BView* parent); + + + void MouseMoved(BColumnListView *parent, BRow *row, BField *field, + BRect field_rect, BPoint point, uint32 buttons, int32 code); + + private: + uint32 fTruncate; + BRow* lastDest; +}; +#endif diff --git a/sources-experimental/SubscriptionListItem.cpp b/sources-experimental/SubscriptionListItem.cpp new file mode 100644 index 0000000..d263901 --- /dev/null +++ b/sources-experimental/SubscriptionListItem.cpp @@ -0,0 +1,324 @@ +#include "SubscriptionListItem.h" +#include "ItemProperty.h" + +#include "ColumnListView.h" +#include "ColumnTypes.h" +//#include +#include +#include "BPLocale.h" +#include "Utils.h" +#include +#include "malloc.h" + +#include + +#define ALTEZZA_BIG 48 +#define ALTEZZA_SMALL 16 +#define DIMESIONE_ICONA 46 + +BBitmap* fGenericSubIcon=NULL; + +SubscriptionListItem::SubscriptionListItem(entry_ref ref):BRow(ALTEZZA_BIG) +{ + if(!fGenericSubIcon) + fGenericSubIcon= LoadIcon("file-46.png"); + + fWeb.SetTo(""); + + field = new SubscriptionField("",123); + field->SetBitmapPointer(fGenericSubIcon); + SetField( field, 0 ); + + fChannel.AddElementListener(this); + + SetIsNew(false); + + extraSetting = columnsState = NULL; + + fRef=ref; + + fStatusFilter = FILTER_NONE; +} + + +void +SubscriptionListItem::SetSize(SubscriptionSize size){ + + switch(size){ + case BIG: + SetHeight(ALTEZZA_BIG); + break; + case SMALL: + SetHeight(ALTEZZA_SMALL); + break; + }; + field->SetSize(size); +// printf("SubscriptionListItem SET TITLE %s\n",field->String()); +} + + +bool +SubscriptionListItem::HasOwnImage(){ + + if(field->GetBitmap()==fGenericSubIcon) + return false; + + return true; +} + +void +SubscriptionListItem::KeyModified(int32 key, void* data,ssize_t) { + + switch(key) + { + case CHANNEL_TITLE: +// printf("SubscriptionListItem SET TITLE %s\n",(const char*)data); + field->SetString((const char*)data); +// printf("SubscriptionListItem SET TITLE %s\n",field->String()); + break; + + case CHANNEL_URL: + fUrl.SetTo((const char*)data); + break; + + case CHANNEL_WEBLINK: + fWeb.SetTo((const char*)data); + break; + + case CHANNEL_NEWITEMS: + { + int32 c = *((int32*)data); + field->AddNewCount(c); + } + break; + + case CHANNEL_RSS_FILE_STATUS: + { + int32 c = *((int32*)data); + field->SetFileStatus((FileStatus)c); + } + break; + case CHANNEL_IMAGE_DATA: + { + BBitmap* icon = (BBitmap*)data; + if(!icon) return; //safety + //here resizing please! + //quale è il lato + lungo? + + BBitmap* nicon; + float h = icon->Bounds().Height(); + float w =icon->Bounds().Width(); + + if( h == w ) + nicon = rescale_bitmap(icon,DIMESIONE_ICONA,DIMESIONE_ICONA); + else + { + if(h>w) + { + float diff = w/h; + nicon = rescale_bitmap(icon,DIMESIONE_ICONA*diff,DIMESIONE_ICONA); + } + else + { + float diff = h/w; + nicon = rescale_bitmap(icon,DIMESIONE_ICONA,DIMESIONE_ICONA*diff); + } + + } + + field->SetBitmapPersonal(nicon); + } + break; + + default: + break; + }; +} + + +SubscriptionListItem::~SubscriptionListItem(){ + //nothing to do here? +} + + +BBitmap* +SubscriptionListItem::rescale_bitmap( BBitmap * original, int32 width, int32 height ) +{ + + float starting_width = original->Bounds().Width()+1; + float starting_height = original->Bounds().Height()+1; + + float new_width = width; //round(starting_width * new_settings->width_coefficient); + float new_height = height; //round(starting_height * new_settings->height_coefficient); + + // Create a new bitmap here and copy it applying scaling. + // But first create an intermediate bitmap for scaling in one direction only. + // Remember that the returned bitmap must accept views + // First scale the width. + // If the new size is the same as old return the original + if ((new_width == starting_width) && (new_height == starting_height)) + return new BBitmap(original); + + + + BBitmap *intermediate_bitmap; + if (new_width != starting_width) { + intermediate_bitmap = new BBitmap(BRect(0,0,new_width-1,starting_height-1),B_RGB_32_BIT); + if (intermediate_bitmap->IsValid() == FALSE) + #ifdef ZETA + throw bad_alloc(); + #else + return NULL; + #endif + uint32 *target_bits = (uint32*)intermediate_bitmap->Bits(); + int32 target_bpr = intermediate_bitmap->BytesPerRow()/4; + uint32 *source_bits = (uint32*)original->Bits(); + int32 source_bpr = original->BytesPerRow()/4; + int32 bottom = (int32)original->Bounds().bottom; + float diff = (starting_width)/(new_width); + float accumulation = 0; + + + if (diff<1) { + // Enlarge in x direction. + for (int32 y=0;y<=bottom;y++) { + accumulation = 0; + for (int32 x=0;x1) { + // Make smaller in x direction. + diff = (starting_width-1)/new_width; // Why this line??? + for (int32 y=0;y<=bottom;y++) { + accumulation = 0; + for (int32 x=0;xIsValid() == FALSE) + #ifdef ZETA + throw bad_alloc(); + #else + return NULL; + #endif + uint32 *target_bits = (uint32*)new_bitmap->Bits(); + int32 target_bpr = new_bitmap->BytesPerRow()/4; + uint32 *source_bits = (uint32*)intermediate_bitmap->Bits(); + int32 source_bpr = intermediate_bitmap->BytesPerRow()/4; + int32 bottom = (int32)new_bitmap->Bounds().bottom; + float diff = (starting_height-1)/(new_height); + float accumulation = 0; + if (diff<1) { + // Make larger in y direction. + for (int32 y=0;y<=bottom;y++) { + for (int32 x=0;x1) { + // Make smaller in y direction. + diff = (starting_height-1)/new_height; + accumulation = 0; + for (int32 y=0;y<=bottom;y++) { + for (int32 x=0;xSetHighColor(0,0,0); + parent->FillRoundRect(BRect(_rect.left + 6, _rect.top + 6,_rect.left + 9,_rect.top + 9),1,1); + } +} + diff --git a/sources-experimental/SubscriptionListItem.h b/sources-experimental/SubscriptionListItem.h new file mode 100644 index 0000000..6d514e8 --- /dev/null +++ b/sources-experimental/SubscriptionListItem.h @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#ifndef _SubscriptionListItem_H +#define _SubscriptionListItem_H + +#include "ColumnListView.h" +#include "ColumnTypes.h" + +#include "ElementListener.h" + +#include "SubscriptionColumn.h" + +#include "RssChannel.h" + +#include + + +class SubscriptionListItem : public BRow, public ElementListener +{ + public: + + + SubscriptionListItem(entry_ref fRef); + ~SubscriptionListItem(); + + BString GetURL(){ return fUrl;} + BString GetWeblink(){ return fWeb;} + void SetFileStatus(FileStatus c){field->SetFileStatus(c);} + FileStatus GetFileStatus(){return field->GetFileStatus();} + + BString GetTitle(){return field->String();} + void KeyModified(int32 key, void* data,ssize_t); + + void SetNewCount(int32 count){ field->SetNewCount(count);} + void AddNewCount(int32 add){ field->AddNewCount(add);} + int32 GetNewCount(){ return field->GetNewCount(); } + + void SetPreferredPosition(int32 index){ + field->SetPreferredPosition(index); + } + + void SetFilePercentage(int32 per){ field->SetFilePercentage(per);} + + void SetSize(SubscriptionSize size); + + bool HasOwnImage(); + + //don't like this: + RssChannel fChannel; + + void DrawBackground(BRect _rect,BView* _target_view,bool _is_selected,bool _is_focus ); + + bool IsNew(){ return isNew; } + void SetIsNew(bool set){ isNew = set; } + + entry_ref fRef; + + entry_ref lastSelected; //<---- ? remove and add as list. + + BMessage* extraSetting; //TODO: per channel setttings + BMessage* columnsState; //columns states + //TODO: list of selected entry_ref. + + enum StatusFilter { + FILTER_NONE = 0, + FILTER_NEW = 1, + FILTER_DOWNLOADED = 2 + }; + + + StatusFilter fStatusFilter; //maybe can become an attribute? + + private: + + BBitmap* rescale_bitmap( BBitmap * src, int32 width, int32 height ); + SubscriptionField* field; + BString fUrl; //? + BString fWeb; + + inline uint32 mix_2_pixels_fixed(uint32 p1,uint32 p2,uint32 c) + { + uint32 inv_c = 32768 - c; + + return ((((((p1 >> 24) &0xFF) * c + ((p2 >> 24)&0xFF) * inv_c)>>15)<<24) & 0xFF000000) | + ((((((p1 >> 16)&0xFF) * c + ((p2 >> 16)&0xFF) * inv_c)>>15)<<16) & 0x00FF0000) | + ((((((p1 >> 8)&0xFF) * c + ((p2 >> 8)&0xFF) * inv_c)>>15)<<8) & 0x0000FF00) | + (((((p1&0xFF) * c + (p2&0xFF) * inv_c)>>15)) & 0x000000FF); + } + + bool isNew; + + + }; + +#endif diff --git a/sources-experimental/SubscriptionListView.cpp b/sources-experimental/SubscriptionListView.cpp new file mode 100644 index 0000000..ce1dc5b --- /dev/null +++ b/sources-experimental/SubscriptionListView.cpp @@ -0,0 +1,276 @@ +#include "SubscriptionListView.h" +#include "SubscriptionListItem.h" + +#include "BPLocale.h" +#include +#include "Utils.h" +#include "GroupItem.h" +#include "Colors.h" + +#include + +#include + +#define DROP_CHANNEL 'drch' +#define DROP_GROUP 'drgr' + +SubscriptionListView::SubscriptionListView(BRect r): +BColumnListView(r,"SubscriptionListView",B_FOLLOW_LEFT_RIGHT, B_WILL_DRAW|B_FRAME_EVENTS|B_NAVIGABLE,B_FANCY_BORDER,true) +{ + + podcast=new SubscriptionColumn(_T("Subscriptions"),200,36,300,B_TRUNCATE_MIDDLE,B_ALIGN_LEFT); + AddColumn(podcast,0); + SetColumnFlags(B_ALLOW_COLUMN_RESIZE ); + SetSelectionMode(B_SINGLE_SELECTION_LIST); + const rgb_color x = {238,185,0,255}; //244,203,63 244,190,23 + SetColor(B_COLOR_SELECTION,x);//! + + SetColor(B_COLOR_BACKGROUND,White); + + SetColor(B_COLOR_ROW_DIVIDER,BeBackgroundGrey); + + + CurrentSelection(0); + + BMessage* selected=new BMessage(CHANNEL_SELECTED); + selected->AddInt32("buttons",0); + SetSelectionMessage(selected); + + + SetSortColumn(podcast,true,true); + SetSortingEnabled(false); + fItemSize = BIG; +} + +void +SubscriptionListView::FrameResized(float w,float h){ + BColumnListView::FrameResized(w,h); + podcast->SetWidth(w-35); + GetTitleView()->Invalidate(); + Refresh(); +} + +void +SubscriptionListView::SelectionChanged(){ + uint32 buttons; + + BMessage *msg = Window()->CurrentMessage(); + + if(msg) + msg->FindInt32("buttons", (int32 *)&buttons); + + SelectionMessage()->ReplaceInt32("buttons",buttons); + + BColumnListView::SelectionChanged(); +} + +void +SubscriptionListView::MessageDropped(BMessage* msg, BPoint point){ + + if(msg->what==DROP_CHANNEL) DroppedSubscription(msg,point); + else + if(msg->what==DROP_GROUP) DroppedGroup(msg,point); + + +} + +void +SubscriptionListView::DroppedSubscription(BMessage* msg, BPoint point){ + + int32 from=msg->FindInt32("from"); + int32 parentFrom=msg->FindInt32("parent"); + + BRow * frow= NULL; + + if(parentFrom!=-1){ + BRow* parent= RowAt(parentFrom); + if(!parent) return; //some error occured. + frow=RowAt(from,parent); + } + else + frow=RowAt(from); + + BRow *row=RowAt(point); + + if(!frow || frow==row) return; + + SubscriptionListItem* sitem=dynamic_cast(row); + + if(row && sitem) { + int32 to = IndexOf(row); //this is a position relative to the parent. + + //printf("Move from %ld to %ld\n",from,to); + BRow* parent=NULL; + FindParent(row,&parent,NULL); + RemoveRow(frow); + AddRow(frow,to,parent); + DeselectAll(); + } + else + if(row){ //dropped to a group + RemoveRow(frow); + AddRow(frow,row); + DeselectAll(); + } + else + if(!row){ //dropped outside any other channel == add at the bottom. + RemoveRow(frow); + AddRow(frow,CountRows(),NULL); + } + + AddToSelection(frow); +} + + +void +SubscriptionListView::DroppedGroup(BMessage* msg, BPoint point) +{ + int32 from=msg->FindInt32("from"); + int32 parentFrom=msg->FindInt32("parent"); + + BRow* frow= NULL; + + if(parentFrom!=-1){ + BRow* parent= RowAt(parentFrom); + if(!parent) return; //some error occured. + frow=RowAt(from,parent); + } + else + frow=RowAt(from); + + + BRow *row=RowAt(point); + if(!row) return; + + GroupItem* gitem=dynamic_cast(row); + if(gitem) + { + printf("Dropped, we should move the dropped into the group '%s'\n", "fix", gitem->GroupName().String() ); + RemoveRow(frow); + AddRow(frow,row); + DeselectAll(); + } +} + + +bool +SubscriptionListView::InitiateDrag(BPoint p, bool ) +{ + + + BMessage *msg = Window()->CurrentMessage(); + if(msg->FindInt32("buttons") == B_SECONDARY_MOUSE_BUTTON) return false; + + BRow *item=CurrentSelection(NULL); + if(!item) return false; + + SubscriptionListItem* sitem=dynamic_cast(item); + if(sitem) { + BMessage re(DROP_CHANNEL); + re.AddInt32("from",IndexOf(item)); + //are we in a group? + BRow* parent=NULL; + FindParent(item,&parent,NULL); + if(parent) + re.AddInt32("parent",IndexOf(parent)); + else + re.AddInt32("parent",-1); + + #ifdef ZETA + BBitmap *bit=new BBitmap(*( ((SubscriptionField*)item->GetField(0))->GetBitmap() )); + #else + BBitmap *bit=new BBitmap( ((SubscriptionField*)item->GetField(0))->GetBitmap() ); + #endif + DragMessage(&re,bit,B_OP_ALPHA,BPoint(bit->Bounds().Width()/2,bit->Bounds().Height()/2),this); + + return true; + } + + GroupItem* gitem=dynamic_cast(item); + if(gitem) { + BMessage re(DROP_GROUP); + re.AddInt32("from",IndexOf(item)); + BRect r(0,0,20,20); + r.OffsetTo(p.x,p.y); + DragMessage(&re,r,this); + + return true; + } + + return false; +} + +SubscriptionSize +SubscriptionListView::ItemSize(){ + return fItemSize; +} + +void +SubscriptionListView::SetItemSize(SubscriptionSize size){ + + //I hope we are locked! + //change the size of every BRow + + if( fItemSize == size ) return; + + fItemSize = size; + + BRow* selected = CurrentSelection(); + + DeselectAll(); + + ChangeSize(NULL); + + + AddToSelection(selected); + + //redraw all! + Refresh(); +} + +void +SubscriptionListView::ChangeSize(BRow* parent){ + + int32 tot = CountRows(parent); + for(int i=0;i(RowAt(0,parent)); + if(item) { + RemoveRow(item); + AddRow(item,tot,parent); + } + GroupItem* grp=dynamic_cast(RowAt(0,parent)); + if(grp) ChangeSize(grp); + } +} + +void +SubscriptionListView::AddRow(BRow* row, BRow *par){ + + SubscriptionListItem* item=dynamic_cast(row); + if(item) + item->SetSize(fItemSize); + BColumnListView::AddRow(row,par); + +} + +void +SubscriptionListView::AddGroup(GroupItem* group){ + AddRow((BRow*)group,(BRow*)NULL); +} + + + +void +SubscriptionListView::AddRow(BRow* row, int32 index, BRow *par){ + + SubscriptionListItem* item=dynamic_cast(row); + if(item) + item->SetSize(fItemSize); + BColumnListView::AddRow(row,index,par); +} + + +void +SubscriptionListView::MouseMoved(BPoint point,uint32 transit,const BMessage* message){ +} + diff --git a/sources-experimental/SubscriptionListView.h b/sources-experimental/SubscriptionListView.h new file mode 100644 index 0000000..765d6f3 --- /dev/null +++ b/sources-experimental/SubscriptionListView.h @@ -0,0 +1,48 @@ +#ifndef _SubscriptionListView_H_ +#define _SubscriptionListView_H_ + +#include "ColumnListView.h" +#include "SubscriptionColumn.h" + +#define CHANNEL_SELECTED 'invo' + +class GroupItem; + +class SubscriptionListView : public BColumnListView +{ + public: + SubscriptionListView(BRect r); + void FrameResized(float w ,float h); + void SelectionChanged(); + bool InitiateDrag(BPoint point, bool wasSelected); + void MessageDropped(BMessage*, BPoint point); + + void AddRow(BRow*, BRow *parent = 0); + void AddRow(BRow*, int32 index, BRow *parent = 0); + + void AddGroup(GroupItem* ); + //TODO: void AddGroup(GroupItem* group, GroupItem* parent); + + + void SetItemSize(SubscriptionSize size); //BIG or SMALL + SubscriptionSize ItemSize(); + + //Better drag support + + virtual void MouseMoved(BPoint point,uint32 transit,const BMessage* message); + + + + private: + + void ChangeSize(BRow* parent); + void DroppedSubscription(BMessage*, BPoint point); + void DroppedGroup(BMessage*, BPoint point); + + BColumn* podcast; + SubscriptionSize fItemSize; +}; + +#endif + +//. diff --git a/sources-experimental/TextControlFloater.cpp b/sources-experimental/TextControlFloater.cpp new file mode 100644 index 0000000..c8552e0 --- /dev/null +++ b/sources-experimental/TextControlFloater.cpp @@ -0,0 +1,157 @@ +// TextControlFloater.cpp + +#include "TextControlFloater.h" + +#include +#include + + + +// ---------------------------------------------------------------- // + +class MomentaryTextControl : + public BTextControl { + typedef BTextControl _inherited; + +public: + MomentaryTextControl( + BRect frame, + const char* name, + const char* label, + const char* text, + BMessage* message, + uint32 resizingMode=B_FOLLOW_LEFT|B_FOLLOW_TOP, + uint32 flags=B_WILL_DRAW|B_NAVIGABLE) : + BTextControl(frame, name, label, text, message, resizingMode, flags) { + + SetEventMask(B_POINTER_EVENTS|B_KEYBOARD_EVENTS); + } + +public: + virtual void AllAttached() { + TextView()->SelectAll(); + + // size parent to fit me + Window()->ResizeTo(Bounds().Width(),Bounds().Height()-1); + + Window()->Show(); + } + + virtual void MouseDown( + BPoint point) { + + if(Bounds().Contains(point)) + _inherited::MouseDown(point); + + Invoke(); +// // +++++ shouldn't an out-of-bounds click send the changed value? +// BMessenger(Window()).SendMessage(B_QUIT_REQUESTED); + } + + virtual void KeyDown( + const char* bytes, + int32 numBytes) { + + if(numBytes == 1 && *bytes == B_ESCAPE) { + BWindow* w = Window(); // +++++ maui/2 workaround + BMessenger(w).SendMessage(B_QUIT_REQUESTED); + return; + } + } +}; + +// ---------------------------------------------------------------- // + +// ---------------------------------------------------------------- // +// dtor/ctors +// ---------------------------------------------------------------- // + +TextControlFloater::~TextControlFloater() { + if(m_cancelMessage) + delete m_cancelMessage; +} + +TextControlFloater::TextControlFloater( + BRect frame, + alignment align, + const BFont* font, + const char* text, + const BMessenger& target, + BMessage* message, + BMessage* cancelMessage) : + BWindow( + frame, //.InsetBySelf(-3.0,-3.0), // expand frame to counteract control border + "TextControlFloater", + B_NO_BORDER_WINDOW_LOOK, + B_FLOATING_APP_WINDOW_FEEL, + 0), + m_target(target), + m_message(message), + m_cancelMessage(cancelMessage), + m_sentUpdate(false) { + + m_control = new MomentaryTextControl( + Bounds(), + "textControl", + 0, + text, + message, + B_FOLLOW_NONE); + + Run(); + Lock(); + + m_control->TextView()->SetFontAndColor(font); + m_control->TextView()->SetAlignment(align); + m_control->SetDivider(-3.0); + + m_control->SetViewColor(B_TRANSPARENT_COLOR); + m_control->TextView()->SelectAll(); + AddChild(m_control); + m_control->MakeFocus(); + + Unlock(); +} + +// ---------------------------------------------------------------- // +// BWindow +// ---------------------------------------------------------------- // + +void TextControlFloater::WindowActivated( + bool activated) { + + if(!activated) + // +++++ will the message get sent first? + Quit(); +} + +// ---------------------------------------------------------------- // +// BHandler +// ---------------------------------------------------------------- // + +void TextControlFloater::MessageReceived( + BMessage* message) { + + if(message->what == m_message->what) { + // done; relay message to final target + message->AddString("_value", m_control->TextView()->Text()); + m_target.SendMessage(message); + m_sentUpdate = true; + Quit(); + return; + } + + switch(message->what) { + default: + _inherited::MessageReceived(message); + } +} + +bool TextControlFloater::QuitRequested() { + if(!m_sentUpdate && m_cancelMessage) + m_target.SendMessage(m_cancelMessage); + + return true; +} + +// END -- TextControlFloater.cpp -- diff --git a/sources-experimental/TextControlFloater.h b/sources-experimental/TextControlFloater.h new file mode 100644 index 0000000..851de11 --- /dev/null +++ b/sources-experimental/TextControlFloater.h @@ -0,0 +1,64 @@ +// TextControlFloater.h +// * PURPOSE +// Display an editable text field in a simple pop-up window +// (which must automatically close when the user hits 'enter' +// or the window loses focus). +// * TO DO +++++ +// escape key -> cancel +// +// * HISTORY +// e.moon 23aug99 Begun + +#ifndef __TextControlFloater_H__ +#define __TextControlFloater_H__ + +#include +#include + +class BTextControl; +class BFont; + +//#include "cortex_defs.h" + + +class TextControlFloater : + public BWindow { + typedef BWindow _inherited; + +public: // dtor/ctors + virtual ~TextControlFloater(); + + TextControlFloater( + BRect frame, + alignment align, + const BFont* font, + const char* text, + const BMessenger& target, + BMessage* message, + BMessage* cancelMessage=0); + +public: // BWindow + virtual void WindowActivated( + bool activated); + + virtual bool QuitRequested(); + +public: // BHandler + virtual void MessageReceived( + BMessage* message); + +private: + BTextControl* m_control; + + BMessenger m_target; + const BMessage* m_message; + BMessage* m_cancelMessage; + + // true if a message has been sent indicating the + // user modified the text + bool m_sentUpdate; +}; + + +#endif /*__TextControlFloater_H__*/ + diff --git a/sources-experimental/TheApp.cpp b/sources-experimental/TheApp.cpp new file mode 100644 index 0000000..a372994 --- /dev/null +++ b/sources-experimental/TheApp.cpp @@ -0,0 +1,483 @@ +#include "TheApp.h" +#include "FilePanel.h" + +#include +#include + +#include "owner.h" +#include "Logger.h" + +#include +#include +#include +#include +#include "BPLocale.h" + + +#include "BPAlert.h" +#include "Utils.h" +#include "RVAction.h" + +#include "Setting.h" +#include "BPSettingsWindow.h" +//#include "LicenceInfo.h" +#include "MainModel.h" +#include "HelpViewer.h" +#include "AttributeMap.h" +#include "InterfaceDefs.h" + + +#include "IActionManagerBP.h" +#include "ActionHTTPContent.h" +#include +#include "DownloadManager.h" + +extern DownloadManager* download_manager; + + +#define UPDATE_INFO 'updt' +#define CHECK_UPDATE 'ckup' + +MainWindow* main_window; +IActionManagerBP action_manager; +Setting podder_settings("BePodder.conf"); +//LicenceInfo linfo("BePodder.key"); + + +TheApp::TheApp(const char * signature) : + BApplication(signature) +{ + //load settings from disk: + podder_settings.Retrive(); + + InstallMimeTypes(); + + MainModel *fModel = new MainModel(); + main_window=new MainWindow(); + fController = new MainController(main_window,fModel); + + action_manager.init(fController,main_window); + + main_window->init(fController); +} + +void +TheApp::ReadyToRun(){ + +// linfo.LoadFromFile(); + + ApplySettings(); + ApplyWindowSettings(); + + main_window->Show(); + snooze(200000); + +// BMessage grp; +// if( podder_settings.FindMessage(SETTINGS_GROUPS,&grp) == B_OK) +// if(main_window->Lock()){ +// fController->LoadGroupSetting(&grp); +// main_window->Unlock(); +// } + + + this->PostMessage(ARCHIVE_PARSE); + + + +// we disabledupdates? + + BMessage msg; + bool val = true; + if( podder_settings.FindMessage(SETTINGS_UPDATES,&msg) == B_OK) { + if(msg.FindBool("check_updates",&val) != B_OK) val= true; + } + + if(val) + ChekUpdate(); + + + + + return; +} + +void +TheApp::ChekUpdate() { + + /************ + + CHECKING UPDATE IS DISABLED. + + ********/ + + return; + + //uhm check for update? + printf("Checking for updates..\n"); + ActionHTTPContent* update=new ActionHTTPContent("http://www.funkyideasoft.com/latest.nfo"); + update->SetTargetAndWhat(this,UPDATE_INFO); + download_manager->SingleThreadAction(update); +} + +void +TheApp::AboutRequested(){ + + BString text("\nBePodder"); + text <<"\n\nDevelopers:\n\tAndrea Anzani [xeD]\n\tGiuseppe Gargaro [Beck]\n\nGraphic:\n\tzuMi\n\n\n"; + text << "Version : " << VERSION_NAME << " " << VERSION_ID << "\n"; + + BPAlert* about = new BPAlert("about", text.String() ,_T("Close!"),NULL,NULL,B_WIDTH_AS_USUAL,LoadIcon("logo-64.png")); + about->Go(); +} + +bool +TheApp::QuitRequested(){ + + + if(main_window->Lock()){ + + fController->QuitRequested(); + + BMessage data; + main_window->SaveSetting(&data); + podder_settings.RemoveData(SETTINGS_MAINWINDOW); + podder_settings.AddMessage(SETTINGS_MAINWINDOW,&data); + + main_window->Quit(); + } + podder_settings.Store(); + return true; +} + +void +TheApp::ArgvReceived(int32 argc, char **argv){ + + // debugger("ARGV"); + + if(argc<2) return; + + main_window->Activate(); + + BMessage msg('addu'); + msg.AddString("url",argv[1]); + BMessenger(main_window).SendMessage(&msg); +} + + +void +TheApp::MessageReceived(BMessage* msg){ + + //B_ARGV_RECEIVED + + switch(msg->what){ + + case CHECK_UPDATE: + ChekUpdate(); + break; + case UPDATE_INFO: + { + BString rel; + if(msg->FindString("content",&rel)==B_OK && rel != "" && rel.Compare(VERSION_ID) != 0) + { + //FIX da tradurre! + BString text("A new release of this application is available!\n\n Your version : "); + text << VERSION_ID << "\n\n" << "Latest available version : " << rel ; + text << "\n\nGo to our web site and download the latest version!\n" ; + + BPAlert *alert = new BPAlert("BePodder",text.String(),_T("Web Site"),_T("Close"),NULL,B_WIDTH_AS_USUAL, LoadIcon("logo-64.png")); + if(alert->Go()==0) + fController->OpenURL("http://www.funkyideasoft.com/downloads.html"); + } + } + break; + case PERFORM_ACTION: + action_manager.Perform(msg); + break; + case ARCHIVE_PARSE: + { + //show the alert + BPAlert *alert = new BPAlert("BePodder",_TT("alert3"),NULL,NULL,NULL,B_WIDTH_AS_USUAL, LoadIcon("enqueued-32.png")); + alert->Go(NULL); + + + fController->ParseArchive(); + + main_window->SelectSubscription(0); + //close the alert + alert->PostMessage(B_QUIT_REQUESTED); + + } + break; + case APPLY_SETTINGS: + ApplySettings(); + break; + case 'lic2': + { + + BPAlert* about = new BPAlert("Sorry", _T("Shareware application!\n\nPlease support us!\n\nBuy a software licence!\nMore info on our website\n"),_T("Web Site"),_T("Close"),NULL,B_WIDTH_AS_USUAL,LoadIcon("logo-64.png")); + if(about->Go()==0){ + fController->OpenURL("http://www.funkyideasoft.com/bepodder.html"); + } + + } + break; + case HELPVIEWER_OPEN_URL: + { + BString url; + if(msg->FindString("url",&url)==B_OK){ + if(fController) + fController->OpenURL(url); + } + } + break; + default: + BApplication::MessageReceived(msg); + break; + } +} + +void +TheApp::ApplySettings(){ + + BMessage msg; + + msg.MakeEmpty(); + if( podder_settings.FindMessage(SETTINGS_DOWNLOAD,&msg) == B_OK) + fController->LoadSettings(SETTINGS_DOWNLOAD,&msg); + + msg.MakeEmpty(); + if( podder_settings.FindMessage(SETTINGS_PROXY,&msg) == B_OK) + fController->LoadSettings(SETTINGS_PROXY,&msg); + + + msg.MakeEmpty(); + if( podder_settings.FindMessage(SETTINGS_FILETYPE,&msg) == B_OK) + fController->LoadSettings(SETTINGS_FILETYPE,&msg); + + + msg.MakeEmpty(); + if( podder_settings.FindMessage(SETTINGS_CHANNELS,&msg) == B_OK) + fController->LoadSettings(SETTINGS_CHANNELS,&msg); +} + +void +TheApp::ApplyWindowSettings(){ + + BMessage msg; + if( podder_settings.FindMessage(SETTINGS_MAINWINDOW,&msg) == B_OK) + if(main_window->Lock()){ + main_window->LoadSetting(&msg); + main_window->Unlock(); + } +} + + +void +TheApp::InstallMimeTypes(){ + + BMimeType channel(MIME_CHANNEL); + + if (channel.IsInstalled()) { + BMessage info; + BString revision; + if( channel.GetAttrInfo(&info) == B_OK && info.FindString("revision",&revision)==B_OK && revision.ICompare("1.2")==0) + return; + + + channel.Delete(); + } + + printf("Installing Channel MimeType..\n"); + + channel.SetShortDescription("BePodder Channel"); + + BMessage achannel; + + achannel.AddString("attr:name","bp:title"); + achannel.AddString("attr:public_name","Title"); + achannel.AddInt32("attr:type",B_STRING_TYPE); + achannel.AddInt32("attr:width",30); + achannel.AddInt32("attr:alignment",B_ALIGN_LEFT); + achannel.AddBool("attr:extra",false); + achannel.AddBool("attr:viewable",true); + achannel.AddBool("attr:editable",false); + + achannel.AddString("attr:name","bp:link"); + achannel.AddString("attr:public_name","Feed Link"); + achannel.AddInt32("attr:type",B_STRING_TYPE); + achannel.AddInt32("attr:width",30); + achannel.AddInt32("attr:alignment",B_ALIGN_LEFT); + achannel.AddBool("attr:extra",false); + achannel.AddBool("attr:viewable",true); + achannel.AddBool("attr:editable",false); + + achannel.AddString("attr:name","bp:category"); + achannel.AddString("attr:public_name","Category"); + achannel.AddInt32("attr:type",B_STRING_TYPE); + achannel.AddInt32("attr:width",30); + achannel.AddInt32("attr:alignment",B_ALIGN_LEFT); + achannel.AddBool("attr:extra",false); + achannel.AddBool("attr:viewable",true); + achannel.AddBool("attr:editable",false); + + achannel.AddString("attr:name","bp:weblink"); + achannel.AddString("attr:public_name","Website"); + achannel.AddInt32("attr:type",B_STRING_TYPE); + achannel.AddInt32("attr:width",30); + achannel.AddInt32("attr:alignment",B_ALIGN_LEFT); + achannel.AddBool("attr:extra",false); + achannel.AddBool("attr:viewable",true); + achannel.AddBool("attr:editable",false); + +// achannel.AddString("revision","1.2"); + + channel.SetAttrInfo(&achannel); + + if(channel.Install()!=B_OK) + printf("Error Installing!\n"); + + + BMimeType item(MIME_ITEM); + + if (item.IsInstalled()) { + BMessage info; + BString revision; + if( item.GetAttrInfo(&info) == B_OK && info.FindString("revision",&revision)==B_OK && revision.ICompare("1.2")==0) + return; + + item.Delete(); + } + + printf("Installing Item MimeType..\n"); + + item.SetShortDescription("BePodder Episode"); + + + BMessage aitem; + + aitem.AddString("attr:name","bp:item_title"); + aitem.AddString("attr:public_name","Title"); + aitem.AddInt32("attr:type",B_STRING_TYPE); + aitem.AddInt32("attr:width",30); + aitem.AddInt32("attr:alignment",B_ALIGN_LEFT); + aitem.AddBool("attr:extra",false); + aitem.AddBool("attr:viewable",true); + aitem.AddBool("attr:editable",false); + + aitem.AddString("attr:name","bp:item_pubdate"); + aitem.AddString("attr:public_name","Published"); + aitem.AddInt32("attr:type",B_TIME_TYPE); + aitem.AddInt32("attr:width",30); + aitem.AddInt32("attr:alignment",B_ALIGN_LEFT); + aitem.AddBool("attr:extra",false); + aitem.AddBool("attr:viewable",true); + aitem.AddBool("attr:editable",false); + + aitem.AddString("attr:name","bp:item_guid"); + aitem.AddString("attr:public_name","Guid"); + aitem.AddInt32("attr:type",B_STRING_TYPE); + aitem.AddInt32("attr:width",30); + aitem.AddInt32("attr:alignment",B_ALIGN_LEFT); + aitem.AddBool("attr:extra",false); + aitem.AddBool("attr:viewable",true); + aitem.AddBool("attr:editable",false); + + aitem.AddString("attr:name","bp:enclosure_size"); + aitem.AddString("attr:public_name","Enclosure Size"); + aitem.AddInt32("attr:type",B_OFF_T_TYPE); + aitem.AddInt32("attr:width",30); + aitem.AddInt32("attr:alignment",B_ALIGN_RIGHT); + aitem.AddBool("attr:extra",false); + aitem.AddBool("attr:viewable",true); + aitem.AddBool("attr:editable",false); + + aitem.AddString("attr:name","bp:item_status"); + aitem.AddString("attr:public_name","Status"); + aitem.AddInt32("attr:type",B_INT32_TYPE); + aitem.AddInt32("attr:width",30); + aitem.AddInt32("attr:alignment",B_ALIGN_CENTER); + aitem.AddBool("attr:extra",false); + aitem.AddBool("attr:viewable",true); + aitem.AddBool("attr:editable",false); + + aitem.AddString("attr:name","bp:enclosure_url"); + aitem.AddString("attr:public_name","Enclosure URL"); + aitem.AddInt32("attr:type",B_STRING_TYPE); + aitem.AddInt32("attr:width",30); + aitem.AddInt32("attr:alignment",B_ALIGN_LEFT); + aitem.AddBool("attr:extra",false); + aitem.AddBool("attr:viewable",true); + aitem.AddBool("attr:editable",false); + + aitem.AddString("attr:name","bp:enclosure_path"); + aitem.AddString("attr:public_name","Enclosure Path"); + aitem.AddInt32("attr:type",B_STRING_TYPE); + aitem.AddInt32("attr:width",30); + aitem.AddInt32("attr:alignment",B_ALIGN_LEFT); + aitem.AddBool("attr:extra",false); + aitem.AddBool("attr:viewable",true); + aitem.AddBool("attr:editable",false); + + aitem.AddString("attr:name","bp:item_link"); + aitem.AddString("attr:public_name","Link"); + aitem.AddInt32("attr:type",B_STRING_TYPE); + aitem.AddInt32("attr:width",30); + aitem.AddInt32("attr:alignment",B_ALIGN_LEFT); + aitem.AddBool("attr:extra",false); + aitem.AddBool("attr:viewable",true); + aitem.AddBool("attr:editable",false); + + aitem.AddString("attr:name","bp:category"); + aitem.AddString("attr:public_name","Category"); + aitem.AddInt32("attr:type",B_STRING_TYPE); + aitem.AddInt32("attr:width",30); + aitem.AddInt32("attr:alignment",B_ALIGN_LEFT); + aitem.AddBool("attr:extra",false); + aitem.AddBool("attr:viewable",true); + aitem.AddBool("attr:editable",false); + + aitem.AddString("attr:name","bp:item_keywords"); + aitem.AddString("attr:public_name","Keywords"); + aitem.AddInt32("attr:type",B_STRING_TYPE); + aitem.AddInt32("attr:width",30); + aitem.AddInt32("attr:alignment",B_ALIGN_LEFT); + aitem.AddBool("attr:extra",false); + aitem.AddBool("attr:viewable",true); + aitem.AddBool("attr:editable",false); + + aitem.AddString("attr:name","bp:enclosure_type"); + aitem.AddString("attr:public_name","Enclosure Type"); + aitem.AddInt32("attr:type",B_STRING_TYPE); + aitem.AddInt32("attr:width",30); + aitem.AddInt32("attr:alignment",B_ALIGN_LEFT); + aitem.AddBool("attr:extra",false); + aitem.AddBool("attr:viewable",true); + aitem.AddBool("attr:editable",false); + +// aitem.AddString("revision","1.2"); + + item.SetAttrInfo(&aitem); + if(item.Install()!=B_OK) + printf("Error Installing!\n"); + + BMimeType ch(MIME_ARCHIVED_CHANNEL); + + if (ch.IsInstalled()) { + BMessage info; + BString revision; + if( ch.GetAttrInfo(&info) == B_OK && info.FindString("revision",&revision)==B_OK && revision.ICompare("1.2")==0) + return; + ch.Delete(); + } + + printf("Installing Archived Channel MimeType..\n"); + + ch.SetShortDescription("BePodder Archived Channel"); + + BMessage ach; +// ach.AddString("revision","1.2"); + + ch.SetAttrInfo(&ach); + if(ch.Install()!=B_OK) + printf("Error Installing!\n"); +} diff --git a/sources-experimental/TheApp.h b/sources-experimental/TheApp.h new file mode 100644 index 0000000..2c7bae6 --- /dev/null +++ b/sources-experimental/TheApp.h @@ -0,0 +1,31 @@ +#include + +#include "MainWindow.h" +#include "MainController.h" + +class TheApp : public BApplication { + +public: + TheApp(const char * signature); + + void MessageReceived(BMessage*); + void ArgvReceived(int32 argc, char **argv) ; + + void AboutRequested(); + void ReadyToRun(); + bool QuitRequested(); + + void ChekUpdate(); + +private: + + void InstallMimeTypes(); + + + void ApplySettings(); + void ApplyWindowSettings(); + + MainController* fController; + + +}; diff --git a/sources-experimental/TitleTextRender.cpp b/sources-experimental/TitleTextRender.cpp new file mode 100644 index 0000000..0ff589e --- /dev/null +++ b/sources-experimental/TitleTextRender.cpp @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#include "TitleTextRender.h" + + +TitleTextRender::TitleTextRender(){ + fFont = *be_bold_font; + +}; + +TitleTextRender::TitleTextRender(BFont font){ + fFont = font; + +}; + +TitleTextRender::~TitleTextRender(){ +} + +void +TitleTextRender::Render(BView *target,const char* txt,int16 num,BPoint pos,BRect r){ + target->SetFont(&fFont); + target->DrawString(txt,num,pos); + target->StrokeLine(pos + BPoint(0,1) , pos + BPoint(fFont.StringWidth(txt),1),B_MIXED_COLORS); +} + +void +TitleTextRender::GetHeight(font_height *height){ + fFont.GetHeight(height); + height->ascent += 5; + height->descent +=5; +} + +void +TitleTextRender::GetEscapements(const char charArray[], int32 numChars,float escapementArray[]){ + fFont.GetEscapements(charArray,numChars,escapementArray); +} + +float +TitleTextRender::Size(float maxwidth){ + return fFont.Size(); +} diff --git a/sources-experimental/TitleTextRender.h b/sources-experimental/TitleTextRender.h new file mode 100644 index 0000000..ad7030e --- /dev/null +++ b/sources-experimental/TitleTextRender.h @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + + +#ifndef _TitleTextRender_H_ +#define _TitleTextRender_H_ + +#include +#include +#include "TextRender.h" + +class TitleTextRender : public TextRender +{ + public: + TitleTextRender(); + TitleTextRender(BFont font); + virtual ~TitleTextRender(); + + void Render(BView *target,const char*,int16 num,BPoint pos,BRect r); + void GetHeight(font_height *height); + void GetEscapements(const char charArray[], int32 numChars,float escapementArray[]); + float Size(float maxwidth); + + // + + private: + BFont fFont; +}; +#endif diff --git a/sources-experimental/XMLChannelExtractor.cpp b/sources-experimental/XMLChannelExtractor.cpp new file mode 100644 index 0000000..d2d583d --- /dev/null +++ b/sources-experimental/XMLChannelExtractor.cpp @@ -0,0 +1,286 @@ +#include "XMLChannelExtractor.h" + +#include "libxml/tree.h" +#include "libxml/xpath.h" +#include "libxml/xpathInternals.h" +#include "libxml/parserInternals.h" +#include "libxml/debugXML.h" + +#include "RssItem.h" + +#include "curl/curl.h" + +#include "MemoryArchive.h" + +//#define CHANNEL_QUERY "/rss/channel" +#define CHANNEL_QUERY "//*[local-name()='channel']" + +#define FEED_QUERY "//*[local-name()='feed']" + +//#define ITEM_QUERY "/rss/channel/item" +//#define ITEM_QUERY "//*[local-name()='item']" +//#define ENTRY_QUERY "//*[local-name()='entry']" + + +#define START_QUERY "//*[local-name()='" +#define END_QUERY "']" + +BList* +XMLChannelExtractor::Parse(BString filename){ + + BList* list=NULL; + + xmlParserCtxtPtr ctxt = xmlNewParserCtxt(); + xmlDocPtr doc = xmlCtxtReadFile(ctxt, filename.String(), NULL, XML_PARSE_RECOVER|XML_PARSE_NOBLANKS|XML_PARSE_NOCDATA); + xmlXPathContextPtr pathCtxt = xmlXPathNewContext(doc); + + BString elementType("item"); + + //testing code! + { + xmlXPathObjectPtr itemNode = xmlXPathEvalExpression((const xmlChar *)CHANNEL_QUERY, pathCtxt); + if (itemNode == NULL) { + xmlFreeParserCtxt(ctxt); + xmlXPathFreeContext(pathCtxt); + xmlXPathFreeObject(itemNode); + return NULL; + }; + //only one channel per rss file! + if(itemNode->nodesetval == NULL || itemNode->nodesetval->nodeNr !=1){ + //we can try to search for a 'feed' + xmlXPathFreeObject(itemNode); + itemNode = xmlXPathEvalExpression((const xmlChar *)FEED_QUERY, pathCtxt); + if (itemNode == NULL) { + xmlFreeParserCtxt(ctxt); + xmlXPathFreeContext(pathCtxt); + xmlXPathFreeObject(itemNode); + return NULL; + }; + if(itemNode->nodesetval == NULL || itemNode->nodesetval->nodeNr !=1){ + xmlFreeParserCtxt(ctxt); + xmlXPathFreeContext(pathCtxt); + xmlXPathFreeObject(itemNode); + return NULL; + } + elementType.SetTo("entry"); + + }; + + ParseChannel(itemNode->nodesetval->nodeTab[0]->children,elementType); + + /* + Testing code. + + */ + + //parsing the channel's attributes.. + + + + } + + BString elementQuery(START_QUERY); + elementQuery << elementType << END_QUERY; + + if (pathCtxt != NULL) { + xmlXPathObjectPtr itemNode = xmlXPathEvalExpression((const xmlChar *)elementQuery.String(), pathCtxt); + if (itemNode == NULL) { + xmlFreeParserCtxt(ctxt); + xmlXPathFreeContext(pathCtxt); + xmlXPathFreeObject(itemNode); + return NULL; + }; + + xmlNodeSetPtr items = itemNode->nodesetval; + if (items == NULL) { + xmlFreeParserCtxt(ctxt); + xmlXPathFreeContext(pathCtxt); + xmlXPathFreeObject(itemNode); + return NULL; + }; + + + + list=new BList(items->nodeNr); + + for (int32 i = 0; i < items->nodeNr; i++) { + + MemoryArchive *ma=new MemoryArchive(); + + RssItem rss; + rss.AddElementListener(ma); + + fItemExtractor.SetNotifier(&rss); + fItemExtractor.Parse(items->nodeTab[i]->children); + + rss.SetFileStatus(NEW); + + + if( rss.Guid() != "" ) + list->AddItem((void*)ma); + else + if( rss.EnclosureLink() != "") { + rss.SetGuid(rss.EnclosureLink().String()); + list->AddItem((void*)ma); + } + else + if( ma->GetDataString(ITEM_LINK) !=""){ + rss.SetGuid(ma->GetDataString(ITEM_LINK).String()); + list->AddItem((void*)ma); + } + else + if(ma->GetDataString(ITEM_PUBDATE) !=""){ + rss.SetGuid(ma->GetDataString(ITEM_PUBDATE) .String()); + list->AddItem((void*)ma,0); + } + else + { + rss.RemoveElementListener(ma); + delete ma; //! + ma = NULL; + } + + //post process fixes: + + if(ma) { + if(ma->GetDataString(ITEM_PUBDATE) =="") { + //if no data, add the now date! + time_t when = real_time_clock() - i; + ma->SetKey(ITEM_PUBDATE,(void*)&when,(ssize_t)sizeof(time_t)); + } + if(ma->GetDataString(ITEM_LINK) == ma->GetDataString(ITEM_ENCLOSURE_URL)){ + ma->SetKeyString(ITEM_LINK,""); + } + if(ma->GetDataString(ITEM_TITLE) == "" && ma->GetDataString(ITEM_ENCLOSURE_LOCALPATH) != ""){ + ma->SetKeyString(ITEM_TITLE,ma->GetDataString(ITEM_ENCLOSURE_LOCALPATH).String()); + } + if(ma->GetDataString(ITEM_DESCRIPTION) == "" && ma->GetDataString(ITEM_SUMMARY) != ""){ + ma->SetKeyString(ITEM_DESCRIPTION,ma->GetDataString(ITEM_SUMMARY).String()); + } + } + + rss.RemoveElementListener(ma); + } + xmlXPathFreeObject(itemNode); + }; + + xmlFreeParserCtxt(ctxt); + xmlXPathFreeContext(pathCtxt); + + return list; +} + + +int +XMLChannelExtractor::ParseChannel(xmlNodePtr node,BString leaf){ + + xmlNode *cur_node = NULL; + BString currentCategory(""); + + for (cur_node = node; cur_node; cur_node = cur_node->next) { + if (cur_node->type == XML_ELEMENT_NODE) { + + // printf("ParseChannel type: Element, name: %s %s\n", cur_node->name,cur_node->content); + + BString bname((const char*)cur_node->name); + + if (cur_node->children && (cur_node->children->type == XML_TEXT_NODE || cur_node->children->type == XML_CDATA_SECTION_NODE) ) { + + //text element.. + if(bname.ICompare("title") == 0){ + BString title((const char*)cur_node->children->content); + title.RemoveAll("\n"); + NotifyString(CHANNEL_TITLE,title.String()); + } + else + if(bname.ICompare("link") == 0){ + NotifyString(CHANNEL_WEBLINK,(const char*)cur_node->children->content); + } + + else if(bname.ICompare("description") == 0 && cur_node->children != NULL){ + NotifyString(CHANNEL_DESCRIPTION,(const char*)cur_node->children->content); + } + + /* + else if(bname.ICompare("link") == 0){ + NotifyString(,(const char*)cur_node->children->content); + } + else if(bname.ICompare("pubDate") == 0){ + time_t when = curl_getdate((const char*)cur_node->children->content,NULL); + NotifyNotifier(,(void*)&when,sizeof(time_t)); + } + */ + } + + //non text element like only attributes or sub-elemnt(not handled) + { + if(bname.ICompare("image") == 0) + { + _parseImage(cur_node); + }//end - image + else + if(bname.ICompare("category") == 0){ + + BString cat =XMLItemExtractor::_parseCategory(cur_node); + if(cat != "") + currentCategory << " " << cat; //NotifyNotifier(CHANNEL_CATEGORY,(void*)cat.String(),cat.Length()); + } + else + if(bname.ICompare(leaf) == 0) + goto finished; + + } + + } + } + + finished: + if(currentCategory != "") + NotifyNotifier(CHANNEL_CATEGORY,(void*)currentCategory.String(),currentCategory.Length()); + return 0; +} + +void +XMLChannelExtractor::_parseImage(xmlNode* cur_node){ + + xmlAttr *attr = cur_node->properties; + + xmlAttr *cur_attr = NULL; + for (cur_attr = attr; cur_attr; cur_attr = cur_attr->next) { + + BString battr((const char*)cur_attr->name); + + if(battr.ICompare("href") == 0) + { + xmlNodePtr node = cur_attr->children; + //if(node) printf("value %s \n",node->content); + + BString imageURL ; + imageURL << (const char*)node->content; + + NotifyNotifier(CHANNEL_IMAGE_URL,(void*)imageURL.String(),imageURL.Length()); + return; + + } + } //end of for. + + + xmlNode *sub_node = NULL; + if(!cur_node->children) return; + + for (sub_node = cur_node->children; sub_node; sub_node = sub_node->next) { + BString sub_name((const char*)sub_node->name); + if(sub_name.ICompare("url") == 0 ){ + if (sub_node->children && sub_node->children->type == XML_TEXT_NODE){ + //save the url! + BString imageURL ; + imageURL << (const char*)sub_node->children->content; + NotifyNotifier(CHANNEL_IMAGE_URL,(void*)imageURL.String(),imageURL.Length()); + return; + } + } + }// end sub_image! +} + + + diff --git a/sources-experimental/XMLChannelExtractor.h b/sources-experimental/XMLChannelExtractor.h new file mode 100644 index 0000000..482a7d0 --- /dev/null +++ b/sources-experimental/XMLChannelExtractor.h @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#ifndef XMLChannelExtractor_H_ +#define XMLChannelExtractor_H_ + +#include "Extractor.h" +#include "XMLItemExtractor.h" + + +class MemoryArchive; + +class XMLChannelExtractor : public Extractor +{ + + public: + BList* Parse(BString filename); + + private: + XMLItemExtractor fItemExtractor; + int ParseChannel(xmlNodePtr node,BString leaf); + void _parseImage(xmlNodePtr node); +}; +#endif diff --git a/sources-experimental/XMLItemExtractor.cpp b/sources-experimental/XMLItemExtractor.cpp new file mode 100644 index 0000000..9ddf6dd --- /dev/null +++ b/sources-experimental/XMLItemExtractor.cpp @@ -0,0 +1,202 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + + +#include "XMLItemExtractor.h" +#include "curl/curl.h" +#include "FileStatus.h" + + +int +XMLItemExtractor::Parse(xmlNodePtr node){ + + xmlNode *cur_node = NULL; + BString currentCategory(""); + + for (cur_node = node; cur_node; cur_node = cur_node->next) { + if (cur_node->type == XML_ELEMENT_NODE) { + //printf("node type: Element, name: %s %s\n", cur_node->name,cur_node->content); + + BString bname((const char*)cur_node->name); + + if (cur_node->children && (cur_node->children->type == XML_TEXT_NODE || cur_node->children->type == XML_CDATA_SECTION_NODE) ) { + + //text elemnt. + if(bname.ICompare("title") == 0){ + NotifyString(ITEM_TITLE,(const char*)xmlNodeGetContent(cur_node->children)); + } + else if(bname.ICompare("guid") == 0){ + NotifyString(ITEM_GUID,(const char*)cur_node->children->content); + } + else if(bname.ICompare("id") == 0){ //ATOM 0.3 support... + NotifyString(ITEM_GUID,(const char*)cur_node->children->content); + } + else if(bname.ICompare("link") == 0){ + NotifyString(ITEM_LINK,(const char*)cur_node->children->content); + } + else if(bname.ICompare("pubDate") == 0){ + time_t when = curl_getdate((const char*)cur_node->children->content,NULL); + if(when < 0){ + //? not rfc822 ?? + } + NotifyNotifier(ITEM_PUBDATE,(void*)&when,sizeof(time_t)); + } + else if(bname.ICompare("keywords") == 0){ + NotifyString(ITEM_KEYWORDS,(const char*)cur_node->children->content); + } + } + + + if(bname.ICompare("description") == 0 && cur_node->children != NULL){ + NotifyString(ITEM_DESCRIPTION,(const char*)cur_node->children->content); + } + else + if(bname.ICompare("summary") == 0 && cur_node->children != NULL){ + NotifyString(ITEM_SUMMARY,(const char*)cur_node->children->content); + } + + + { + //non text elemnt like only attributes or sub-elemnt(not handled) + if(bname.ICompare("enclosure") == 0){ + + // managing the enclosure: + // FIX + NotifyInt32(ITEM_ENCLOSURE_FILE_STATUS,NOT_DOWNLOADED); + xmlAttr *attr = cur_node->properties; + + + + xmlAttr *cur_attr = NULL; + for (cur_attr = attr; cur_attr; cur_attr = cur_attr->next) { + + BString battr((const char*)cur_attr->name); + //printf("attr url (%ld): %s\n",i,attr->name ); + + if(battr.ICompare("url") == 0){ + xmlNodePtr node = cur_attr->children; + //if(node) printf("value %s \n",node->content); + + BString imageURL ; //= GetNodeContents(node); + imageURL << (const char*)node->content; + imageURL.RemoveAll("\n"); + + BString leaf(imageURL.String()); + int32 last_pos = leaf.FindLast("/"); + + leaf.Remove(0,last_pos+1); + + //printf("outut name: [%s]\n",leaf.String()); + + NotifyNotifier(ITEM_ENCLOSURE_URL,(void*)imageURL.String(),imageURL.Length()); + NotifyNotifier(ITEM_ENCLOSURE_LOCALPATH,(void*)leaf.String(),leaf.Length()); + //fs = 0; + //NotifyNotifier(ITEM_ENCLOSURE_FILE_STATUS,&fs,sizeof(FileStatus)); + + } + else if(battr.ICompare("length") == 0){ + xmlNodePtr node = cur_attr->children; + if(node) { + //printf("size %s \n",node->content); + off_t size = atoll((const char*)node->content); + NotifyNotifier(ITEM_ENCLOSURE_LENGTH,(void*)&size,sizeof(off_t)); + } + + } + else if(battr.ICompare("type") == 0){ + xmlNodePtr node = cur_attr->children; + if(node) { + //printf("type %s \n",node->content); + NotifyString(ITEM_ENCLOSURE_TYPE,(const char*)node->content); + } + } + + } + } + else + if(bname.ICompare("category") == 0){ + BString cat =XMLItemExtractor::_parseCategory(cur_node); + if(cat != "") + currentCategory << " " << cat; + } + + continue; + } + } + } + + if(currentCategory != "") + NotifyNotifier(CHANNEL_CATEGORY,(void*)currentCategory.String(),currentCategory.Length()); + + return 0; +} + + + +BString +XMLItemExtractor::_parseCategory(xmlNode* cur_node){ + + /* + + + + */ + + //debugger("category!"); + + BString categoryString; + + categoryString = _extractCategoryText(cur_node); //TOP LEVEL CATEGORY + + if(categoryString == "") return NULL; //safety (should never happen) + + + + xmlNode *sub_node = NULL; + if(!cur_node->children) return categoryString; + + for (sub_node = cur_node->children; sub_node; sub_node = sub_node->next) { + BString sub_name((const char*)sub_node->name); + if(sub_name.ICompare("category") == 0 ){ + BString sub_category = _extractCategoryText(sub_node); + if(sub_category != ""){ + categoryString << " "; + categoryString << sub_category; + } + } + } + + //add to the archive + return categoryString; + //NotifyNotifier(CHANNEL_CATEGORY,(void*)categoryString.String(),categoryString.Length()); +} + + +BString +XMLItemExtractor::_extractCategoryText(xmlNodePtr cur_node){ + + xmlAttr *attr = cur_node->properties; + + xmlAttr *cur_attr = NULL; + for (cur_attr = attr; cur_attr; cur_attr = cur_attr->next) { + + BString battr((const char*)cur_attr->name); + + if(battr.ICompare("text") == 0) + { + xmlNodePtr node = cur_attr->children; + + BString category ; + category << (const char*)node->content; + + return category; + + } + } //end of for. + + return NULL; +} + diff --git a/sources-experimental/XMLItemExtractor.h b/sources-experimental/XMLItemExtractor.h new file mode 100644 index 0000000..63ecb51 --- /dev/null +++ b/sources-experimental/XMLItemExtractor.h @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2005 by Andrea Anzani + * oxygenum@tiscali.it + * +*/ + +#ifndef XMLItemExtractor_H_ +#define XMLItemExtractor_H_ + +#include "Extractor.h" + +#include "libxml/tree.h" +#include "libxml/xpath.h" +#include "libxml/xpathInternals.h" +#include "libxml/parserInternals.h" +#include "libxml/debugXML.h" + + +class XMLItemExtractor : public Extractor +{ + + public: + + int Parse(xmlNodePtr node); + + + //general purpose: + + static BString _parseCategory(xmlNodePtr node); + static BString _extractCategoryText(xmlNodePtr node); + +}; +#endif diff --git a/sources-experimental/htmlparse.cpp b/sources-experimental/htmlparse.cpp new file mode 100644 index 0000000..f8a77a4 --- /dev/null +++ b/sources-experimental/htmlparse.cpp @@ -0,0 +1,216 @@ +#include +#include +#include + +#include +#include "htmlparse.h" + +void encode_html( BString &msg ) { + // BStrings are slow and sucky, but this is real easy + msg.ReplaceAll("&","&"); + msg.ReplaceAll("\"","""); + msg.ReplaceAll("<","<"); + msg.ReplaceAll(">",">"); + + msg.ReplaceAll("[b]",""); + msg.ReplaceAll("[/b]",""); + msg.ReplaceAll("[i]",""); + msg.ReplaceAll("[/i]",""); + + msg.Prepend(""); + msg.Append(""); +} + +int +parse_html_2( char * msg, int size, char** to, int* tosize ){ + + return 0; +} + + +int parse_html( char * msg , int size ) +{ + + //-- pre parser --// + BString preparser(msg); +// preparser.ReplaceAll("\n"," "); + preparser.ReplaceAll("\r"," "); + preparser.ReplaceAll("\t"," "); + preparser.ReplaceAll("à","à"); //should be illegal! + preparser.ReplaceAll("è","è"); //should be illegal! + preparser.ReplaceAll(" "," "); //should be illegal! + preparser.ReplaceAll("&","&"); + preparser.ReplaceAll(""","\""); + preparser.ReplaceAll(">",">"); + preparser.ReplaceAll("<","<"); + preparser.ReplaceAll("'","'"); + preparser.CopyInto(msg,0,preparser.Length()); + size = preparser.Length(); + //------------------// + + if(msg[size]!='\0') msg[size]='\0'; + + bool is_in_tag = false; + bool is_newline = true; + bool is_last_space = false; + int copy_pos = 0; + + char * copy = new char[size + 1]; + + memset(copy,'\0',size + 1); + + + for ( int i=0; msg[i]; i++ ) + { + switch ( msg[i] ) + { + case ' ': + if(!is_newline && !is_last_space) { + copy[copy_pos++] = msg[i]; + is_last_space=true; + } + + break; + + case '\n': + is_newline = true; + is_last_space=false; + copy[copy_pos++] = ' '; + break; + case '<': + is_last_space=false; + is_in_tag = true; + /*for (int j = i+1; msg[j]; j++) { + if (isspace(msg[j])) continue; + else if (tolower(msg[j]) == 'a') { + copy[copy_pos++] = '['; + copy[copy_pos++] = ' '; + for (; msg[j] && msg[j] != '='; j++); j++; + for (; msg[j] && isspace(msg[j]); j++); + if (msg[j] == '\"') j++; + for (; msg[j] && !isspace(msg[j]) && msg[j] != '\"'; j++) + copy[copy_pos++] = msg[j]; + copy[copy_pos++] = ' '; + copy[copy_pos++] = ']'; + copy[copy_pos++] = ' '; + } else break; + } + */ + //while( + is_newline = false; + break; + case '>': + is_in_tag = false; + is_newline = false; + is_last_space=false; + break; + case '&': + is_newline = false; + is_last_space=false; + if (strncmp(""",&msg[i],6) == 0) { + copy[copy_pos++] = '\"'; + i += 5; + break; + } + if (strncmp("<",&msg[i],4) == 0) { + copy[copy_pos++] = '<'; + i += 3; + break; + } + if (strncmp(">",&msg[i],4) == 0) { + copy[copy_pos++] = '>'; + i += 3; + break; + } + if (strncmp("&",&msg[i],5) == 0) { + copy[copy_pos++] = '&'; + i += 4; + break; + } + if (strncmp("&#",&msg[i],2) == 0) { + + + + //test code: + + unsigned n = 0, nb, j; + char bytes[6], b0; + + /* properties of UTF-8 chars >= a given value */ + static struct { unsigned minval; int len; char byte0; } + utf8prop[] = { + { 1<<26, 6, 0xfc }, + { 1<<21, 5, 0xf8 }, + { 1<<16, 4, 0xf0 }, + { 1<<11, 3, 0xe0 }, + { 1<<7, 2, 0xc0 }, + { 0, 1, } + }; + + char* buf=msg; + + i += 2; + n = 0; + if (buf[i] == 'x' || buf[i] == 'X') { + for (i++; buf[i] != ';'; i++) { + const char *hex = "0123456789abcdef", + *hex2 = "0123456789ABCDEF"; + char *s; + int c; + if ((s = strchr(hex, buf[i]))) + c = s - hex; + else if ((s = strchr(hex2, buf[i]))) + c = s - hex2; + else + goto invalid; + + n = (n << 4) | c; + } + } + else while (isdigit(buf[i])) + n = n*10+(buf[i++] - '0'); + if (!n || n > 1<<31 || buf[i] != ';') { + invalid: + //fprintf(stderr, "bad input sequence\n"); + break; + } + /* utf-8 encoding starts here */ + if (n < 0x80) { + copy[copy_pos++] = n; + break; + } + for (j = 0; n < utf8prop[j].minval; j++) + ; + nb = utf8prop[j].len; + b0 = utf8prop[j].byte0; + + for (j = nb; j; j--) { + bytes[j-1] = (n & 0x3f) | 0x80; + n >>= 6; + } + bytes[0] |= b0; + + for (j = 0; j < nb; j++) + copy[copy_pos++] = bytes[j]; + + break; + } + default: + is_newline = false; + is_last_space=false; + if ( !is_in_tag ) + { + copy[copy_pos++] = msg[i]; + } + } + } + + copy[copy_pos] = '\0'; + + + strncpy(msg, copy,copy_pos); + + + delete copy; + return copy_pos; +} diff --git a/sources-experimental/htmlparse.h b/sources-experimental/htmlparse.h new file mode 100644 index 0000000..cb55019 --- /dev/null +++ b/sources-experimental/htmlparse.h @@ -0,0 +1,12 @@ +#ifndef IMKIT_HTML_PARSE_H +#define IMKIT_HTML_PARSE_H + +#include + +int parse_html( char * msg, int size ); + +int parse_html_2( char * msg, int size, char** to, int* tosize ); + +void encode_html( BString &msg ); + +#endif // IMKIT_HTML_PARSE_H diff --git a/sources-experimental/owner.h b/sources-experimental/owner.h new file mode 100644 index 0000000..6444f73 --- /dev/null +++ b/sources-experimental/owner.h @@ -0,0 +1,3 @@ +#define VERSION_NAME "Appcaster (ALPHA)" +#define VERSION_ID "1.3.0" +#define EMAIL "bepodder.team@gmail.com" diff --git a/xres.output.rsrc b/xres.output.rsrc new file mode 100644 index 0000000..d98baac Binary files /dev/null and b/xres.output.rsrc differ