├── Makefile.in ├── Version.mk ├── acinclude.m4 ├── aclocal.m4 ├── android ├── AndroidManifest.xml ├── CMakeLists.txt ├── DWindows.kt └── dw.cpp ├── config.guess ├── config.sub ├── configure ├── configure.ac ├── debian ├── changelog ├── compat ├── control ├── copyright └── rules ├── dw.h ├── dw.hpp ├── dwcompat.c ├── dwcompat.h ├── dwconfig.h.in ├── dwindows-config.1 ├── dwindows-config1.in ├── dwindows1.pc.in ├── dwtest.c ├── dwtestoo.cpp ├── gtk ├── dw.c ├── file.xpm ├── folder.xpm ├── kill.xpm ├── maximize.xpm ├── messagebox_error.xpm ├── messagebox_information.xpm ├── messagebox_question.xpm ├── messagebox_warning.xpm └── minimize.xpm ├── gtk3 └── dw.c ├── gtk4 └── dw.c ├── image ├── test.bmp └── test.png ├── install-sh ├── ios └── dw.m ├── license.txt ├── mac ├── Info.plist ├── Info.template ├── PkgInfo ├── dw.m ├── file.png ├── finishup.sh └── folder.png ├── makefile.emx ├── makefile.mingw ├── makefile.vac ├── makefile.vc ├── makefile.wpm ├── mobile.txt ├── org.dbsoft.dwindows.dwtest.desktop.in ├── os2 ├── dirent.c ├── dw.c ├── dw.def ├── dw.lnk ├── dwcompat.def ├── dwcompat.lnk ├── dwtest.def ├── file.ico ├── folder.ico ├── readme-os2.txt └── svnrev.cmd ├── platform └── dirent.h ├── readme.txt ├── style.txt ├── template └── dw.c └── win ├── XBrowseForFolder.cpp ├── XBrowseForFolder.h ├── __SVN__.REV ├── browser.c ├── dirent.c ├── dw-mingw.def ├── dw.c ├── dw.def ├── dw.dll.x64.manifest ├── dw.dll.x86.manifest ├── dw.rc ├── dwcompat-mingw.def ├── dwcompat.def ├── dwtest.exe.x64.manifest ├── dwtest.exe.x86.manifest ├── dwtest.rc ├── edge.cpp ├── file.ico ├── folder.ico ├── readme-win.txt └── wintoast.cpp /Makefile.in: -------------------------------------------------------------------------------- 1 | srcdir=@srcdir@ 2 | mandir=@mandir@ 3 | CC = @CC@ 4 | CXX = @CXX@ 5 | PLATCCFLAGS = @PLATCCFLAGS@ 6 | MLFLAGS = -L. 7 | include $(srcdir)/Version.mk 8 | CCFLAGS = @CFLAGS@ $(PLATCCFLAGS) @ARCH@ -D@DW_DEFINE@ -DBUILD_DLL -DDW_RESOURCES -DVER_REV=$(VER_REV) 9 | CXXFLAGS= 10 | LFLAGS = @LIBS@ @ARCH@ 11 | ARFLAGS = @ARFLAGS@ 12 | INSTALL = @INSTALL@ 13 | DW_SRC = @DW_SRC@ 14 | DW_DIR = @DW_DIR@ 15 | INCPATH = -I.. -I. -I$(srcdir) 16 | TARGET = @TARGET@ 17 | SRCS = $(srcdir)/$(DW_DIR)/$(DW_SRC) 18 | BROWSER_OBJECT= @BROWSER_OBJECT@ 19 | COMPAT_OBJECT = @COMPAT_OBJECT@ 20 | INSTALL_COMPAT= @INSTALL_COMPAT@ 21 | INSTALL_TEST = @INSTALL_TEST@ 22 | OBJECTS = dw.o $(BROWSER_OBJECT) 23 | SRCS2 = $(srcdir)dwcompat.c 24 | OBJECTS2= $(COMPAT_OBJECT) 25 | TARGET2= @TARGET2@ 26 | TARGETS = @TARGETS@ 27 | VER_MAJ = $(DW_MAJOR_VERSION) 28 | VER_MIN = $(DW_MINOR_VERSION) 29 | VER_REV = @SVNVERSION@ 30 | SOSUFFIX= @SOSUFFIX@ 31 | SONAME = @SONAME@ 32 | LIBPREFIX = @LIBPREFIX@ 33 | LIBSUFFIX = @LIBSUFFIX@ 34 | prefix = $(DESTDIR)@prefix@ 35 | SRCDIR=dwindows-$(VER_MAJ).$(VER_MIN) 36 | 37 | #.SUFFIXES: .c .cpp .h .hpp 38 | 39 | #.c.o: 40 | # $(CC) -c $(CCFLAGS) $(INCPATH) -o $@ $< 41 | 42 | #.cpp.o: 43 | # $(CXX) -c $(CXXFLAGS) $(CCFLAGS) $(INCPATH) -o $@ $< 44 | 45 | 46 | # Link flags shared objects 47 | SYSCONF_LFLAGS_SHOBJ = @SHAREDFLAG@ 48 | 49 | # Linking shared libraries 50 | # - Build the $(TARGET) library, eg. lib$(TARGET).so.0.0 51 | # - Usually needs to incorporate $(VER_MAJ) and $(VER_MIN) 52 | # 53 | SYSCONF_LINK_SHLIB = @CC@ 54 | SYSCONF_LINK_TARGET_SHARED = @SYSCONF_LINK_TARGET_SHARED@ 55 | SYSCONF_LINK_LIB_SHARED = $(SYSCONF_LINK_SHLIB) $(SYSCONF_LFLAGS_SHOBJ) \ 56 | -o $(SYSCONF_LINK_TARGET_SHARED) \ 57 | $(OBJECTS) $(LFLAGS) $(SONAME); \ 58 | rm -f lib$(TARGET).$(SOSUFFIX) lib$(TARGET).$(SOSUFFIX).$(VER_MAJ); \ 59 | ln -s $(SYSCONF_LINK_TARGET_SHARED) lib$(TARGET).$(SOSUFFIX); \ 60 | ln -s $(SYSCONF_LINK_TARGET_SHARED) lib$(TARGET).$(SOSUFFIX).$(VER_MAJ) 61 | 62 | SYSCONF_LINK_TARGET_SHARED2 = @SYSCONF_LINK_TARGET_SHARED2@ 63 | SYSCONF_LINK_LIB_SHARED2 = $(SYSCONF_LINK_SHLIB) $(SYSCONF_LFLAGS_SHOBJ) \ 64 | -o $(SYSCONF_LINK_TARGET_SHARED2) \ 65 | $(OBJECTS2) $(LFLAGS); \ 66 | rm -f lib$(TARGET2).$(SOSUFFIX) lib$(TARGET2).$(SOSUFFIX).$(VER_MAJ); \ 67 | ln -s $(SYSCONF_LINK_TARGET_SHARED2) lib$(TARGET2).$(SOSUFFIX); \ 68 | ln -s $(SYSCONF_LINK_TARGET_SHARED2) lib$(TARGET2).$(SOSUFFIX).$(VER_MAJ) 69 | 70 | 71 | # Linking static libraries 72 | # - Build the $(TARGET) library, eg. lib$(TARGET).a 73 | # 74 | SYSCONF_AR = ar $(ARFLAGS) 75 | SYSCONF_LINK_TARGET_STATIC = @SYSCONF_LINK_TARGET_STATIC@ 76 | SYSCONF_LINK_LIB_STATIC = rm -f $(SYSCONF_LINK_TARGET_STATIC) ; \ 77 | $(SYSCONF_AR) $(SYSCONF_LINK_TARGET_STATIC) $(OBJECTS) 78 | 79 | 80 | 81 | ####### Build rules 82 | 83 | SYSCONF_LINK_TARGET = $(SYSCONF_LINK_TARGET_SHARED) 84 | SYSCONF_LINK_LIB = $(SYSCONF_LINK_LIB_SHARED) 85 | 86 | SYSCONF_LINK_TARGET2 = $(SYSCONF_LINK_TARGET_SHARED2) 87 | SYSCONF_LINK_LIB2 = $(SYSCONF_LINK_LIB_SHARED2) 88 | 89 | all: $(TARGETS) dwtest dwtestoo 90 | 91 | install: installbase $(INSTALL_COMPAT) $(INSTALL_TEST) 92 | 93 | installbase: $(SYSCONF_LINK_TARGET) 94 | $(INSTALL) -d $(prefix)/include; \ 95 | $(INSTALL) -d $(prefix)/lib; \ 96 | $(INSTALL) -d $(prefix)/bin; \ 97 | $(INSTALL) -d $(prefix)/share/man/man1; \ 98 | $(INSTALL) -d $(prefix)/lib/pkgconfig; \ 99 | $(INSTALL) $(srcdir)/dw.h $(prefix)/include; \ 100 | sed -e 's/@DW_MAJOR_VERSION@/'$(VER_MAJ)'/' -e 's/@DW_MINOR_VERSION@/'$(VER_MIN)'/' -e 's/@DW_SUB_VERSION@/'$(VER_REV)'/' < dwindows-config1 > dwindows-config 101 | $(INSTALL) dwindows-config $(prefix)/bin; \ 102 | sed -e 's/@VERSION@/'$(VER_MAJ).$(VER_MIN).$(VER_REV)'/' < dwindows1.pc > dwindows.pc 103 | $(INSTALL) dwindows.pc $(prefix)/lib/pkgconfig; \ 104 | $(INSTALL) $(srcdir)/dwindows-config.1 $(prefix)/share/man/man1; \ 105 | cd $(prefix)/share/man/man1; gzip -f -9 dwindows-config.1 106 | $(INSTALL) $(SYSCONF_LINK_TARGET) $(prefix)/lib; \ 107 | cd $(prefix)/lib; \ 108 | rm -f lib$(TARGET).so lib$(TARGET).so.$(VER_MAJ); \ 109 | ln -sf $(SYSCONF_LINK_TARGET_SHARED) lib$(TARGET).$(SOSUFFIX); \ 110 | ln -sf $(SYSCONF_LINK_TARGET_SHARED) lib$(TARGET).$(SOSUFFIX).$(VER_MAJ) 111 | 112 | installdwtest: dwtest 113 | $(INSTALL) -d $(prefix)/bin; \ 114 | $(INSTALL) -d $(prefix)/share/applications; \ 115 | $(INSTALL) -d $(prefix)/share/dwtest; \ 116 | $(INSTALL) dwtest $(prefix)/bin; \ 117 | $(INSTALL) dwtestoo $(prefix)/bin; \ 118 | $(INSTALL) org.dbsoft.dwindows.dwtest.desktop $(prefix)/share/applications/; \ 119 | $(INSTALL) image/test.png $(prefix)/share/dwtest; \ 120 | $(INSTALL) gtk/file.xpm $(prefix)/share/dwtest; \ 121 | $(INSTALL) gtk/folder.xpm $(prefix)/share/dwtest 122 | 123 | installdwcompat: $(SYSCONF_LINK_TARGET2) 124 | $(INSTALL) -d $(prefix)/lib; \ 125 | $(INSTALL) $(SYSCONF_LINK_TARGET2) $(prefix)/lib; \ 126 | $(INSTALL) $(srcdir)/dwcompat.h $(prefix)/include; \ 127 | $(INSTALL) $(srcdir)/dwconfig.h $(prefix)/include; \ 128 | cd $(prefix)/lib; \ 129 | rm -f lib$(TARGET2).$(SOSUFFIX) lib$(TARGET2).$(SOSUFFIX).$(VER_MAJ); \ 130 | ln -sf $(SYSCONF_LINK_TARGET_SHARED2) lib$(TARGET2).$(SOSUFFIX); \ 131 | ln -sf $(SYSCONF_LINK_TARGET_SHARED2) lib$(TARGET2).$(SOSUFFIX).$(VER_MAJ) 132 | 133 | uninstall: 134 | rm -f $(prefix)/lib/lib$(TARGET2).$(SOSUFFIX).$(VER_MAJ) 135 | rm -f $(prefix)/lib/lib$(TARGET2).$(SOSUFFIX) 136 | rm -f $(prefix)/lib/lib$(TARGET2).$(SOSUFFIX).$(VER_MAJ).$(VER_MIN) 137 | rm -f $(prefix)/lib/lib$(TARGET).$(SOSUFFIX).$(VER_MAJ) 138 | rm -f $(prefix)/lib/lib$(TARGET).$(SOSUFFIX) 139 | rm -f $(prefix)/lib/lib$(TARGET).$(SOSUFFIX).$(VER_MAJ).$(VER_MIN) 140 | rm -f $(prefix)/lib/pkgconfig/dwindows.pc 141 | rm -f $(prefix)/bin/dwindows-config 142 | rm -f $(prefix)/bin/dwtest 143 | rm -f $(prefix)/bin/dwtestoo 144 | rm -f $(prefix)/include/dwcompat.h 145 | rm -f $(prefix)/include/dwconfig.h 146 | rm -f $(prefix)/include/dw.h 147 | rm -f $(prefix)/share/applications/org.dbsoft.dwindows.dwtest.desktop 148 | rm -f $(prefix)/share/man/man1/dwindows-config.1.gz 149 | rm -f $(prefix)/share/dwtest/test.png 150 | rm -f $(prefix)/share/dwtest/file.xpm 151 | rm -f $(prefix)/share/dwtest/folder.xpm 152 | 153 | deb: dist 154 | -rm -fr tmp 155 | -mkdir tmp 156 | (cd tmp;tar zxvf ../../$(srcdir)/$(SRCDIR).tar.gz;cd $(SRCDIR);dpkg-buildpackage -rfakeroot;cd ..;ls -l) 157 | 158 | distclean: clean 159 | rm -f config.status config.log dwconfig.h 160 | rm -f dwindows-config dwindows-config1 dwindows.pc dwindows1.pc 161 | rm -f org.dbsoft.dwindows.dwtest.desktop 162 | rm -f Makefile 163 | 164 | clean: 165 | rm -f *.$(SOSUFFIX) 166 | rm -f *.$(SOSUFFIX).* 167 | rm -f *.o 168 | rm -f *~ 169 | rm -f *.a 170 | rm -f $(DW_DIR)/*.o 171 | rm -f dwtest 172 | rm -rf dwtest.app 173 | rm -f dwtestoo 174 | rm -rf dwtestoo.app 175 | 176 | $(SYSCONF_LINK_TARGET2): $(OBJECTS2) 177 | $(SYSCONF_LINK_LIB2) 178 | 179 | $(SYSCONF_LINK_TARGET): $(OBJECTS) 180 | $(SYSCONF_LINK_LIB) 181 | 182 | $(SYSCONF_LINK_TARGET_STATIC): $(OBJECTS) 183 | $(SYSCONF_LINK_LIB_STATIC) 184 | 185 | dw.o: $(srcdir)/$(DW_DIR)/$(DW_SRC) $(srcdir)/dw.h 186 | $(CC) -c $(INCPATH) $(CCFLAGS) -o $@ $(srcdir)/$(DW_DIR)/$(DW_SRC) 187 | 188 | browser.o: $(srcdir)/$(DW_DIR)/browser.cpp $(srcdir)/dw.h 189 | $(CXX) -c $(INCPATH) $(CCFLAGS) -o $@ $(srcdir)/$(DW_DIR)/browser.cpp 190 | 191 | dwcompat.o: $(srcdir)/dwcompat.c 192 | $(CC) -c $(INCPATH) $(CCFLAGS) -o $@ $(srcdir)/dwcompat.c 193 | 194 | dwtest.o: $(srcdir)/dwtest.c $(srcdir)/dw.h 195 | $(CC) -c $(INCPATH) $(CCFLAGS) -o $@ $(srcdir)/dwtest.c 196 | 197 | dwtest: dwtest.o 198 | $(CC) -o dwtest dwtest.o $(MLFLAGS) -l$(TARGET) $(LFLAGS) 199 | -chmod +x $(srcdir)/mac/finishup.sh 200 | -$(srcdir)/mac/finishup.sh "$(srcdir)" dwtest "$(CODESIGNIDENTITY)" 201 | 202 | dwtestoo.o: $(srcdir)/dwtestoo.cpp $(srcdir)/dw.h $(srcdir)/dw.hpp 203 | $(CXX) -c $(INCPATH) $(CXXFLAGS) $(CCFLAGS) -o $@ $(srcdir)/dwtestoo.cpp 204 | 205 | dwtestoo: dwtestoo.o 206 | $(CXX) -o dwtestoo dwtestoo.o $(MLFLAGS) -l$(TARGET) $(LFLAGS) -lstdc++ 207 | -chmod +x $(srcdir)/mac/finishup.sh 208 | -$(srcdir)/mac/finishup.sh "$(srcdir)" dwtestoo "$(CODESIGNIDENTITY)" 209 | 210 | zip: 211 | zip dwindows$(VER_MAJ)$(VER_MIN).zip $(srcdir)/*.txt $(srcdir)/makefile.* \ 212 | $(srcdir)/*.c $(srcdir)/dw.h $(srcdir)/dwcompat.h $(srcdir)/*.cpp $(srcdir)/*.hpp \ 213 | $(srcdir)/install.sh $(srcdir)/*.in $(srcdir)/*.ac $(srcdir)/configure $(srcdir)/Version.mk \ 214 | $(srcdir)/ac*.m4 $(srcdir)/dwindows-config.1 $(srcdir)/config.sub $(srcdir)/config.guess $(srcdir)/image/test.* \ 215 | $(srcdir)/win/*.c $(srcdir)/win/*.cpp $(srcdir)/win/*.h $(srcdir)/win/*.ico $(srcdir)/win/*.txt $(srcdir)/win/*.def $(srcdir)/win/*.rc $(srcdir)/win/*.manifest \ 216 | $(srcdir)/os2/*.c $(srcdir)/os2/*.ico $(srcdir)/os2/*.txt $(srcdir)/os2/*.def $(srcdir)/os2/*.lnk \ 217 | $(srcdir)/gtk/*.c $(srcdir)/gtk3/*.c $(srcdir)/gtk4/*.c $(srcdir)/gtk/*.xpm \ 218 | $(srcdir)/mac/Info.* $(srcdir)/mac/PkgInfo $(srcdir)/mac/*.m $(srcdir)/mac/*.sh $(srcdir)/mac/*.png \ 219 | $(srcdir)/ios/*.m $(srcdir)/android/*.cpp $(srcdir)/android/*.kt $(srcdir)/android/*.txt $(srcdir)/android/*.xml \ 220 | $(srcdir)/debian/control $(srcdir)/debian/rules $(srcdir)/debian/copyright $(srcdir)/debian/compat $(srcdir)/debian/changelog \ 221 | $(srcdir)/platform/*.h $(srcdir)/template/*.c 222 | 223 | dist: 224 | (cd $(srcdir)/..;ln -sf dwindows $(SRCDIR)) 225 | (cd $(srcdir)/..;tar -cvf - $(SRCDIR)/*.txt $(SRCDIR)/makefile.* $(SRCDIR)/*.c $(SRCDIR)/dw.h $(SRCDIR)/dwcompat.h \ 226 | $(SRCDIR)/*.cpp $(SRCDIR)/*.hpp $(SRCDIR)/install.sh $(SRCDIR)/*.in $(SRCDIR)/*.ac $(SRCDIR)/configure $(SRCDIR)/Version.mk \ 227 | $(SRCDIR)/ac*.m4 $(SRCDIR)/dwindows-config.1 $(SRCDIR)/config.sub $(SRCDIR)/config.guess $(SRCDIR)/image/test.* \ 228 | $(SRCDIR)/win/*.c $(SRCDIR)/win/*.cpp $(SRCDIR)/win/*.h $(SRCDIR)/win/*.txt $(SRCDIR)/win/*.def $(SRCDIR)/win/*.ico $(SRCDIR)/win/*.rc $(SRCDIR)/win/*.manifest \ 229 | $(SRCDIR)/os2/*.c $(SRCDIR)/os2/*.ico $(SRCDIR)/os2/*.txt $(SRCDIR)/os2/*.def $(SRCDIR)/os2/*.lnk \ 230 | $(SRCDIR)/gtk/*.c $(SRCDIR)/gtk3/*.c $(SRCDIR)/gtk4/*.c $(SRCDIR)/gtk/*.xpm \ 231 | $(SRCDIR)/mac/Info.* $(SRCDIR)/mac/PkgInfo $(SRCDIR)/mac/*.m $(SRCDIR)/mac/*.sh $(SRCDIR)/mac/*.png \ 232 | $(SRCDIR)/ios/*.m $(SRCDIR)/android/*.cpp $(SRCDIR)/android/*.kt $(SRCDIR)/android/*.txt $(SRCDIR)/android/*.xml \ 233 | $(SRCDIR)/debian/control $(SRCDIR)/debian/rules $(SRCDIR)/debian/copyright $(SRCDIR)/debian/compat $(SRCDIR)/debian/changelog \ 234 | $(SRCDIR)/platform/*.h $(SRCDIR)/template/*.c | gzip > $(SRCDIR).tar.gz ) 235 | (cd $(srcdir)/..;rm -f $(SRCDIR)) 236 | -------------------------------------------------------------------------------- /Version.mk: -------------------------------------------------------------------------------- 1 | # Set these here to change the version for all platforms 2 | DW_MAJOR_VERSION=3 3 | DW_MINOR_VERSION=4 4 | -------------------------------------------------------------------------------- /aclocal.m4: -------------------------------------------------------------------------------- 1 | # generated automatically by aclocal 1.16.5 -*- Autoconf -*- 2 | 3 | # Copyright (C) 1996-2021 Free Software Foundation, Inc. 4 | 5 | # This file is free software; the Free Software Foundation 6 | # gives unlimited permission to copy and/or distribute it, 7 | # with or without modifications, as long as this notice is preserved. 8 | 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 11 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 12 | # PARTICULAR PURPOSE. 13 | 14 | m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) 15 | # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- 16 | # serial 11 (pkg-config-0.29.1) 17 | 18 | dnl Copyright © 2004 Scott James Remnant . 19 | dnl Copyright © 2012-2015 Dan Nicholson 20 | dnl 21 | dnl This program is free software; you can redistribute it and/or modify 22 | dnl it under the terms of the GNU General Public License as published by 23 | dnl the Free Software Foundation; either version 2 of the License, or 24 | dnl (at your option) any later version. 25 | dnl 26 | dnl This program is distributed in the hope that it will be useful, but 27 | dnl WITHOUT ANY WARRANTY; without even the implied warranty of 28 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 29 | dnl General Public License for more details. 30 | dnl 31 | dnl You should have received a copy of the GNU General Public License 32 | dnl along with this program; if not, write to the Free Software 33 | dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 34 | dnl 02111-1307, USA. 35 | dnl 36 | dnl As a special exception to the GNU General Public License, if you 37 | dnl distribute this file as part of a program that contains a 38 | dnl configuration script generated by Autoconf, you may include it under 39 | dnl the same distribution terms that you use for the rest of that 40 | dnl program. 41 | 42 | dnl PKG_PREREQ(MIN-VERSION) 43 | dnl ----------------------- 44 | dnl Since: 0.29 45 | dnl 46 | dnl Verify that the version of the pkg-config macros are at least 47 | dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's 48 | dnl installed version of pkg-config, this checks the developer's version 49 | dnl of pkg.m4 when generating configure. 50 | dnl 51 | dnl To ensure that this macro is defined, also add: 52 | dnl m4_ifndef([PKG_PREREQ], 53 | dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) 54 | dnl 55 | dnl See the "Since" comment for each macro you use to see what version 56 | dnl of the macros you require. 57 | m4_defun([PKG_PREREQ], 58 | [m4_define([PKG_MACROS_VERSION], [0.29.1]) 59 | m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, 60 | [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) 61 | ])dnl PKG_PREREQ 62 | 63 | dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) 64 | dnl ---------------------------------- 65 | dnl Since: 0.16 66 | dnl 67 | dnl Search for the pkg-config tool and set the PKG_CONFIG variable to 68 | dnl first found in the path. Checks that the version of pkg-config found 69 | dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is 70 | dnl used since that's the first version where most current features of 71 | dnl pkg-config existed. 72 | AC_DEFUN([PKG_PROG_PKG_CONFIG], 73 | [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) 74 | m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) 75 | m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) 76 | AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) 77 | AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) 78 | AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) 79 | 80 | if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then 81 | AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) 82 | fi 83 | if test -n "$PKG_CONFIG"; then 84 | _pkg_min_version=m4_default([$1], [0.9.0]) 85 | AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) 86 | if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then 87 | AC_MSG_RESULT([yes]) 88 | else 89 | AC_MSG_RESULT([no]) 90 | PKG_CONFIG="" 91 | fi 92 | fi[]dnl 93 | ])dnl PKG_PROG_PKG_CONFIG 94 | 95 | dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 96 | dnl ------------------------------------------------------------------- 97 | dnl Since: 0.18 98 | dnl 99 | dnl Check to see whether a particular set of modules exists. Similar to 100 | dnl PKG_CHECK_MODULES(), but does not set variables or print errors. 101 | dnl 102 | dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 103 | dnl only at the first occurence in configure.ac, so if the first place 104 | dnl it's called might be skipped (such as if it is within an "if", you 105 | dnl have to call PKG_CHECK_EXISTS manually 106 | AC_DEFUN([PKG_CHECK_EXISTS], 107 | [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 108 | if test -n "$PKG_CONFIG" && \ 109 | AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then 110 | m4_default([$2], [:]) 111 | m4_ifvaln([$3], [else 112 | $3])dnl 113 | fi]) 114 | 115 | dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) 116 | dnl --------------------------------------------- 117 | dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting 118 | dnl pkg_failed based on the result. 119 | m4_define([_PKG_CONFIG], 120 | [if test -n "$$1"; then 121 | pkg_cv_[]$1="$$1" 122 | elif test -n "$PKG_CONFIG"; then 123 | PKG_CHECK_EXISTS([$3], 124 | [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` 125 | test "x$?" != "x0" && pkg_failed=yes ], 126 | [pkg_failed=yes]) 127 | else 128 | pkg_failed=untried 129 | fi[]dnl 130 | ])dnl _PKG_CONFIG 131 | 132 | dnl _PKG_SHORT_ERRORS_SUPPORTED 133 | dnl --------------------------- 134 | dnl Internal check to see if pkg-config supports short errors. 135 | AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], 136 | [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 137 | if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then 138 | _pkg_short_errors_supported=yes 139 | else 140 | _pkg_short_errors_supported=no 141 | fi[]dnl 142 | ])dnl _PKG_SHORT_ERRORS_SUPPORTED 143 | 144 | 145 | dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 146 | dnl [ACTION-IF-NOT-FOUND]) 147 | dnl -------------------------------------------------------------- 148 | dnl Since: 0.4.0 149 | dnl 150 | dnl Note that if there is a possibility the first call to 151 | dnl PKG_CHECK_MODULES might not happen, you should be sure to include an 152 | dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac 153 | AC_DEFUN([PKG_CHECK_MODULES], 154 | [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 155 | AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl 156 | AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl 157 | 158 | pkg_failed=no 159 | AC_MSG_CHECKING([for $1]) 160 | 161 | _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) 162 | _PKG_CONFIG([$1][_LIBS], [libs], [$2]) 163 | 164 | m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS 165 | and $1[]_LIBS to avoid the need to call pkg-config. 166 | See the pkg-config man page for more details.]) 167 | 168 | if test $pkg_failed = yes; then 169 | AC_MSG_RESULT([no]) 170 | _PKG_SHORT_ERRORS_SUPPORTED 171 | if test $_pkg_short_errors_supported = yes; then 172 | $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` 173 | else 174 | $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` 175 | fi 176 | # Put the nasty error message in config.log where it belongs 177 | echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD 178 | 179 | m4_default([$4], [AC_MSG_ERROR( 180 | [Package requirements ($2) were not met: 181 | 182 | $$1_PKG_ERRORS 183 | 184 | Consider adjusting the PKG_CONFIG_PATH environment variable if you 185 | installed software in a non-standard prefix. 186 | 187 | _PKG_TEXT])[]dnl 188 | ]) 189 | elif test $pkg_failed = untried; then 190 | AC_MSG_RESULT([no]) 191 | m4_default([$4], [AC_MSG_FAILURE( 192 | [The pkg-config script could not be found or is too old. Make sure it 193 | is in your PATH or set the PKG_CONFIG environment variable to the full 194 | path to pkg-config. 195 | 196 | _PKG_TEXT 197 | 198 | To get pkg-config, see .])[]dnl 199 | ]) 200 | else 201 | $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS 202 | $1[]_LIBS=$pkg_cv_[]$1[]_LIBS 203 | AC_MSG_RESULT([yes]) 204 | $3 205 | fi[]dnl 206 | ])dnl PKG_CHECK_MODULES 207 | 208 | 209 | dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 210 | dnl [ACTION-IF-NOT-FOUND]) 211 | dnl --------------------------------------------------------------------- 212 | dnl Since: 0.29 213 | dnl 214 | dnl Checks for existence of MODULES and gathers its build flags with 215 | dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags 216 | dnl and VARIABLE-PREFIX_LIBS from --libs. 217 | dnl 218 | dnl Note that if there is a possibility the first call to 219 | dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to 220 | dnl include an explicit call to PKG_PROG_PKG_CONFIG in your 221 | dnl configure.ac. 222 | AC_DEFUN([PKG_CHECK_MODULES_STATIC], 223 | [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 224 | _save_PKG_CONFIG=$PKG_CONFIG 225 | PKG_CONFIG="$PKG_CONFIG --static" 226 | PKG_CHECK_MODULES($@) 227 | PKG_CONFIG=$_save_PKG_CONFIG[]dnl 228 | ])dnl PKG_CHECK_MODULES_STATIC 229 | 230 | 231 | dnl PKG_INSTALLDIR([DIRECTORY]) 232 | dnl ------------------------- 233 | dnl Since: 0.27 234 | dnl 235 | dnl Substitutes the variable pkgconfigdir as the location where a module 236 | dnl should install pkg-config .pc files. By default the directory is 237 | dnl $libdir/pkgconfig, but the default can be changed by passing 238 | dnl DIRECTORY. The user can override through the --with-pkgconfigdir 239 | dnl parameter. 240 | AC_DEFUN([PKG_INSTALLDIR], 241 | [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) 242 | m4_pushdef([pkg_description], 243 | [pkg-config installation directory @<:@]pkg_default[@:>@]) 244 | AC_ARG_WITH([pkgconfigdir], 245 | [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, 246 | [with_pkgconfigdir=]pkg_default) 247 | AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) 248 | m4_popdef([pkg_default]) 249 | m4_popdef([pkg_description]) 250 | ])dnl PKG_INSTALLDIR 251 | 252 | 253 | dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) 254 | dnl -------------------------------- 255 | dnl Since: 0.27 256 | dnl 257 | dnl Substitutes the variable noarch_pkgconfigdir as the location where a 258 | dnl module should install arch-independent pkg-config .pc files. By 259 | dnl default the directory is $datadir/pkgconfig, but the default can be 260 | dnl changed by passing DIRECTORY. The user can override through the 261 | dnl --with-noarch-pkgconfigdir parameter. 262 | AC_DEFUN([PKG_NOARCH_INSTALLDIR], 263 | [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) 264 | m4_pushdef([pkg_description], 265 | [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) 266 | AC_ARG_WITH([noarch-pkgconfigdir], 267 | [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, 268 | [with_noarch_pkgconfigdir=]pkg_default) 269 | AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) 270 | m4_popdef([pkg_default]) 271 | m4_popdef([pkg_description]) 272 | ])dnl PKG_NOARCH_INSTALLDIR 273 | 274 | 275 | dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, 276 | dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 277 | dnl ------------------------------------------- 278 | dnl Since: 0.28 279 | dnl 280 | dnl Retrieves the value of the pkg-config variable for the given module. 281 | AC_DEFUN([PKG_CHECK_VAR], 282 | [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 283 | AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl 284 | 285 | _PKG_CONFIG([$1], [variable="][$3]["], [$2]) 286 | AS_VAR_COPY([$1], [pkg_cv_][$1]) 287 | 288 | AS_VAR_IF([$1], [""], [$5], [$4])dnl 289 | ])dnl PKG_CHECK_VAR 290 | 291 | dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, 292 | dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], 293 | dnl [DESCRIPTION], [DEFAULT]) 294 | dnl ------------------------------------------ 295 | dnl 296 | dnl Prepare a "--with-" configure option using the lowercase 297 | dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and 298 | dnl PKG_CHECK_MODULES in a single macro. 299 | AC_DEFUN([PKG_WITH_MODULES], 300 | [ 301 | m4_pushdef([with_arg], m4_tolower([$1])) 302 | 303 | m4_pushdef([description], 304 | [m4_default([$5], [build with ]with_arg[ support])]) 305 | 306 | m4_pushdef([def_arg], [m4_default([$6], [auto])]) 307 | m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes]) 308 | m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no]) 309 | 310 | m4_case(def_arg, 311 | [yes],[m4_pushdef([with_without], [--without-]with_arg)], 312 | [m4_pushdef([with_without],[--with-]with_arg)]) 313 | 314 | AC_ARG_WITH(with_arg, 315 | AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),, 316 | [AS_TR_SH([with_]with_arg)=def_arg]) 317 | 318 | AS_CASE([$AS_TR_SH([with_]with_arg)], 319 | [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)], 320 | [auto],[PKG_CHECK_MODULES([$1],[$2], 321 | [m4_n([def_action_if_found]) $3], 322 | [m4_n([def_action_if_not_found]) $4])]) 323 | 324 | m4_popdef([with_arg]) 325 | m4_popdef([description]) 326 | m4_popdef([def_arg]) 327 | 328 | ])dnl PKG_WITH_MODULES 329 | 330 | dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, 331 | dnl [DESCRIPTION], [DEFAULT]) 332 | dnl ----------------------------------------------- 333 | dnl 334 | dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES 335 | dnl check._[VARIABLE-PREFIX] is exported as make variable. 336 | AC_DEFUN([PKG_HAVE_WITH_MODULES], 337 | [ 338 | PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) 339 | 340 | AM_CONDITIONAL([HAVE_][$1], 341 | [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) 342 | ])dnl PKG_HAVE_WITH_MODULES 343 | 344 | dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, 345 | dnl [DESCRIPTION], [DEFAULT]) 346 | dnl ------------------------------------------------------ 347 | dnl 348 | dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after 349 | dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make 350 | dnl and preprocessor variable. 351 | AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES], 352 | [ 353 | PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4]) 354 | 355 | AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], 356 | [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) 357 | ])dnl PKG_HAVE_DEFINE_WITH_MODULES 358 | 359 | m4_include([acinclude.m4]) 360 | -------------------------------------------------------------------------------- /android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 17 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /android/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # For more information about using CMake with Android Studio, read the 2 | # documentation: https://d.android.com/studio/projects/add-native-code.html 3 | 4 | # Sets the minimum version of CMake required to build the native library. 5 | 6 | cmake_minimum_required(VERSION 3.10.2) 7 | 8 | # Declares and names the project. 9 | 10 | project("dwtest") 11 | 12 | # Creates and names a library, sets it as either STATIC 13 | # or SHARED, and provides the relative paths to its source code. 14 | # You can define multiple libraries, and CMake builds them for you. 15 | # Gradle automatically packages shared libraries with your APK. 16 | 17 | add_library( # Sets the name of the library. 18 | dwindows 19 | 20 | # Sets the library as a shared library. 21 | SHARED 22 | 23 | # Provides a relative path to your source file(s). 24 | dw.cpp dwtest.c ) 25 | 26 | # Searches for a specified prebuilt library and stores the path as a 27 | # variable. Because CMake includes system libraries in the search path by 28 | # default, you only need to specify the name of the public NDK library 29 | # you want to add. CMake verifies that the library exists before 30 | # completing its build. 31 | 32 | find_library( # Sets the name of the path variable. 33 | log-lib 34 | 35 | # Specifies the name of the NDK library that 36 | # you want CMake to locate. 37 | log ) 38 | 39 | # Specifies libraries CMake should link to your target library. You 40 | # can link multiple libraries, such as libraries you define in this 41 | # build script, prebuilt third-party libraries, or system libraries. 42 | 43 | target_link_libraries( # Specifies the target library. 44 | dwindows 45 | 46 | # Links the target library to the log library 47 | # included in the NDK. 48 | ${log-lib} ) -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | AC_INIT([dwindows],[3.3]) 2 | AC_CONFIG_HEADERS([dwconfig.h]) 3 | 4 | TARGET="dwindows" 5 | TARGET2="dwcompat" 6 | AC_SUBST(TARGET) 7 | AC_SUBST(TARGET2) 8 | 9 | AC_DEFUN([AC_DATAROOTDIR_CHECKED]) 10 | 11 | DW_DIR=gtk3 12 | DW_SRC=dw.c 13 | DW_DEFINE=__UNIX__ 14 | SHAREDFLAG=-shared 15 | SOSUFFIX=so 16 | LIBSUFFIX=a 17 | LIBPREFIX=lib 18 | INSTALL_TEST="installdwtest" 19 | INCLUDES="-I." 20 | 21 | AC_PROG_CC 22 | AC_PROG_CXX 23 | AX_CXX_COMPILE_STDCXX(11,,optional) 24 | 25 | AC_CHECK_PROG(MAKE, gmake, gmake) 26 | if test x"$MAKE" = x; then 27 | AC_CHECK_PROG(MAKE, make, make) 28 | fi 29 | if test -d .svn; then 30 | AC_CHECK_PROG(SVNVERSION, svnversion, svnversion) 31 | fi 32 | if test x"$SVNVERSION" = x; then 33 | SVNVERSION=0 34 | else 35 | SVNVERSION="\` $SVNVERSION -n . | cut -d \":\" -f 1 | tr -d MS \`" 36 | fi 37 | 38 | AC_PROG_INSTALL 39 | 40 | AC_SUBST(MAKE) 41 | 42 | dnl Checks for system 43 | AC_CANONICAL_TARGET 44 | 45 | dnl ---------------------- check for '--with-dwcompat' switch ----------------- 46 | AC_ARG_WITH(dwcompat, 47 | [ --with-dwcompat specify this to build the optional dwcompat library], 48 | [with_dwcompat=$withval], 49 | [with_dwcompat=no], 50 | ) 51 | 52 | dnl ---------------------- check for '--with-gtk2' switch ----------------- 53 | AC_ARG_WITH(gtk2, 54 | [ --with-gtk2 specify this to build with GTK+ 2.x if available], 55 | [with_gtk2=$withval], 56 | [with_gtk2=no], 57 | ) 58 | 59 | dnl ---------------------- check for '--with-gtk4' switch ----------------- 60 | AC_ARG_WITH(gtk4, 61 | [ --with-gtk4 specify this to build with GTK+ 4.x if available], 62 | [with_gtk4=$withval], 63 | [with_gtk4=no], 64 | ) 65 | 66 | dnl ---------------------- check for '--with-deprecated' switch ----------------- 67 | AC_ARG_WITH(deprecated, 68 | [ --with-deprecated specify this to build with deprecated functions], 69 | [with_deprecated=$withval], 70 | [with_deprecated=no], 71 | ) 72 | 73 | dnl ---------------------- check for '--with-arch' switch ----------------- 74 | AC_ARG_WITH(arch, 75 | [ --with-arch specify MacOS architecture: one of modern, classic, 32bit, intel, arm, powerpc], 76 | [with_arch=$withval], 77 | [with_arch=no], 78 | ) 79 | 80 | dnl ---------------------- check for '--with-sdk' switch ----------------- 81 | AC_ARG_WITH(sdk, 82 | [ --with-sdk specify this to build with an alternate MacOS SDK location], 83 | [with_sdk=$withval], 84 | [with_sdk=no], 85 | ) 86 | 87 | dnl ---------------------- check for '--with-minver' switch ----------------- 88 | AC_ARG_WITH(minver, 89 | [ --with-minver specify this to build with a minimum MacOS version], 90 | [with_minver=$withval], 91 | [with_minver=no], 92 | ) 93 | 94 | AC_HEADER_DIRENT 95 | AC_CHECK_HEADERS(unistd.h) 96 | AC_CHECK_HEADERS(sys/stat.h) 97 | 98 | AC_CHECK_FUNCS(pipe, AC_DEFINE(HAVE_PIPE,1,Determine whether we have the pipe function)) 99 | AC_CHECK_FUNCS(vsnprintf, AC_DEFINE(HAVE_VSNPRINTF,1,Determine whether we have the vsnprintf function)) 100 | 101 | AC_CHECK_FUNCS(connect) 102 | if test x"$ac_cv_func_connect" = x"no"; then 103 | if test -z "$libsocket"; then 104 | AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket",) 105 | fi 106 | 107 | dnl this is for isc. need the nsl_s library as well. 108 | if test -z "$libinet"; then 109 | AC_CHECK_LIB(inet, socket, libnsl=1; LIBS="$LIBS -linet -lnsl_s",) 110 | fi 111 | 112 | if test -z "$libnsl"; then 113 | AC_CHECK_LIB(nsl, gethostname, LIBS="$LIBS -lnsl",) 114 | fi 115 | fi 116 | 117 | AC_CHECK_LIB(sun, getpwnam, LIBS="$LIBS -lsun",) 118 | AC_CHECK_LIB(dgc, inet_addr, LIBS="$LIBS -ldgc",) 119 | AC_CHECK_LIB(resolv, gethostbyname, LIBS="$LIBS -lresolv",) 120 | AC_CHECK_LIB(m, atan2, LIBS="$LIBS -lm",) 121 | 122 | build_gtk="yes" 123 | check_pthreads="yes" 124 | PLATLIBS="" 125 | SONAME="" 126 | PLATCCFLAGS="-g -O2 -fPIC -Wall" 127 | ARFLAGS="cqs" 128 | ARCH="" 129 | 130 | case "$target" in 131 | *linux*) 132 | SONAME="-Wl,-soname,lib$TARGET.so.\$(DW_MAJOR_VERSION)" 133 | ;; 134 | *apple-darwin*) 135 | case "$with_arch" in 136 | no) 137 | ARCH="" 138 | ;; 139 | classic) 140 | ARCH="-arch ppc -arch x86_64 -arch i386" 141 | ;; 142 | 32bit) 143 | ARCH="-arch ppc -arch i386" 144 | ;; 145 | intel) 146 | ARCH="-arch i386 -arch x86_64" 147 | ;; 148 | powerpc) 149 | ARCH="-arch ppc -arch ppc64" 150 | ;; 151 | arm) 152 | ARCH="-arch arm64" 153 | ;; 154 | modern) 155 | ARCH="-arch x86_64 -arch arm64" 156 | ;; 157 | *) 158 | ARCH="-arch $with_arch" 159 | ;; 160 | esac 161 | case "$with_sdk" in 162 | no) 163 | ;; 164 | *) 165 | CC="$CC -isysroot$with_sdk" 166 | ;; 167 | esac 168 | case "$with_minver" in 169 | no) 170 | ;; 171 | *) 172 | CFLAGS="$CFLAGS -mmacosx-version-min=$with_minver" 173 | LIBS="$LIBS -mmacosx-version-min=$with_minver" 174 | ;; 175 | esac 176 | SHAREDFLAG="-dynamiclib -flat_namespace -undefined suppress -headerpad_max_install_names" 177 | SOSUFFIX=dylib 178 | DW_DIR=mac 179 | DW_SRC=dw.m 180 | DW_DEFINE=__MAC__ 181 | LIBS="$LIBS -framework Cocoa -framework WebKit" 182 | save_libs="$LIBS" 183 | LIBS="$LIBS -weak_framework UserNotifications" 184 | INSTALL_TEST="" 185 | AC_CHECK_FUNC(exit, , [LIBS="$save_libs"]) 186 | build_gtk="no" 187 | ;; 188 | *) 189 | ;; 190 | esac 191 | 192 | dnl ---------------------- default targets to build ----------------- 193 | if test $with_dwcompat = yes; then 194 | COMPAT_OBJECT="dwcompat.o" 195 | INSTALL_COMPAT="installdwcompat" 196 | SYSCONF_LINK_TARGET_SHARED2="lib$TARGET2.$SOSUFFIX.\$(DW_MAJOR_VERSION).\$(DW_MINOR_VERSION)" 197 | else 198 | COMPAT_OBJECT="" 199 | INSTALL_COMPAT="" 200 | SYSCONF_LINK_TARGET_SHARED2="" 201 | fi 202 | SYSCONF_LINK_TARGET_SHARED="lib$TARGET.$SOSUFFIX.\$(DW_MAJOR_VERSION).\$(DW_MINOR_VERSION)" 203 | SYSCONF_LINK_TARGET_STATIC="lib$TARGET.a" 204 | 205 | TARGETS="$SYSCONF_LINK_TARGET_SHARED $SYSCONF_LINK_TARGET_SHARED2" 206 | 207 | if test $build_gtk = "yes"; then 208 | AC_PATH_XTRA 209 | LIBS="$LIBS $X_LIBS -lX11" 210 | AC_CHECK_PROG(PKG_CFG, pkg-config, pkg-config) 211 | if test x"$PKG_CFG" != x; then 212 | # Figure out the best available GTK packages... 213 | # Preference order GTK3>GTK4>GTK2, WebKit2>WebKit1.1>WebKit1.0>WebKit 214 | GTK_LIBS="" 215 | GTK_PACKAGES="" 216 | WEBKIT_PKG="" 217 | WEBKIT_ALT_PKG="" 218 | if test $with_gtk4 = "yes"; then 219 | # First try the X11 version so we can call Xlib directly 220 | # to fill in the holes not available with Wayland 221 | GTK_PACKAGES="gtk4-x11" 222 | GTK_LIBS=`$PKG_CFG --silence-errors --libs $GTK_PACKAGES` 223 | if test x"$GTK_LIBS" = x; then 224 | GTK_PACKAGES="gtk4" 225 | GTK_LIBS=`$PKG_CFG --silence-errors --libs $GTK_PACKAGES` 226 | fi 227 | if test x"$GTK_LIBS" != x; then 228 | DW_DIR=gtk4 229 | # WebKit2GTK built for GTK4 becomes 5.0 or 6.0 230 | WEBKIT_PKG="webkitgtk-6.0" 231 | WEBKIT_ALT_PKG="webkit2gtk-5.0" 232 | fi 233 | else 234 | # Put the GTK2 test here since --with-gtk2 is mutually 235 | # exclusive with --with-gtk4 236 | if test $with_gtk2 = "yes"; then 237 | GTK_PACKAGES="gtk+-2.0 gthread-2.0" 238 | GTK_LIBS=`$PKG_CFG --silence-errors --libs $GTK_PACKAGES` 239 | if test x"$GTK_LIBS" != x; then 240 | DW_DIR=gtk 241 | WEBKIT_PKG="webkit-1.1" 242 | WEBKIT_ALT_PKG="webkit-1.0" 243 | fi 244 | fi 245 | fi 246 | # We did not successfully find a GTK installation after 247 | # handling --with-gtk2 and --with-gtk4 so try GTK3 248 | if test x"$GTK_LIBS" = x; then 249 | # GTK3 Defaults section 250 | GTK_PACKAGES="gtk+-3.0" 251 | GTK_LIBS=`$PKG_CFG --silence-errors --libs $GTK_PACKAGES` 252 | WEBKIT_PKG="webkit2gtk-4.0" 253 | WEBKIT_ALT_PKG="webkitgtk-3.0" 254 | fi 255 | echo "checking for GTK version: $DW_DIR" 256 | # Test for the preferred WebKit package 257 | WEBKIT_LIBS=`$PKG_CFG --silence-errors --libs $WEBKIT_PKG` 258 | if test x"$WEBKIT_LIBS" = x; then 259 | # Preferred package is not available, try the alternate if defined 260 | if test x"$WEBKIT_ALT_PKG" != x; then 261 | WEBKIT_LIBS=`$PKG_CFG --silence-errors --libs $WEBKIT_ALT_PKG` 262 | if test x"$WEBKIT_LIBS" != x; then 263 | WEBKIT_PKG=$WEBKIT_ALT_PKG 264 | fi 265 | fi 266 | fi 267 | echo "checking for WebKit package: $WEBKIT_PKG" 268 | WEBKIT_CFLAGS=`$PKG_CFG --silence-errors --cflags $WEBKIT_PKG` 269 | # If we got a WebKit package that might work... 270 | # Add defintitions necessary for the correct code paths 271 | if test x"$WEBKIT_LIBS" != x; then 272 | if test "$WEBKIT_PKG" = "webkit-1.0"; then 273 | AC_DEFINE(USE_WEBKIT10,1,Uses WebKit 1.0) 274 | fi 275 | if test "$WEBKIT_PKG" = "webkit-1.1"; then 276 | AC_DEFINE(USE_WEBKIT11,1,Uses WebKit 1.1) 277 | fi 278 | if test "$WEBKIT_PKG" = "webkit2gtk-4.0"; then 279 | AC_DEFINE(USE_WEBKIT2,1,Uses WebKit 2) 280 | fi 281 | if test "$WEBKIT_PKG" = "webkitgtk-6.0"; then 282 | AC_DEFINE(USE_WEBKIT6,1,Uses WebKit 6) 283 | fi 284 | fi 285 | if test x"$RPATH" != x; then 286 | RPATH="-Wl,-R$RPATH" 287 | fi 288 | fi 289 | 290 | GTK_CFLAGS=`$PKG_CFG --cflags $GTK_PACKAGES` 291 | GTK_LIBS=`$PKG_CFG --libs $GTK_PACKAGES` 292 | PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.32.0], [DW_GRESOURCE="enabled"], [CFLAGS="$CFLAGS -DDW_INCLUDE_DEPRECATED_RESOURCES=1"]) 293 | fi 294 | 295 | if test $check_pthreads = "yes"; then 296 | AC_CHECK_HEADER(pthread.h,,AC_MSG_ERROR([pthread header not found. Dynamic Windows cannot build without it.])) 297 | AC_CHECK_LIB(pthread, 298 | pthread_attr_init, 299 | PTHREAD_LIBS="-lpthread", 300 | AC_CHECK_LIB(pthreads, 301 | pthread_attr_init, 302 | PTHREAD_LIBS="-lpthreads", 303 | AC_CHECK_LIB(c_r, 304 | pthread_attr_init, 305 | PTHREAD_LIBS="-lc_r", 306 | AC_CHECK_LIB(c, 307 | pthread_attr_init, 308 | PTHREAD_LIBS="-lc", 309 | AC_MSG_ERROR(pthread library not found. dwindows cannot build without it.) 310 | ) 311 | ) 312 | ) 313 | ) 314 | fi 315 | 316 | CFLAGS="$CFLAGS $GTK_CFLAGS $GDK_IMLIB_FLAGS $WEBKIT_CFLAGS" 317 | 318 | if test $with_deprecated = yes; then 319 | CFLAGS="$CFLAGS -DDW_INCLUDE_DEPRECATED" 320 | fi 321 | if test x"$WEBKIT_LIBS" != x; then 322 | WEBKIT_LIB=`$PKG_CFG --silence-errors --libs-only-l $WEBKIT_PKG | cut -b 3-` 323 | AC_CHECK_LIB($WEBKIT_LIB,webkit_web_view_new,AC_DEFINE(USE_WEBKIT,1,Uses some flavor of WebKit),) 324 | fi 325 | 326 | LIBS="$RPATH $LIBS $GTK_LIBS $PTHREAD_LIBS $GDK_IMLIB_LIBS $WEBKIT_LIBS $PLATLIBS" 327 | 328 | AC_CHECK_FUNCS(ubuntu_overlay_scrollbar_set_enabled, AC_DEFINE(HAVE_OVERLAY_SCROLLBARS,1,Define if we have Ubuntu overlay scrollbars)) 329 | AC_CHECK_FUNCS(ubuntu_gtk_set_use_overlay_scrollbar, AC_DEFINE(HAVE_OVERLAY_SCROLLBARS2,1,Define if we have Ubuntu overlay scrollbars)) 330 | 331 | RM="rm -f" 332 | LN="ln -s" 333 | CP="cp" 334 | MV="mv" 335 | MKDIR="mkdir" 336 | 337 | AC_SUBST(SYSCONF_LINK_TARGET_SHARED) 338 | AC_SUBST(SYSCONF_LINK_TARGET_SHARED2) 339 | AC_SUBST(SYSCONF_LINK_TARGET_STATIC) 340 | 341 | AC_SUBST(INCLUDES) 342 | AC_SUBST(PLATCCFLAGS) 343 | AC_SUBST(ARFLAGS) 344 | AC_SUBST(RM) 345 | AC_SUBST(LN) 346 | AC_SUBST(CP) 347 | AC_SUBST(MV) 348 | AC_SUBST(MKDIR) 349 | AC_SUBST(SHAREDFLAG) 350 | AC_SUBST(SOSUFFIX) 351 | AC_SUBST(LIBSUFFIX) 352 | AC_SUBST(LIBPREFIX) 353 | AC_SUBST(SONAME) 354 | AC_SUBST(TARGETS) 355 | 356 | AC_SUBST(DW_SRC) 357 | AC_SUBST(DW_DIR) 358 | AC_SUBST(DW_DEFINE) 359 | AC_SUBST(DW_GRESOURCE) 360 | AC_SUBST(BROWSER_OBJECT) 361 | AC_SUBST(COMPAT_OBJECT) 362 | AC_SUBST(INSTALL_COMPAT) 363 | AC_SUBST(INSTALL_TEST) 364 | 365 | AC_SUBST(ARCH) 366 | 367 | AC_CONFIG_FILES([ 368 | Makefile 369 | dwindows1.pc 370 | dwindows-config1 371 | org.dbsoft.dwindows.dwtest.desktop ]) 372 | AC_OUTPUT 373 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: dwindows 2 | Section: devel 3 | Priority: optional 4 | Maintainer: Mark Hessling 5 | Build-Depends: debhelper (>= 5), autotools-dev 6 | Standards-Version: 3.7.2 7 | 8 | Package: dwindows 9 | Architecture: any 10 | Depends: ${shlibs:Depends} 11 | Description: Dynamic Windows is a lightweight GUI API for C. 12 | dwindows provides a high-level wrapper over GTK+ to provide 13 | a simple, lightweight GUI hiding some of the complexity of GTK+. 14 | It provides the same API for GTK+, native Windows, MacOS X and OS/2. 15 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | This package was debianized by Mark Hessling on 2 | Sun, 12 Apr 2009 13:18:35 +1000. 3 | 4 | Upstream Authors: 5 | 6 | Brian Smith 7 | Mark Hessling 8 | Nickolay V. Shmyrev 9 | Achim Hasenmueller 10 | Peter Nielsen 11 | Sergey I. Yevtushenko 12 | 13 | Copyright: 14 | 15 | Copyright (c) 2000-2022, Brian Smith 16 | Copyright (c) 2003-2022, Mark Hessling 17 | Copyright (c) 2019, Anton Popov 18 | Copyright (c) 2007, Alex Taylor 19 | Copyright (c) 2002, Nickolay V. Shmyrev 20 | Copyright (c) 2000, Achim Hasenmueller 21 | Copyright (c) 2000, Peter Nielsen 22 | Copyright (c) 1998, Sergey I. Yevtushenko 23 | All rights reserved. 24 | 25 | License: 26 | 27 | Redistribution and use in source and binary forms, with or without modification, 28 | are permitted provided that the following conditions are met: 29 | 30 | * Redistributions of source code must retain the above copyright notice, this 31 | list of conditions and the following disclaimer. 32 | * Redistributions in binary form must reproduce the above copyright notice, 33 | this list of conditions and the following disclaimer in the documentation and/or 34 | other materials provided with the distribution. 35 | * The names of its contributors may not be used to endorse or promote products 36 | derived from this software without specific prior written permission. 37 | 38 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 39 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 40 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 41 | THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 42 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 43 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 44 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 45 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 46 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 47 | 48 | The Debian packaging is (C) 2009-2011, Mark Hessling and 49 | is licensed under the GPL, see `/usr/share/common-licenses/GPL'. 50 | 51 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | # Sample debian/rules that uses debhelper. 4 | # This file was originally written by Joey Hess and Craig Small. 5 | # As a special exception, when this file is copied by dh-make into a 6 | # dh-make output file, you may use that output file without restriction. 7 | # This special exception was added by Craig Small in version 0.37 of dh-make. 8 | 9 | # Uncomment this to turn on verbose mode. 10 | #export DH_VERBOSE=1 11 | 12 | 13 | # These are used for cross-compiling and for saving the configure script 14 | # from having to guess our platform (since we know it already) 15 | DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) 16 | DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) 17 | 18 | 19 | config.status: configure 20 | dh_testdir 21 | # Add here commands to configure the package. 22 | ifneq "$(wildcard /usr/share/misc/config.sub)" "" 23 | cp -f /usr/share/misc/config.sub config.sub 24 | endif 25 | ifneq "$(wildcard /usr/share/misc/config.guess)" "" 26 | cp -f /usr/share/misc/config.guess config.guess 27 | endif 28 | ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs" 29 | 30 | 31 | build: build-stamp 32 | 33 | build-stamp: config.status 34 | dh_testdir 35 | 36 | # Add here commands to compile the package. 37 | $(MAKE) 38 | #docbook-to-man debian/dwindows.sgml > dwindows.1 39 | 40 | touch $@ 41 | 42 | clean: 43 | dh_testdir 44 | dh_testroot 45 | rm -f build-stamp 46 | 47 | # Add here commands to clean up after the build process. 48 | -$(MAKE) distclean 49 | rm -f config.sub config.guess 50 | 51 | dh_clean 52 | 53 | install: build 54 | dh_testdir 55 | dh_testroot 56 | dh_clean -k 57 | dh_installdirs 58 | 59 | # Add here commands to install the package into debian/dwindows. 60 | $(MAKE) prefix=$(CURDIR)/debian/dwindows/usr install 61 | 62 | 63 | # Build architecture-independent files here. 64 | binary-indep: build install 65 | # We have nothing to do by default. 66 | 67 | # Build architecture-dependent files here. 68 | binary-arch: build install 69 | dh_testdir 70 | dh_testroot 71 | dh_installchangelogs 72 | dh_installdocs 73 | dh_installexamples 74 | # dh_install 75 | # dh_installmenu 76 | # dh_installdebconf 77 | # dh_installlogrotate 78 | # dh_installemacsen 79 | # dh_installpam 80 | # dh_installmime 81 | # dh_python 82 | # dh_installinit 83 | # dh_installcron 84 | # dh_installinfo 85 | dh_installman 86 | dh_link 87 | dh_strip 88 | dh_compress 89 | dh_fixperms 90 | # dh_perl 91 | dh_makeshlibs 92 | dh_installdeb 93 | dh_shlibdeps 94 | dh_gencontrol 95 | dh_md5sums 96 | dh_builddeb 97 | 98 | binary: binary-indep binary-arch 99 | .PHONY: build clean binary-indep binary-arch binary install 100 | -------------------------------------------------------------------------------- /dwcompat.h: -------------------------------------------------------------------------------- 1 | /* $Id$ */ 2 | 3 | #ifndef _DWCOMPAT_H 4 | #define _DWCOMPAT_H 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | /* This header includes and defines everything needed for a given OS/compiler */ 11 | #if defined(__UNIX__) || defined(__MAC__) || defined(__IOS__) || defined(__ANDROID__) 12 | /* iOS and Android currently don't use autoconf */ 13 | #if !defined(__IOS__) && !defined(__ANDROID__) 14 | #include "dwconfig.h" 15 | #else 16 | #define HAVE_DIRENT_H 1 17 | #define HAVE_PIPE 1 18 | #define HAVE_VSNPRINTF 1 19 | #endif 20 | 21 | /* Attempt to include 64 bit file functions on various unix flavors */ 22 | #ifndef _FILE_OFFSET_BITS 23 | #define _FILE_OFFSET_BITS 64 24 | #endif 25 | #ifndef _LARGEFILE_SOURCE 26 | #define _LARGEFILE_SOURCE 1 27 | #endif 28 | #ifndef _LARGEFILE64_SOURCE 29 | #define _LARGEFILE64_SOURCE 1 30 | #endif 31 | #ifndef _LARGE_FILES 32 | #define _LARGE_FILES 1 33 | #endif 34 | #ifndef _DARWIN_USE_64_BIT_INODE 35 | #define _DARWIN_USE_64_BIT_INODE 1 36 | #endif 37 | 38 | #include 39 | #include 40 | void msleep(long period); 41 | #endif /* Unix */ 42 | 43 | #ifndef __TARGET__ 44 | #define __TARGET__ "dw" 45 | #endif 46 | 47 | #include 48 | #if HAVE_DIRENT_H 49 | #include 50 | #define NAMLEN(dirent) strlen((dirent)->d_name) 51 | #else 52 | #define dirent direct 53 | #define NAMLEN(dirent) (dirent)->d_namlen 54 | #if HAVE_SYS_NDIR_H 55 | #include 56 | #endif /* HAVE_SYS_NDIR_H */ 57 | #if HAVE_SYS_DIR_H 58 | #include 59 | #endif /* HAVE_SYS_DIR_H */ 60 | #if HAVE_NDIR_H 61 | #include 62 | #endif /* HAVE_NDIR_H */ 63 | #endif /* HAVE_DIRENT_H */ 64 | 65 | #ifdef DIRSEP 66 | #undef DIRSEP 67 | #endif 68 | 69 | #ifdef __WATCOMC__ 70 | #include 71 | #include 72 | #include 73 | # ifdef _stati64 74 | # ifdef stat 75 | # undef stat 76 | # endif 77 | # define stat(a, b) _stati64(a, b) 78 | # define dwstat _stati64 79 | # endif 80 | #endif 81 | 82 | #if defined(__EMX__) || defined(__OS2__) || defined(__WIN32__) || defined(WINNT) 83 | #include 84 | #include 85 | 86 | #define DIRSEP "\\" 87 | #define TYPDIR "." 88 | #else 89 | #define DIRSEP "/" 90 | #define TYPDIR "/usr/local/" __TARGET__ 91 | #endif 92 | #define INIDIR "~/." __TARGET__ 93 | 94 | /* OS/2 */ 95 | #if defined(__EMX__) || defined(__OS2__) 96 | #define INCL_WIN 97 | #define INCL_GPI 98 | #define INCL_VIO 99 | #define INCL_NLS 100 | #define INCL_DOS 101 | #define INCL_DEV 102 | #define INCL_DOSERRORS 103 | 104 | #ifdef __OS2__ 105 | # if (defined(__IBMC__) || defined(__WATCOMC__) || defined(_System)) && !defined(API) 106 | # define API _System 107 | # endif 108 | #endif 109 | 110 | #ifndef API 111 | #define API 112 | #endif 113 | 114 | #include 115 | 116 | /* Mostly safe but slow snprintf() for compilers that don't have it... 117 | * like VisualAge. So we can write safe code and still use VAC to test. 118 | */ 119 | #if defined(__IBMC__) && !defined(snprintf) 120 | #include 121 | #include 122 | #include 123 | static int _dw_snprintf(char *str, size_t size, const char *format, ...) 124 | { 125 | va_list args; 126 | char *outbuf = calloc(1, size + strlen(format) + 1024); 127 | int retval = -1; 128 | 129 | if(outbuf) 130 | { 131 | va_start(args, format); 132 | vsprintf(outbuf, format, args); 133 | va_end(args); 134 | retval = strlen(outbuf); 135 | strncpy(str, outbuf, size); 136 | free(outbuf); 137 | } 138 | return retval; 139 | } 140 | #define snprintf _dw_snprintf 141 | #endif 142 | 143 | 144 | #define msleep(a) DosSleep(a) 145 | 146 | #ifdef __EMX__ 147 | #include "platform/dirent.h" 148 | #include 149 | #ifdef FD_SETSIZE 150 | #undef FD_SETSIZE 151 | #endif 152 | #define FD_SETSIZE 1024 153 | #endif /* __EMX__ */ 154 | 155 | #if defined(__EMX__) || defined(__WATCOMC__) 156 | #define strcasecmp stricmp 157 | #define strncasecmp strnicmp 158 | #endif 159 | 160 | #ifndef OS2 161 | #define OS2 162 | #endif /* OS2 */ 163 | 164 | #include 165 | 166 | #ifndef BKS_TABBEDDIALOG 167 | #define BKS_TABBEDDIALOG 0x0800 168 | #endif 169 | 170 | #define PIPEROOT "\\socket" 171 | #endif /* __EMX__ || __IBMC__ */ 172 | 173 | #if defined(__OS2__) && (defined(__IBMC__) || defined(__WATCOMC__)) 174 | #define BSD_SELECT 175 | 176 | #include 177 | #include 178 | #include 179 | #include 180 | #include 181 | #include 182 | #include 183 | /* For VAC we are using the Mozilla dirent.c */ 184 | #ifndef __WATCOMC__ 185 | #include "platform/dirent.h" 186 | #endif 187 | #endif 188 | 189 | /* Windows */ 190 | #if defined(__WIN32__) || defined(WINNT) 191 | 192 | #if defined(MSVC) && !defined(API) 193 | # if defined(__MINGW32__) && defined(BUILD_DLL) 194 | # define API _cdecl __declspec(dllexport) 195 | # else 196 | # define API _cdecl 197 | # endif 198 | #endif 199 | 200 | #include 201 | #include 202 | #include 203 | #include 204 | #include 205 | 206 | #ifdef MSVC 207 | #include "platform/dirent.h" 208 | #undef alloca 209 | #define alloca _alloca 210 | #ifdef __stat64 211 | #undef stat 212 | #define stat(a, b) _stat64(a, b) 213 | #define dwstat __stat64 214 | #endif 215 | #include 216 | #else 217 | #include 218 | #include 219 | #endif 220 | 221 | #include 222 | 223 | /* Cygwin and Visual Studio 15.4 (SDK 10.0.16299.15) support domain sockets */ 224 | #if defined(__CYGWIN32__) 225 | #include 226 | #elif defined(_MSC_VER) && _MSC_VER >= 1912 227 | #include 228 | #define PIPEROOT getenv("TEMP") ? getenv("TEMP") : "C:\\Windows\\Temp" 229 | #else 230 | #define NO_DOMAIN_SOCKETS 231 | #endif 232 | 233 | #if defined(_P_NOWAIT) && !defined(P_NOWAIT) 234 | #define P_NOWAIT _P_NOWAIT 235 | #endif 236 | 237 | #ifdef _MSC_VER 238 | /* Handle deprecated functions in Visual C */ 239 | # if _MSC_VER < 1500 240 | # define vsnprintf _vsnprintf 241 | # endif 242 | #define HAVE_VSNPRINTF 243 | # if _MSC_VER >= 1400 244 | # define strcasecmp(a, b) _stricmp(a, b) 245 | # define strncasecmp(a, b, c) _strnicmp(a, b, c) 246 | # define strdup(a) _strdup(a) 247 | # define snprintf _snprintf 248 | # define unlink(a) _unlink(a) 249 | # define rmdir(a) _rmdir(a) 250 | # define close(a) _close(a) 251 | # define open(a, b) _open(a, b) 252 | # define read(a, b, c) _read(a, b, c) 253 | # define fdopen(a, b) _fdopen(a, b) 254 | # define getcwd(a, b) _getcwd(a, b) 255 | # define chdir(a) _chdir(a) 256 | # define getpid() _getpid() 257 | #ifndef _DW_INTERNAL 258 | # define mkdir(a,b) _mkdir(a) 259 | #endif 260 | # else 261 | # define strcasecmp(a, b) stricmp(a, b) 262 | # define strncasecmp(a, b, c) strnicmp(a, b, c) 263 | # endif 264 | #endif 265 | #define msleep(a) Sleep(a) 266 | 267 | #endif /* WIN32 */ 268 | 269 | /* Everything else ;) */ 270 | #include 271 | #ifdef HAVE_UNISTD_H 272 | #include 273 | #endif /* HAVE_UNISTD_H */ 274 | #ifdef HAVE_SYS_STAT_H 275 | #include 276 | #endif 277 | #include 278 | #include 279 | #include 280 | #include 281 | 282 | #if !defined(_MSC_VER) && !defined(__MINGW32__) 283 | #ifndef __WATCOMC__ 284 | #include 285 | #endif 286 | #include 287 | #include 288 | #include 289 | #include 290 | #ifndef __IBMC__ 291 | #include 292 | #endif 293 | #if defined(__OS2__) && defined(RES_DEFAULT) 294 | #undef RES_DEFAULT 295 | #endif 296 | #include 297 | #include 298 | #endif /* !_MSC_VER */ 299 | #include 300 | 301 | #ifndef _MAX_PATH 302 | #define _MAX_PATH 255 303 | #endif 304 | 305 | /* IBM C doesn't allow "t" in the mode parameter 306 | * because it violates the ANSI standard. 307 | */ 308 | #ifdef __IBMC__ 309 | #define FOPEN_READ_TEXT "r" 310 | #define FOPEN_WRITE_TEXT "w" 311 | #define FOPEN_APPEND_TEXT "a" 312 | #else 313 | #define FOPEN_READ_TEXT "rt" 314 | #define FOPEN_WRITE_TEXT "wt" 315 | #define FOPEN_APPEND_TEXT "at" 316 | #endif 317 | #define FOPEN_READ_BINARY "rb" 318 | #define FOPEN_WRITE_BINARY "wb" 319 | #define FOPEN_APPEND_BINARY "ab" 320 | 321 | #ifndef API 322 | #define API 323 | #endif 324 | 325 | #ifndef PIPEROOT 326 | #define PIPEROOT "/tmp" 327 | #endif 328 | 329 | #define PIPENAME "%s%s" __TARGET__ "%d-%d" 330 | 331 | /* Compatibility layer for IBM C/Winsock 332 | * Now using macros so we can allow cross 333 | * compiler support. 334 | */ 335 | 336 | #if defined(__IBMC__) || (defined(__WIN32__) && !defined(__CYGWIN32__)) 337 | #define sockread(a, b, c, d) recv(a, b, c, d) 338 | #else 339 | #define sockread(a, b, c, d) read(a, b, c) 340 | #endif 341 | 342 | #if defined(__IBMC__) || (defined(__WIN32__) && !defined(__CYGWIN32__)) 343 | #define sockwrite(a, b, c, d) send(a, b, c, d) 344 | #else 345 | #define sockwrite(a, b, c, d) write(a, b, c) 346 | #endif 347 | 348 | #ifdef __IBMC__ 349 | #define sockclose(a) soclose(a) 350 | #elif defined(__WIN32__) && !defined(__CYGWIN32__) 351 | #define sockclose(a) closesocket(a) 352 | #else 353 | #define sockclose(a) close(a) 354 | #endif 355 | 356 | #if defined(__OS2__) && !defined(__EMX__) 357 | #define nonblock(a) { int _nonblock = 1; ioctl(a, FIONBIO, (char *)&_nonblock, sizeof(_nonblock)); } 358 | #elif defined(__WIN32__) && !defined(__CYGWIN32__) 359 | #define nonblock(a) { int _nonblock = 1; ioctlsocket(a, FIONBIO, (unsigned long *)&_nonblock); } 360 | #else 361 | #define nonblock(a) fcntl(a, F_SETFL, O_NONBLOCK) 362 | #endif 363 | 364 | #if defined(__OS2__) && !defined(__EMX__) 365 | #define block(a) { int _block = 0; ioctl(a, FIONBIO, (char *)&_nonblock, sizeof(_block)); } 366 | #elif defined(__WIN32__) && !defined(__CYGWIN32__) 367 | #define block(a) { int _block = 0; ioctlsocket(a, FIONBIO, (unsigned long *)&_block); } 368 | #else 369 | #define block(a) fcntl(a, F_SETFL, 0) 370 | #endif 371 | 372 | #ifdef __IBMC__ 373 | #define sockinit() sock_init(); 374 | #elif defined(__WIN32__) || defined(WINNT) 375 | #define sockinit() { static WSADATA wsa; WSAStartup(MAKEWORD (2, 0), &wsa); } 376 | #else /* !WIN32 */ 377 | #define sockinit() 378 | #endif 379 | 380 | #if defined(__WIN32__) || defined(WINNT) 381 | #define sockshutdown() WSACleanup() 382 | #else /* !WIN32 */ 383 | #define sockshutdown() 384 | #endif 385 | 386 | #define oldsockpipe(pipes) { \ 387 | struct sockaddr_in server_addr; \ 388 | struct sockaddr_in listen_addr = { 0 }; \ 389 | int tmpsock, len = sizeof(struct sockaddr_in); \ 390 | struct hostent *he = gethostbyname("localhost"); \ 391 | pipes[0] = pipes[1] = -1; \ 392 | if(he) \ 393 | { \ 394 | memset(&server_addr, 0, sizeof(server_addr)); \ 395 | server_addr.sin_family = AF_INET; \ 396 | server_addr.sin_port = 0; \ 397 | server_addr.sin_addr.s_addr = INADDR_ANY; \ 398 | if ((tmpsock = socket(AF_INET, SOCK_STREAM, 0)) > -1 && bind(tmpsock, (struct sockaddr *)&server_addr, sizeof(server_addr)) > -1 && listen(tmpsock, 0) > -1) \ 399 | { \ 400 | memset(&listen_addr, 0, sizeof(listen_addr)); \ 401 | getsockname(tmpsock, (struct sockaddr *)&listen_addr, &len); \ 402 | server_addr.sin_family = AF_INET; \ 403 | server_addr.sin_port = listen_addr.sin_port; \ 404 | server_addr.sin_addr.s_addr = *((unsigned long *)he->h_addr); \ 405 | if((pipes[1] = socket(AF_INET, SOCK_STREAM, 0)) > -1 && !connect(pipes[1], (struct sockaddr *)&server_addr, sizeof(server_addr))) \ 406 | pipes[0] = accept(tmpsock, 0, 0); \ 407 | } \ 408 | if(tmpsock > -1) \ 409 | sockclose(tmpsock); \ 410 | } \ 411 | } 412 | 413 | #ifdef HAVE_PIPE 414 | #define sockpipe(pipes) { if(pipe(pipes) < 0) pipes[0] = pipes[1] = -1; } 415 | #elif !defined(NO_DOMAIN_SOCKETS) 416 | #define sockpipe(pipes) { \ 417 | struct sockaddr_un un; \ 418 | int tmpsock = socket(AF_UNIX, SOCK_STREAM, 0); \ 419 | pipes[0] = pipes[1] = -1; \ 420 | if(tmpsock > -1 && (pipes[1] = socket(AF_UNIX, SOCK_STREAM, 0)) > -1) \ 421 | { \ 422 | memset(&un, 0, sizeof(un)); \ 423 | un.sun_family=AF_UNIX; \ 424 | sprintf(un.sun_path, PIPENAME, PIPEROOT, DIRSEP, (int)getpid(), pipes[1]); \ 425 | unlink(un.sun_path); \ 426 | bind(tmpsock, (struct sockaddr *)&un, sizeof(un)); \ 427 | listen(tmpsock, 0); \ 428 | connect(pipes[1], (struct sockaddr *)&un, sizeof(un)); \ 429 | pipes[0] = accept(tmpsock, 0, 0); \ 430 | } else \ 431 | oldsockpipe(pipes); \ 432 | if(tmpsock > -1) \ 433 | sockclose(tmpsock); \ 434 | } 435 | #else 436 | #define sockpipe(pipes) oldsockpipe(pipes) 437 | #endif 438 | 439 | /* Ok Windows and OS/2 both seem to be missing these */ 440 | #if defined(__WIN32__) || defined(__OS2__) 441 | typedef int socklen_t; 442 | #ifndef _IN_ADDR_T_DECLARED 443 | typedef unsigned long in_addr_t; 444 | #endif 445 | #endif 446 | 447 | /* If dwstat didn't otherwise get defined */ 448 | #ifndef dwstat 449 | #define dwstat stat 450 | #endif 451 | 452 | /* Make sure O_BINARY is defined */ 453 | #ifndef O_BINARY 454 | #define O_BINARY 0 455 | #endif 456 | 457 | #if defined(__IBMC__) || defined(__WATCOMC__) || (defined(_MSC_VER) && _MSC_VER < 1400) || defined(__MINGW32__) || defined(__MINGW64__) 458 | #ifndef _DW_INTERNAL 459 | # undef mkdir 460 | # define mkdir(a,b) mkdir(a) 461 | #endif 462 | #endif 463 | 464 | #define socksprint(a, b) sockwrite(a, b, strlen(b), 0) 465 | 466 | char * API vargs(char *buf, int len, char *format, ...); 467 | int API makedir(char *path); 468 | void API setfileinfo(char *filename, char *url, char *logfile); 469 | #ifdef __MINGW32__ 470 | double API drivesize(int drive); 471 | double API drivefree(int drive); 472 | #else 473 | long double API drivesize(int drive); 474 | long double API drivefree(int drive); 475 | #endif 476 | int API isdrive(int drive); 477 | void API getfsname(int drive, char *buf, int len); 478 | FILE * API fsopen(char *path, char *modes); 479 | int API fsclose(FILE *fp); 480 | char * API fsgets(char *str, int size, FILE *stream); 481 | int API fsseek(FILE *stream, long offset, int whence); 482 | int API locale_init(char *filename, int my_locale); 483 | char * API locale_string(char *default_text, int message); 484 | void API nice_strformat(char *dest, long double val, int dec); 485 | void API initdir(int argc, char *argv[]); 486 | int API setpath(char *path); 487 | 488 | #ifdef __cplusplus 489 | } 490 | #endif 491 | 492 | #endif 493 | -------------------------------------------------------------------------------- /dwconfig.h.in: -------------------------------------------------------------------------------- 1 | /* dwconfig.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Define to 1 if you have the `connect' function. */ 4 | #undef HAVE_CONNECT 5 | 6 | /* define if the compiler supports basic C++11 syntax */ 7 | #undef HAVE_CXX11 8 | 9 | /* Define to 1 if you have the header file, and it defines `DIR'. 10 | */ 11 | #undef HAVE_DIRENT_H 12 | 13 | /* Define to 1 if you have the header file. */ 14 | #undef HAVE_INTTYPES_H 15 | 16 | /* Define to 1 if you have the header file, and it defines `DIR'. */ 17 | #undef HAVE_NDIR_H 18 | 19 | /* Define if we have Ubuntu overlay scrollbars */ 20 | #undef HAVE_OVERLAY_SCROLLBARS 21 | 22 | /* Define if we have Ubuntu overlay scrollbars */ 23 | #undef HAVE_OVERLAY_SCROLLBARS2 24 | 25 | /* Define to 1 if you have the `pipe' function. */ 26 | #undef HAVE_PIPE 27 | 28 | /* Define to 1 if you have the header file. */ 29 | #undef HAVE_STDINT_H 30 | 31 | /* Define to 1 if you have the header file. */ 32 | #undef HAVE_STDIO_H 33 | 34 | /* Define to 1 if you have the header file. */ 35 | #undef HAVE_STDLIB_H 36 | 37 | /* Define to 1 if you have the header file. */ 38 | #undef HAVE_STRINGS_H 39 | 40 | /* Define to 1 if you have the header file. */ 41 | #undef HAVE_STRING_H 42 | 43 | /* Define to 1 if you have the header file, and it defines `DIR'. 44 | */ 45 | #undef HAVE_SYS_DIR_H 46 | 47 | /* Define to 1 if you have the header file, and it defines `DIR'. 48 | */ 49 | #undef HAVE_SYS_NDIR_H 50 | 51 | /* Define to 1 if you have the header file. */ 52 | #undef HAVE_SYS_STAT_H 53 | 54 | /* Define to 1 if you have the header file. */ 55 | #undef HAVE_SYS_TYPES_H 56 | 57 | /* Define to 1 if you have the `ubuntu_gtk_set_use_overlay_scrollbar' 58 | function. */ 59 | #undef HAVE_UBUNTU_GTK_SET_USE_OVERLAY_SCROLLBAR 60 | 61 | /* Define to 1 if you have the `ubuntu_overlay_scrollbar_set_enabled' 62 | function. */ 63 | #undef HAVE_UBUNTU_OVERLAY_SCROLLBAR_SET_ENABLED 64 | 65 | /* Define to 1 if you have the header file. */ 66 | #undef HAVE_UNISTD_H 67 | 68 | /* Define to 1 if you have the `vsnprintf' function. */ 69 | #undef HAVE_VSNPRINTF 70 | 71 | /* Define to the address where bug reports for this package should be sent. */ 72 | #undef PACKAGE_BUGREPORT 73 | 74 | /* Define to the full name of this package. */ 75 | #undef PACKAGE_NAME 76 | 77 | /* Define to the full name and version of this package. */ 78 | #undef PACKAGE_STRING 79 | 80 | /* Define to the one symbol short name of this package. */ 81 | #undef PACKAGE_TARNAME 82 | 83 | /* Define to the home page for this package. */ 84 | #undef PACKAGE_URL 85 | 86 | /* Define to the version of this package. */ 87 | #undef PACKAGE_VERSION 88 | 89 | /* Define to 1 if all of the C90 standard headers exist (not just the ones 90 | required in a freestanding environment). This macro is provided for 91 | backward compatibility; new code need not use it. */ 92 | #undef STDC_HEADERS 93 | 94 | /* Uses some flavor of WebKit */ 95 | #undef USE_WEBKIT 96 | 97 | /* Uses WebKit 1.0 */ 98 | #undef USE_WEBKIT10 99 | 100 | /* Uses WebKit 1.1 */ 101 | #undef USE_WEBKIT11 102 | 103 | /* Uses WebKit 2 */ 104 | #undef USE_WEBKIT2 105 | 106 | /* Uses WebKit 6 */ 107 | #undef USE_WEBKIT6 108 | 109 | /* Define to 1 if the X Window System is missing or not being used. */ 110 | #undef X_DISPLAY_MISSING 111 | -------------------------------------------------------------------------------- /dwindows-config.1: -------------------------------------------------------------------------------- 1 | .TH dwindows-config 1 "12 Apr 2009" "dwindows" "GNU/Linux" 2 | .SH NAME 3 | dwindows-config \- get information about installed dwindows library 4 | .SH SYNOPSIS 5 | .B dwindows-config 6 | [\fIOPTION\fR] ... 7 | .SH DESCRIPTION 8 | Provides information about dwindows library. 9 | 10 | Known values for OPTION are: 11 | .TP 12 | \fB\-\-prefix\fR 13 | print dwindows prefix 14 | .TP 15 | \fB\-\-libs\fR 16 | print library linking information 17 | .TP 18 | \fB\-\-cflags\fR 19 | print preprocessor flags, I_opts, and compiler options 20 | .TP 21 | \fB\-\-help\fR 22 | print this help and exit 23 | .TP 24 | \fB\-\-version\fR 25 | print version information 26 | .SH "AUTHOR" 27 | This manpage has been written by Mark hessling 28 | based on libpng12-config.1. 29 | 30 | 31 | -------------------------------------------------------------------------------- /dwindows-config1.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | dw_libs="@LIBS@" 4 | dw_cflags="@CFLAGS@ -D@DW_DEFINE@" 5 | 6 | prefix=@prefix@ 7 | exec_prefix=@exec_prefix@ 8 | exec_prefix_set=no 9 | 10 | usage() 11 | { 12 | cat <&2 27 | fi 28 | 29 | while test $# -gt 0; do 30 | case "$1" in 31 | -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; 32 | *) optarg= ;; 33 | esac 34 | 35 | case $1 in 36 | --prefix=*) 37 | prefix=$optarg 38 | if test $exec_prefix_set = no ; then 39 | exec_prefix=$optarg 40 | fi 41 | ;; 42 | --prefix) 43 | echo_prefix=yes 44 | ;; 45 | --exec-prefix=*) 46 | exec_prefix=$optarg 47 | exec_prefix_set=yes 48 | ;; 49 | --version) 50 | echo @DW_MAJOR_VERSION@.@DW_MINOR_VERSION@.@DW_SUB_VERSION@ 51 | ;; 52 | --cflags) 53 | echo_cflags=yes 54 | ;; 55 | --libs) 56 | echo_libs=yes 57 | ;; 58 | --gresource) 59 | echo_gresource=yes 60 | ;; 61 | *) 62 | usage 1 1>&2 63 | ;; 64 | esac 65 | shift 66 | done 67 | 68 | if test "$echo_prefix" = "yes"; then 69 | echo $prefix 70 | fi 71 | 72 | if test "$echo_exec_prefix" = "yes"; then 73 | echo $exec_prefix 74 | fi 75 | 76 | if test "$echo_cflags" = "yes"; then 77 | echo -I${prefix}/include $dw_cflags 78 | fi 79 | 80 | if test "$echo_libs" = "yes"; then 81 | echo -L${prefix}/lib -ldwindows $dw_libs 82 | fi 83 | 84 | if test "$echo_gresource" = "yes"; then 85 | echo @DW_GRESOURCE@ 86 | fi 87 | 88 | -------------------------------------------------------------------------------- /dwindows1.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=${prefix} 3 | libdir=${exec_prefix}/lib 4 | includedir=${exec_prefix}/include 5 | 6 | Name: dwindows 7 | Description: Dynamic Windows Cross platform UI Toolkit 8 | Version: @VERSION@ 9 | Libs: -L${prefix}/lib -ldwindows @LIBS@ 10 | Cflags: -I${prefix}/include @CFLAGS@ -D@DW_DEFINE@ 11 | -------------------------------------------------------------------------------- /gtk/file.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char * FILE_xpm[] = { 3 | "16 16 16 1", 4 | " c None", 5 | ". c #000000", 6 | "+ c #D5FFFF", 7 | "@ c #F7F7F7", 8 | "# c #8092AA", 9 | "$ c #646464", 10 | "% c #AADBFF", 11 | "& c #F0F0F0", 12 | "* c #E8E8E8", 13 | "= c #D5DBFF", 14 | "- c #5592AA", 15 | "; c #E0E0E0", 16 | "> c #2B92FF", 17 | ", c #2B6DAA", 18 | "' c #556DAA", 19 | ") c #55DBFF", 20 | " ", 21 | " #########- ", 22 | " #@@@@@@@#)$ ", 23 | " #@@@@@@@>>,$ ", 24 | " #@@@@@@&==%-$ ", 25 | " #@@@@@@@+++=$ ", 26 | " #@@@@@@&+++=$ ", 27 | " #&&@*++%+++=$ ", 28 | " #&&&*++++++%$ ", 29 | " #**++%%%+++%$ ", 30 | " #**++++%%++%$ ", 31 | " -;;++%%%%%%%$ ", 32 | " -;+++++%%%%%$ ", 33 | " '###########$ ", 34 | " $$$$$$$$$$$$ ", 35 | " "}; 36 | -------------------------------------------------------------------------------- /gtk/folder.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char * FOLDER_xpm[] = { 3 | "16 16 10 1", 4 | " c None", 5 | ". c #000000", 6 | "+ c #AA9200", 7 | "@ c #FFFFAA", 8 | "# c #FFDB55", 9 | "$ c #AA6D00", 10 | "% c #F7F7F7", 11 | "& c #D59255", 12 | "* c #FFDBAA", 13 | "= c #D5B655", 14 | " ", 15 | " &&&& ", 16 | " &%%%%& ", 17 | "&%@@@@%+++++$ ", 18 | "&@@@@@@%%%%%$ ", 19 | "&@*++++++++++++ ", 20 | "&#+%%%%%%%%%*%+$", 21 | "&#+@@@@@@@@@#@+$", 22 | "&#+@@@@@@@@@.@+$", 23 | "&#+@@**@**@@=@+$", 24 | "&#+@########=@+$", 25 | "&#+@########=@+$", 26 | " ++++++++++++++$", 27 | " $$$$$$$$$$$$$ ", 28 | " ", 29 | " "}; 30 | -------------------------------------------------------------------------------- /gtk/kill.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char * kill_xpm[] = { 3 | /* width height num_colors chars_per_pixel */ 4 | "15 15 6 1", 5 | /* colors */ 6 | " c white", 7 | ". c #5f5f5f", 8 | "X c gray75", 9 | "o c black", 10 | "O c gray40", 11 | "+ c gray70", 12 | /* pixels */ 13 | " .", 14 | " XXXXXXXXXXXX..", 15 | " XoO++++++OoX..", 16 | " XOoO++++OoOX..", 17 | " X+OoO++OoO+X..", 18 | " X++OoOOoO++X..", 19 | " X+++OooO+++X..", 20 | " X+++OooO+++X..", 21 | " X++OoOOoO++X..", 22 | " X+OoO++OoO+X..", 23 | " XOoO++++OoOX..", 24 | " XoO++++++OoX..", 25 | " XXXXXXXXXXXX..", 26 | " ..............", 27 | "..............."}; 28 | -------------------------------------------------------------------------------- /gtk/maximize.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char * maximize_xpm[] = { 3 | /* width height num_colors chars_per_pixel */ 4 | "15 15 5 1", 5 | /* colors */ 6 | " c white", 7 | ". c #5f5f5f", 8 | "X c gray75", 9 | "o c gray70", 10 | "O c black", 11 | /* pixels */ 12 | " .", 13 | " XXXXXXXXXXXX..", 14 | " XooooooooooX..", 15 | " XoOOOOOOOOoX..", 16 | " XoOOOOOOOOoX..", 17 | " XoOOOOOOOOoX..", 18 | " XoOOOOOOOOoX..", 19 | " XoOOOOOOOOoX..", 20 | " XoOOOOOOOOoX..", 21 | " XoOOOOOOOOoX..", 22 | " XoOOOOOOOOoX..", 23 | " XooooooooooX..", 24 | " XXXXXXXXXXXX..", 25 | " ..............", 26 | "..............."}; 27 | -------------------------------------------------------------------------------- /gtk/messagebox_error.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char *_dw_messagebox_error[] = { 3 | /* columns rows colors chars-per-pixel */ 4 | "32 32 72 1", 5 | " c opaque", 6 | ". c #8b0000", 7 | "X c #930000", 8 | "o c #9b0000", 9 | "O c #9c0a0a", 10 | "+ c #a20000", 11 | "@ c #a10b0b", 12 | "# c #ab0000", 13 | "$ c #aa0a0a", 14 | "% c #ae1717", 15 | "& c #b30000", 16 | "* c #b70b0b", 17 | "= c #bb0000", 18 | "- c #b41414", 19 | "; c #c40000", 20 | ": c #ca0000", 21 | "> c #cd0909", 22 | ", c #ca1212", 23 | "< c #d10000", 24 | "1 c #d30b0b", 25 | "2 c #dc0000", 26 | "3 c #dd0909", 27 | "4 c #c72929", 28 | "5 c #cd2929", 29 | "6 c #d62929", 30 | "7 c #e40000", 31 | "8 c #ec0303", 32 | "9 c #ee1515", 33 | "0 c #eb1f1f", 34 | "q c #f20000", 35 | "w c #fd0202", 36 | "e c #f90808", 37 | "r c #f51616", 38 | "t c #f31818", 39 | "y c #fe1111", 40 | "u c #fe1c1c", 41 | "i c #ec2b2b", 42 | "p c #ed3f3f", 43 | "a c #f52222", 44 | "s c #f72c2c", 45 | "d c #fd2222", 46 | "f c #ff2828", 47 | "g c #f23636", 48 | "h c #f33c3c", 49 | "j c #fe3333", 50 | "k c #ff3f3f", 51 | "l c #ec4444", 52 | "z c #ff4545", 53 | "x c #ff4a4a", 54 | "c c #f75656", 55 | "v c #f75c5c", 56 | "b c #fe5555", 57 | "n c #ff6767", 58 | "m c #fc6b6b", 59 | "M c #f57272", 60 | "N c #fd7272", 61 | "B c #fc7979", 62 | "V c #ff8a8a", 63 | "C c #fe9090", 64 | "Z c #fd9c9c", 65 | "A c #fea2a2", 66 | "S c #feabab", 67 | "D c #ffb1b1", 68 | "F c #febcbc", 69 | "G c #ffc4c4", 70 | "H c #fecccc", 71 | "J c #ffd4d4", 72 | "K c #ffdbdb", 73 | "L c #ffe1e1", 74 | "P c #ffebeb", 75 | "I c white", 76 | "U c None", 77 | /* pixels */ 78 | "UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU", 79 | "UUUUUUUUUUU;;;;;=====UUUUUUUUUUU", 80 | "UUUUUUUU:::;;::::;;==&&&UUUUUUUU", 81 | "UUUUUUU::;:20vBBBBMi<;&&&UUUUUUU", 82 | "UUUUUU:::2cDPPPPPPPPHM1&&#UUUUUU", 83 | "UUUUU::..UU", 101 | "UU&&&tduuNISuuuuuuuuSINuuu9X..UU", 102 | "UUU&#*dfffbffffffffffbfffaO..UUU", 103 | "UUUU##,sjjjjjjjjjjjjjjjjj-..UUUU", 104 | "UUUUU##*gzkkkkkkzkkkkkzg@..UUUUU", 105 | "UUUUUU#+#6xxxxxxxxxxxz5X..UUUUUU", 106 | "UUUUUUU++o$5lbbbbbbl4O...UUUUUUU", 107 | "UUUUUUUU+ooooO-%%%O.....UUUUUUUU", 108 | "UUUUUUUUUUUooXXXXX...UUUUUUUUUUU", 109 | "UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU" 110 | }; 111 | -------------------------------------------------------------------------------- /gtk/messagebox_information.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char *_dw_messagebox_information[] = { 3 | /* columns rows colors chars-per-pixel */ 4 | "32 32 5 1", 5 | " c opaque", 6 | ". c blue", 7 | "X c gray60", 8 | "o c white", 9 | "O c None", 10 | /* pixels */ 11 | "OOOOOOOOOOOXXXXXXXXOOOOOOOOOOOOO", 12 | "OOOOOOOOXXXooooooooXXXOOOOOOOOOO", 13 | "OOOOOOXXooooooooooooooXXOOOOOOOO", 14 | "OOOOOXooooooooooooooooooXOOOOOOO", 15 | "OOOOXoooooooo....oooooooo OOOOOO", 16 | "OOOXoooooooo......oooooooo OOOOO", 17 | "OOXooooooooo......ooooooooo OOOO", 18 | "OXooooooooooo....ooooooooooo OOO", 19 | "OXoooooooooooooooooooooooooo XOO", 20 | "Xoooooooooooooooooooooooooooo O", 21 | "Xoooooooooo.......ooooooooooo O", 22 | "Xoooooooooooo.....ooooooooooo ", 23 | "Xoooooooooooo.....ooooooooooo ", 24 | "Xoooooooooooo.....ooooooooooo ", 25 | "Xoooooooooooo.....ooooooooooo ", 26 | "Xoooooooooooo.....ooooooooooo ", 27 | "OXooooooooooo.....oooooooooo ", 28 | "OXooooooooooo.....oooooooooo ", 29 | "OOXoooooooooo.....ooooooooo O", 30 | "OOO ooooooo.........oooooo O", 31 | "OOOO oooooooooooooooooooo OO", 32 | "OOOOO oooooooooooooooooo OOO", 33 | "OOOOOO oooooooooooooo OOOO", 34 | "OOOOOOOX oooooooo OOOOO", 35 | "OOOOOOOO oooo OOOOOO", 36 | "OOOOOOOOOO ooo OOOOOOOO", 37 | "OOOOOOOOOOOOO ooo OOOOOOOOOOO", 38 | "OOOOOOOOOOOOOOO oo OOOOOOOOOOO", 39 | "OOOOOOOOOOOOOOOO o OOOOOOOOOOO", 40 | "OOOOOOOOOOOOOOOOO OOOOOOOOOOO", 41 | "OOOOOOOOOOOOOOOOOO OOOOOOOOOOO", 42 | "OOOOOOOOOOOOOOOOOOO OOOOOOOOOOO" 43 | }; 44 | -------------------------------------------------------------------------------- /gtk/messagebox_question.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char *_dw_messagebox_question[] = { 3 | /* columns rows colors chars-per-pixel */ 4 | "32 32 96 2", 5 | " c opaque", 6 | ". c #00008b", 7 | "X c #000093", 8 | "o c #00009b", 9 | "O c #0a0a9b", 10 | "+ c #0000a3", 11 | "@ c #0000ab", 12 | "# c #0a0aab", 13 | "$ c #0000b3", 14 | "% c #0000bc", 15 | "& c #0000c3", 16 | "* c #0f0fc6", 17 | "= c #0000c9", 18 | "- c #0b0bcc", 19 | "; c #0101d5", 20 | ": c #0e0ed4", 21 | "> c #0000da", 22 | ", c #1111d5", 23 | "< c #1919d3", 24 | "1 c #1d1ddc", 25 | "2 c #2424c4", 26 | "3 c #3e3ecf", 27 | "4 c #2020d3", 28 | "5 c #2323da", 29 | "6 c #3030d5", 30 | "7 c #3030db", 31 | "8 c #3c3cde", 32 | "9 c #0000e2", 33 | "0 c #0d0de3", 34 | "q c #0202ea", 35 | "w c #1a1ae0", 36 | "e c #1919ec", 37 | "r c #0000f3", 38 | "t c #0a0af5", 39 | "y c #0000fc", 40 | "u c #0a0afe", 41 | "i c #1010f4", 42 | "p c #1414ff", 43 | "a c #1818ff", 44 | "s c #2020e5", 45 | "d c #2f2feb", 46 | "f c #3e3eeb", 47 | "g c #2020f4", 48 | "h c #2e2ef7", 49 | "j c #2020ff", 50 | "k c #2b2bfe", 51 | "l c #3030f4", 52 | "z c #3e3ef5", 53 | "x c #3535fe", 54 | "c c #3838f8", 55 | "v c #4b4bda", 56 | "b c #5252d4", 57 | "n c #5252da", 58 | "m c #4848eb", 59 | "M c #4545f6", 60 | "N c #4444ff", 61 | "B c #4d4dfe", 62 | "V c #5858f7", 63 | "C c #5252fd", 64 | "Z c #5858ff", 65 | "A c #6f6feb", 66 | "S c #6c6cf5", 67 | "D c #6363fd", 68 | "F c #6a6afe", 69 | "G c #7474fd", 70 | "H c #7b7bfe", 71 | "J c #8181d9", 72 | "K c #8383e4", 73 | "L c #8b8be8", 74 | "P c #9191eb", 75 | "I c #9c9ced", 76 | "U c #8282f5", 77 | "Y c #8080fc", 78 | "T c #8c8cfe", 79 | "R c #9d9df3", 80 | "E c #9292fd", 81 | "W c #9d9dfe", 82 | "Q c #a0a0ed", 83 | "! c #aeaeee", 84 | "~ c #bdbdea", 85 | "^ c #a3a3fc", 86 | "/ c #acacfe", 87 | "( c #b4b4f1", 88 | ") c #b5b5fb", 89 | "_ c #bfbffc", 90 | "` c #cfcfed", 91 | "' c #c1c1f6", 92 | "] c #c1c1fe", 93 | "[ c #ccccfe", 94 | "{ c #d1d1fe", 95 | "} c #dbdbfe", 96 | "| c #e1e1ff", 97 | " . c #eeeefc", 98 | ".. c #f1f1ff", 99 | "X. c white", 100 | "o. c None", 101 | /* pixels */ 102 | "o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.", 103 | "o.o.o.o.o.o.o.o.o.o.o.o.= = & & % % % % o.o.o.o.o.o.o.o.o.o.o.o.", 104 | "o.o.o.o.o.o.o.o.o.= = = & = % & & % % % $ % $ o.o.o.o.o.o.o.o.o.", 105 | "o.o.o.o.o.o.o.o.= = = = ; 9 d z z f > ; & $ $ $ o.o.o.o.o.o.o.o.", 106 | "o.o.o.o.o.o.= = = = 9 V ^ ............] G 1 $ $ @ $ o.o.o.o.o.o.", 107 | "o.o.o.o.o.= = = > M ] | | { I L ! ! ( } | | F : @ @ @ o.o.o.o.o.", 108 | "o.o.o.o.= = = 0 Y { { ) L ! X.X.X.X.X.~ ' { { / 5 @ + @ o.o.o.o.", 109 | "o.o.o.o.= = 9 W ] ] R L X.X.X.X.X.X.X.X.X.} ] _ ) 5 + + o.o.o.o.", 110 | "o.o.o.= = > F ) / ^ L X.X.X.X.X.X.X.X.X.X.X.] ) ) T - + + o.o.o.", 111 | "o.o.= = = h W W W A X.X.X.X.} ^ W / .X.X.X...W W W D + + o o.o.", 112 | "o.o.= = 9 H T T T P X.X.X. .T T T T U .X.X.X.E T T T , + o o.o.", 113 | "o.o.= = h H H H H R X.X.X./ H H H H S ~ X.X.X.W H Z c t + o o.o.", 114 | "o.= & ; B F F F F E X.X...G F F F F b X.X.X.X.l t q r r & o o o.", 115 | "o.& = 9 B Z Z Z Z Z T / F Z Z Z Z v ` X.X.X._ r r r r r ; o X o.", 116 | "o.& % q N N N N N N N N N N N N v .X.X.X...e r r r q r 9 o X o.", 117 | "o.& % t x x x x x x x x x x x 3 .X.X.X...l r r q r r r r X X o.", 118 | "o.% % t j j j j j j j j j j 4 .X.X.X. .l r r r r r r r r X X o.", 119 | "o.& % q p p u p p u p p p u J X.X.X.} l r r r r r r r r 9 X X o.", 120 | "o.% % 9 y y y y y y y y y r ~ X.X.X.l y r r r y r r r r ; X . o.", 121 | "o.% % ; y y y y y y y y y y ~ X.X.{ y y y y y y y y y y % . . o.", 122 | "o.o.% % y y y y y y y y y y Q X.X.Y y y y y y y y y y y o X o.o.", 123 | "o.o.$ $ 9 u u u u u u u u u a G F u u u u u u u u u u ; . . o.o.", 124 | "o.o.$ $ % p p a p p p p p p < K A l a a p p p p p p p o . . o.o.", 125 | "o.o.o.$ $ , j a j j j a a e ` X.X...h a a j j j j a * . . o.o.o.", 126 | "o.o.o.o.@ @ w k k k k x k w X.X.X.X.Z k k k k k k < . . o.o.o.o.", 127 | "o.o.o.o.@ @ @ 5 x x x x x l ..X.X.X.C x x x x x 4 . . . o.o.o.o.", 128 | "o.o.o.o.o.@ + + < N N N N N F ] { H N N N N N 2 . . . o.o.o.o.o.", 129 | "o.o.o.o.o.o.@ + + # 7 B C B B B B B B B B 6 O . . . o.o.o.o.o.o.", 130 | "o.o.o.o.o.o.o.o.+ + o # 2 8 m Z Z m 8 2 O . . . o.o.o.o.o.o.o.o.", 131 | "o.o.o.o.o.o.o.o.o.o o o o o X X X X . . . . . o.o.o.o.o.o.o.o.o.", 132 | "o.o.o.o.o.o.o.o.o.o.o.o.o X X X X X . . o.o.o.o.o.o.o.o.o.o.o.o.", 133 | "o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o.o." 134 | }; 135 | -------------------------------------------------------------------------------- /gtk/messagebox_warning.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char *_dw_messagebox_warning[] = { 3 | /* columns rows colors chars-per-pixel */ 4 | "32 32 134 2", 5 | " c opaque", 6 | ". c #1a1a1a", 7 | "X c #212121", 8 | "o c #2b2b2b", 9 | "O c #323225", 10 | "+ c #373737", 11 | "@ c #3c3c31", 12 | "# c #4c1c00", 13 | "$ c #572000", 14 | "% c #6d2800", 15 | "& c #742b00", 16 | "* c #46463c", 17 | "= c #6e6e16", 18 | "- c gray43", 19 | "; c #797979", 20 | ": c #823000", 21 | "> c #8a3300", 22 | ", c #943700", 23 | "< c #9e3b00", 24 | "1 c #a63e00", 25 | "2 c #a83e00", 26 | "3 c #b34200", 27 | "4 c #bb4500", 28 | "5 c #c54900", 29 | "6 c #cb4c00", 30 | "7 c #d14d00", 31 | "8 c #d35303", 32 | "9 c #d35408", 33 | "0 c #d55800", 34 | "q c #d85f00", 35 | "w c #d96400", 36 | "e c #da6b00", 37 | "r c #dd7100", 38 | "t c #dd7a00", 39 | "y c #e37b00", 40 | "u c #a9a91c", 41 | "i c #9a9a44", 42 | "p c #88886c", 43 | "a c #8b8b79", 44 | "s c #b5b54d", 45 | "d c #a7a776", 46 | "f c #e08500", 47 | "g c #e48b00", 48 | "h c #e98f01", 49 | "j c #e99002", 50 | "k c orange2", 51 | "l c #e9a100", 52 | "z c #eeac00", 53 | "x c #f2aa01", 54 | "c c #fcbf00", 55 | "v c #f9bf0d", 56 | "b c #f2c400", 57 | "n c #ffc700", 58 | "m c #f9cb06", 59 | "M c #f9cc0a", 60 | "N c #f4d303", 61 | "B c #f4d50c", 62 | "V c #f9dd00", 63 | "C c #fcda0c", 64 | "Z c #f5d610", 65 | "A c #fcdb13", 66 | "S c #ffd32e", 67 | "D c #ffd925", 68 | "F c #fced03", 69 | "G c #ffea0e", 70 | "H c #ffeb18", 71 | "J c #fff70d", 72 | "K c #fffe03", 73 | "L c #fffe0c", 74 | "P c #fff111", 75 | "I c #fff21e", 76 | "U c #fffe14", 77 | "Y c #fffe1c", 78 | "T c #e3e326", 79 | "R c #e4e43a", 80 | "E c #ffe236", 81 | "W c #ffe43f", 82 | "Q c #fffe22", 83 | "! c #fffe2a", 84 | "~ c #fff73a", 85 | "^ c #ffff32", 86 | "/ c #ffff3a", 87 | "( c #ffde56", 88 | ") c #ffde58", 89 | "_ c #ffea43", 90 | "` c #ffec51", 91 | "' c #fff243", 92 | "] c #fffe43", 93 | "[ c #ffff49", 94 | "{ c #fff356", 95 | "} c #fffd54", 96 | "| c #ffff5b", 97 | " . c #e9e978", 98 | ".. c #ffea7b", 99 | "X. c #ffff63", 100 | "o. c #fffe6c", 101 | "O. c #f4f47c", 102 | "+. c #ffff75", 103 | "@. c #ffff7a", 104 | "#. c #838383", 105 | "$. c #8b8b8b", 106 | "%. c #949494", 107 | "&. c #9b9b93", 108 | "*. c #989898", 109 | "=. c #b8b898", 110 | "-. c #b7b7a1", 111 | ";. c #dcdc9e", 112 | ":. c #c6c6b8", 113 | ">. c #c9c9b6", 114 | ",. c #d1d1a6", 115 | "<. c #dcdcbc", 116 | "1. c #fff28c", 117 | "2. c #fffe81", 118 | "3. c #fffe8b", 119 | "4. c #fff292", 120 | "5. c #fffd93", 121 | "6. c #fffd9b", 122 | "7. c #eeeea8", 123 | "8. c #fff3ab", 124 | "9. c #ffffa2", 125 | "0. c #ffffad", 126 | "q. c #ffffb4", 127 | "w. c #fffebb", 128 | "e. c #d9d9c6", 129 | "r. c #e5e5c8", 130 | "t. c #ebebc7", 131 | "y. c #ededd4", 132 | "u. c #fefcc3", 133 | "i. c #fffdcb", 134 | "p. c #ffffd2", 135 | "a. c #ffffdf", 136 | "s. c #ffffe0", 137 | "d. c white", 138 | "f. c None", 139 | /* pixels */ 140 | "f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.", 141 | "f.f.f.f.f.f.f.f.f.f.f.f.f.f.6 5 f.f.f.f.f.f.f.f.f.f.f.f.f.f.", 142 | "f.f.f.f.f.f.f.f.f.f.f.f.f.7 7 7 5 f.f.f.f.f.f.f.f.f.f.f.f.f.", 143 | "f.f.f.f.f.f.f.f.f.f.f.f.6 6 y y 6 & f.f.f.f.f.f.f.f.f.f.f.f.", 144 | "f.f.f.f.f.f.f.f.f.f.f.f.6 0 c c 0 5 f.f.f.f.f.f.f.f.f.f.f.f.", 145 | "f.f.f.f.f.f.f.f.f.f.f.7 7 k n n k 7 1 f.f.f.f.f.f.f.f.f.f.f.", 146 | "f.f.f.f.f.f.f.f.f.f.f.6 w S i.i.S w 6 f.f.f.f.f.f.f.f.f.f.f.", 147 | "f.f.f.f.f.f.f.f.f.f.7 7 x 8.s.s.8.x 7 3 f.f.f.f.f.f.f.f.f.f.", 148 | "f.f.f.f.f.f.f.f.f.6 7 y ) a.a.s.a.) y 6 & f.f.f.f.f.f.f.f.f.", 149 | "f.f.f.f.f.f.f.f.f.7 0 v u.:.%.%.:.u.v 8 4 f.f.f.f.f.f.f.f.f.", 150 | "f.f.f.f.f.f.f.f.6 6 h ..y.*.*.*.%.e...h 6 , f.f.f.f.f.f.f.f.", 151 | "f.f.f.f.f.f.f.f.7 q D i.r.%.%.%.%.>.i.D w 6 f.f.f.f.f.f.f.f.", 152 | "f.f.f.f.f.f.f.7 7 x 1.p.t.%.%.%.$.<.p.1.x 8 1 f.f.f.f.f.f.f.", 153 | "f.f.f.f.f.f.7 7 e _ u.i.i.*.%.$.$.u.u.u.E r 6 # f.f.f.f.f.f.f.", 154 | "f.f.f.f.f.f.6 6 M 6.u.u.u.-.$.$.&.u.w.w.4.m 7 4 f.f.f.f.f.f.", 155 | "f.f.f.f.f.6 7 h ` w.w.w.w.,.#.#.=.q.q.q.0._ h 6 % f.f.f.f.f.", 156 | "f.f.f.f.f.8 0 A 5.q.0.q.q.7.; ; ;.9.9.9.6.2.C 0 5 f.f.f.f.f.", 157 | "f.f.f.f.6 6 z { 9.9.6.6.6.6.a - 6.6.6.5.3.3.' z 6 < f.f.f.f.", 158 | "f.f.f.f.7 e H 3.5.5.5.5.5.5.d p 3.3.3.@.@.@.o.G e 6 f.f.f.f.", 159 | "f.f.f.7 7 b { @.3.@.3.@.3.@.O. .@.+.+.+.o.X.X.~ b 7 4 f.f.f.", 160 | "f.f.7 7 f I o.o.o.o.o.o.o.o.o.o.X.X.X.| } } [ [ P g 6 # f.f.f.", 161 | "f.f.7 0 V ] } } | | | | | s * + i [ [ [ ] ] / / ! V 0 5 f.f.", 162 | "f.6 7 l U ] ] ] [ ] [ [ [ @ o o o R / ^ ^ ! ! ! ! J l 6 , f.", 163 | "f.7 w F ! ! ^ ^ ^ ^ ^ ^ ^ O X . . T ! Q Q Y Y Y U U F w 5 f.", 164 | "7 7 b J Y Y Y Y Y Q Q Q Y u . . = U U U U L L L L K K b 6 2 ", 165 | "6 y K L U U U U U Y U U U U U U U U L L L L K L K K K K y 6 ", 166 | "7 f N B B B B Z Z Z Z B B B B B B N B N N B N N N N N N f 6 ", 167 | "6 7 7 8 9 9 9 9 9 9 9 9 9 9 9 9 8 8 9 7 8 8 8 6 7 7 6 7 7 3 ", 168 | " & > > & > > & : : : : : : : : & > & > : : : : : : : : $ ", 169 | " ", 170 | "f. f.", 171 | "f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f." 172 | }; 173 | -------------------------------------------------------------------------------- /gtk/minimize.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char * minimize_xpm[] = { 3 | /* width height num_colors chars_per_pixel */ 4 | "15 15 5 1", 5 | /* colors */ 6 | " c white", 7 | ". c #5f5f5f", 8 | "X c gray75", 9 | "o c gray70", 10 | "O c black", 11 | /* pixels */ 12 | " .", 13 | " XXXXXXXXXXXX..", 14 | " XooooooooooX..", 15 | " XooooooooooX..", 16 | " XooooooooooX..", 17 | " XoooOOOOoooX..", 18 | " XoooOOOOoooX..", 19 | " XoooOOOOoooX..", 20 | " XoooOOOOoooX..", 21 | " XooooooooooX..", 22 | " XooooooooooX..", 23 | " XooooooooooX..", 24 | " XXXXXXXXXXXX..", 25 | " ..............", 26 | "..............."}; 27 | -------------------------------------------------------------------------------- /image/test.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dbsoft/dwindows/5c2f0fff986340614cea6cd08a4bcaee1453752c/image/test.bmp -------------------------------------------------------------------------------- /image/test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dbsoft/dwindows/5c2f0fff986340614cea6cd08a4bcaee1453752c/image/test.png -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) 2000-2023, Brian Smith 3 | Copyright (c) 2003-2022, Mark Hessling 4 | Copyright (c) 2022, Amr Hesham 5 | Copyright (c) 2019, Anton Popov 6 | Copyright (c) 2017, Ralph Shane 7 | Copyright (c) 2007, Alex Taylor 8 | Copyright (c) 2002, Nickolay V. Shmyrev 9 | Copyright (c) 2000, Achim Hasenmueller 10 | Copyright (c) 2000, Peter Nielsen 11 | Copyright (c) 1998, Sergey I. Yevtushenko 12 | All rights reserved. 13 | 14 | Redistribution and use in source and binary forms, with or without modification, 15 | are permitted provided that the following conditions are met: 16 | 17 | * Redistributions of source code must retain the above copyright notice, this 18 | list of conditions and the following disclaimer. 19 | * Redistributions in binary form must reproduce the above copyright notice, 20 | this list of conditions and the following disclaimer in the documentation and/or 21 | other materials provided with the distribution. 22 | * The names of its contributors may not be used to endorse or promote products 23 | derived from this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 26 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 27 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 28 | THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 30 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 32 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | -------------------------------------------------------------------------------- /mac/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | dwtest 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | org.dbsoft.dwtest 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | dwtest 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.1 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSApplicationCategoryType 26 | public.app-category.developer-tools 27 | LSMinimumSystemVersion 28 | ${MACOSX_DEPLOYMENT_TARGET} 29 | NSPrincipalClass 30 | NSApplication 31 | NSAppTransportSecurity 32 | 33 | NSAllowsArbitraryLoadsInWebContent 34 | 35 | NSAllowsArbitraryLoads 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /mac/Info.template: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | APPNAME 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | org.dbsoft.APPNAME 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | dwtest 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.1 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSApplicationCategoryType 26 | public.app-category.developer-tools 27 | LSMinimumSystemVersion 28 | ${MACOSX_DEPLOYMENT_TARGET} 29 | NSPrincipalClass 30 | NSApplication 31 | NSAppTransportSecurity 32 | 33 | NSAllowsArbitraryLoadsInWebContent 34 | 35 | NSAllowsArbitraryLoads 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /mac/PkgInfo: -------------------------------------------------------------------------------- 1 | APPL???? -------------------------------------------------------------------------------- /mac/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dbsoft/dwindows/5c2f0fff986340614cea6cd08a4bcaee1453752c/mac/file.png -------------------------------------------------------------------------------- /mac/finishup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | PLATFORM=`uname -s` 3 | RELEASE=`uname -r` 4 | REQUIRED=11.0.0 5 | SRCDIR=$1 6 | BINNAME=$2 7 | IDENTITY=$3 8 | 9 | if [ $PLATFORM = "Darwin" ] 10 | then 11 | mkdir -p $BINNAME.app/Contents/MacOS 12 | mkdir -p $BINNAME.app/Contents/Resources 13 | 14 | cat $SRCDIR/mac/Info.template | sed s/APPNAME/$BINNAME/ > $BINNAME.app/Contents/Info.plist 15 | cp -f $SRCDIR/mac/PkgInfo $BINNAME.app/Contents 16 | cp -f $SRCDIR/mac/file.png $BINNAME.app/Contents/Resources 17 | cp -f $SRCDIR/mac/folder.png $BINNAME.app/Contents/Resources 18 | cp -f $SRCDIR/image/test.png $BINNAME.app/Contents/Resources 19 | cp -f $BINNAME $BINNAME.app/Contents/MacOS 20 | if [ "$(printf '%s\n' "$REQUIRED" "$RELEASE" | sort -n | head -n1)" = "$REQUIRED" ]; then 21 | DEEP="--deep" 22 | fi 23 | # Check if there is a certificate to sign with... 24 | if [ -z "$IDENTITY" ]; then 25 | echo "No identity set signing AdHoc." 26 | codesign $DEEP -s "-" $BINNAME.app 27 | else 28 | echo "Signing code with identity: $IDENTITY" 29 | codesign $DEEP -s "$IDENTITY" $BINNAME.app 30 | fi 31 | fi 32 | -------------------------------------------------------------------------------- /mac/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dbsoft/dwindows/5c2f0fff986340614cea6cd08a4bcaee1453752c/mac/folder.png -------------------------------------------------------------------------------- /makefile.emx: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | 3 | # Dynamic Windows EMX Makefile 4 | 5 | CC = gcc 6 | RM = rm -f 7 | RC = rc 8 | MAKE = make 9 | COMPRESS = lxlite 10 | include Version.mk 11 | VER = $(DW_MAJOR_VERSION)$(DW_MINOR_VERSION) 12 | VERDOT = $(DW_MAJOR_VERSION).$(DW_MINOR_VERSION) 13 | AVERREV := $(shell os2\svnrev.cmd) 14 | include SVN.REV 15 | 16 | DEFS = 17 | LIBS = 18 | 19 | CFLAGS = -O -g -Zomf -Zmt -D__OS2__ -D__ST_MT_ERRNO__ -DUNICODE -DVER_REV=$(VERREV) -I. -Wall -o $(@) 20 | LDFLAGS = -Zdll -static-libgcc 21 | RCFLAGS = -r 22 | 23 | 24 | COMPATOBJECTS = dwcompat.obj dirent.obj 25 | COMPATSOURCES = dwcompat.c dirent.c 26 | 27 | all: dw.dll dwcompat.dll dwtest.exe dwtestoo.exe 28 | 29 | dw.dll: os2\dw.c os2\dw.def 30 | $(CC) $(CFLAGS) $(DEFS) -o dw.dll os2/dw.c $(LDFLAGS) os2/dw.def 31 | 32 | dw.lib: os2\dw.def 33 | emximp -o dw.lib os2\dw.def 34 | 35 | dwcompat.dll: $(COMPATOBJECTS) os2\dwcompat.def 36 | $(CC) $(CFLAGS) $(DEFS) -o dwcompat.dll $(COMPATOBJECTS) $(LDFLAGS) -lsocket os2/dwcompat.def 37 | 38 | dwcompat.lib: os2\dwcompat.def 39 | emximp -o dwcompat.lib os2\dwcompat.def 40 | 41 | dwtest.exe: dwtest.obj dw.lib dwcompat.lib 42 | $(CC) $(CFLAGS) -Zomf -Zmt -static-libgcc -Zlinker /pm:pm -o dwtest.exe dwtest.obj -Llib -ldw -ldwcompat os2/dwtest.def 43 | 44 | dwtestoo.exe: dwtestoo.obj dw.lib dwcompat.lib 45 | $(CC) $(CFLAGS) -Zomf -Zmt -static-libgcc -Zlinker /pm:pm -o dwtestoo.exe dwtestoo.obj -Llib -ldw -ldwcompat -lstdc++ os2/dwtest.def 46 | 47 | 48 | clean: 49 | $(RM) *.obj *.o *.lib *.res *~ dwtest.exe dwtestoo.exe dw.dll dwcompat.dll SVN.REV 50 | 51 | dw.obj: dw.c 52 | $(CC) $(CFLAGS) -c $< 53 | 54 | dwcompat.obj: dwcompat.c 55 | $(CC) $(CFLAGS) -c $< 56 | 57 | dirent.obj: os2/dirent.c 58 | $(CC) $(CFLAGS) -c $< 59 | 60 | dwtest.obj: dwtest.c 61 | $(CC) $(CFLAGS) -c $< 62 | 63 | dwtestoo.obj: dwtestoo.cpp dw.hpp 64 | $(CC) $(CFLAGS) -std=c++11 -c $< 65 | 66 | 67 | zip: dw.dll 68 | cp os2/readme-os2.txt . 69 | zip dwindows-os2-$(VERDOT).zip readme-os2.txt readme.txt dw.dll dwcompat.dll dw.lib dwcompat.lib dw.h dwcompat.h dw.hpp 70 | -------------------------------------------------------------------------------- /makefile.mingw: -------------------------------------------------------------------------------- 1 | 2 | # Dynamic Windows MINGW Makefile 3 | 4 | CC = gcc 5 | CXX = g++ 6 | RM = rm -f 7 | 8 | DEFS = 9 | LIBS = 10 | 11 | ifndef TARGET_CPU 12 | TARGET_CPU=x86 13 | endif 14 | 15 | ifeq ($(TARGET_CPU), x86) 16 | PLATFORM_DEF=-DWIN32 17 | PLATFORM_CFLAGS=-m32 18 | PLATFORM_TARGET=pe-i386 19 | else 20 | PLATFORM_DEF=-DWIN64 21 | PLATFORM_CFLAGS=-m64 22 | PLATFORM_TARGET=pe-x86-64 -DDW64 23 | endif 24 | 25 | # Had to add -Wno-unused-value due to every Win32 macro generating this warning... 26 | # GCC has marked this as WONTFIX http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24900 27 | # This seems to be fixed in Mingw-w64 8.1 readd the option below if using an old compiler 28 | CFLAGS = -O -g -DMSVC $(PLATFORM_DEF) $(PLATFORM_CFLAGS) -D__WIN32__ -DBUILD_DLL -DGDIPLUS -DRICHEDIT -DTOOLBAR -DUNICODE -D_UNICODE -DISOLATION_AWARE_ENABLED=1 -I./win -I. -I./platform -Wall -mthreads -o $(@) 29 | LDFLAGS = -shared -mwindows -mthreads -lcomctl32 -lole32 -loleaut32 -luserenv -lmsimg32 -lgdiplus -luuid 30 | 31 | COMPATOBJECTS = dwcompat.o dirent.o 32 | OBJECTS = dw.o browser.o XBrowseForFolder.o 33 | 34 | VPATH=../ ../win 35 | 36 | all: dw.dll dwcompat.dll dwtest.exe dwtestoo.exe 37 | 38 | dw.res: win/dw.rc 39 | windres --target=$(PLATFORM_TARGET) --input win/dw.rc --output dw.res --output-format=coff 40 | 41 | dw.dll: $(OBJECTS) win/dw-mingw.def dw.res 42 | $(CC) $(CFLAGS) $(DEFS) -o dw.dll dw.res $(OBJECTS) $(LDFLAGS) \ 43 | -Wl,--out-implib,dw.a -Wl,-Map,dw.dll.map -Wl,--cref -Wl,--enable-stdcall-fixup win/dw-mingw.def 44 | 45 | dwcompat.dll: $(COMPATOBJECTS) win/dwcompat-mingw.def 46 | $(CC) $(CFLAGS) $(DEFS) -o dwcompat.dll $(COMPATOBJECTS) $(LDFLAGS) -lwsock32 \ 47 | -Wl,--out-implib,dwcompat.a -Wl,-Map,dwcompat.dll.map -Wl,--cref -Wl,--enable-stdcall-fixup win/dwcompat-mingw.def 48 | 49 | dwtest.res: win/dwtest.rc 50 | windres --target=$(PLATFORM_TARGET) --input win/dwtest.rc --output dwtest.res --output-format=coff 51 | 52 | dwtest.exe: dwtest.o dw.a dwcompat.a dwtest.res 53 | $(CC) $(CFLAGS) -o dwtest.exe dwtest.res dwtest.o dw.a dwcompat.a 54 | 55 | dwtestoo.exe: dwtestoo.o dw.a dwcompat.a dwtest.res 56 | $(CXX) $(CFLAGS) -o dwtestoo.exe dwtest.res dwtestoo.o dw.a dwcompat.a 57 | 58 | clean: 59 | $(RM) *.obj *.o *.lib *.res *~ dwtest.exe dw.dll dwcompat.dll SVN.REV 60 | 61 | dw.o: win/dw.c 62 | $(CC) $(CFLAGS) -c $< 63 | 64 | browser.o: win/browser.c 65 | $(CC) $(CFLAGS) -c $< 66 | 67 | XBrowseForFolder.o: win/XBrowseForFolder.cpp 68 | $(CC) $(CFLAGS) -c $< 69 | 70 | dwcompat.o: dwcompat.c 71 | $(CC) $(CFLAGS) -c $< 72 | 73 | dirent.o: win/dirent.c 74 | $(CC) $(CFLAGS) -c $< 75 | 76 | dwtest.o: dwtest.c 77 | $(CC) $(CFLAGS) -c $< 78 | 79 | dwtestoo.o: dwtestoo.cpp 80 | $(CXX) -std=c++11 $(CFLAGS) -c $< 81 | 82 | DEPS := $(wildcard *.d) 83 | ifneq ($(DEPS),) 84 | include $(DEPS) 85 | endif 86 | 87 | -------------------------------------------------------------------------------- /makefile.vac: -------------------------------------------------------------------------------- 1 | .SUFFIXES: .c .obj 2 | 3 | !if ![cmd /c os2\svnrev.cmd] 4 | !include SVN.REV 5 | !endif 6 | 7 | .all: \ 8 | .\dw.dll \ 9 | .\dwcompat.dll \ 10 | .\dwtest.exe 11 | 12 | .c.obj: 13 | icc.exe /DOS2 /DTCPV40HDRS /DBUILD_DLL /DUNICODE /DVER_REV=$(VERREV) /I. /Tm+ /Tdc /Ss /V"Dynamic Windows Compatibility" /Ti /Gm /Gd- /G5 /Ge- /C /W3 %s 14 | 15 | .\dw.dll: \ 16 | .\os2\dw.obj 17 | @echo " Link::Linker " 18 | icc.exe @<< 19 | /B" /NOE /de /ST:32768 /nologo /li" 20 | /Fe"dw.dll" os2\dw.def 21 | .\dw.obj 22 | so32dll.lib 23 | tcp32dll.lib 24 | libuls.lib 25 | libconv.lib 26 | unikbd.lib 27 | << 28 | IMPLIB DW.LIB OS2\DW.DEF 29 | 30 | .\dwcompat.dll: \ 31 | .\os2\dirent.obj \ 32 | .\dwcompat.obj 33 | @echo " Link::Linker " 34 | icc.exe @<< 35 | /B" /NOE /de /ST:32768 /nologo /li" 36 | /Fe"dwcompat.dll" os2\dwcompat.def 37 | .\dirent.obj 38 | .\dwcompat.obj 39 | so32dll.lib 40 | tcp32dll.lib 41 | << 42 | IMPLIB DWCOMPAT.LIB OS2\DWCOMPAT.DEF 43 | 44 | dwtest.obj: 45 | icc /Ti /DOS2 /DTCPV40HDRS /Sp1 /I. /Sm /Ss /Q /Gm /Gt /C dwtest.c 46 | dwtest.exe: dwtest.obj 47 | icc @<< 48 | /B" /DE /optfunc /pm:pm" 49 | /Fedwtest.exe 50 | dw.lib dwcompat.lib 51 | dwtest.obj 52 | os2\dwtest.def 53 | << 54 | clean : 55 | @if exist *.obj del *.obj 56 | @if exist *.map del *.map 57 | @if exist *.lib del *.lib 58 | @if exist *.dll del *.dll 59 | @if exist *.exe del *.exe 60 | @if exist *.REV del *.REV 61 | -------------------------------------------------------------------------------- /makefile.vc: -------------------------------------------------------------------------------- 1 | # 2 | # Visual C Makefile for Dynamic Windows 3 | # 4 | !include Version.mk 5 | VER = $(DW_MAJOR_VERSION)$(DW_MINOR_VERSION) 6 | VERDOT = $(DW_MAJOR_VERSION).$(DW_MINOR_VERSION) 7 | VERREV = 0 8 | 9 | # Configure alternate compiler based on Clang/LLVM 10 | !if "$(CLANG)" == "Y" 11 | WLIB=llvm-lib.exe 12 | CC=clang-cl.exe 13 | LINK=lld-link.exe 14 | !else 15 | WLIB=lib.exe 16 | CC=cl.exe 17 | LINK=link.exe 18 | !endif 19 | 20 | # 21 | # Configure settings for the target platform 22 | # Default to x86 if not specified 23 | # 24 | !if "$(TARGET_CPU)" == "" 25 | !if "$(VSCMD_ARG_TGT_ARCH)" == "" 26 | !if "$(PLATFORM)" == "" 27 | TARGET_CPU=x86 28 | !else 29 | TARGET_CPU=$(PLATFORM) 30 | !endif 31 | !else 32 | TARGET_CPU=$(VSCMD_ARG_TGT_ARCH) 33 | !endif 34 | !endif 35 | 36 | # 37 | # Setup the source and destination directories 38 | # 39 | !if "$(DWINDOWS_SRCDIR)" == "" 40 | SRCDIR=. 41 | !else 42 | SRCDIR=$(DWINDOWS_SRCDIR) 43 | !endif 44 | 45 | !if "$(DWLIBDIR)" == "" 46 | DWLIBDIR=$(SRCDIR) 47 | !endif 48 | 49 | !if "$(TARGET_CPU)" == "x86" 50 | PLATFORM_DEF = -DWIN32 51 | PLATFORM_NAME = win32 52 | !else 53 | PLATFORM_DEF = -DWIN64 54 | PLATFORM_NAME = win64 55 | !endif 56 | 57 | # 58 | # Settings for either debug or release 59 | # 60 | !if "$(DEBUG)" == "Y" 61 | CFLAGS_DEBUG = -DDEBUG -Z7 -W3 -Od -MTd # was -Zi 62 | LINK_DEBUG = -debug 63 | !else 64 | CFLAGS_DEBUG = -Ox -MT 65 | LINK_DEBUG = -release 66 | !endif 67 | 68 | # Check the SVN revision number if possible 69 | !if ![subwcrev . win\__SVN__.REV SVN.REV > NUL] 70 | !include SVN.REV 71 | !message Revision is [$(VERREV)] 72 | SVNVERSION=-DVER_REV=$(VERREV) 73 | !else 74 | # Check the Mercurial revision number if possible 75 | !if ![hg log -r . --template="VER_REV={rev}" > HG.REV] 76 | !include HG.REV 77 | !message Revision is [$(VER_REV)] 78 | SVNVERSION=-DVER_REV=$(VER_REV) 79 | !endif 80 | !endif 81 | 82 | # 83 | # Settings for supporting embedded Edge (Chromium) WebView2 84 | # 85 | !if "$(WEBVIEW2DIR)" == "" 86 | WEBVIEW2DIR=$(SRCDIR)\packages\Microsoft.Web.WebView2 87 | !endif 88 | 89 | !if exists($(WEBVIEW2DIR)\build\native\include\WebView2.h) 90 | WEBVIEW2INC=-DBUILD_EDGE -I$(WEBVIEW2DIR)\build\native\include 91 | !if exists($(WEBVIEW2DIR)\build\native\$(TARGET_CPU)\WebView2LoaderStatic.lib) 92 | WEBVIEW2LIB=$(WEBVIEW2DIR)\build\native\$(TARGET_CPU)\WebView2LoaderStatic.lib version.lib 93 | !else 94 | WEBVIEW2LIB=$(WEBVIEW2DIR)\build\native\$(TARGET_CPU)\WebView2Loader.dll.lib 95 | WEBVIEW2LOADER=$(WEBVIEW2DIR)\build\native\$(TARGET_CPU)\WebView2Loader.dll 96 | !endif 97 | WEBVIEW2OBJ=edge.obj 98 | !endif 99 | 100 | # 101 | # Settings for supporting WinToast notifications 102 | # 103 | !if "$(WINTOASTDIR)" == "" 104 | WINTOASTDIR=$(SRCDIR)\packages\WinToast 105 | !endif 106 | 107 | !if exists($(WINTOASTDIR)\src\wintoastlib.h) 108 | WINTOASTINC=-DBUILD_TOAST -I$(WINTOASTDIR)\src 109 | WINTOASTOBJ=wintoast.obj wintoastlib.obj 110 | !endif 111 | 112 | # The Visual C CRT and other Windows components have deprecated lots of common functions 113 | # These options will hide the deprecation warnings; Comment the next line to see them 114 | CRT_FLAGS = -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNING -D_WINSOCK_DEPRECATED_NO_WARNINGS 115 | 116 | CFLAGS = -c $(PLATFORM_DEF) -D__WIN32__ -DMSVC -DRICHEDIT -DTOOLBAR -DGDIPLUS -DAEROGLASS -D_UNICODE -DUNICODE -DBUILD_DLL -DISOLATION_AWARE_ENABLED=1 -I$(SRCDIR)\platform -I$(SRCDIR) $(WEBVIEW2INC) $(WINTOASTINC) $(SVNVERSION) $(CRT_FLAGS) 117 | LIBS = wsock32.lib kernel32.lib user32.lib comctl32.lib gdi32.lib advapi32.lib shell32.lib comdlg32.lib ole32.lib oleaut32.lib userenv.lib msimg32.lib gdiplus.lib $(WEBVIEW2LIB) 118 | RES = 119 | LINKFLAGS = -machine:$(TARGET_CPU) -manifest $(LINK_DEBUG) 120 | DLLLINKFLAGS = -dll 121 | DEFFILE = $(SRCDIR)\win\dw.def 122 | DEFFILE2 = $(SRCDIR)\win\dwcompat.def 123 | 124 | OBJS = dw.obj browser.obj XBrowseForFolder.obj $(WEBVIEW2OBJ) $(WINTOASTOBJ) 125 | 126 | OBJS2 = dwcompat.obj dirent.obj 127 | 128 | all: dw dwcompat dwtest dwtestoo 129 | 130 | clean: 131 | -erase *.dll 132 | -erase *.exe 133 | -erase *.opt 134 | -erase *.lib 135 | -erase *.obj 136 | -erase *.o 137 | -erase *.map 138 | -erase *.pdb 139 | -erase *.ilk 140 | -erase *.exp 141 | -erase *.REV 142 | -erase *~ 143 | 144 | distclean: clean 145 | -rd /s /q $(DWLIBDIR)\x86 146 | -rd /s /q $(DWLIBDIR)\x64 147 | -erase readme-win.txt 148 | 149 | dw: dw.dll 150 | 151 | dw.dll: $(OBJS) $(DEFFILE) 152 | $(LINK) @<< 153 | -out:$(@) -def:$(DEFFILE) 154 | $(LINKFLAGS) $(DLLLINKFLAGS) 155 | $(OBJS) $(RES) 156 | $(LIBS) 157 | << 158 | $(WLIB) -def:$(DEFFILE) -machine:$(TARGET_CPU) -out:dw.lib 159 | mt.exe -manifest dw.dll.manifest $(SRCDIR)\win\dw.dll.$(TARGET_CPU).manifest -outputresource:dw.dll;2 160 | -erase dw.dll.manifest 161 | -md $(DWLIBDIR)\$(TARGET_CPU) 162 | copy dw.lib $(DWLIBDIR)\$(TARGET_CPU)\dw.lib 163 | copy dw.dll $(DWLIBDIR)\$(TARGET_CPU)\dw.dll 164 | !if exists($(WEBVIEW2LOADER)) 165 | copy $(WEBVIEW2LOADER) $(DWLIBDIR)\$(TARGET_CPU)\WebView2Loader.dll 166 | !endif 167 | 168 | dwcompat: dwcompat.dll 169 | 170 | dwcompat.dll: $(OBJS2) $(DEFFILE2) 171 | $(LINK) @<< 172 | -out:$(@) -def:$(DEFFILE2) 173 | $(LINKFLAGS) $(DLLLINKFLAGS) 174 | $(OBJS2) $(RES) 175 | $(LIBS) 176 | << 177 | $(WLIB) -def:$(DEFFILE2) -machine:$(TARGET_CPU) -out:dwcompat.lib 178 | mt.exe -manifest dwcompat.dll.manifest -outputresource:dwcompat.dll;2 179 | -erase dwcompat.dll.manifest 180 | -md $(DWLIBDIR)\$(TARGET_CPU) 181 | copy dwcompat.lib $(DWLIBDIR)\$(TARGET_CPU)\dwcompat.lib 182 | copy dwcompat.dll $(DWLIBDIR)\$(TARGET_CPU)\dwcompat.dll 183 | 184 | dw.obj: $(SRCDIR)\win\dw.c 185 | $(CC) $(CFLAGS) $(CFLAGS_DEBUG) $(SRCDIR)\win\dw.c 186 | 187 | browser.obj: $(SRCDIR)\win\browser.c 188 | $(CC) $(CFLAGS) $(CFLAGS_DEBUG) $(SRCDIR)\win\browser.c 189 | 190 | XBrowseForFolder.obj: $(SRCDIR)\win\XBrowseForFolder.cpp 191 | $(CC) $(CFLAGS) $(CFLAGS_DEBUG) $(SRCDIR)\win\XBrowseForFolder.cpp 192 | 193 | edge.obj: $(SRCDIR)\win\edge.cpp 194 | $(CC) $(CFLAGS) $(CFLAGS_DEBUG) $(SRCDIR)\win\edge.cpp 195 | 196 | wintoast.obj: $(SRCDIR)\win\wintoast.cpp 197 | $(CC) $(CFLAGS) /EHsc $(CFLAGS_DEBUG) $(SRCDIR)\win\wintoast.cpp 198 | 199 | wintoastlib.obj: $(WINTOASTDIR)\src\wintoastlib.cpp 200 | $(CC) $(CFLAGS) /EHsc $(CFLAGS_DEBUG) $(WINTOASTDIR)\src\wintoastlib.cpp 201 | 202 | dirent.obj: $(SRCDIR)\win\dirent.c 203 | $(CC) $(CFLAGS) $(CFLAGS_DEBUG) $(SRCDIR)\win\dirent.c 204 | 205 | dwcompat.obj: $(SRCDIR)\dwcompat.c 206 | $(CC) $(CFLAGS) $(CFLAGS_DEBUG) $(SRCDIR)\dwcompat.c 207 | 208 | dwtest.obj: $(SRCDIR)\dwtest.c $(SRCDIR)\dw.h 209 | $(CC) $(CFLAGS) $(CFLAGS_DEBUG) $(SRCDIR)\dwtest.c 210 | 211 | dwtest: dwtest.exe 212 | 213 | dwtest.exe: dwtest.obj 214 | $(LINK) $(LINKFLAGS) /out:dwtest.exe dwtest.obj /subsystem:windows $(DWLIBDIR)\dwcompat.lib $(DWLIBDIR)\dw.lib $(LIBS) 215 | mt.exe /manifest dwtest.exe.manifest $(SRCDIR)\win\dwtest.exe.$(TARGET_CPU).manifest /outputresource:dwtest.exe;1 216 | -erase dwtest.exe.manifest 217 | 218 | dwtestoo.obj: $(SRCDIR)\dwtestoo.cpp $(SRCDIR)\dw.h $(SRCDIR)\dw.hpp 219 | $(CC) $(CFLAGS) /Zc:__cplusplus /EHsc $(CFLAGS_DEBUG) $(SRCDIR)\dwtestoo.cpp 220 | 221 | dwtestoo: dwtestoo.exe 222 | 223 | dwtestoo.exe: dwtestoo.obj 224 | $(LINK) $(LINKFLAGS) /out:dwtestoo.exe dwtestoo.obj /subsystem:windows $(DWLIBDIR)\dwcompat.lib $(DWLIBDIR)\dw.lib $(LIBS) 225 | mt.exe /manifest dwtestoo.exe.manifest $(SRCDIR)\win\dwtest.exe.$(TARGET_CPU).manifest /outputresource:dwtestoo.exe;1 226 | -erase dwtestoo.exe.manifest 227 | 228 | zip: dw.dll 229 | copy win\readme-win.txt . 230 | zip dwindows-win-$(VERDOT).zip readme-win.txt readme.txt x64\dw.dll x64\dwcompat.dll x64\dw.lib x64\dwcompat.lib x86\dw.dll x86\dwcompat.dll x86\dw.lib x86\dwcompat.lib dw.h dwcompat.h dw.hpp 231 | -------------------------------------------------------------------------------- /makefile.wpm: -------------------------------------------------------------------------------- 1 | #=================================================================== 2 | # 3 | # Auto-dependency information 4 | # 5 | #=================================================================== 6 | OS22_H = $(%WATCOM)\h\os2 7 | CFLAGS = -i=os2 -i=$(OS22_H) -DUNICODE -bm -bt=OS2 -zq -d2 -bd -sg 8 | TKPATH=C:\Toolkit 9 | TLKTLIB = $(TKPATH)\LIB 10 | 11 | .SUFFIXES: 12 | .SUFFIXES: .obj .c 13 | .c.obj: .AUTODEPEND 14 | wcc386 $(CFLAGS) $*.c 15 | 16 | all: dw.dll dwcompat.dll dwtest.exe 17 | 18 | dwcompat.dll: dirent.obj dwcompat.obj 19 | wlink @os2\dwcompat.lnk name dwcompat.dll system os2v2_dll d a library $(TLKTLIB)\so32dll,$(TLKTLIB)\tcp32dll option implib=dwcompat option map option symf f $[@ f dwcompat 20 | 21 | dirent.obj: 22 | wcc386 $(CFLAGS) os2\dirent.c 23 | 24 | dw.dll: dw.obj 25 | wlink @os2\dw.lnk name dw.dll system os2v2_dll d a library $(TLKTLIB)\libuls,$(TLKTLIB)\libconv,$(TLKTLIB)\unikbd option implib=dw option map option symf f $[@ 26 | 27 | dw.obj: os2\dw.c 28 | wcc386 $(CFLAGS) os2\dw.c 29 | 30 | dwtest.exe: dwtest.obj 31 | wlink name dwtest.exe system os2v2_pm d a library dw.lib option map option symf f $[@ 32 | 33 | dwtest.obj: 34 | wcc386 /DOS2 -i=os2 -i=$(OS22_H) -bm -bt=OS2 -zq -d2 -sg dwtest.c 35 | 36 | clean: 37 | @if exist *.obj del *.obj 38 | @if exist *.sym del *.sym 39 | @if exist *.map del *.map 40 | @if exist *.lib del *.lib 41 | @if exist *.dll del *.dll 42 | @if exist *.exe del *.exe 43 | 44 | -------------------------------------------------------------------------------- /mobile.txt: -------------------------------------------------------------------------------- 1 | How to create a Dynamic Windows project for iOS in Xcode and Android in Android Studio. 2 | 3 | 4 | Xcode 5 | 6 | === Dynamic Windows Project Creation === 7 | 1. File -> New -> Project... 8 | 2. Select "iOS" then "App" then click "Next" 9 | 3. Fill in the following: 10 | "Product Name" with "Dynamic Windows iOS" 11 | "Team" select the appropriate team for this project. 12 | "Organization Identifier" with "org.dbsoft" 13 | "Interface" select "Storyboard" 14 | "Language" select "Objective-C" 15 | Uncheck "Include Tests" and click "Next" 16 | 4. Choose a location for the project, "Don't add to any project or workspace" 17 | 5. Rename the "Dynamic Windows iOS" target to "dwtest" and remove the following files: 18 | *.m, *.h, *.storyboard and Assets.xcassets 19 | 6. Select "dwtest" folder and File -> Add Files to "Dynamic Windows iOS"... 20 | Select "dwtest.c" from the file dialog with "Copy items if needed" unchecked. 21 | "Add to targets" should have "dwtest" checked. 22 | 7. Highlight the project "Dynamic Windows iOS" in the top left then select the target "dwtest" 23 | Edit "Bundle Identifier" to be "org.dbsoft.dwindows.dwtest" 24 | 8. Click the target dropdown and click "Add Target" 25 | Select "Framework" and click "Next" 26 | "Product name" with "dwindows" uncheck "Include Tests" 27 | 9. Delete the created "dwindows.h" and "Move to Trash" 28 | 10. Select "dwindows" folder and File -> Add Files to "Dynamic Windows iOS"... 29 | Add "dw.h" and "ios/dw.m" with "Copy items if needed" unchecked. 30 | 11. Repeat steps 8 through 10 with "dwcompat" adding the dwcompat.c and dwcompat.h files. 31 | 12. Highlight the project "Dynamic Windows iOS" in the top left then select the main project. 32 | Click "Build Settings" for the entire project and find "Apple Clang - Preprocessing" 33 | Double click "Preprocessor Macros" and add "__IOS__" to the list for release and debug. 34 | 13. Edit the "Info.plist" in "dwtest" and remove all the settings below "Bundle version" 35 | This is required because Dynamic Windows does not use storyboards. 36 | If necessary edit the "dwtest" "Build Settings" and correct the path to "dwtest/Info.plist" 37 | 14. Highlight the project "Dynamic Windows iOS" in the top left then File -> New -> Group 38 | Name the new group "Resources" 39 | Copy "mac/file.png" "mac/folder.png" and "image/test.png" into "Resources" 40 | 41 | === Project Creation === 42 | 1. File -> New -> Project... 43 | 2. Select "iOS" then "App" then click "Next" 44 | 3. Fill in the following: 45 | "Product Name" with your application name. 46 | "Team" select the appropriate team for this project. 47 | "Organization Identifier" with your identifier 48 | "Interface" select "Storyboard" 49 | "Language" select "Objective-C" 50 | Uncheck "Include Tests" and click "Next" 51 | 4. Choose a location for the project, "Don't add to any project or workspace" 52 | 5. Make sure you close the "Dynamic Windows iOS" main project before step 6. 53 | 6. Select the project in the top left and File -> Add Files to "Project Name"... 54 | Find the "Dynamic Windows iOS" project and add it to the application project. 55 | 7. Select the Project folder and File -> Add Files to "Project Name"... 56 | Add your source files with "Copy items if needed" unchecked. 57 | 8. Edit the "Info.plist" in the Project and remove all the settings below "Bundle version" 58 | This is required because Dynamic Windows does not use storyboards. 59 | 9. Highlight the Project Name in the top left then File -> New -> Group 60 | Name the new group "Resources" 61 | 10. Place any application resource images in the form "#.png" where # is the resource ID. 62 | Any other application files placed here will be accessible via dw_app_dir() at runtime. 63 | 11. Open Assets.xcassets and drag the appropriate icons into the bottom sections. 64 | 12. Select the project in the top left and select the application target from the drop down list. 65 | Under "General" find "Frameworks, Libraries and Embedded Content" 66 | Add "dwindows.framework" from the "Dynamic Windows iOS" project. 67 | If necessary add "dwcompat.framework" from the Dynamic Windows iOS" project. 68 | 13. Highlight the project name in the top left then select the main project. 69 | Click "Info" and set the "iOS Deployment Target" to "13.0" 70 | 14. Click "Build Settings" for the entire project and find "Search Paths" and add the path to 71 | dw.h in "Header Search Paths" for Release and Debug (Any Architecture | Any SDK) 72 | 15. Also under "Build Settings" find "Apple Clang – Preprocessing" 73 | Double click "Preprocessor Macros" and add "__IOS__" to the list for release and debug. 74 | 75 | 76 | Android Studio 77 | 78 | === Project Creation === 79 | 1. File -> New -> New Project 80 | 2. Select "Phone and Tablet" then "Native C++" and click "Next" 81 | 3. Fill in the following: 82 | "Name" with your own application name 83 | "Package name" with "org.dbsoft.dwindows" 84 | "Save location" can be the default 85 | "Language" select "Kotlin" 86 | "Minimum SDK" select "API 26: Android 8.0 (Oreo)" 87 | click "Next" 88 | 4. Select "Toolchain Default" and click "Finish" 89 | 90 | === Source File Installation === 91 | 5. Install "android/DWindows.kt" into "app/src/main/java/org/dbsoft/dwindows" 92 | Remove "MainActivity.kt" from app/src/main/java/org/dbsoft/dwindows" 93 | 6. Install "dw.h" and "android/dw.cpp" into "app/src/main/cpp" 94 | Remove "native-lib.cpp" from "app/src/main/cpp" 95 | 7. Optionally install "dwcompat.h" and "dwcompat.c" into "app/src/main/cpp" 96 | 8. Install your source files (or our example "dwtest.c") into "app/src/main/cpp" 97 | 9. Right click "app" in your project and click New -> Folder -> Assets Folder 98 | "Target Source Set" select "main" and click "Finish" 99 | 10. Place any application resource images in the form "#.png" where # is the resource ID. 100 | Any other application files placed here will be accessible via dw_app_dir() at runtime. 101 | 102 | === Project Configuration === 103 | 11. Open "app/manifests/AndroidManifest.xml" and in the "activity" section 104 | change "android:name" from ".MainActivity" to ".DWindows" 105 | 12. Recommend adding the following (but depends on the app usage): 106 | android:configChanges="orientation|screenSize|screenLayout|keyboardHidden" 107 | android:screenOrientation="fullSensor" 108 | android:persistent="true" 109 | android:exported="true" 110 | android:usesCleartextTraffic="true" 111 | 13: Open "app/src/main/cpp/CMakeLists.txt" and in the add_library() section: 112 | Remove "native-lib.cpp" and add "dw.cpp" optionally "dwcompat.c" and your applications C 113 | or C++ source files that you had installed in step 8. 114 | Also change "project()" to be your project name. 115 | 14. Open "build.gradle (Module)" in "Gradle Scripts" and change "applicationId" to your App ID. 116 | 117 | === Application Assets === 118 | 15. Remove all the files under "app/res/mipmap/ic_launcher" and app/res/mipmap/ic_launcher_round" 119 | 16. Right click "app" and click New -> Image Asset 120 | "Icon Type" select "Launcher Icons (Legacy Only)" 121 | "Name" enter "ic_launcher" 122 | "Asset Type" check "Image" 123 | "Path" click the folder icon and select the largest launcher image you have. 124 | "Shape" select "Square" 125 | Click "Next" and then "Finish" 126 | 17. Right click "app" and click New -> Image Asset 127 | "Icon Type" select "Launcher Icons (Legacy Only)" 128 | "Name" enter "ic_launcher_round" 129 | "Asset Type" check "Image" 130 | "Path" click the folder icon and select the largest launcher image you have. 131 | "Shape" select "Circle" 132 | Click "Next" and then "Finish" 133 | 134 | 135 | -------------------------------------------------------------------------------- /org.dbsoft.dwindows.dwtest.desktop.in: -------------------------------------------------------------------------------- 1 | 2 | [Desktop Entry] 3 | Name=Dynamic Windows Test 4 | Exec=@prefix@/bin/dwtest 5 | Terminal=false 6 | MultipleArgs=false 7 | Type=Application 8 | Categories=Application;Development;X-Red-Hat-Base; 9 | -------------------------------------------------------------------------------- /os2/dirent.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #define INCL_DOSFILEMGR 7 | #define INCL_DOSERRORS 8 | #include "dwcompat.h" 9 | #include 10 | 11 | #ifdef __WATCOMC__ 12 | #include "platform\dirent.h" 13 | typedef struct _dirdescr DIRW; 14 | #define DIR DIRW 15 | #endif 16 | 17 | # define FFBUF FILEFINDBUF3 18 | # define Word ULONG 19 | /* 20 | * LS20 recommends a request count of 100, but according to the 21 | * APAR text it does not lead to missing files, just to funny 22 | * numbers of returned entries. 23 | * 24 | * LS30 HPFS386 requires a count greater than 2, or some files 25 | * are missing (those starting with a character less that '.'). 26 | * 27 | * Novell looses entries which overflow the buffer. In previous 28 | * versions of dirent2, this could have lead to missing files 29 | * when the average length of 100 directory entries was 40 bytes 30 | * or more (quite unlikely for files on a Novell server). 31 | * 32 | * Conclusion: Make sure that the entries all fit into the buffer 33 | * and that the buffer is large enough for more than 2 entries 34 | * (each entry is at most 300 bytes long). And ignore the LS20 35 | * effect. 36 | */ 37 | # define Count 25 38 | # define BufSz (25 * (sizeof(FILEFINDBUF3)+1)) 39 | 40 | #if defined(__IBMC__) || defined(__IBMCPP__) 41 | #define error(rc) _doserrno = rc, errno = EOS2ERR 42 | #else 43 | #define error(rc) errno = 255 44 | #endif 45 | 46 | struct _dirdescr { 47 | HDIR handle; /* DosFindFirst handle */ 48 | char fstype; /* filesystem type */ 49 | Word count; /* valid entries in */ 50 | long number; /* absolute number of next entry */ 51 | int index; /* relative number of next entry */ 52 | FFBUF * next; /* pointer to next entry */ 53 | char name[MAXPATHLEN+3]; /* directory name */ 54 | unsigned attrmask; /* attribute mask for seekdir */ 55 | struct dirent entry; /* buffer for directory entry */ 56 | BYTE ffbuf[BufSz]; 57 | }; 58 | 59 | /* 60 | * Return first char of filesystem type, or 0 if unknown. 61 | */ 62 | static char API getFSType(const char *path) 63 | { 64 | static char cache[1+26]; 65 | char drive[3], info[512]; 66 | Word unit, infolen; 67 | char r; 68 | 69 | if (isalpha((int)path[0]) && path[1] == ':') { 70 | unit = toupper(path[0]) - '@'; 71 | path += 2; 72 | } else { 73 | ULONG driveMap; 74 | if (DosQueryCurrentDisk(&unit, &driveMap)) 75 | return 0; 76 | } 77 | 78 | if ((path[0] == '\\' || path[0] == '/') 79 | && (path[1] == '\\' || path[1] == '/')) 80 | return 0; 81 | 82 | if (cache [unit]) 83 | return cache [unit]; 84 | 85 | drive[0] = '@' + unit; 86 | drive[1] = ':'; 87 | drive[2] = '\0'; 88 | infolen = sizeof info; 89 | if (DosQueryFSAttach((PSZ)drive, 0, FSAIL_QUERYNAME, (PVOID)info, &infolen)) 90 | return 0; 91 | if (infolen >= sizeof(FSQBUFFER2)) { 92 | FSQBUFFER2 *p = (FSQBUFFER2 *)info; 93 | r = p->szFSDName[p->cbName]; 94 | } else 95 | r = 0; 96 | return cache [unit] = r; 97 | } 98 | 99 | char * API _abs_path(const char *name, char *buffer, int len) 100 | { 101 | char buf[4]; 102 | if (isalpha((int)name[0]) && name[1] == ':' && name[2] == '\0') { 103 | buf[0] = name[0]; 104 | buf[1] = name[1]; 105 | buf[2] = '.'; 106 | buf[3] = '\0'; 107 | name = buf; 108 | } 109 | if (DosQueryPathInfo((PSZ)name, FIL_QUERYFULLNAME, buffer, len)) 110 | return NULL; 111 | return buffer; 112 | } 113 | 114 | DIR * API _openxdir(const char *path, unsigned att_mask) 115 | { 116 | DIR *dir; 117 | char name[MAXPATHLEN+3]; 118 | Word rc; 119 | 120 | if(!path) 121 | return NULL; 122 | 123 | dir = malloc(sizeof(DIR)); 124 | if (dir == NULL) { 125 | errno = ENOMEM; 126 | return NULL; 127 | } 128 | 129 | strncpy(name, path, MAXPATHLEN); 130 | name[MAXPATHLEN] = '\0'; 131 | switch (name[strlen(name)-1]) { 132 | default: 133 | strcat(name, "\\"); 134 | case '\\': 135 | case '/': 136 | case ':': 137 | ; 138 | } 139 | strcat(name, "."); 140 | if (!abs_path(name, dir->name, MAXPATHLEN+1)) 141 | strcpy(dir->name, name); 142 | if (dir->name[strlen(dir->name)-1] == '\\') 143 | strcat(dir->name, "*"); 144 | else 145 | strcat(dir->name, "\\*"); 146 | 147 | dir->fstype = getFSType(dir->name); 148 | dir->attrmask = att_mask | A_DIR; 149 | 150 | dir->handle = HDIR_CREATE; 151 | dir->count = 100; 152 | rc = DosFindFirst((PSZ)dir->name, &dir->handle, dir->attrmask, 153 | dir->ffbuf, sizeof dir->ffbuf, &dir->count, FIL_STANDARD); 154 | switch (rc) { 155 | default: 156 | free(dir); 157 | error(rc); 158 | return NULL; 159 | case NO_ERROR: 160 | case ERROR_NO_MORE_FILES: 161 | ; 162 | } 163 | 164 | dir->number = 0; 165 | dir->index = 0; 166 | dir->next = (FFBUF *)dir->ffbuf; 167 | 168 | return (DIR *)dir; 169 | } 170 | 171 | DIR * API _opendir(const char *pathname) 172 | { 173 | return openxdir(pathname, 0); 174 | } 175 | 176 | struct dirent * API _readdir(DIR *dir) 177 | { 178 | static int dummy_ino = 2; 179 | 180 | if (dir->index == dir->count) { 181 | Word rc; 182 | dir->count = 100; 183 | rc = DosFindNext(dir->handle, dir->ffbuf, 184 | sizeof dir->ffbuf, &dir->count); 185 | if (rc) { 186 | error(rc); 187 | return NULL; 188 | } 189 | 190 | dir->index = 0; 191 | dir->next = (FFBUF *)dir->ffbuf; 192 | } 193 | 194 | if (dir->index == dir->count) 195 | return NULL; 196 | 197 | memcpy(dir->entry.d_name, dir->next->achName, dir->next->cchName); 198 | dir->entry.d_name[dir->next->cchName] = '\0'; 199 | dir->entry.d_ino = dummy_ino++; 200 | dir->entry.d_reclen = dir->next->cchName; 201 | dir->entry.d_namlen = dir->next->cchName; 202 | dir->entry.d_size = dir->next->cbFile; 203 | dir->entry.d_attribute = dir->next->attrFile; 204 | dir->entry.d_time = *(USHORT *)&dir->next->ftimeLastWrite; 205 | dir->entry.d_date = *(USHORT *)&dir->next->fdateLastWrite; 206 | 207 | switch (dir->fstype) { 208 | case 'F': /* FAT */ 209 | case 'C': /* CDFS */ 210 | if (dir->next->attrFile & FILE_DIRECTORY) 211 | strupr(dir->entry.d_name); 212 | else 213 | strlwr(dir->entry.d_name); 214 | } 215 | 216 | dir->next = (FFBUF *)((BYTE *)dir->next + dir->next->oNextEntryOffset); 217 | ++dir->number; 218 | ++dir->index; 219 | 220 | return &dir->entry; 221 | } 222 | 223 | long API _telldir(DIR *dir) 224 | { 225 | return dir->number; 226 | } 227 | 228 | void API _seekdir(DIR *dir, long off) 229 | { 230 | if (dir->number > off) { 231 | char name[MAXPATHLEN+2]; 232 | Word rc; 233 | 234 | DosFindClose(dir->handle); 235 | 236 | strcpy(name, dir->name); 237 | strcat(name, "*"); 238 | 239 | dir->handle = HDIR_CREATE; 240 | dir->count = 32767; 241 | rc = DosFindFirst((PSZ)name, &dir->handle, dir->attrmask, 242 | dir->ffbuf, sizeof dir->ffbuf, &dir->count, FIL_STANDARD); 243 | switch (rc) { 244 | default: 245 | error(rc); 246 | return; 247 | case NO_ERROR: 248 | case ERROR_NO_MORE_FILES: 249 | ; 250 | } 251 | 252 | dir->number = 0; 253 | dir->index = 0; 254 | dir->next = (FFBUF *)dir->ffbuf; 255 | } 256 | 257 | while (dir->number < off && readdir(dir)) 258 | ; 259 | } 260 | 261 | void API _closedir(DIR *dir) 262 | { 263 | DosFindClose(dir->handle); 264 | free(dir); 265 | } 266 | 267 | /*****************************************************************************/ 268 | 269 | #ifdef TEST 270 | 271 | main(int argc, char **argv) 272 | { 273 | int i; 274 | DIR *dir; 275 | struct dirent *ep; 276 | 277 | for (i = 1; i < argc; ++i) { 278 | dir = opendir(argv[i]); 279 | if (!dir) 280 | continue; 281 | while (ep = readdir(dir)) 282 | if (strchr("\\/:", argv[i] [strlen(argv[i]) - 1])) 283 | printf("%s%s\n", argv[i], ep->d_name); 284 | else 285 | printf("%s/%s\n", argv[i], ep->d_name); 286 | closedir(dir); 287 | } 288 | 289 | return 0; 290 | } 291 | 292 | #endif 293 | 294 | -------------------------------------------------------------------------------- /os2/dw.def: -------------------------------------------------------------------------------- 1 | LIBRARY DW INITINSTANCE TERMINSTANCE 2 | 3 | DESCRIPTION 'Dynamic Windows for OS/2' 4 | 5 | CODE LOADONCALL 6 | DATA NONSHARED LOADONCALL 7 | 8 | EXPORTS 9 | dw_init @10 10 | dw_main @11 11 | dw_exit @12 12 | dw_beep @13 13 | dw_messagebox @14 14 | dw_debug @15 15 | dw_environment_query @16 16 | dw_exec @17 17 | dw_browse @18 18 | dw_file_browse @19 19 | dw_user_dir @20 20 | dw_flush @21 21 | dw_free @22 22 | dw_main_sleep @23 23 | dw_main_iteration @24 24 | dw_app_dir @25 25 | dw_main_quit @26 26 | dw_shutdown @27 27 | dw_app_id_set @28 28 | 29 | _dw_init_thread @30 30 | _dw_deinit_thread @31 31 | 32 | dw_vdebug @35 33 | dw_vmessagebox @36 34 | 35 | dw_box_new @40 36 | dw_groupbox_new @41 37 | dw_box_pack_start @42 38 | dw_box_pack_end @43 39 | dw_box_pack_at_index @44 40 | 41 | dw_mdi_new @46 42 | 43 | dw_box_unpack @47 44 | dw_box_unpack_at_index @48 45 | 46 | dw_window_new @50 47 | dw_window_show @51 48 | dw_window_hide @52 49 | dw_window_destroy @53 50 | dw_window_set_font @54 51 | dw_window_set_color @55 52 | dw_window_set_pos @56 53 | dw_window_set_size @57 54 | dw_window_set_pos_size @58 55 | dw_window_get_pos_size @59 56 | dw_window_set_style @60 57 | dw_window_set_icon @61 58 | dw_window_set_bitmap @62 59 | dw_window_get_text @63 60 | dw_window_set_text @64 61 | dw_window_disable @65 62 | dw_window_enable @66 63 | dw_window_capture @67 64 | dw_window_release @68 65 | dw_window_reparent @69 66 | dw_window_function @70 67 | dw_window_from_id @71 68 | dw_window_set_border @72 69 | dw_window_minimize @73 70 | dw_window_set_pointer @74 71 | dw_window_default @75 72 | dw_window_raise @76 73 | dw_window_lower @77 74 | dw_window_click_default @78 75 | dw_window_redraw @79 76 | dw_bitmap_new @80 77 | dw_window_set_bitmap_from_data @81 78 | dw_window_get_font @82 79 | dw_window_set_tooltip @83 80 | dw_window_get_preferred_size @84 81 | dw_window_set_gravity @85 82 | dw_window_set_focus @86 83 | dw_window_compare @87 84 | 85 | dw_button_new @90 86 | dw_bitmapbutton_new @91 87 | dw_bitmapbutton_new_from_file @92 88 | dw_bitmapbutton_new_from_data @93 89 | 90 | dw_text_new @100 91 | dw_status_text_new @101 92 | 93 | dw_entryfield_new @110 94 | dw_entryfield_password_new @111 95 | 96 | dw_combobox_new @120 97 | 98 | dw_radiobutton_new @130 99 | 100 | dw_listbox_new @140 101 | dw_listbox_append @141 102 | dw_listbox_clear @142 103 | dw_listbox_count @143 104 | dw_listbox_set_top @144 105 | dw_listbox_select @145 106 | dw_listbox_delete @146 107 | dw_listbox_get_text @147 108 | dw_listbox_set_text @148 109 | dw_listbox_selected @149 110 | dw_listbox_selected_multi @150 111 | dw_listbox_list_append @151 112 | dw_listbox_insert @152 113 | 114 | dw_percent_new @160 115 | dw_percent_set_pos @162 116 | 117 | dw_mle_new @170 118 | dw_mle_import @171 119 | dw_mle_export @172 120 | dw_mle_get_size @173 121 | dw_mle_delete @174 122 | dw_mle_clear @175 123 | dw_mle_freeze @176 124 | dw_mle_thaw @177 125 | dw_mle_set_cursor @178 126 | dw_mle_set_visible @179 127 | dw_mle_search @180 128 | dw_mle_set_editable @181 129 | dw_mle_set_word_wrap @182 130 | dw_mle_set_auto_complete @183 131 | 132 | dw_spinbutton_new @190 133 | dw_spinbutton_set_pos @191 134 | dw_spinbutton_set_limits @192 135 | dw_entryfield_set_limit @193 136 | dw_spinbutton_get_pos @194 137 | 138 | dw_checkbox_new @200 139 | dw_checkbox_get @201 140 | dw_checkbox_set @202 141 | 142 | dw_icon_load @210 143 | dw_icon_free @211 144 | dw_icon_load_from_file @212 145 | dw_icon_load_from_data @213 146 | 147 | dw_container_new @220 148 | dw_container_setup @221 149 | dw_container_alloc @222 150 | dw_container_set_item @223 151 | dw_container_set_row_title @224 152 | dw_container_insert @225 153 | dw_container_clear @226 154 | dw_container_query_start @228 155 | dw_container_query_next @229 156 | dw_container_delete @230 157 | dw_container_scroll @231 158 | dw_container_set_column_width @232 159 | dw_container_cursor @233 160 | dw_container_optimize @234 161 | dw_container_delete_row @235 162 | dw_container_change_item @236 163 | dw_container_get_column_type @237 164 | dw_container_change_row_title @238 165 | dw_container_set_stripe @239 166 | 167 | dw_filesystem_setup @240 168 | dw_filesystem_set_item @241 169 | dw_filesystem_set_file @242 170 | dw_filesystem_change_item @243 171 | dw_filesystem_change_file @244 172 | dw_filesystem_get_column_type @245 173 | dw_filesystem_set_column_title @246 174 | 175 | dw_container_set_row_data @600 176 | dw_container_change_row_data @601 177 | dw_container_delete_row_by_data @602 178 | dw_container_cursor_by_data @603 179 | 180 | dw_screen_width @250 181 | dw_screen_height @251 182 | 183 | dw_color_depth_get @260 184 | dw_color_foreground_set @261 185 | dw_color_background_set @262 186 | dw_color_choose @263 187 | 188 | dw_notebook_new @270 189 | dw_notebook_page_new @271 190 | dw_notebook_page_destroy @272 191 | dw_notebook_page_set_text @273 192 | dw_notebook_page_set_status_text @274 193 | dw_notebook_page_set @275 194 | dw_notebook_page_get @276 195 | dw_notebook_pack @277 196 | 197 | dw_menu_new @280 198 | dw_menubar_new @281 199 | dw_menu_append_item @282 200 | dw_menu_item_set_check @283 201 | dw_menu_popup @284 202 | dw_menu_destroy @285 203 | dw_menu_item_set_state @286 204 | dw_menu_delete_item @287 205 | 206 | dw_pointer_query_pos @290 207 | dw_pointer_set_pos @291 208 | 209 | dw_mutex_new @300 210 | dw_mutex_close @301 211 | dw_mutex_lock @302 212 | dw_mutex_unlock @303 213 | dw_mutex_trylock @304 214 | 215 | dw_event_new @310 216 | dw_event_reset @311 217 | dw_event_post @312 218 | dw_event_wait @313 219 | dw_event_close @314 220 | 221 | dw_thread_new @320 222 | dw_thread_end @321 223 | dw_thread_id @322 224 | 225 | dw_render_new @330 226 | dw_draw_point @331 227 | dw_draw_line @332 228 | dw_draw_rect @333 229 | dw_draw_text @334 230 | dw_draw_polygon @335 231 | dw_draw_arc @336 232 | dw_render_redraw @337 233 | 234 | dw_pixmap_bitblt @340 235 | dw_pixmap_new @341 236 | dw_pixmap_grab @342 237 | dw_pixmap_destroy @343 238 | dw_pixmap_new_from_file @344 239 | dw_pixmap_new_from_data @345 240 | dw_pixmap_set_transparent_color @346 241 | dw_pixmap_set_font @347 242 | dw_pixmap_stretch_bitblt @348 243 | dw_pixmap_get_width @355 244 | dw_pixmap_get_height @356 245 | 246 | dw_dialog_new @350 247 | dw_dialog_dismiss @351 248 | dw_dialog_wait @352 249 | 250 | dw_signal_connect @360 251 | dw_signal_disconnect_by_window @361 252 | dw_signal_disconnect_by_data @362 253 | dw_signal_disconnect_by_name @363 254 | dw_signal_connect_data @364 255 | 256 | dw_timer_connect @365 257 | dw_timer_disconnect @366 258 | 259 | dw_tree_new @370 260 | dw_tree_insert @371 261 | dw_tree_clear @372 262 | dw_tree_item_delete @373 263 | dw_tree_item_change @374 264 | dw_tree_item_expand @375 265 | dw_tree_item_collapse @376 266 | dw_tree_item_select @377 267 | dw_tree_item_set_data @378 268 | dw_tree_insert_after @379 269 | dw_tree_item_get_data @380 270 | dw_tree_get_title @381 271 | dw_tree_get_parent @382 272 | 273 | dw_font_text_extents_get @385 274 | dw_font_choose @386 275 | dw_font_set_default @387 276 | 277 | dw_slider_new @390 278 | dw_slider_get_pos @391 279 | dw_slider_set_pos @392 280 | 281 | dw_window_set_data @400 282 | dw_window_get_data @401 283 | 284 | dw_splitbar_new @410 285 | dw_splitbar_set @411 286 | dw_splitbar_get @412 287 | 288 | dw_module_load @420 289 | dw_module_symbol @421 290 | dw_module_close @422 291 | 292 | dw_scrollbar_new @430 293 | dw_scrollbar_get_pos @431 294 | dw_scrollbar_set_pos @432 295 | dw_scrollbar_set_range @433 296 | 297 | dw_taskbar_insert @440 298 | dw_taskbar_delete @441 299 | 300 | dw_named_memory_new @450 301 | dw_named_memory_get @451 302 | dw_named_memory_free @452 303 | 304 | dw_named_event_new @460 305 | dw_named_event_get @461 306 | dw_named_event_reset @462 307 | dw_named_event_post @463 308 | dw_named_event_wait @464 309 | dw_named_event_close @465 310 | 311 | dw_html_new @470 312 | dw_html_action @471 313 | dw_html_raw @472 314 | dw_html_url @473 315 | dw_html_javascript_run @474 316 | dw_html_javascript_add @475 317 | 318 | dw_calendar_new @480 319 | dw_calendar_set_date @481 320 | dw_calendar_get_date @482 321 | 322 | dw_clipboard_get_text @490 323 | dw_clipboard_set_text @491 324 | 325 | dw_scrollbox_new @500 326 | dw_scrollbox_get_pos @501 327 | dw_scrollbox_get_range @502 328 | 329 | dw_print_new @510 330 | dw_print_run @511 331 | dw_print_cancel @512 332 | 333 | dw_utf8_to_wchar @520 334 | dw_wchar_to_utf8 @521 335 | 336 | dw_notification_new @530 337 | dw_notification_send @531 338 | 339 | dw_feature_get @540 340 | dw_feature_set @541 341 | -------------------------------------------------------------------------------- /os2/dw.lnk: -------------------------------------------------------------------------------- 1 | option DESCRIPTION 'Dynamic Windows for OS/2' 2 | segment type DATA NONSHARED LOADONCALL 3 | 4 | export dw_init.10 5 | export dw_main.11 6 | export dw_exit.12 7 | export dw_beep.13 8 | export dw_messagebox.14 9 | export dw_debug.15 10 | export dw_environment_query.16 11 | export dw_exec.17 12 | export dw_browse.18 13 | export dw_file_browse.19 14 | export dw_user_dir.20 15 | export dw_flush.21 16 | export dw_free.22 17 | export dw_main_sleep.23 18 | export dw_main_iteration.24 19 | export dw_app_dir.25 20 | export dw_main_quit.26 21 | export dw_shutdown.27 22 | export dw_app_id_set.28 23 | 24 | export _dw_init_thread.30 25 | export _dw_deinit_thread.31 26 | 27 | export dw_vdebug.35 28 | export dw_vmessagebox.36 29 | 30 | export dw_box_new.40 31 | export dw_groupbox_new.41 32 | export dw_box_pack_start.42 33 | export dw_box_pack_end.43 34 | export dw_box_pack_at_index.44 35 | 36 | export dw_mdi_new.46 37 | 38 | export dw_box_unpack.47 39 | export dw_box_unpack_at_index.48 40 | 41 | export dw_window_new.50 42 | export dw_window_show.51 43 | export dw_window_hide.52 44 | export dw_window_destroy.53 45 | export dw_window_set_font.54 46 | export dw_window_set_color.55 47 | export dw_window_set_pos.56 48 | export dw_window_set_size.57 49 | export dw_window_set_pos_size.58 50 | export dw_window_get_pos_size.59 51 | export dw_window_set_style.60 52 | export dw_window_set_icon.61 53 | export dw_window_set_bitmap.62 54 | export dw_window_get_text.63 55 | export dw_window_set_text.64 56 | export dw_window_disable.65 57 | export dw_window_enable.66 58 | export dw_window_capture.67 59 | export dw_window_release.68 60 | export dw_window_reparent.69 61 | export dw_window_function.70 62 | export dw_window_from_id.71 63 | export dw_window_set_border.72 64 | export dw_window_minimize.73 65 | export dw_window_set_pointer.74 66 | export dw_window_default.75 67 | export dw_window_raise.76 68 | export dw_window_lower.77 69 | export dw_window_click_default.78 70 | export dw_window_redraw.79 71 | export dw_bitmap_new.80 72 | export dw_window_set_bitmap_from_data.81 73 | export dw_window_get_font.82 74 | export dw_window_set_tooltip.83 75 | export dw_window_get_preferred_size.84 76 | export dw_window_set_gravity.85 77 | export dw_window_set_focus.86 78 | export dw_window_compare.87 79 | 80 | export dw_button_new.90 81 | export dw_bitmapbutton_new.91 82 | export dw_bitmapbutton_new_from_file.92 83 | export dw_bitmapbutton_new_from_data.93 84 | 85 | export dw_text_new.100 86 | export dw_status_text_new.101 87 | 88 | export dw_entryfield_new.110 89 | export dw_entryfield_password_new.111 90 | 91 | export dw_combobox_new.120 92 | 93 | export dw_radiobutton_new.130 94 | 95 | export dw_listbox_new.140 96 | export dw_listbox_append.141 97 | export dw_listbox_clear.142 98 | export dw_listbox_count.143 99 | export dw_listbox_set_top.144 100 | export dw_listbox_select.145 101 | export dw_listbox_delete.146 102 | export dw_listbox_get_text.147 103 | export dw_listbox_set_text.148 104 | export dw_listbox_selected.149 105 | export dw_listbox_selected_multi.150 106 | export dw_listbox_list_append.151 107 | export dw_listbox_insert.152 108 | 109 | export dw_percent_new.160 110 | export dw_percent_set_pos.162 111 | 112 | export dw_mle_new.170 113 | export dw_mle_import.171 114 | export dw_mle_export.172 115 | export dw_mle_get_size.173 116 | export dw_mle_delete.174 117 | export dw_mle_clear.175 118 | export dw_mle_freeze.176 119 | export dw_mle_thaw.177 120 | export dw_mle_set_cursor.178 121 | export dw_mle_set_visible.179 122 | export dw_mle_search.180 123 | export dw_mle_set_editable.181 124 | export dw_mle_set_word_wrap.182 125 | 126 | export dw_spinbutton_new.190 127 | export dw_spinbutton_set_pos.191 128 | export dw_spinbutton_set_limits.192 129 | export dw_entryfield_set_limit.193 130 | export dw_spinbutton_get_pos.194 131 | 132 | export dw_checkbox_new.200 133 | export dw_checkbox_get.201 134 | export dw_checkbox_set.202 135 | 136 | export dw_icon_load.210 137 | export dw_icon_free.211 138 | export dw_icon_load_from_file.212 139 | export dw_icon_load_from_data.213 140 | 141 | export dw_container_new.220 142 | export dw_container_setup.221 143 | export dw_container_alloc.222 144 | export dw_container_set_item.223 145 | export dw_container_set_row_title.224 146 | export dw_container_insert.225 147 | export dw_container_clear.226 148 | export dw_container_query_start.228 149 | export dw_container_query_next.229 150 | export dw_container_delete.230 151 | export dw_container_scroll.231 152 | export dw_container_set_column_width.232 153 | export dw_container_cursor.233 154 | export dw_container_optimize.234 155 | export dw_container_delete_row.235 156 | export dw_container_change_item.236 157 | export dw_container_get_column_type.237 158 | export dw_container_change_row_title.238 159 | export dw_container_set_stripe.239 160 | 161 | export dw_filesystem_setup.240 162 | export dw_filesystem_set_item.241 163 | export dw_filesystem_set_file.242 164 | export dw_filesystem_change_item.243 165 | export dw_filesystem_change_file.244 166 | export dw_filesystem_get_column_type.245 167 | export dw_filesystem_set_column_title.246 168 | 169 | export dw_container_set_row_data.600 170 | export dw_container_change_row_data.601 171 | export dw_container_delete_row_by_data.602 172 | export dw_container_cursor_by_data.603 173 | 174 | export dw_screen_width.250 175 | export dw_screen_height.251 176 | 177 | export dw_color_depth_get.260 178 | export dw_color_foreground_set.261 179 | export dw_color_background_set.262 180 | export dw_color_choose.263 181 | 182 | export dw_notebook_new.270 183 | export dw_notebook_page_new.271 184 | export dw_notebook_page_destroy.272 185 | export dw_notebook_page_set_text.273 186 | export dw_notebook_page_set_status_text.274 187 | export dw_notebook_page_set.275 188 | export dw_notebook_page_get.276 189 | export dw_notebook_pack.277 190 | 191 | export dw_menu_new.280 192 | export dw_menubar_new.281 193 | export dw_menu_append_item.282 194 | export dw_menu_item_set_check.283 195 | export dw_menu_popup.284 196 | export dw_menu_destroy.285 197 | export dw_menu_item_set_state.286 198 | 199 | export dw_pointer_query_pos.290 200 | export dw_pointer_set_pos.291 201 | 202 | export dw_mutex_new.300 203 | export dw_mutex_close.301 204 | export dw_mutex_lock.302 205 | export dw_mutex_unlock.303 206 | export dw_mutex_trylock.304 207 | 208 | export dw_event_new.310 209 | export dw_event_reset.311 210 | export dw_event_post.312 211 | export dw_event_wait.313 212 | export dw_event_close.314 213 | 214 | export dw_thread_new.320 215 | export dw_thread_end.321 216 | export dw_thread_id.322 217 | 218 | export dw_render_new.330 219 | export dw_draw_point.331 220 | export dw_draw_line.332 221 | export dw_draw_rect.333 222 | export dw_draw_text.334 223 | export dw_draw_polygon.335 224 | export dw_draw_arc.336 225 | export dw_render_redraw.337 226 | 227 | export dw_pixmap_bitblt.340 228 | export dw_pixmap_new.341 229 | export dw_pixmap_grab.342 230 | export dw_pixmap_destroy.343 231 | export dw_pixmap_new_from_file.344 232 | export dw_pixmap_new_from_data.345 233 | export dw_pixmap_set_transparent_color.346 234 | export dw_pixmap_set_font.347 235 | export dw_pixmap_stretch_bitblt.348 236 | export dw_pixmap_get_width.355 237 | export dw_pixmap_get_height.356 238 | 239 | export dw_dialog_new.350 240 | export dw_dialog_dismiss.351 241 | export dw_dialog_wait.352 242 | 243 | export dw_signal_connect.360 244 | export dw_signal_disconnect_by_window.361 245 | export dw_signal_disconnect_by_data.362 246 | export dw_signal_disconnect_by_name.363 247 | export dw_signal_connect_data.364 248 | 249 | export dw_timer_connect.365 250 | export dw_timer_disconnect.366 251 | 252 | export dw_tree_new.370 253 | export dw_tree_insert.371 254 | export dw_tree_clear.372 255 | export dw_tree_item_delete.373 256 | export dw_tree_item_change.374 257 | export dw_tree_item_expand.375 258 | export dw_tree_item_collapse.376 259 | export dw_tree_item_select.377 260 | export dw_tree_item_set_data.378 261 | export dw_tree_insert_after.379 262 | export dw_tree_item_get_data.380 263 | export dw_tree_get_title.381 264 | export dw_tree_get_parent.382 265 | 266 | export dw_font_text_extents_get.385 267 | export dw_font_choose.386 268 | export dw_font_set_default.387 269 | 270 | export dw_slider_new.390 271 | export dw_slider_get_pos.391 272 | export dw_slider_set_pos.392 273 | 274 | export dw_window_set_data.400 275 | export dw_window_get_data.401 276 | 277 | export dw_splitbar_new.410 278 | export dw_splitbar_set.411 279 | export dw_splitbar_get.412 280 | 281 | export dw_module_load.420 282 | export dw_module_symbol.421 283 | export dw_module_close.422 284 | 285 | export dw_scrollbar_new.430 286 | export dw_scrollbar_get_pos.431 287 | export dw_scrollbar_set_pos.432 288 | export dw_scrollbar_set_range.433 289 | 290 | export dw_taskbar_insert.440 291 | export dw_taskbar_delete.441 292 | 293 | export dw_named_memory_new.450 294 | export dw_named_memory_get.451 295 | export dw_named_memory_free.452 296 | 297 | export dw_named_event_new.460 298 | export dw_named_event_get.461 299 | export dw_named_event_reset.462 300 | export dw_named_event_post.463 301 | export dw_named_event_wait.464 302 | export dw_named_event_close.465 303 | 304 | export dw_html_new.470 305 | export dw_html_action.471 306 | export dw_html_raw.472 307 | export dw_html_url.473 308 | export dw_html_javascript_run.474 309 | export dw_html_javascript_add.475 310 | 311 | export dw_calendar_new.480 312 | export dw_calendar_set_date.481 313 | export dw_calendar_get_date.482 314 | 315 | export dw_clipboard_get_text.490 316 | export dw_clipboard_set_text.491 317 | 318 | export dw_scrollbox_new.500 319 | export dw_scrollbox_get_pos.501 320 | export dw_scrollbox_get_range.502 321 | 322 | export dw_print_new.510 323 | export dw_print_run.511 324 | export dw_print_cancel.512 325 | 326 | export dw_utf8_to_wchar.520 327 | export dw_wchar_to_utf8.521 328 | 329 | export dw_notification_new.530 330 | export dw_notification_send.531 331 | 332 | export dw_feature_get.540 333 | export dw_feature_set.541 334 | 335 | -------------------------------------------------------------------------------- /os2/dwcompat.def: -------------------------------------------------------------------------------- 1 | LIBRARY DWCOMPAT INITINSTANCE TERMINSTANCE 2 | 3 | DESCRIPTION 'Dynamic Windows Compatibility Module for OS/2' 4 | 5 | CODE LOADONCALL 6 | DATA NONSHARED LOADONCALL 7 | 8 | EXPORTS 9 | makedir @20 10 | vargs @21 11 | setfileinfo @22 12 | drivefree @23 13 | isdrive @24 14 | drivesize @25 15 | getfsname @26 16 | 17 | _opendir @30 18 | _openxdir @31 19 | _readdir @32 20 | _seekdir @33 21 | _telldir @34 22 | _closedir @35 23 | 24 | fsopen @40 25 | fsclose @41 26 | fsgets @42 27 | fsseek @43 28 | 29 | locale_init @50 30 | locale_string @51 31 | 32 | nice_strformat @60 33 | initdir @61 34 | -------------------------------------------------------------------------------- /os2/dwcompat.lnk: -------------------------------------------------------------------------------- 1 | option DESCRIPTION 'Dynamic Windows Compatibility Module for OS/2' 2 | segment type DATA NONSHARED LOADONCALL 3 | 4 | export makedir.20 5 | export vargs.21 6 | export setfileinfo.22 7 | export drivefree.23 8 | export isdrive.24 9 | export drivesize.25 10 | export getfsname.26 11 | 12 | export _opendir.30 13 | export _openxdir.31 14 | export _readdir.32 15 | export _seekdir.33 16 | export _telldir.34 17 | export _closedir.35 18 | 19 | export fsopen.40 20 | export fsclose.41 21 | export fsgets.42 22 | export fsseek.43 23 | 24 | export locale_init.50 25 | export locale_string.51 26 | 27 | export nice_strformat.60 28 | export initdir.61 29 | -------------------------------------------------------------------------------- /os2/dwtest.def: -------------------------------------------------------------------------------- 1 | NAME DWTEST WINDOWAPI 2 | 3 | DESCRIPTION 'Sample DW application' 4 | 5 | STACKSIZE 128000 6 | -------------------------------------------------------------------------------- /os2/file.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dbsoft/dwindows/5c2f0fff986340614cea6cd08a4bcaee1453752c/os2/file.ico -------------------------------------------------------------------------------- /os2/folder.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dbsoft/dwindows/5c2f0fff986340614cea6cd08a4bcaee1453752c/os2/folder.ico -------------------------------------------------------------------------------- /os2/readme-os2.txt: -------------------------------------------------------------------------------- 1 | This package contains Dynamic Windows (dwindows) v 3.1 for OS/2 and eCS. 2 | 3 | It contains: 4 | 5 | dw.dll - main dwindows DLL 6 | dwcompat.dll - compatibility DLL (optional) 7 | dw.h - header file 8 | dw.lib - import library for functions in dw.dll 9 | dwcompat.lib - import library for functions in dwcompat.dll 10 | readme-os2.txt - this file 11 | 12 | This binary package was compiled with gcc 9.2.0. 13 | It requires libcn0.dll available at https://ecsoft2.org/libc-next-runtime 14 | 15 | Dynamic Windows may take advantage of features from these packages: 16 | 17 | XCenter/eCenter with the System Tray plugin 18 | http://www.eros2.info/systray_widget_en.shtml 19 | 20 | Generalized Bitmap Module - For additional image formats 21 | https://ecsoft2.org/generalised-bitmap-module-gbm 22 | 23 | -- Special notes for version 3.1 -- 24 | Version 2.4 has started a transition to Unicode on OS/2. Warp 4 and 25 | later have fairly decent support for UTF-8 via codepage 1208, however 26 | there are some known input problems, which shall be worked around 27 | in future versions. For English or non-input applications Unicode 28 | is the recommended version, however for applications that have not 29 | been converted to UTF-8 or which are experiencing input problems, 30 | a non-Unicode version of the DLL is included. 31 | -------------------------------------------------------------------------------- /os2/svnrev.cmd: -------------------------------------------------------------------------------- 1 | /* REXX script to get the svn revision and display it. */ 2 | Trace o 3 | fn = 'SVN.REV' 4 | 'svnversion . | rxqueue > nul:' 5 | /* default version to 0, if svnversion doesn't exist or no .svn here */ 6 | ver = 0 7 | If Queued() \= 0 Then 8 | Do 9 | /* Using PARSE PULL preserves case */ 10 | /* If it is a double value get the first value only */ 11 | Parse Pull sval ver ':' . 12 | If Strip( ver ) = '' Then ver = sval 13 | If ver = 'exported' Then ver = 0 14 | If Datatype( Right( ver, 1 ) ) \= 'NUM' Then ver = Substr( ver, 1, Length( ver) - 1 ) 15 | End 16 | Call Stream fn, 'C', 'OPEN' 17 | Call Lineout fn,'VERREV='ver 18 | Call Stream fn, 'C', 'CLOSE' 19 | Exit 0 20 | 21 | -------------------------------------------------------------------------------- /platform/dirent.h: -------------------------------------------------------------------------------- 1 | #ifdef __UNIX__ 2 | #include 3 | #else 4 | #ifndef __DIRENT_H__ 5 | #define __DIRENT_H__ 6 | 7 | #include "dwcompat.h" 8 | #include 9 | #ifdef MAXPATHLEN 10 | #undef MAXPATHLEN 11 | #endif 12 | #define MAXPATHLEN (FILENAME_MAX*4) 13 | #define MAXNAMLEN FILENAME_MAX 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | /* attribute stuff */ 20 | #ifndef A_RONLY 21 | # define A_RONLY 0x01 22 | # define A_HIDDEN 0x02 23 | # define A_SYSTEM 0x04 24 | # define A_LABEL 0x08 25 | # define A_DIR 0x10 26 | # define A_ARCHIVE 0x20 27 | #endif 28 | 29 | #ifdef __WATCOMC__ 30 | #undef DIR 31 | #undef direct 32 | #undef dirent 33 | #define DIR DIRW 34 | #endif 35 | 36 | struct dirent { 37 | int d_ino; /* Dummy */ 38 | int d_reclen; /* Dummy, same as d_namlen */ 39 | int d_namlen; /* length of name */ 40 | char d_name[MAXNAMLEN + 1]; 41 | unsigned long long d_size; 42 | unsigned long d_attribute; /* attributes (see above) */ 43 | unsigned short d_time; /* modification time */ 44 | unsigned short d_date; /* modification date */ 45 | }; 46 | 47 | typedef struct _dirdescr DIR; 48 | /* the structs do not have to be defined here */ 49 | 50 | extern DIR * API _opendir(const char *); 51 | #define opendir(a) _opendir(a) 52 | extern DIR *API _openxdir(const char *, unsigned); 53 | #define openxdir(a, b) _openxdir(a, b) 54 | extern struct dirent * API _readdir(DIR *); 55 | #define readdir(a) _readdir(a) 56 | extern void API _seekdir(DIR *, long); 57 | #define seekdir(a, b) _seekdir(a, b) 58 | extern long API _telldir(DIR *); 59 | #define telldir(a) _telldir(a) 60 | extern void API _closedir(DIR *); 61 | #define closedir(a) _closedir(a) 62 | 63 | #define rewinddir(dirp) _seekdir(dirp, 0L) 64 | extern char * API _abs_path(const char *name, char *buffer, int len); 65 | #define abs_path(a, b, c) _abs_path(a, b, c) 66 | 67 | #ifndef S_IFMT 68 | #define S_IFMT ( S_IFDIR | S_IFREG ) 69 | #endif 70 | 71 | #ifndef S_ISDIR 72 | #define S_ISDIR( m ) (((m) & S_IFMT) == S_IFDIR) 73 | #endif 74 | 75 | #ifndef S_ISREG 76 | #define S_ISREG( m ) (((m) & S_IFMT) == S_IFREG) 77 | #endif 78 | 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | 83 | #endif 84 | #endif 85 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | This is a stable release of Dynamic Windows version 3.4. 2 | 3 | The current Dynamic Windows source base is considered stable on: 4 | OS/2, Mac, Windows, Linux, FreeBSD, OpenSolaris and iOS. 5 | The source base is considered beta on Android, alpha on C++. 6 | 7 | Build Recommendations: 8 | MacOS: 9 | 11-13: configure --with-arch=modern --with-minver=10.15 10 | 64bit Intel and Apple Silicon (ARM64) with Dark Mode. 11 | 10.13-10.15: configure --with-minver=10.8 12 | 64bit Intel with Notifications, Dark Mode for 10.14-15. 13 | 10.8-10.12: configure --with-arch=intel --with-minver=10.8 14 | 64 and 32bit Intel with Notifications but no Dark Mode. 15 | 10.5-10.6: configure --with-arch=classic --with-minver=10.5 16 | 32bit PowerPC, 64bit and 32bit Intel classic support. 17 | No Notifications, Dark Mode nor NSView container/trees. 18 | Windows: 19 | 7-11: Visual Studio 2017-2022, WebView2 and WinToast. 20 | Should run on Vista and later, supports domain sockets 21 | on Windows 10, oldsockpipe() on older versions. 22 | XP: Visual Studio 2010. 23 | Should run on XP and later, with Aero on Vista and 7. 24 | No Notifications nor WebView2 and oldsockpipe() on all. 25 | 2000: Visual Studio 2005. Should run on 2000 and later, 26 | no Aero, no Notifications, no WebView2 and oldsockpipe() 27 | on all versions. 28 | C++: Recommends a C++11 compatible compiler. 29 | MacOS: PowerPC GCC 6 from Tiger Brew. 30 | Intel Apple Clang from Xcode 4.4 or later. 31 | Apple Silicon any supported Apple Clang. 32 | Windows: Visual Studio 2015, recent Clang-cl or MingW32. 33 | Linux/FreeBSD: GCC 5 or Clang 3.3 recommended. 34 | OS/2: GCC 9.2 from Bitwise Works recommended. 35 | 36 | If you build with a pre-C++11 compiler features will be 37 | disabled, and you may ended up building an extremely 38 | simplified sample application instead of the full one. 39 | 40 | Known problems: 41 | 42 | Boxes with no expandable items will have their contents centered on 43 | GTK2 instead of top or left justified on the other platforms. 44 | Pack an expandable DW_NOHWND item at the end of the box to keep 45 | the same appearance as other platforms. 46 | GTK3/4 due to changes in the core architecture does not support 47 | widgets that are smaller than what is contained within them, 48 | unless they use scrolled windows. GTK2 and other platforms do. 49 | Therefore windows or other elements may expand their size to 50 | fit the contents, overriding requested size settings. 51 | In Unicode mode on OS/2 there are some bugs in the input controls, 52 | minor bugs in entryfield based controls and major bugs in the MLE. 53 | The text displays properly but the cursor and selection jumps 54 | around oddly when passing over multibyte characters. 55 | System scaling on Windows versions earlier than 10 will scale the 56 | individual controls, but will not scale the top-level window size. 57 | Windows 10 and higher will scale both the controls and window. 58 | 59 | Known limitations: 60 | 61 | Some widget may not be completely created when the widget handle is 62 | returned. Some need to be setup such as Container controls on GTK, 63 | and others need to be packed before they are finalized. Once setup 64 | and packed it is completely safe to operate on widgets. If you choose 65 | to operate on widgets before setup and/or packing, then it depends 66 | on the platform if it will work or not. 67 | 68 | Changes from version 3.3: 69 | Pushed up the Android requirements to Android 8 (API 26 Oreo). 70 | Added dw_html_javascript_add() and DW_SIGNAL_HTML_MESSAGE. 71 | This allows HTML embedded javascript to call into native code. 72 | Supported on Windows, Mac, GTK3/4, iOS and Android. 73 | Windows 7+ with Edge WebView2. MacOS 10.10+. 74 | GTK3/4 with WebKitGTK 2 or higher. 75 | iOS and Android, all supported versions. 76 | Added DW_FEATURE_RENDER_SAFE that requires safe rendering. 77 | This means only allowing drawing in the EXPOSE callback. 78 | On Android this also enables off main thread expose events. 79 | Added high and low priority event queues on Android and 80 | increased the queue length. This should prevent important 81 | events from being dropped, only superfluous expose events. 82 | This feature is enabled by default on Android. 83 | This feature is disabled by default or unavailable on others. 84 | Added support for MacOS 14 Sonoma and iOS 17. 85 | 86 | Dynamic Windows Documentation is available at: 87 | 88 | https://dbsoft.org/dw_help.php 89 | 90 | If you have any questions or suggestions feel free to email me at: 91 | 92 | brian@dbsoft.org 93 | 94 | Thanks! 95 | 96 | Brian Smith 97 | -------------------------------------------------------------------------------- /style.txt: -------------------------------------------------------------------------------- 1 | === Code Style and Design === 2 | 3 | --- Design Principles --- 4 | 5 | To explain the existing style and where we are going it makes sense to explain the history of Dynamic Windows. There are several design principles that Dynamic Windows adheres to: 6 | 7 | 1) Compatibility, Portability 8 | 9 | C was chosen as the API because essentially every platform has a C compiler. Even when the internals are written in another language, like C++, Objective-C or Kotlin/Java, the exported API is portable C that can be used on all the platforms. 10 | 11 | 2) Light-weight 12 | 13 | C is also one of the most light weight languages making it a good choice here too. We leverage the native APIs on the platform to reduce the Dynamic Windows footprint. Only implementing our own widgets or functionality when the target platform has no native support. 14 | 15 | 3) Native 16 | 17 | While the C API hides all the internals for a platform from the developer behind typedefs and API calls, the native system functionality is just below the surface. Platform specific #ifdefs can allow you to use native system calls to augment Dynamic Windows functionality. 18 | 19 | This was a bit more simple in the past when all the system APIs were in C, but it is still possible with systems like Mac and iOS where the internals are in Objective-C, an intermediary source file may be necessary to call native code. 20 | 21 | 4) Easily embeddable 22 | 23 | The core Dynamic Windows functionality should be encapsulated into a single file when possible. The idea is that including Dynamic Windows in a project should be as simple as adding the dw.h header and the target platform core source file into your project. 24 | 25 | 5) Simplicity 26 | 27 | It should be fairly simple to write a modern and functional interface even when using a fairly low level language such as C. We accomplish this by encapsulating the complexity in the library behind a simple API. Using the box packing, signal handling and object data functionality that are the center pieces of the API. 28 | 29 | --- History --- 30 | 31 | These principles were critical in the first Dynamic Window use case, it was used to write a graphical self-installer for OS/2 (and later, Windows and Unix). The executable header needed to be compact, and able to function with a minimal system install. Later scripting support was added using the built-in system scripting language REXX, which was also ported to the other platforms using Mark Hessling's Regina REXX interpreter. 32 | 33 | Dynamic Windows was then built as a Dynamic Link Library or Shared Object to be used in more standard applications, including my HandyFTP application which was originally written with the Cell Toolkit on OS/2, the graphical versions of the BitchX IRC client and various other private applications. 34 | 35 | In those early days not much thought was given to namespace pollution, or consistency for the internals, as long as the public APIs were exported and things compiled and worked things were good. As time marched on, code was acquired from other sources or contributed by people to the project and the internal naming got more and more random. 36 | 37 | At some point I became aware that on Linux, shared libraries basically exported all symbols by default, when I ran into an odd symbol conflict issue in an application I was working on. When built as DLLs on OS/2 and Windows this was not really an issue, since exports at the time were explicit in the export definition file. The experience on Linux however, made me think about the naming of global functions and variables, which caused me to start adding an underscore _ to any internal functions in an attempt to avoid conflicts. I did this on all platforms, since one of the design principles was embedding and in that use case even OS/2 and Windows can have name conflicts. 38 | 39 | When I came back from a break from working on Dynamic Windows, I started using _dw_ as the prefix to my internal functions, since while I have never actually run into an issue with an underscored function or variable colliding, it is possible that another library could be using underscores to do the same thing that we were. Therefore for visual consistency and as an added layer of protection the _dw_ prefix seemed like a good idea. 40 | 41 | During the 3.2 release cycle I have been effectively writing 3 new platforms simultaneously, one from scratch (Android) and two based on existing code (iOS based on Mac and GTK4 based on GTK3 and Mac). I began thinking about making things work and look the same on all the platforms. I tried to keep them all functioning similarly and in essentially the same style when possible, which is great for these new platforms but it caused them to diverge from the existing platforms. So I decided to go back and start updating the old existing platforms with the style choices I made with these new platforms, and it became obvious I should document and have discussions with users about these changes. 42 | 43 | --- Style in the 3.2 Release --- 44 | 45 | - Public - 46 | 47 | These functions, types and constants are part of the portable C API, usable by everyone on any platform. 48 | 49 | Function prefix: dw_ (lowercase) 50 | Handle type prefix: H (uppercase) 51 | Structure prefix: DW (mixedcase) 52 | Constant prefix: DW_ (uppercase) 53 | 54 | - Internal - 55 | 56 | These functions, variables and constants are used only inside Dynamic Windows, or the platform they are defined in. 57 | 58 | Function prefix: _dw_ (lowercase) 59 | Variable prefix: _dw_ (lowercase) 60 | Constant prefix: _DW_ (uppercase) 61 | 62 | - Native - 63 | 64 | These non-C classes (Objective-C or C++) or variables are platform specific and can be used inside a platform #ifdef 65 | 66 | Class prefix: DW (mixedcase) 67 | Variable prefix: DW (mixedcase) 68 | 69 | There are at least two functions that are sort of exceptions to this, _dw_init_thread() and _dw_deinit_thread() are two internal functions that are exported for use in language bindings such as Google's Go. Plus at the time of this writing I have not finished the code audit, so there may be some that have not been changed yet to match this scheme or due to possible compatibility problems. 70 | 71 | Also the Kotlin code for Android does not follow this naming system, but to access the Kotlin APIs you need to call it via JNI, so there are no namespace issues. However it may make sense to have non-C code style guidelines added to this document at a later date. 72 | 73 | --- 3.2 Release C Coding Style Guidelines --- 74 | 75 | Due to the base API being in C, it brings lots of compatibility but also many pitfalls. Writing applications in C brings memory handling and variable management pitfalls. 76 | 77 | We have tried to handle these issues by providing access to the C memory and string functions when including dw.h and providing a virtual method of storing data on window/widget handles with the dw_window_get_data() and dw_window_set_data() APIs. This allows you to avoid creating global variables, and instead save data on the window handles, along with macros for converting types such as: DW_POINTER_TO_INT() and DW_INT_TO_POINTER(). 78 | 79 | Ideally globals should only be used for data that is truly global, settings and such. Windows and other handles should be context specific, created in dwmain() and then destroyed when leaving dw_main(). Any window specific data should be saved on the window handle with dw_window_set_data() then accessed with dw_window_get_data() in the callbacks using the window handles passed. 80 | 81 | The dwtest application should be updated in the future to adhere to these guidelines, but since it was originally written ages ago it is not an example of a modern Dynamic Windows application. Dynamic Windows Interface Builder should be looked at for modern Dynamic Windows coding style. 82 | 83 | --- Contributing --- 84 | 85 | This is a preliminary document subject to change, if you have any input on this document, such as suggestions or criticisms, I am posting it on the DBSoft forums and you can comment on it there: 86 | 87 | https://dbsoft.org/forum/forumdisplay.php?fid=3 88 | 89 | Thanks for reading! 90 | Brian -------------------------------------------------------------------------------- /win/XBrowseForFolder.h: -------------------------------------------------------------------------------- 1 | // XBrowseForFolder.h Version 1.2 2 | // 3 | // Author: Hans Dietrich 4 | // hdietrich@gmail.com 5 | // 6 | // This software is released into the public domain. You are free to use 7 | // it in any way you like, except that you may not sell this source code. 8 | // 9 | // This software is provided "as is" with no expressed or implied warranty. 10 | // I accept no liability for any damage or loss of business that this 11 | // software may cause. 12 | // 13 | /////////////////////////////////////////////////////////////////////////////// 14 | 15 | #ifndef XBROWSEFORFOLDER_H 16 | #define XBROWSEFORFOLDER_H 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | BOOL XBrowseForFolder(HWND hWnd, 23 | LPCTSTR lpszInitialFolder, 24 | int nFolder, 25 | LPCTSTR lpszCaption, 26 | LPTSTR lpszBuf, 27 | DWORD dwBufSize, 28 | BOOL bEditBox); 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | #endif //XBROWSEFORFOLDER_H 34 | -------------------------------------------------------------------------------- /win/__SVN__.REV: -------------------------------------------------------------------------------- 1 | VERREV=$WCREV$ -------------------------------------------------------------------------------- /win/dirent.c: -------------------------------------------------------------------------------- 1 | #undef UNICODE 2 | #undef _UNICODE 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | #define _DW_INTERNAL 13 | #include "dwcompat.h" 14 | #include 15 | #include 16 | 17 | #define error(rc) errno = 255 18 | 19 | struct _dirdescr { 20 | HANDLE handle; /* DosFindFirst handle */ 21 | char fstype; /* filesystem type */ 22 | long count; /* valid entries in */ 23 | long number; /* absolute number of next entry */ 24 | int index; /* relative number of next entry */ 25 | char name[MAXPATHLEN+3]; /* directory name */ 26 | unsigned attrmask; /* attribute mask for seekdir */ 27 | struct dirent entry; /* buffer for directory entry */ 28 | WIN32_FIND_DATA data; 29 | }; 30 | 31 | /* 32 | * Return first char of filesystem type, or 0 if unknown. 33 | */ 34 | static char getFSType(const char *path) 35 | { 36 | static char cache[1+26]; 37 | char drive[3]; 38 | UCHAR unit; 39 | char r; 40 | 41 | if (isalpha(path[0]) && path[1] == ':') { 42 | unit = toupper(path[0]) - '@'; 43 | path += 2; 44 | } else { 45 | return 0; 46 | } 47 | 48 | if ((path[0] == '\\' || path[0] == '/') 49 | && (path[1] == '\\' || path[1] == '/')) 50 | return 0; 51 | 52 | if (cache [unit]) 53 | return cache [unit]; 54 | 55 | drive[0] = '@' + unit; 56 | drive[1] = ':'; 57 | drive[2] = '\0'; 58 | 59 | r = GetDriveType(drive); 60 | 61 | return cache [unit] = r; 62 | } 63 | 64 | char * API abs_path(const char *name, char *buffer, int len) 65 | { 66 | LPTSTR file; 67 | 68 | if(isalpha(name[0]) && name[1] == ':' && name[2] == '\0') 69 | { 70 | int drive = _getdrive(); 71 | char newdrive = toupper(name[0]); 72 | 73 | _chdrive((newdrive - 'A')+1); 74 | 75 | if(_getcwd(buffer, len)) 76 | { 77 | _chdrive(drive); 78 | return buffer; 79 | } 80 | _chdrive(drive); 81 | return NULL; 82 | } 83 | if(GetFullPathName(name, len, buffer, &file)) 84 | return buffer; 85 | return NULL; 86 | } 87 | 88 | DIR * API openxdir(const char *path, unsigned att_mask) 89 | { 90 | DIR *dir; 91 | char name[MAXPATHLEN+3]; 92 | 93 | dir = malloc(sizeof(DIR)); 94 | if (dir == NULL) { 95 | errno = ENOMEM; 96 | return NULL; 97 | } 98 | 99 | strncpy(name, path, MAXPATHLEN); 100 | name[MAXPATHLEN] = '\0'; 101 | switch (name[strlen(name)-1]) { 102 | default: 103 | strcat(name, "\\"); 104 | case '\\': 105 | case '/': 106 | case ':': 107 | ; 108 | } 109 | strcat(name, "."); 110 | if (!abs_path(name, dir->name, MAXPATHLEN+1)) 111 | strcpy(dir->name, name); 112 | if (dir->name[strlen(dir->name)-1] == '\\') 113 | strcat(dir->name, "*"); 114 | else 115 | strcat(dir->name, "\\*"); 116 | 117 | dir->fstype = getFSType(dir->name); 118 | dir->attrmask = att_mask | A_DIR; 119 | 120 | dir->count = 100; 121 | if((dir->handle = FindFirstFile(dir->name, &dir->data))==INVALID_HANDLE_VALUE) 122 | { 123 | free(dir); 124 | error(rc); 125 | return NULL; 126 | } 127 | 128 | dir->number = 0; 129 | dir->index = 0; 130 | 131 | return (DIR *)dir; 132 | } 133 | 134 | DIR * API opendir(const char *pathname) 135 | { 136 | return openxdir(pathname, 0); 137 | } 138 | 139 | struct dirent * API readdir(DIR *dir) 140 | { 141 | static int dummy_ino = 2; 142 | 143 | if (dir->number) 144 | { 145 | dir->count = 100; 146 | if(!FindNextFile(dir->handle, &(dir->data))) 147 | { 148 | error(rc); 149 | return NULL; 150 | } 151 | 152 | dir->index = 0; 153 | } 154 | 155 | strcpy(dir->entry.d_name, dir->data.cFileName); 156 | dir->entry.d_ino = dummy_ino++; 157 | dir->entry.d_reclen = (int)strlen(dir->data.cFileName); 158 | dir->entry.d_namlen = (int)strlen(dir->data.cFileName); 159 | dir->entry.d_size = dir->data.nFileSizeLow; 160 | dir->entry.d_attribute = dir->data.dwFileAttributes; 161 | #if 0 162 | dir->entry.d_time = *(USHORT *)&dir->next->ftimeLastWrite; 163 | dir->entry.d_date = *(USHORT *)&dir->next->fdateLastWrite; 164 | #endif 165 | 166 | dir->number++; 167 | dir->index++; 168 | return &dir->entry; 169 | } 170 | 171 | long API telldir(DIR *dir) 172 | { 173 | return dir->number; 174 | } 175 | 176 | void API seekdir(DIR *dir, long off) 177 | { 178 | if (dir->number > off) { 179 | char name[MAXPATHLEN+2]; 180 | 181 | FindClose(dir->handle); 182 | 183 | strcpy(name, dir->name); 184 | strcat(name, "*"); 185 | 186 | if((dir->handle = FindFirstFile(name, &(dir->data)))==NULL) 187 | { 188 | error(rc); 189 | return; 190 | } 191 | 192 | dir->number = 0; 193 | dir->index = 0; 194 | } 195 | 196 | while (dir->number < off && readdir(dir)) 197 | ; 198 | } 199 | 200 | void API closedir(DIR *dir) 201 | { 202 | FindClose(dir->handle); 203 | free(dir); 204 | } 205 | 206 | /*****************************************************************************/ 207 | 208 | #ifdef TEST 209 | 210 | main(int argc, char **argv) 211 | { 212 | int i; 213 | DIR *dir; 214 | struct dirent *ep; 215 | 216 | for (i = 1; i < argc; ++i) { 217 | dir = opendir(argv[i]); 218 | if (!dir) 219 | continue; 220 | while (ep = readdir(dir)) 221 | if (strchr("\\/:", argv[i] [strlen(argv[i]) - 1])) 222 | printf("%s%s\n", argv[i], ep->d_name); 223 | else 224 | printf("%s/%s\n", argv[i], ep->d_name); 225 | closedir(dir); 226 | } 227 | 228 | return 0; 229 | } 230 | 231 | #endif 232 | -------------------------------------------------------------------------------- /win/dw-mingw.def: -------------------------------------------------------------------------------- 1 | LIBRARY dw.dll 2 | 3 | DESCRIPTION 'Dynamic Windows for Win32' 4 | 5 | EXPORTS 6 | Win32_Set_Instance @1 7 | 8 | dw_init @10 9 | dw_main @11 10 | dw_exit @12 11 | dw_beep @13 12 | dw_messagebox @14 13 | dw_debug @15 14 | dw_environment_query @16 15 | dw_exec @17 16 | dw_browse @18 17 | dw_file_browse @19 18 | dw_user_dir @20 19 | dw_flush @21 20 | dw_free @22 21 | dw_main_sleep @23 22 | dw_main_iteration @24 23 | dw_app_dir @25 24 | dw_main_quit @26 25 | dw_shutdown @27 26 | 27 | _dw_init_thread @30 28 | _dw_deinit_thread @31 29 | 30 | dw_box_new @40 31 | dw_groupbox_new @41 32 | dw_box_pack_start @42 33 | dw_box_pack_end @43 34 | dw_box_pack_at_index @44 35 | 36 | dw_mdi_new @46 37 | 38 | dw_box_unpack @47 39 | dw_box_unpack_at_index @48 40 | 41 | dw_window_new @50 42 | dw_window_show @51 43 | dw_window_hide @52 44 | dw_window_destroy @53 45 | dw_window_set_font @54 46 | dw_window_set_color @55 47 | dw_window_set_pos @56 48 | dw_window_set_size @57 49 | dw_window_set_pos_size @58 50 | dw_window_get_pos_size @59 51 | dw_window_set_style @60 52 | dw_window_set_icon @61 53 | dw_window_set_bitmap @62 54 | dw_window_get_text @63 55 | dw_window_set_text @64 56 | dw_window_disable @65 57 | dw_window_enable @66 58 | dw_window_capture @67 59 | dw_window_release @68 60 | dw_window_reparent @69 61 | dw_window_function @70 62 | dw_window_from_id @71 63 | dw_window_set_border @72 64 | dw_window_minimize @73 65 | dw_window_set_pointer @74 66 | dw_window_default @75 67 | dw_window_raise @76 68 | dw_window_lower @77 69 | dw_window_click_default @78 70 | dw_window_redraw @79 71 | dw_bitmap_new @80 72 | dw_window_set_bitmap_from_data @81 73 | dw_window_get_font @82 74 | dw_window_set_tooltip @83 75 | dw_window_get_preferred_size @84 76 | dw_window_set_gravity @85 77 | dw_window_set_focus @86 78 | 79 | dw_button_new @90 80 | dw_bitmapbutton_new @91 81 | dw_bitmapbutton_new_from_file @92 82 | dw_bitmapbutton_new_from_data @93 83 | 84 | dw_text_new @100 85 | dw_status_text_new @101 86 | 87 | dw_entryfield_new @110 88 | dw_entryfield_password_new @111 89 | 90 | dw_combobox_new @120 91 | 92 | dw_radiobutton_new @130 93 | 94 | dw_listbox_new @140 95 | dw_listbox_append @141 96 | dw_listbox_clear @142 97 | dw_listbox_count @143 98 | dw_listbox_set_top @144 99 | dw_listbox_select @145 100 | dw_listbox_delete @146 101 | dw_listbox_get_text @147 102 | dw_listbox_set_text @148 103 | dw_listbox_selected @149 104 | dw_listbox_selected_multi @150 105 | dw_listbox_list_append @151 106 | dw_listbox_insert @152 107 | 108 | dw_percent_new @160 109 | dw_percent_set_pos @162 110 | 111 | dw_mle_new @170 112 | dw_mle_import @171 113 | dw_mle_export @172 114 | dw_mle_get_size @173 115 | dw_mle_delete @174 116 | dw_mle_clear @175 117 | dw_mle_freeze @176 118 | dw_mle_thaw @177 119 | dw_mle_set_cursor @178 120 | dw_mle_set_visible @179 121 | dw_mle_search @180 122 | dw_mle_set_editable @181 123 | dw_mle_set_word_wrap @182 124 | dw_mle_set_auto_complete @183 125 | 126 | dw_spinbutton_new @190 127 | dw_spinbutton_set_pos @191 128 | dw_spinbutton_set_limits @192 129 | dw_entryfield_set_limit @193 130 | dw_spinbutton_get_pos @194 131 | 132 | dw_checkbox_new @200 133 | dw_checkbox_get @201 134 | dw_checkbox_set @202 135 | 136 | dw_icon_load @210 137 | dw_icon_free @211 138 | dw_icon_load_from_file @212 139 | dw_icon_load_from_data @213 140 | 141 | dw_container_new @220 142 | dw_container_setup @221 143 | dw_container_alloc @222 144 | dw_container_set_item @223 145 | dw_container_set_row_title @224 146 | dw_container_insert @225 147 | dw_container_clear @226 148 | dw_container_query_start @228 149 | dw_container_query_next @229 150 | dw_container_delete @230 151 | dw_container_scroll @231 152 | dw_container_set_column_width @232 153 | dw_container_cursor @233 154 | dw_container_optimize @234 155 | dw_container_delete_row @235 156 | dw_container_change_item @236 157 | dw_container_get_column_type @237 158 | dw_container_change_row_title @238 159 | dw_container_set_stripe @239 160 | 161 | dw_container_set_row_data @600 162 | dw_container_change_row_data @601 163 | dw_container_delete_row_by_data @602 164 | dw_container_cursor_by_data @603 165 | 166 | dw_filesystem_setup @240 167 | dw_filesystem_set_item @241 168 | dw_filesystem_set_file @242 169 | dw_filesystem_change_item @243 170 | dw_filesystem_change_file @244 171 | dw_filesystem_get_column_type @245 172 | dw_filesystem_set_column_title @246 173 | 174 | dw_screen_width @250 175 | dw_screen_height @251 176 | 177 | dw_color_depth_get @260 178 | dw_color_foreground_set @261 179 | dw_color_background_set @262 180 | dw_color_choose @263 181 | 182 | dw_notebook_new @270 183 | dw_notebook_page_new @271 184 | dw_notebook_page_destroy @272 185 | dw_notebook_page_set_text @273 186 | dw_notebook_page_set_status_text @274 187 | dw_notebook_page_set @275 188 | dw_notebook_page_get @276 189 | dw_notebook_pack @277 190 | 191 | dw_menu_new @280 192 | dw_menubar_new @281 193 | dw_menu_append_item @282 194 | dw_menu_item_set_check @283 195 | dw_menu_popup @284 196 | dw_menu_destroy @285 197 | dw_menu_item_set_state @286 198 | dw_menu_delete_item @287 199 | 200 | dw_pointer_query_pos @290 201 | dw_pointer_set_pos @291 202 | 203 | dw_mutex_new @300 204 | dw_mutex_close @301 205 | dw_mutex_lock @302 206 | dw_mutex_unlock @303 207 | dw_mutex_trylock @304 208 | 209 | dw_event_new @310 210 | dw_event_reset @311 211 | dw_event_post @312 212 | dw_event_wait @313 213 | dw_event_close @314 214 | 215 | dw_thread_new @320 216 | dw_thread_end @321 217 | dw_thread_id @322 218 | 219 | dw_render_new @330 220 | dw_draw_point @331 221 | dw_draw_line @332 222 | dw_draw_rect @333 223 | dw_draw_text @334 224 | dw_draw_polygon @335 225 | dw_draw_arc @336 226 | 227 | dw_pixmap_bitblt @340 228 | dw_pixmap_new @341 229 | dw_pixmap_grab @342 230 | dw_pixmap_destroy @343 231 | dw_pixmap_new_from_file @344 232 | dw_pixmap_new_from_data @345 233 | dw_pixmap_set_transparent_color @346 234 | dw_pixmap_set_font @347 235 | dw_pixmap_stretch_bitblt @348 236 | 237 | dw_dialog_new @350 238 | dw_dialog_dismiss @351 239 | dw_dialog_wait @352 240 | 241 | dw_signal_connect @360 242 | dw_signal_disconnect_by_window @361 243 | dw_signal_disconnect_by_data @362 244 | dw_signal_disconnect_by_name @363 245 | dw_signal_connect_data @364 246 | 247 | dw_timer_connect @365 248 | dw_timer_disconnect @366 249 | 250 | dw_tree_new @370 251 | dw_tree_insert @371 252 | dw_tree_clear @372 253 | dw_tree_item_delete @373 254 | dw_tree_item_change @374 255 | dw_tree_item_expand @375 256 | dw_tree_item_collapse @376 257 | dw_tree_item_select @377 258 | dw_tree_item_set_data @378 259 | dw_tree_insert_after @379 260 | dw_tree_item_get_data @380 261 | dw_tree_get_title @381 262 | dw_tree_get_parent @382 263 | 264 | dw_font_text_extents_get @385 265 | dw_font_choose @386 266 | dw_font_set_default @387 267 | 268 | dw_slider_new @390 269 | dw_slider_get_pos @391 270 | dw_slider_set_pos @392 271 | 272 | dw_window_set_data @400 273 | dw_window_get_data @401 274 | 275 | dw_splitbar_new @410 276 | dw_splitbar_set @411 277 | dw_splitbar_get @412 278 | 279 | dw_module_load @420 280 | dw_module_symbol @421 281 | dw_module_close @422 282 | 283 | dw_scrollbar_new @430 284 | dw_scrollbar_get_pos @431 285 | dw_scrollbar_set_pos @432 286 | dw_scrollbar_set_range @433 287 | 288 | dw_taskbar_insert @440 289 | dw_taskbar_delete @441 290 | 291 | dw_named_memory_new @450 292 | dw_named_memory_get @451 293 | dw_named_memory_free @452 294 | 295 | dw_named_event_new @460 296 | dw_named_event_get @461 297 | dw_named_event_reset @462 298 | dw_named_event_post @463 299 | dw_named_event_wait @464 300 | dw_named_event_close @465 301 | 302 | dw_html_new @470 303 | dw_html_action @471 304 | dw_html_raw @472 305 | dw_html_url @473 306 | dw_html_javascript_run @474 307 | 308 | dw_calendar_new @480 309 | dw_calendar_set_date @481 310 | dw_calendar_get_date @482 311 | 312 | dw_clipboard_get_text @490 313 | dw_clipboard_set_text @491 314 | 315 | dw_scrollbox_new @500 316 | dw_scrollbox_get_pos @501 317 | dw_scrollbox_get_range @502 318 | 319 | dw_print_new @510 320 | dw_print_run @511 321 | dw_print_cancel @512 322 | 323 | dw_utf8_to_wchar @520 324 | dw_wchar_to_utf8 @521 325 | -------------------------------------------------------------------------------- /win/dw.def: -------------------------------------------------------------------------------- 1 | LIBRARY DW 2 | 3 | EXPORTS 4 | Win32_Set_Instance @1 5 | _dw_convertargs @2 6 | 7 | dw_init @10 8 | dw_main @11 9 | dw_exit @12 10 | dw_beep @13 11 | dw_messagebox @14 12 | dw_debug @15 13 | dw_environment_query @16 14 | dw_exec @17 15 | dw_browse @18 16 | dw_file_browse @19 17 | dw_user_dir @20 18 | dw_flush @21 19 | dw_free @22 20 | dw_main_sleep @23 21 | dw_main_iteration @24 22 | dw_app_dir @25 23 | dw_main_quit @26 24 | dw_shutdown @27 25 | dw_app_id_set @28 26 | 27 | _dw_init_thread @30 28 | _dw_deinit_thread @31 29 | 30 | dw_vdebug @35 31 | dw_vmessagebox @36 32 | 33 | dw_box_new @40 34 | dw_groupbox_new @41 35 | dw_box_pack_start @42 36 | dw_box_pack_end @43 37 | dw_box_pack_at_index @44 38 | 39 | dw_mdi_new @46 40 | 41 | dw_box_unpack @47 42 | dw_box_unpack_at_index @48 43 | 44 | dw_window_new @50 45 | dw_window_show @51 46 | dw_window_hide @52 47 | dw_window_destroy @53 48 | dw_window_set_font @54 49 | dw_window_set_color @55 50 | dw_window_set_pos @56 51 | dw_window_set_size @57 52 | dw_window_set_pos_size @58 53 | dw_window_get_pos_size @59 54 | dw_window_set_style @60 55 | dw_window_set_icon @61 56 | dw_window_set_bitmap @62 57 | dw_window_get_text @63 58 | dw_window_set_text @64 59 | dw_window_disable @65 60 | dw_window_enable @66 61 | dw_window_capture @67 62 | dw_window_release @68 63 | dw_window_reparent @69 64 | dw_window_function @70 65 | dw_window_from_id @71 66 | dw_window_set_border @72 67 | dw_window_minimize @73 68 | dw_window_set_pointer @74 69 | dw_window_default @75 70 | dw_window_raise @76 71 | dw_window_lower @77 72 | dw_window_click_default @78 73 | dw_window_redraw @79 74 | dw_bitmap_new @80 75 | dw_window_set_bitmap_from_data @81 76 | dw_window_get_font @82 77 | dw_window_set_tooltip @83 78 | dw_window_get_preferred_size @84 79 | dw_window_set_gravity @85 80 | dw_window_set_focus @86 81 | dw_window_compare @87 82 | 83 | dw_button_new @90 84 | dw_bitmapbutton_new @91 85 | dw_bitmapbutton_new_from_file @92 86 | dw_bitmapbutton_new_from_data @93 87 | 88 | dw_text_new @100 89 | dw_status_text_new @101 90 | 91 | dw_entryfield_new @110 92 | dw_entryfield_password_new @111 93 | 94 | dw_combobox_new @120 95 | 96 | dw_radiobutton_new @130 97 | 98 | dw_listbox_new @140 99 | dw_listbox_append @141 100 | dw_listbox_clear @142 101 | dw_listbox_count @143 102 | dw_listbox_set_top @144 103 | dw_listbox_select @145 104 | dw_listbox_delete @146 105 | dw_listbox_get_text @147 106 | dw_listbox_set_text @148 107 | dw_listbox_selected @149 108 | dw_listbox_selected_multi @150 109 | dw_listbox_list_append @151 110 | dw_listbox_insert @152 111 | 112 | dw_percent_new @160 113 | dw_percent_set_pos @162 114 | 115 | dw_mle_new @170 116 | dw_mle_import @171 117 | dw_mle_export @172 118 | dw_mle_get_size @173 119 | dw_mle_delete @174 120 | dw_mle_clear @175 121 | dw_mle_freeze @176 122 | dw_mle_thaw @177 123 | dw_mle_set_cursor @178 124 | dw_mle_set_visible @179 125 | dw_mle_search @180 126 | dw_mle_set_editable @181 127 | dw_mle_set_word_wrap @182 128 | dw_mle_set_auto_complete @183 129 | 130 | dw_spinbutton_new @190 131 | dw_spinbutton_set_pos @191 132 | dw_spinbutton_set_limits @192 133 | dw_entryfield_set_limit @193 134 | dw_spinbutton_get_pos @194 135 | 136 | dw_checkbox_new @200 137 | dw_checkbox_get @201 138 | dw_checkbox_set @202 139 | 140 | dw_icon_load @210 141 | dw_icon_free @211 142 | dw_icon_load_from_file @212 143 | dw_icon_load_from_data @213 144 | 145 | dw_container_new @220 146 | dw_container_setup @221 147 | dw_container_alloc @222 148 | dw_container_set_item @223 149 | dw_container_set_row_title @224 150 | dw_container_insert @225 151 | dw_container_clear @226 152 | dw_container_query_start @228 153 | dw_container_query_next @229 154 | dw_container_delete @230 155 | dw_container_scroll @231 156 | dw_container_set_column_width @232 157 | dw_container_cursor @233 158 | dw_container_optimize @234 159 | dw_container_delete_row @235 160 | dw_container_change_item @236 161 | dw_container_get_column_type @237 162 | dw_container_change_row_title @238 163 | dw_container_set_stripe @239 164 | 165 | dw_filesystem_setup @240 166 | dw_filesystem_set_item @241 167 | dw_filesystem_set_file @242 168 | dw_filesystem_change_item @243 169 | dw_filesystem_change_file @244 170 | dw_filesystem_get_column_type @245 171 | dw_filesystem_set_column_title @246 172 | 173 | dw_container_set_row_data @600 174 | dw_container_change_row_data @601 175 | dw_container_delete_row_by_data @602 176 | dw_container_cursor_by_data @603 177 | 178 | dw_screen_width @250 179 | dw_screen_height @251 180 | 181 | dw_color_depth_get @260 182 | dw_color_foreground_set @261 183 | dw_color_background_set @262 184 | dw_color_choose @263 185 | 186 | dw_notebook_new @270 187 | dw_notebook_page_new @271 188 | dw_notebook_page_destroy @272 189 | dw_notebook_page_set_text @273 190 | dw_notebook_page_set_status_text @274 191 | dw_notebook_page_set @275 192 | dw_notebook_page_get @276 193 | dw_notebook_pack @277 194 | 195 | dw_menu_new @280 196 | dw_menubar_new @281 197 | dw_menu_append_item @282 198 | dw_menu_item_set_check @283 199 | dw_menu_popup @284 200 | dw_menu_destroy @285 201 | dw_menu_item_set_state @286 202 | dw_menu_delete_item @287 203 | 204 | dw_pointer_query_pos @290 205 | dw_pointer_set_pos @291 206 | 207 | dw_mutex_new @300 208 | dw_mutex_close @301 209 | dw_mutex_lock @302 210 | dw_mutex_unlock @303 211 | dw_mutex_trylock @304 212 | 213 | dw_event_new @310 214 | dw_event_reset @311 215 | dw_event_post @312 216 | dw_event_wait @313 217 | dw_event_close @314 218 | 219 | dw_thread_new @320 220 | dw_thread_end @321 221 | dw_thread_id @322 222 | 223 | dw_render_new @330 224 | dw_draw_point @331 225 | dw_draw_line @332 226 | dw_draw_rect @333 227 | dw_draw_text @334 228 | dw_draw_polygon @335 229 | dw_draw_arc @336 230 | dw_render_redraw @337 231 | 232 | dw_pixmap_bitblt @340 233 | dw_pixmap_new @341 234 | dw_pixmap_grab @342 235 | dw_pixmap_destroy @343 236 | dw_pixmap_new_from_file @344 237 | dw_pixmap_new_from_data @345 238 | dw_pixmap_set_transparent_color @346 239 | dw_pixmap_set_font @347 240 | dw_pixmap_stretch_bitblt @348 241 | dw_pixmap_get_width @355 242 | dw_pixmap_get_height @356 243 | 244 | dw_dialog_new @350 245 | dw_dialog_dismiss @351 246 | dw_dialog_wait @352 247 | 248 | dw_signal_connect @360 249 | dw_signal_disconnect_by_window @361 250 | dw_signal_disconnect_by_data @362 251 | dw_signal_disconnect_by_name @363 252 | dw_signal_connect_data @364 253 | 254 | dw_timer_connect @365 255 | dw_timer_disconnect @366 256 | 257 | dw_tree_new @370 258 | dw_tree_insert @371 259 | dw_tree_clear @372 260 | dw_tree_item_delete @373 261 | dw_tree_item_change @374 262 | dw_tree_item_expand @375 263 | dw_tree_item_collapse @376 264 | dw_tree_item_select @377 265 | dw_tree_item_set_data @378 266 | dw_tree_insert_after @379 267 | dw_tree_item_get_data @380 268 | dw_tree_get_title @381 269 | dw_tree_get_parent @382 270 | 271 | dw_font_text_extents_get @385 272 | dw_font_choose @386 273 | dw_font_set_default @387 274 | 275 | dw_slider_new @390 276 | dw_slider_get_pos @391 277 | dw_slider_set_pos @392 278 | 279 | dw_window_set_data @400 280 | dw_window_get_data @401 281 | 282 | dw_splitbar_new @410 283 | dw_splitbar_set @411 284 | dw_splitbar_get @412 285 | 286 | dw_module_load @420 287 | dw_module_symbol @421 288 | dw_module_close @422 289 | 290 | dw_scrollbar_new @430 291 | dw_scrollbar_get_pos @431 292 | dw_scrollbar_set_pos @432 293 | dw_scrollbar_set_range @433 294 | 295 | dw_taskbar_insert @440 296 | dw_taskbar_delete @441 297 | 298 | dw_named_memory_new @450 299 | dw_named_memory_get @451 300 | dw_named_memory_free @452 301 | 302 | dw_named_event_new @460 303 | dw_named_event_get @461 304 | dw_named_event_reset @462 305 | dw_named_event_post @463 306 | dw_named_event_wait @464 307 | dw_named_event_close @465 308 | 309 | dw_html_new @470 310 | dw_html_action @471 311 | dw_html_raw @472 312 | dw_html_url @473 313 | dw_html_javascript_run @474 314 | dw_html_javascript_add @475 315 | 316 | dw_calendar_new @480 317 | dw_calendar_set_date @481 318 | dw_calendar_get_date @482 319 | 320 | dw_clipboard_get_text @490 321 | dw_clipboard_set_text @491 322 | 323 | dw_scrollbox_new @500 324 | dw_scrollbox_get_pos @501 325 | dw_scrollbox_get_range @502 326 | 327 | dw_print_new @510 328 | dw_print_run @511 329 | dw_print_cancel @512 330 | 331 | dw_utf8_to_wchar @520 332 | dw_wchar_to_utf8 @521 333 | 334 | dw_notification_new @530 335 | dw_notification_send @531 336 | 337 | dw_feature_get @540 338 | dw_feature_set @541 339 | -------------------------------------------------------------------------------- /win/dw.dll.x64.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | Dynamic Windows 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /win/dw.dll.x86.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | Dynamic Windows 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /win/dw.rc: -------------------------------------------------------------------------------- 1 | #include "winuser.h" 2 | #ifdef DW64 3 | 2 RT_MANIFEST dw.dll.x64.manifest 4 | #else 5 | 2 RT_MANIFEST dw.dll.x86.manifest 6 | #endif -------------------------------------------------------------------------------- /win/dwcompat-mingw.def: -------------------------------------------------------------------------------- 1 | LIBRARY dwcompat.dll 2 | 3 | DESCRIPTION 'Dynamic Windows Compatibility Module for Win32' 4 | 5 | EXPORTS 6 | makedir @20 7 | vargs @21 8 | setfileinfo @22 9 | drivefree @23 10 | isdrive @24 11 | drivesize @25 12 | getfsname @26 13 | 14 | _opendir @30 15 | _openxdir @31 16 | _readdir @32 17 | _seekdir @33 18 | _telldir @34 19 | _closedir @35 20 | 21 | fsopen @40 22 | fsclose @41 23 | fsgets @42 24 | fsseek @43 25 | 26 | locale_init @50 27 | locale_string @51 28 | 29 | nice_strformat @60 30 | initdir @61 31 | setpath @62 32 | -------------------------------------------------------------------------------- /win/dwcompat.def: -------------------------------------------------------------------------------- 1 | LIBRARY DWCOMPAT 2 | 3 | EXPORTS 4 | makedir @20 5 | vargs @21 6 | setfileinfo @22 7 | drivefree @23 8 | isdrive @24 9 | drivesize @25 10 | getfsname @26 11 | 12 | _opendir @30 13 | _openxdir @31 14 | _readdir @32 15 | _seekdir @33 16 | _telldir @34 17 | _closedir @35 18 | 19 | fsopen @40 20 | fsclose @41 21 | fsgets @42 22 | fsseek @43 23 | 24 | locale_init @50 25 | locale_string @51 26 | 27 | nice_strformat @60 28 | initdir @61 29 | setpath @62 30 | -------------------------------------------------------------------------------- /win/dwtest.exe.x64.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | Dynamic Windows Test 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /win/dwtest.exe.x86.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | Dynamic Windows Test 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /win/dwtest.rc: -------------------------------------------------------------------------------- 1 | #include "winuser.h" 2 | #ifdef DW64 3 | 1 RT_MANIFEST dwtest.exe.x64.manifest 4 | #else 5 | 1 RT_MANIFEST dwtest.exe.x86.manifest 6 | #endif -------------------------------------------------------------------------------- /win/file.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dbsoft/dwindows/5c2f0fff986340614cea6cd08a4bcaee1453752c/win/file.ico -------------------------------------------------------------------------------- /win/folder.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dbsoft/dwindows/5c2f0fff986340614cea6cd08a4bcaee1453752c/win/folder.ico -------------------------------------------------------------------------------- /win/readme-win.txt: -------------------------------------------------------------------------------- 1 | This package contains Dynamic Windows (dwindows) v 3.1 for Windows. 2 | 3 | It contains: 4 | 5 | dw.dll - main dwindows DLL 6 | dwcompat.dll - compatibility DLL (optional) 7 | dw.h - header file 8 | dw.lib - import library for functions in dw.dll 9 | dwcompat.lib - import library for functions in dwcompat.dll 10 | readme-win.txt - this file 11 | 12 | Dynamic Windows may take advantage of features from these packages: 13 | 14 | WinToast notification library 15 | https://github.com/mohabouje/WinToast 16 | 17 | Microsoft WebView2 SDK & Microsoft Edge Browser or Runtime 18 | https://www.nuget.org/packages/Microsoft.Web.WebView2 19 | Browser: https://www.microsoft.com/en-us/edge 20 | Runtime: https://developer.microsoft.com/en-us/microsoft-edge/webview2/ 21 | -------------------------------------------------------------------------------- /win/wintoast.cpp: -------------------------------------------------------------------------------- 1 | /* Simple WinToast forwarder from Dynamic Windows APIs */ 2 | 3 | #include "dw.h" 4 | #include "wintoastlib.h" 5 | 6 | using namespace WinToastLib; 7 | 8 | extern "C" { 9 | LRESULT CALLBACK _dw_wndproc(HWND hWnd, UINT msg, WPARAM mp1, LPARAM mp2); 10 | } 11 | 12 | class DWHandler : public IWinToastHandler { 13 | public: 14 | WinToastTemplate *templ; 15 | 16 | void toastActivated() const { 17 | // The user clicked in this toast 18 | _dw_wndproc((HWND)templ, WM_USER+102, 0, 0); 19 | dw_signal_disconnect_by_window((HWND)templ); 20 | delete templ; 21 | } 22 | 23 | void toastActivated(int actionIndex) const { 24 | // The user clicked on action 25 | _dw_wndproc((HWND)templ, WM_USER+102, 0, 0); 26 | dw_signal_disconnect_by_window((HWND)templ); 27 | delete templ; 28 | } 29 | 30 | void toastDismissed(WinToastDismissalReason state) const { 31 | switch (state) { 32 | case UserCanceled: 33 | // The user dismissed this toast 34 | dw_signal_disconnect_by_window((HWND)templ); 35 | delete templ; 36 | break; 37 | case TimedOut: 38 | // The toast has timed out 39 | break; 40 | case ApplicationHidden: 41 | // The application hid the toast using ToastNotifier.hide() 42 | break; 43 | default: 44 | // Toast not activated 45 | break; 46 | } 47 | } 48 | 49 | void toastFailed() const { 50 | // Error showing current toast 51 | delete templ; 52 | } 53 | }; 54 | 55 | 56 | enum Results { 57 | ToastClicked, // user clicked on the toast 58 | ToastDismissed, // user dismissed the toast 59 | ToastTimeOut, // toast timed out 60 | ToastHided, // application hid the toast 61 | ToastNotActivated, // toast was not activated 62 | ToastFailed, // toast failed 63 | SystemNotSupported, // system does not support toasts 64 | UnhandledOption, // unhandled option 65 | MultipleTextNotSupported, // multiple texts were provided 66 | InitializationFailure, // toast notification manager initialization failure 67 | ToastNotLaunched // toast could not be launched 68 | }; 69 | 70 | extern "C" { 71 | 72 | void _dw_toast_init(LPWSTR AppName, LPWSTR AppID) 73 | { 74 | if(WinToast::isCompatible()) 75 | { 76 | // Generate a Microsoft compatible Application User Model ID 77 | LPWSTR company = wcschr(AppID, '.'); 78 | *company = 0; 79 | LPWSTR product = wcschr(++company, '.'); 80 | *product = 0; 81 | LPWSTR subproduct = wcschr(++product, '.'); 82 | if(subproduct) 83 | *subproduct = 0; 84 | LPWSTR version = subproduct ? wcschr(++subproduct, '.') : NULL; 85 | 86 | WinToast::instance()->setAppName(AppName); 87 | WinToast::instance()->setAppUserModelId(WinToast::instance()->configureAUMI(company, product, 88 | subproduct ? subproduct : L"", (version && version++ && _wtoi(version) > 0) ? version : L"")); 89 | WinToast::instance()->initialize(); 90 | } 91 | } 92 | 93 | void *_dw_notification_new(LPWSTR title, LPWSTR image, LPWSTR description) 94 | { 95 | if(WinToast::isCompatible()) 96 | { 97 | WinToastTemplate *templ = new WinToastTemplate(image ? WinToastTemplate::ImageAndText02 : WinToastTemplate::Text02); 98 | templ->setTextField(title, WinToastTemplate::FirstLine); 99 | templ->setAttributionText(description); 100 | if(image) 101 | { 102 | WCHAR fullpath[MAX_PATH+1] = {0}; 103 | 104 | GetFullPathNameW(image, MAX_PATH, fullpath, NULL); 105 | templ->setImagePath(fullpath); 106 | } 107 | return (void *)templ; 108 | } 109 | return NULL; 110 | } 111 | 112 | int _dw_notification_send(void *notification) 113 | { 114 | if(WinToast::isCompatible()) 115 | { 116 | WinToastTemplate *templ = (WinToastTemplate *)notification; 117 | DWHandler *handler = new DWHandler(); 118 | handler->templ = templ; 119 | 120 | if(templ && WinToast::instance()->showToast(*templ, handler) >= 0) 121 | return DW_ERROR_NONE; 122 | } 123 | return DW_ERROR_UNKNOWN; 124 | } 125 | 126 | BOOL _dw_toast_is_compatible(void) 127 | { 128 | return WinToast::isCompatible(); 129 | } 130 | } 131 | --------------------------------------------------------------------------------