Thu Aug 31 23:02:10 PDT 2000 Michael Jennings <mej@eterm.org>
Still more big changes. Working on adding pixmap and GC tracking to libmej using the existing allocation tracking routines. SVN revision: 3291
This commit is contained in:
parent
d981295368
commit
cdbb53b4bf
|
@ -3846,3 +3846,9 @@ Thu Aug 31 11:22:30 PDT 2000 Michael Jennings <mej@eterm.org>
|
||||||
Crap. That was not supposed to be committed.
|
Crap. That was not supposed to be committed.
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
Thu Aug 31 23:02:10 PDT 2000 Michael Jennings <mej@eterm.org>
|
||||||
|
|
||||||
|
Still more big changes. Working on adding pixmap and GC tracking to
|
||||||
|
libmej using the existing allocation tracking routines.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
|
|
@ -280,6 +280,7 @@
|
||||||
#undef NO_STACK_TRACE
|
#undef NO_STACK_TRACE
|
||||||
#undef DBX
|
#undef DBX
|
||||||
#undef GDB
|
#undef GDB
|
||||||
|
#undef GDB_CMD_FILE
|
||||||
#undef PSTACK
|
#undef PSTACK
|
||||||
|
|
||||||
/* *BSD utmp stuff */
|
/* *BSD utmp stuff */
|
||||||
|
|
143
configure.in
143
configure.in
|
@ -117,11 +117,19 @@ AC_C_CONST
|
||||||
AC_C_INLINE
|
AC_C_INLINE
|
||||||
AC_PATH_XTRA
|
AC_PATH_XTRA
|
||||||
|
|
||||||
if test "$ac_cv_lib_socket_connect" = "yes" ; then
|
if test ! -z "$X_CFLAGS"; then
|
||||||
SUBLIBS="-lsocket"
|
if test -z "$CPPFLAGS"; then
|
||||||
|
CPPFLAGS="$X_CFLAGS"
|
||||||
|
else
|
||||||
|
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if test ! -z "$X_LIBS"; then
|
||||||
|
if test -z "$LDFLAGS"; then
|
||||||
|
LDFLAGS="$X_LIBS"
|
||||||
|
else
|
||||||
|
LDFLAGS="$LDFLAGS $X_LIBS"
|
||||||
fi
|
fi
|
||||||
if test "$ac_cv_lib_nsl_gethostbyname" = "yes" ; then
|
|
||||||
SUBLIBS="$SUBLIBS -lnsl"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dnl# Checks for header files.
|
dnl# Checks for header files.
|
||||||
|
@ -146,20 +154,12 @@ seteuid memmove putenv strsep setresuid setresgid \
|
||||||
memmem usleep snprintf strcasestr strcasechr \
|
memmem usleep snprintf strcasestr strcasechr \
|
||||||
strcasepbrk strrev)
|
strcasepbrk strrev)
|
||||||
dps_snprintf_oflow()
|
dps_snprintf_oflow()
|
||||||
AC_CHECK_LIB(m, pow, LIBS="$LIBS -lm", , $SUBLIBS)
|
AC_CHECK_LIB(m, pow)
|
||||||
|
|
||||||
dnl# Check for the need for -lutil on BSD systems
|
dnl# Portability checks for various functions
|
||||||
AC_CHECK_FUNC(login,
|
AC_SEARCH_LIBS(login, bsd ucb util)
|
||||||
AC_DEFINE(HAVE_LOGIN)
|
AC_SEARCH_LIBS(logout, util)
|
||||||
, AC_CHECK_LIB(util, login, LIBS="$LIBS -lutil" ;
|
AC_SEARCH_LIBS(getpwuid, sun)
|
||||||
AC_DEFINE(HAVE_LOGIN)
|
|
||||||
))
|
|
||||||
AC_CHECK_FUNC(logout,
|
|
||||||
AC_DEFINE(HAVE_LOGOUT)
|
|
||||||
, AC_CHECK_LIB(util, logout, LIBS="$LIBS -lutil" ;
|
|
||||||
AC_DEFINE(HAVE_LOGOUT)
|
|
||||||
))
|
|
||||||
AC_CHECK_FUNC(getpwuid, , AC_CHECK_LIB(sun, getpwuid, LIBS="$LIBS -lsun"))
|
|
||||||
|
|
||||||
dnl#
|
dnl#
|
||||||
dnl# Utility stuff
|
dnl# Utility stuff
|
||||||
|
@ -237,6 +237,37 @@ AC_ARG_WITH(pty-group,
|
||||||
fi
|
fi
|
||||||
)
|
)
|
||||||
|
|
||||||
|
dnl#
|
||||||
|
dnl# X LIBRARIES
|
||||||
|
dnl#
|
||||||
|
AC_CHECK_LIB(X11, XOpenDisplay, , [
|
||||||
|
echo "ERROR: You need libX11 to build Eterm. Verify that you have libX11.a or";
|
||||||
|
echo " libX11.so installed and that it is located in the X libraries";
|
||||||
|
echo " directory shown above. If it is in a different directory, try using";
|
||||||
|
echo " the --x-libraries parameter to configure.";
|
||||||
|
AC_MSG_ERROR([Fatal: libX11 not found.])])
|
||||||
|
AC_CHECK_LIB(Xext, XextAddDisplay, , [
|
||||||
|
echo "ERROR: You need libXext to build Eterm. Verify that you have libXext.a or";
|
||||||
|
echo " libXext.so installed and that it is located in the X libraries";
|
||||||
|
echo " directory shown above. If it is in a different directory, try using";
|
||||||
|
echo " the --x-libraries parameter to configure.";
|
||||||
|
AC_MSG_ERROR([Fatal: libXext not found.])])
|
||||||
|
|
||||||
|
AC_CHECK_LIB(Xext, XShapeQueryExtension, AC_DEFINE(HAVE_X_SHAPE_EXT))
|
||||||
|
|
||||||
|
# check if we need X_LOCALE definition
|
||||||
|
AC_CHECK_LIB(X11, _Xsetlocale, , AC_DEFINE(NO_XLOCALE))
|
||||||
|
|
||||||
|
# For multibyte selection handling
|
||||||
|
if test "$MULTICHAR_ENCODING" != "none"; then
|
||||||
|
AC_CHECK_LIB(Xmu, XmuInternAtom)
|
||||||
|
fi
|
||||||
|
|
||||||
|
# check X11R6 for XIM
|
||||||
|
if test "$XIM" = "TRUE"; then
|
||||||
|
AC_CHECK_LIB(X11, XRegisterIMInstantiateCallback, AC_DEFINE(USE_X11R6_XIM))
|
||||||
|
fi
|
||||||
|
|
||||||
dnl#
|
dnl#
|
||||||
dnl# FEATURES
|
dnl# FEATURES
|
||||||
dnl#
|
dnl#
|
||||||
|
@ -283,7 +314,7 @@ AC_ARG_WITH(imlib,
|
||||||
if test "$withval" != "no"; then
|
if test "$withval" != "no"; then
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
if test "$withval" != "yes"; then
|
if test "$withval" != "yes"; then
|
||||||
CFLAGS="$CFLAGS -I${withval}/include"
|
CPPFLAGS="$CPPFLAGS -I${withval}/include"
|
||||||
LDFLAGS="$LDFLAGS -L${withval}/lib"
|
LDFLAGS="$LDFLAGS -L${withval}/lib"
|
||||||
fi
|
fi
|
||||||
USE_IMLIB=1
|
USE_IMLIB=1
|
||||||
|
@ -299,10 +330,11 @@ AC_ARG_WITH(imlib,
|
||||||
USE_IMLIB=1
|
USE_IMLIB=1
|
||||||
)
|
)
|
||||||
if test $USE_IMLIB -eq 1 ; then
|
if test $USE_IMLIB -eq 1 ; then
|
||||||
AC_CHECK_LIB(dl, dlopen, GRLIBS="-ldl", , $SUBLIBS $X_LIBS $GRLIBS)
|
AC_CHECK_LIB(dl, dlopen, GRLIBS="-ldl", , $GRLIBS)
|
||||||
AC_CHECK_LIB(ttf, TT_Init_FreeType, GRLIBS="-lttf $GRLIBS", , $SUBLIBS $X_LIBS $GRLIBS)
|
AC_CHECK_LIB(ttf, TT_Init_FreeType, GRLIBS="-lttf $GRLIBS", , $GRLIBS)
|
||||||
AC_CHECK_LIB(Imlib2, imlib_create_image,
|
AC_CHECK_LIB(Imlib2, imlib_create_image,
|
||||||
GRLIBS="-lImlib2 $GRLIBS"
|
GRLIBS="-lImlib2 $GRLIBS"
|
||||||
|
AC_DEFINE(HAVE_LIBIMLIB2)
|
||||||
AC_DEFINE(PIXMAP_SUPPORT)
|
AC_DEFINE(PIXMAP_SUPPORT)
|
||||||
AC_DEFINE(BACKING_STORE)
|
AC_DEFINE(BACKING_STORE)
|
||||||
,
|
,
|
||||||
|
@ -310,7 +342,7 @@ if test $USE_IMLIB -eq 1 ; then
|
||||||
AC_WARN(*** or could not be linked. Eterm should still work, but it will ***)
|
AC_WARN(*** or could not be linked. Eterm should still work, but it will ***)
|
||||||
AC_WARN(*** not be very happy. Check config.log for more detailed ***)
|
AC_WARN(*** not be very happy. Check config.log for more detailed ***)
|
||||||
AC_WARN(*** information on why my attempt to link with Imlib2 failed. ***)
|
AC_WARN(*** information on why my attempt to link with Imlib2 failed. ***)
|
||||||
, $SUBLIBS $X_LIBS $GRLIBS)
|
, $GRLIBS)
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -357,10 +389,7 @@ AC_ARG_ENABLE(utmp,
|
||||||
UTMP=1
|
UTMP=1
|
||||||
)
|
)
|
||||||
if test $UTMP -eq 1; then
|
if test $UTMP -eq 1; then
|
||||||
AC_CHECK_LIB(utempter, addToUtmp,
|
AC_CHECK_LIB(utempter, addToUtmp)
|
||||||
AC_DEFINE(HAVE_UTEMPTER)
|
|
||||||
LIBS="$LIBS -lutempter"
|
|
||||||
)
|
|
||||||
fi
|
fi
|
||||||
AC_MSG_CHECKING(for backspace key configuration)
|
AC_MSG_CHECKING(for backspace key configuration)
|
||||||
AC_ARG_WITH(backspace,
|
AC_ARG_WITH(backspace,
|
||||||
|
@ -602,43 +631,12 @@ dnl# ;;
|
||||||
dnl# esac
|
dnl# esac
|
||||||
dnl# , AC_MSG_RESULT(none))
|
dnl# , AC_MSG_RESULT(none))
|
||||||
dnl# if test "$THREADS_LIB" = "posix"; then
|
dnl# if test "$THREADS_LIB" = "posix"; then
|
||||||
dnl# AC_CHECK_LIB(pthread, pthread_create, CFLAGS="$CFLAGS -D_REENTRANT" ; THREADLIBS="-lpthread"
|
dnl# AC_CHECK_LIB(pthread, pthread_create, CPPFLAGS="$CPPFLAGS -D_REENTRANT" ; THREADLIBS="-lpthread"
|
||||||
dnl# AC_DEFINE(USE_POSIX_THREADS)
|
dnl# AC_DEFINE(USE_POSIX_THREADS)
|
||||||
dnl# AC_DEFINE(MUTEX_SYNCH)
|
dnl# AC_DEFINE(MUTEX_SYNCH)
|
||||||
dnl# , , -D_REENTRANT -L/usr/lib -L/lib -L/usr/local/lib)
|
dnl# , , -D_REENTRANT -L/usr/lib -L/lib -L/usr/local/lib)
|
||||||
dnl# fi
|
dnl# fi
|
||||||
|
|
||||||
dnl#
|
|
||||||
dnl# X LIBRARIES
|
|
||||||
dnl#
|
|
||||||
AC_CHECK_LIB(X11, XOpenDisplay, X_LIBS="$X_LIBS -lX11", [
|
|
||||||
echo "ERROR: You need libX11 to build Eterm. Verify that you have libX11.a or";
|
|
||||||
echo " libX11.so installed and that it is located in the X libraries";
|
|
||||||
echo " directory shown above. If it is in a different directory, try using";
|
|
||||||
echo " the --x-libraries parameter to configure.";
|
|
||||||
AC_MSG_ERROR([Fatal: libX11 not found.])], $X_LIBS $SUBLIBS)
|
|
||||||
AC_CHECK_LIB(Xext, XextAddDisplay, X_LIBS="-lXext $X_LIBS", [
|
|
||||||
echo "ERROR: You need libXext to build Eterm. Verify that you have libXext.a or";
|
|
||||||
echo " libXext.so installed and that it is located in the X libraries";
|
|
||||||
echo " directory shown above. If it is in a different directory, try using";
|
|
||||||
echo " the --x-libraries parameter to configure.";
|
|
||||||
AC_MSG_ERROR([Fatal: libXext not found.])], $X_LIBS $SUBLIBS)
|
|
||||||
|
|
||||||
AC_CHECK_LIB(Xext, XShapeQueryExtension, AC_DEFINE(HAVE_X_SHAPE_EXT), , $X_LIBS $SUBLIBS)
|
|
||||||
|
|
||||||
# check if we need X_LOCALE definition
|
|
||||||
AC_CHECK_LIB(X11, _Xsetlocale, , AC_DEFINE(NO_XLOCALE), $X_LIBS $SUBLIBS)
|
|
||||||
|
|
||||||
# For multibyte selection handling
|
|
||||||
if test "$MULTICHAR_ENCODING" != "none"; then
|
|
||||||
AC_CHECK_LIB(Xmu, XmuInternAtom, X_LIBS="-lXmu $X_LIBS", , $X_LIBS $SUBLIBS)
|
|
||||||
fi
|
|
||||||
|
|
||||||
# check X11R6 for XIM
|
|
||||||
if test "$XIM" = "TRUE"; then
|
|
||||||
AC_CHECK_LIB(X11, XRegisterIMInstantiateCallback, AC_DEFINE(USE_X11R6_XIM), , $X_LIBS $SUBLIBS)
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_PREFIX(Eterm)
|
AC_PREFIX(Eterm)
|
||||||
AC_PREFIX(gcc)
|
AC_PREFIX(gcc)
|
||||||
if test "$prefix" = "NONE"; then
|
if test "$prefix" = "NONE"; then
|
||||||
|
@ -709,18 +707,27 @@ if test "X$PKGDATADIR" = "X" ; then
|
||||||
fi
|
fi
|
||||||
export PKGDATADIR
|
export PKGDATADIR
|
||||||
AC_DEFINE_UNQUOTED(PKGDATADIR, "$PKGDATADIR")
|
AC_DEFINE_UNQUOTED(PKGDATADIR, "$PKGDATADIR")
|
||||||
|
if test "$GDB" != "no"; then
|
||||||
|
GDB_CMD_FILE="$PKGDATADIR/gdb.scr"
|
||||||
|
AC_DEFINE_UNQUOTED(GDB_CMD_FILE, "$GDB_CMD_FILE")
|
||||||
|
else
|
||||||
|
GDB_CMD_FILE=""
|
||||||
|
fi
|
||||||
|
AC_SUBST(GDB_CMD_FILE)
|
||||||
|
|
||||||
|
CPPFLAGS=`eval eval eval eval eval echo "-I$includedir -I$prefix/include $CPPFLAGS"`
|
||||||
|
CPPFLAGS=`echo $CPPFLAGS | tr ' ' '\n' | uniq | tr '\n' ' '`
|
||||||
CFLAGS=${CFLAGS--O}
|
CFLAGS=${CFLAGS--O}
|
||||||
LDFLAGS=${LDFLAGS--O}
|
LDFLAGS=`eval eval eval eval eval echo "-L$libdir -L$prefix/lib ${LDFLAGS--O}"`
|
||||||
|
LDFLAGS=`echo $LDFLAGS | tr ' ' '\n' | uniq | tr '\n' ' '`
|
||||||
|
LIBS="$GRLIBS $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
|
||||||
|
|
||||||
CPPFLAGS="$CPPFLAGS"
|
|
||||||
AC_SUBST(CC)
|
AC_SUBST(CC)
|
||||||
AC_SUBST(CFLAGS)
|
AC_SUBST(CFLAGS)
|
||||||
AC_SUBST(CPPFLAGS)
|
AC_SUBST(CPPFLAGS)
|
||||||
AC_SUBST(LDFLAGS)
|
AC_SUBST(LDFLAGS)
|
||||||
AC_SUBST(LIBS)
|
AC_SUBST(LIBS)
|
||||||
AC_SUBST(THREADLIBS)
|
AC_SUBST(THREADLIBS)
|
||||||
AC_SUBST(GRLIBS)
|
|
||||||
|
|
||||||
basedir=.
|
basedir=.
|
||||||
|
|
||||||
|
@ -733,6 +740,8 @@ AC_OUTPUT(Makefile bg/Makefile doc/Makefile utils/Makefile libmej/Makefile
|
||||||
BINDIR=`eval eval eval eval echo ${bindir}`
|
BINDIR=`eval eval eval eval echo ${bindir}`
|
||||||
export BINDIR bindir prefix exec_prefix datadir PACKAGE
|
export BINDIR bindir prefix exec_prefix datadir PACKAGE
|
||||||
|
|
||||||
|
# The awk-fu below replaces @VAR@ in theme config files with the corresponding
|
||||||
|
# environment variables, kinda like AC_OUTPUT above.
|
||||||
changequote(%&, &%)dnl
|
changequote(%&, &%)dnl
|
||||||
%&
|
%&
|
||||||
for i in utils/kEsetroot themes/Eterm/theme.cfg themes/auto/theme.cfg themes/cEterm/theme.cfg \
|
for i in utils/kEsetroot themes/Eterm/theme.cfg themes/auto/theme.cfg themes/cEterm/theme.cfg \
|
||||||
|
@ -758,19 +767,17 @@ if test -z "$GRLIBS"; then
|
||||||
mv doc/Makefile.new doc/Makefile
|
mv doc/Makefile.new doc/Makefile
|
||||||
fi
|
fi
|
||||||
|
|
||||||
test $USE_IMLIB = 0 && GRLIBS="*** WARNING: Pixmap support disabled! ***"
|
|
||||||
|
|
||||||
echo "
|
echo "
|
||||||
$PACKAGE $VERSION
|
$PACKAGE $VERSION
|
||||||
Configuration:
|
Configuration:
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
Source code location: ${srcdir}
|
Source code location: $srcdir
|
||||||
Compiler: ${CC} ${CFLAGS}
|
Host System Type: $host
|
||||||
Host System Type: ${host}
|
Preprocessor: $CC $CPPFLAGS
|
||||||
Graphics libraries: ${GRLIBS}
|
Compiler: $CC $CFLAGS
|
||||||
X libraries/paths: ${X_LIBS}
|
Linker: $CC $LDFLAGS $LIBS
|
||||||
Install path: ${prefix}
|
Install path: $prefix
|
||||||
|
|
||||||
See src/feature.h for further configuration information.
|
See src/feature.h for further configuration information.
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,6 @@ include_HEADERS = libmej.h
|
||||||
|
|
||||||
libmej_la_SOURCES = debug.c mem.c msgs.c strings.c snprintf.c libmej.h
|
libmej_la_SOURCES = debug.c mem.c msgs.c strings.c snprintf.c libmej.h
|
||||||
|
|
||||||
INCLUDES = -I. -I.. -I$(includedir) -I$(prefix)/include
|
LIBS = -lm
|
||||||
|
|
||||||
libmej_la_LDFLAGS = -release $(VERSION)
|
libmej_la_LDFLAGS = -release $(VERSION)
|
||||||
|
|
|
@ -61,6 +61,13 @@
|
||||||
# include <malloc.h>
|
# include <malloc.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <X11/Xatom.h>
|
||||||
|
#include <X11/X.h>
|
||||||
|
#include <X11/Intrinsic.h>
|
||||||
|
#ifdef HAVE_LIBIMLIB2
|
||||||
|
# include <Imlib2.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/******************************* GENERIC GOOP *********************************/
|
/******************************* GENERIC GOOP *********************************/
|
||||||
#ifndef TRUE
|
#ifndef TRUE
|
||||||
# define TRUE ((unsigned char)(1))
|
# define TRUE ((unsigned char)(1))
|
||||||
|
@ -193,7 +200,6 @@ typedef struct ptr_struct {
|
||||||
size_t size;
|
size_t size;
|
||||||
} ptr_t;
|
} ptr_t;
|
||||||
typedef struct memrec_struct {
|
typedef struct memrec_struct {
|
||||||
unsigned char init;
|
|
||||||
unsigned long cnt;
|
unsigned long cnt;
|
||||||
ptr_t *ptrs;
|
ptr_t *ptrs;
|
||||||
} memrec_t;
|
} memrec_t;
|
||||||
|
@ -204,6 +210,13 @@ typedef struct memrec_struct {
|
||||||
# define REALLOC(mem,sz) libmej_realloc(#mem, __FILE__, __LINE__, (mem), (sz))
|
# define REALLOC(mem,sz) libmej_realloc(#mem, __FILE__, __LINE__, (mem), (sz))
|
||||||
# define FREE(ptr) do { libmej_free(#ptr, __FILE__, __LINE__, (ptr)); (ptr) = NULL; } while (0)
|
# define FREE(ptr) do { libmej_free(#ptr, __FILE__, __LINE__, (ptr)); (ptr) = NULL; } while (0)
|
||||||
# define STRDUP(s) libmej_strdup(#s, __FILE__, __LINE__, (s))
|
# define STRDUP(s) libmej_strdup(#s, __FILE__, __LINE__, (s))
|
||||||
|
# define MALLOC_DUMP() libmej_dump_mem_tables()
|
||||||
|
# define X_CREATE_PIXMAP(d, win, w, h, depth) libmej_x_create_pixmap(__FILE__, __LINE__, (d), (win), (w), (h), (depth))
|
||||||
|
# define X_FREE_PIXMAP(d, p) libmej_x_free_pixmap(#p, __FILE__, __LINE__, (d), (p))
|
||||||
|
# define PIXMAP_DUMP() libmej_dump_pixmap_tables()
|
||||||
|
# define X_CREATE_GC(d, win, f, gcv) libmej_x_create_gc(__FILE__, __LINE__, (d), (win), (f), (gcv))
|
||||||
|
# define X_FREE_GC(d, gc) libmej_x_free_gc(#gc, __FILE__, __LINE__, (d), (gc))
|
||||||
|
# define GC_DUMP() libmej_dump_gc_tables()
|
||||||
# define MALLOC_MOD 25
|
# define MALLOC_MOD 25
|
||||||
# define REALLOC_MOD 25
|
# define REALLOC_MOD 25
|
||||||
# define CALLOC_MOD 25
|
# define CALLOC_MOD 25
|
||||||
|
@ -214,6 +227,13 @@ typedef struct memrec_struct {
|
||||||
# define REALLOC(mem,sz) ((sz) ? ((mem) ? (realloc((mem), (sz))) : (malloc(sz))) : ((mem) ? (free(mem), NULL) : (NULL)))
|
# define REALLOC(mem,sz) ((sz) ? ((mem) ? (realloc((mem), (sz))) : (malloc(sz))) : ((mem) ? (free(mem), NULL) : (NULL)))
|
||||||
# define FREE(ptr) do { free(ptr); (ptr) = NULL; } while (0)
|
# define FREE(ptr) do { free(ptr); (ptr) = NULL; } while (0)
|
||||||
# define STRDUP(s) strdup(s)
|
# define STRDUP(s) strdup(s)
|
||||||
|
# define MALLOC_DUMP() NOP
|
||||||
|
# define X_CREATE_PIXMAP(d, win, w, h, depth) XCreatePixmap((d), (win), (w), (h), (depth))
|
||||||
|
# define X_FREE_PIXMAP(d, p) XFreePixmap((d), (p))
|
||||||
|
# define PIXMAP_DUMP() NOP
|
||||||
|
# define X_CREATE_GC(d, win, f, gcv) XCreateGC((d), (win), (f), (gcv))
|
||||||
|
# define X_FREE_GC(d, gc) XFreeGC((d), (gc))
|
||||||
|
# define GC_DUMP() NOP
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Fast memset() macro contributed by vendu */
|
/* Fast memset() macro contributed by vendu */
|
||||||
|
@ -289,16 +309,18 @@ extern unsigned int DEBUG_LEVEL;
|
||||||
|
|
||||||
/* mem.c */
|
/* mem.c */
|
||||||
extern void memrec_init(void);
|
extern void memrec_init(void);
|
||||||
extern void memrec_add_var(void *, size_t);
|
|
||||||
extern void memrec_rem_var(const char *, const char *, unsigned long, void *);
|
|
||||||
extern void memrec_chg_var(const char *, const char *, unsigned long, void *, void *, size_t);
|
|
||||||
extern void memrec_dump(void);
|
|
||||||
extern void *libmej_malloc(const char *, unsigned long, size_t);
|
extern void *libmej_malloc(const char *, unsigned long, size_t);
|
||||||
extern void *libmej_realloc(const char *, const char *, unsigned long, void *, size_t);
|
extern void *libmej_realloc(const char *, const char *, unsigned long, void *, size_t);
|
||||||
extern void *libmej_calloc(const char *, unsigned long, size_t, size_t);
|
extern void *libmej_calloc(const char *, unsigned long, size_t, size_t);
|
||||||
extern void libmej_free(const char *, const char *, unsigned long, void *);
|
extern void libmej_free(const char *, const char *, unsigned long, void *);
|
||||||
extern char *libmej_strdup(const char *, const char *, unsigned long, const char *);
|
extern char *libmej_strdup(const char *, const char *, unsigned long, const char *);
|
||||||
extern void libmej_handle_sigsegv(int);
|
extern void libmej_dump_mem_tables(void);
|
||||||
|
extern Pixmap libmej_x_create_pixmap(const char *, unsigned long, Display *, Drawable, unsigned int, unsigned int, unsigned int);
|
||||||
|
extern void libmej_x_free_pixmap(const char *, const char *, unsigned long, Display *, Pixmap);
|
||||||
|
extern void libmej_dump_pixmap_tables(void);
|
||||||
|
extern GC libmej_x_create_gc(const char *, unsigned long, Display *, Drawable, unsigned long, XGCValues *);
|
||||||
|
extern void libmej_x_free_gc(const char *, const char *, unsigned long, Display *, GC);
|
||||||
|
extern void libmej_dump_gc_tables(void);
|
||||||
|
|
||||||
/* strings.c */
|
/* strings.c */
|
||||||
extern char *left_str(const char *, unsigned long);
|
extern char *left_str(const char *, unsigned long);
|
||||||
|
|
169
libmej/mem.c
169
libmej/mem.c
|
@ -30,6 +30,11 @@ static const char cvs_ident[] = "$Id$";
|
||||||
|
|
||||||
#include "libmej.h"
|
#include "libmej.h"
|
||||||
|
|
||||||
|
static void memrec_add_var(memrec_t *, void *, size_t);
|
||||||
|
static void memrec_rem_var(memrec_t *, const char *, const char *, unsigned long, void *);
|
||||||
|
static void memrec_chg_var(memrec_t *, const char *, const char *, unsigned long, void *, void *, size_t);
|
||||||
|
static void memrec_dump(memrec_t *);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These're added for a pretty obvious reason -- they're implemented towards
|
* These're added for a pretty obvious reason -- they're implemented towards
|
||||||
* The beginning of each one's respective function. (The ones with capitalized
|
* The beginning of each one's respective function. (The ones with capitalized
|
||||||
|
@ -42,40 +47,43 @@ static int realloc_count = 0;
|
||||||
static int free_count = 0;
|
static int free_count = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static memrec_t memrec;
|
static memrec_t malloc_rec, pixmap_rec, gc_rec;
|
||||||
|
|
||||||
void
|
void
|
||||||
memrec_init(void)
|
memrec_init(void)
|
||||||
{
|
{
|
||||||
D_MEM(("Constructing memrec\n"));
|
D_MEM(("Constructing memory allocation records\n"));
|
||||||
memrec.ptrs = (ptr_t *) malloc(sizeof(ptr_t));
|
malloc_rec.ptrs = (ptr_t *) malloc(sizeof(ptr_t));
|
||||||
memrec.init = 1;
|
pixmap_rec.ptrs = (ptr_t *) malloc(sizeof(ptr_t));
|
||||||
|
gc_rec.ptrs = (ptr_t *) malloc(sizeof(ptr_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
memrec_add_var(void *ptr, size_t size)
|
memrec_add_var(memrec_t *memrec, void *ptr, size_t size)
|
||||||
{
|
{
|
||||||
register ptr_t *p;
|
register ptr_t *p;
|
||||||
|
|
||||||
memrec.cnt++;
|
ASSERT(memrec != NULL);
|
||||||
if ((memrec.ptrs = (ptr_t *) realloc(memrec.ptrs, sizeof(ptr_t) * memrec.cnt)) == NULL) {
|
memrec->cnt++;
|
||||||
|
if ((memrec->ptrs = (ptr_t *) realloc(memrec->ptrs, sizeof(ptr_t) * memrec->cnt)) == NULL) {
|
||||||
D_MEM(("Unable to reallocate pointer list -- %s\n", strerror(errno)));
|
D_MEM(("Unable to reallocate pointer list -- %s\n", strerror(errno)));
|
||||||
}
|
}
|
||||||
D_MEM(("Adding variable of size %lu at %8p\n", size, ptr));
|
D_MEM(("Adding variable of size %lu at %8p\n", size, ptr));
|
||||||
p = memrec.ptrs + memrec.cnt - 1;
|
p = memrec->ptrs + memrec->cnt - 1;
|
||||||
p->ptr = ptr;
|
p->ptr = ptr;
|
||||||
p->size = size;
|
p->size = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
memrec_rem_var(const char *var, const char *filename, unsigned long line, void *ptr)
|
memrec_rem_var(memrec_t *memrec, const char *var, const char *filename, unsigned long line, void *ptr)
|
||||||
{
|
{
|
||||||
register ptr_t *p = NULL;
|
register ptr_t *p = NULL;
|
||||||
register unsigned long i;
|
register unsigned long i;
|
||||||
|
|
||||||
for (i = 0; i < memrec.cnt; i++) {
|
ASSERT(memrec != NULL);
|
||||||
if (memrec.ptrs[i].ptr == ptr) {
|
for (i = 0; i < memrec->cnt; i++) {
|
||||||
p = memrec.ptrs + i;
|
if (memrec->ptrs[i].ptr == ptr) {
|
||||||
|
p = memrec->ptrs + i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -83,25 +91,26 @@ memrec_rem_var(const char *var, const char *filename, unsigned long line, void *
|
||||||
D_MEM(("ERROR: File %s, line %d attempted to free variable %s (%8p) which was not allocated with MALLOC/REALLOC\n", filename, line, var, ptr));
|
D_MEM(("ERROR: File %s, line %d attempted to free variable %s (%8p) which was not allocated with MALLOC/REALLOC\n", filename, line, var, ptr));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
memrec.cnt--;
|
memrec->cnt--;
|
||||||
D_MEM(("Removing variable of size %lu at %8p\n", p->size, p->ptr));
|
D_MEM(("Removing variable of size %lu at %8p\n", p->size, p->ptr));
|
||||||
memmove(p, p + 1, sizeof(ptr_t) * (memrec.cnt - i));
|
memmove(p, p + 1, sizeof(ptr_t) * (memrec->cnt - i));
|
||||||
memrec.ptrs = (ptr_t *) realloc(memrec.ptrs, sizeof(ptr_t) * memrec.cnt);
|
memrec->ptrs = (ptr_t *) realloc(memrec->ptrs, sizeof(ptr_t) * memrec->cnt);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
memrec_chg_var(const char *var, const char *filename, unsigned long line, void *oldp, void *newp, size_t size)
|
memrec_chg_var(memrec_t *memrec, const char *var, const char *filename, unsigned long line, void *oldp, void *newp, size_t size)
|
||||||
{
|
{
|
||||||
register ptr_t *p = NULL;
|
register ptr_t *p = NULL;
|
||||||
register unsigned long i;
|
register unsigned long i;
|
||||||
|
|
||||||
for (i = 0; i < memrec.cnt; i++) {
|
ASSERT(memrec != NULL);
|
||||||
if (memrec.ptrs[i].ptr == oldp) {
|
for (i = 0; i < memrec->cnt; i++) {
|
||||||
p = memrec.ptrs + i;
|
if (memrec->ptrs[i].ptr == oldp) {
|
||||||
|
p = memrec->ptrs + i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i == memrec.cnt) {
|
if (i == memrec->cnt) {
|
||||||
D_MEM(("ERROR: File %s, line %d attempted to realloc variable %s (%8p) which was not allocated with MALLOC/REALLOC\n", filename, line, var, oldp));
|
D_MEM(("ERROR: File %s, line %d attempted to realloc variable %s (%8p) which was not allocated with MALLOC/REALLOC\n", filename, line, var, oldp));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -110,27 +119,28 @@ memrec_chg_var(const char *var, const char *filename, unsigned long line, void *
|
||||||
p->size = size;
|
p->size = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
memrec_dump(void)
|
memrec_dump(memrec_t *memrec)
|
||||||
{
|
{
|
||||||
register ptr_t *p;
|
register ptr_t *p;
|
||||||
unsigned long i, j, k, l, total = 0;
|
unsigned long i, j, k, l, total = 0;
|
||||||
unsigned long len;
|
unsigned long len;
|
||||||
unsigned char buff[9];
|
unsigned char buff[9];
|
||||||
|
|
||||||
fprintf(LIBMEJ_DEBUG_FD, "DUMP :: %lu pointers stored.\n", memrec.cnt);
|
ASSERT(memrec != NULL);
|
||||||
|
fprintf(LIBMEJ_DEBUG_FD, "DUMP :: %lu pointers stored.\n", memrec->cnt);
|
||||||
fprintf(LIBMEJ_DEBUG_FD, "DUMP :: Pointer | Address | Size | Offset | 00 01 02 03 04 05 06 07 | ASCII \n");
|
fprintf(LIBMEJ_DEBUG_FD, "DUMP :: Pointer | Address | Size | Offset | 00 01 02 03 04 05 06 07 | ASCII \n");
|
||||||
fprintf(LIBMEJ_DEBUG_FD, "DUMP :: ---------+----------+--------+---------+-------------------------+---------\n");
|
fprintf(LIBMEJ_DEBUG_FD, "DUMP :: ---------+----------+--------+---------+-------------------------+---------\n");
|
||||||
fflush(LIBMEJ_DEBUG_FD);
|
fflush(LIBMEJ_DEBUG_FD);
|
||||||
len = sizeof(ptr_t) * memrec.cnt;
|
len = sizeof(ptr_t) * memrec->cnt;
|
||||||
memset(buff, 0, sizeof(buff));
|
memset(buff, 0, sizeof(buff));
|
||||||
|
|
||||||
/* First, dump the contents of the memrec.ptrs[] array. */
|
/* First, dump the contents of the memrec->ptrs[] array. */
|
||||||
for (p = memrec.ptrs, j = 0; j < len; p++, j += 8) {
|
for (p = memrec->ptrs, j = 0; j < len; p++, j += 8) {
|
||||||
fprintf(LIBMEJ_DEBUG_FD, "DUMP :: %07lu | %8p | %06lu | %07x | ", (unsigned long) 0, memrec.ptrs, (unsigned long) (sizeof(ptr_t) * memrec.cnt), (unsigned int) j);
|
fprintf(LIBMEJ_DEBUG_FD, "DUMP :: %07lu | %8p | %06lu | %07x | ", (unsigned long) 0, memrec->ptrs, (unsigned long) (sizeof(ptr_t) * memrec->cnt), (unsigned int) j);
|
||||||
/* l is the number of characters we're going to output */
|
/* l is the number of characters we're going to output */
|
||||||
l = ((len - j < 8) ? (len - j) : (8));
|
l = ((len - j < 8) ? (len - j) : (8));
|
||||||
/* Copy l bytes (up to 8) from memrec.ptrs[] (p) to buffer */
|
/* Copy l bytes (up to 8) from memrec->ptrs[] (p) to buffer */
|
||||||
memcpy(buff, p + j, l);
|
memcpy(buff, p + j, l);
|
||||||
for (k = 0; k < l; k++) {
|
for (k = 0; k < l; k++) {
|
||||||
fprintf(LIBMEJ_DEBUG_FD, "%02x ", buff[k]);
|
fprintf(LIBMEJ_DEBUG_FD, "%02x ", buff[k]);
|
||||||
|
@ -146,7 +156,7 @@ memrec_dump(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now print out each pointer and its contents. */
|
/* Now print out each pointer and its contents. */
|
||||||
for (p = memrec.ptrs, i = 0; i < memrec.cnt; p++, i++) {
|
for (p = memrec->ptrs, i = 0; i < memrec->cnt; p++, i++) {
|
||||||
/* Add this pointer's size to our total */
|
/* Add this pointer's size to our total */
|
||||||
total += p->size;
|
total += p->size;
|
||||||
for (j = 0; j < p->size; j += 8) {
|
for (j = 0; j < p->size; j += 8) {
|
||||||
|
@ -172,6 +182,7 @@ memrec_dump(void)
|
||||||
fflush(LIBMEJ_DEBUG_FD);
|
fflush(LIBMEJ_DEBUG_FD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/******************** MEMORY ALLOCATION INTERFACE ********************/
|
||||||
void *
|
void *
|
||||||
libmej_malloc(const char *filename, unsigned long line, size_t size)
|
libmej_malloc(const char *filename, unsigned long line, size_t size)
|
||||||
{
|
{
|
||||||
|
@ -189,7 +200,7 @@ libmej_malloc(const char *filename, unsigned long line, size_t size)
|
||||||
temp = (void *) malloc(size);
|
temp = (void *) malloc(size);
|
||||||
ASSERT_RVAL(temp != NULL, NULL);
|
ASSERT_RVAL(temp != NULL, NULL);
|
||||||
if (DEBUG_LEVEL >= DEBUG_MEM) {
|
if (DEBUG_LEVEL >= DEBUG_MEM) {
|
||||||
memrec_add_var(temp, size);
|
memrec_add_var(&malloc_rec, temp, size);
|
||||||
}
|
}
|
||||||
return (temp);
|
return (temp);
|
||||||
}
|
}
|
||||||
|
@ -213,7 +224,7 @@ libmej_realloc(const char *var, const char *filename, unsigned long line, void *
|
||||||
temp = (void *) realloc(ptr, size);
|
temp = (void *) realloc(ptr, size);
|
||||||
ASSERT_RVAL(temp != NULL, ptr);
|
ASSERT_RVAL(temp != NULL, ptr);
|
||||||
if (DEBUG_LEVEL >= DEBUG_MEM) {
|
if (DEBUG_LEVEL >= DEBUG_MEM) {
|
||||||
memrec_chg_var(var, filename, line, ptr, temp, size);
|
memrec_chg_var(&malloc_rec, var, filename, line, ptr, temp, size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (temp);
|
return (temp);
|
||||||
|
@ -235,7 +246,7 @@ libmej_calloc(const char *filename, unsigned long line, size_t count, size_t siz
|
||||||
temp = (void *) calloc(count, size);
|
temp = (void *) calloc(count, size);
|
||||||
ASSERT_RVAL(temp != NULL, NULL);
|
ASSERT_RVAL(temp != NULL, NULL);
|
||||||
if (DEBUG_LEVEL >= DEBUG_MEM) {
|
if (DEBUG_LEVEL >= DEBUG_MEM) {
|
||||||
memrec_add_var(temp, size * count);
|
memrec_add_var(&malloc_rec, temp, size * count);
|
||||||
}
|
}
|
||||||
return (temp);
|
return (temp);
|
||||||
}
|
}
|
||||||
|
@ -253,7 +264,7 @@ libmej_free(const char *var, const char *filename, unsigned long line, void *ptr
|
||||||
D_MEM(("libmej_free() called for variable %s (%8p) at %s:%lu\n", var, ptr, filename, line));
|
D_MEM(("libmej_free() called for variable %s (%8p) at %s:%lu\n", var, ptr, filename, line));
|
||||||
if (ptr) {
|
if (ptr) {
|
||||||
if (DEBUG_LEVEL >= DEBUG_MEM) {
|
if (DEBUG_LEVEL >= DEBUG_MEM) {
|
||||||
memrec_rem_var(var, filename, line, ptr);
|
memrec_rem_var(&malloc_rec, var, filename, line, ptr);
|
||||||
}
|
}
|
||||||
free(ptr);
|
free(ptr);
|
||||||
} else {
|
} else {
|
||||||
|
@ -276,11 +287,85 @@ libmej_strdup(const char *var, const char *filename, unsigned long line, const c
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
libmej_handle_sigsegv(int sig)
|
libmej_dump_mem_tables(void)
|
||||||
{
|
{
|
||||||
#if DEBUG >= DEBUG_MEM
|
memrec_dump(&malloc_rec);
|
||||||
fprintf(LIBMEJ_DEBUG_FD, "Fatal memory fault (%d)! Dumping memory table.\n", sig);
|
}
|
||||||
memrec_dump();
|
|
||||||
#endif
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
|
/******************** PIXMAP ALLOCATION INTERFACE ********************/
|
||||||
|
|
||||||
|
Pixmap
|
||||||
|
libmej_x_create_pixmap(const char *filename, unsigned long line, Display *d, Drawable win, unsigned int w, unsigned int h, unsigned int depth)
|
||||||
|
{
|
||||||
|
Pixmap p;
|
||||||
|
|
||||||
|
D_MEM(("Creating %ux%u pixmap of depth %u for window 0x%08x at %s:%lu\n", w, h, depth, win, filename, line));
|
||||||
|
|
||||||
|
p = XCreatePixmap(d, win, w, h, depth);
|
||||||
|
ASSERT_RVAL(p != None, None);
|
||||||
|
if (DEBUG_LEVEL >= DEBUG_MEM) {
|
||||||
|
memrec_add_var(&pixmap_rec, (void *) p, w * h * (depth / 8));
|
||||||
|
}
|
||||||
|
return (p);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
libmej_x_free_pixmap(const char *var, const char *filename, unsigned long line, Display *d, Pixmap p)
|
||||||
|
{
|
||||||
|
D_MEM(("libmej_x_free_pixmap() called for variable %s (0x%08x) at %s:%lu\n", var, p, filename, line));
|
||||||
|
if (p) {
|
||||||
|
if (DEBUG_LEVEL >= DEBUG_MEM) {
|
||||||
|
memrec_rem_var(&pixmap_rec, var, filename, line, (void *) p);
|
||||||
|
}
|
||||||
|
XFreePixmap(d, p);
|
||||||
|
} else {
|
||||||
|
D_MEM(("ERROR: Caught attempt to free NULL pixmap\n"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
libmej_dump_pixmap_tables(void)
|
||||||
|
{
|
||||||
|
memrec_dump(&pixmap_rec);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/********************** GC ALLOCATION INTERFACE **********************/
|
||||||
|
|
||||||
|
GC
|
||||||
|
libmej_x_create_gc(const char *filename, unsigned long line, Display *d, Drawable win, unsigned long mask, XGCValues *gcv)
|
||||||
|
{
|
||||||
|
GC gc;
|
||||||
|
|
||||||
|
D_MEM(("Creating gc for window 0x%08x at %s:%lu\n", win, filename, line));
|
||||||
|
|
||||||
|
gc = XCreateGC(d, win, mask, gcv);
|
||||||
|
ASSERT_RVAL(gc != None, None);
|
||||||
|
if (DEBUG_LEVEL >= DEBUG_MEM) {
|
||||||
|
memrec_add_var(&gc_rec, (void *) gc, sizeof(XGCValues));
|
||||||
|
}
|
||||||
|
return (gc);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
libmej_x_free_gc(const char *var, const char *filename, unsigned long line, Display *d, GC gc)
|
||||||
|
{
|
||||||
|
D_MEM(("libmej_x_free_gc() called for variable %s (0x%08x) at %s:%lu\n", var, gc, filename, line));
|
||||||
|
if (gc) {
|
||||||
|
if (DEBUG_LEVEL >= DEBUG_MEM) {
|
||||||
|
memrec_rem_var(&gc_rec, var, filename, line, (void *) gc);
|
||||||
|
}
|
||||||
|
XFreeGC(d, gc);
|
||||||
|
} else {
|
||||||
|
D_MEM(("ERROR: Caught attempt to free NULL GC\n"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
libmej_dump_gc_tables(void)
|
||||||
|
{
|
||||||
|
memrec_dump(&gc_rec);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# $Id$
|
# $Id$
|
||||||
|
|
||||||
|
INCLUDES = -I$(top_srcdir)/libmej
|
||||||
|
|
||||||
lib_LTLIBRARIES = libEterm.la
|
lib_LTLIBRARIES = libEterm.la
|
||||||
bin_PROGRAMS = Eterm
|
bin_PROGRAMS = Eterm
|
||||||
|
|
||||||
|
@ -17,6 +19,8 @@ libEterm_la_LDFLAGS = -release $(VERSION)
|
||||||
Eterm_SOURCES = main.c
|
Eterm_SOURCES = main.c
|
||||||
Eterm_DEPENDENCIES = libEterm.la
|
Eterm_DEPENDENCIES = libEterm.la
|
||||||
Eterm_LDFLAGS = -rpath $(libdir):$(pkglibdir)
|
Eterm_LDFLAGS = -rpath $(libdir):$(pkglibdir)
|
||||||
Eterm_LDADD = libEterm.la $(top_builddir)/libmej/libmej.la -L$(libdir) -L$(prefix)/lib $(X_LIBS) $(GRLIBS) $(LIBS)
|
Eterm_LDADD = libEterm.la $(top_builddir)/libmej/libmej.la
|
||||||
|
|
||||||
INCLUDES = -I. -I$(top_srcdir) -I$(top_srcdir)/libmej -I.. -I$(includedir) -I$(prefix)/include $(X_CFLAGS)
|
install-exec-hook:
|
||||||
|
$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
|
||||||
|
test ! -z "$(GDB_CMD_FILE)" && $(INSTALL_DATA) gdb.scr $(DESTDIR)$(pkgdatadir)/
|
||||||
|
|
|
@ -101,7 +101,7 @@ bbar_create(void)
|
||||||
XSelectInput(Xdisplay, bbar->win, mask);
|
XSelectInput(Xdisplay, bbar->win, mask);
|
||||||
XStoreName(Xdisplay, bbar->win, "Eterm Button Bar");
|
XStoreName(Xdisplay, bbar->win, "Eterm Button Bar");
|
||||||
|
|
||||||
bbar->gc = X_CREATE_GC(GCForeground | GCFont, &gcvalue);
|
bbar->gc = LIBMEJ_X_CREATE_GC(GCForeground | GCFont, &gcvalue);
|
||||||
bbar_set_docked(bbar, BBAR_DOCKED_TOP);
|
bbar_set_docked(bbar, BBAR_DOCKED_TOP);
|
||||||
bbar_set_visible(bbar, 1);
|
bbar_set_visible(bbar, 1);
|
||||||
|
|
||||||
|
|
|
@ -972,10 +972,10 @@ hard_exit(void) {
|
||||||
_exit(-1);
|
_exit(-1);
|
||||||
#elif defined(SIGKILL)
|
#elif defined(SIGKILL)
|
||||||
kill(cmd_pid, SIGKILL);
|
kill(cmd_pid, SIGKILL);
|
||||||
raise(SIGKILL);
|
abort();
|
||||||
#else
|
#else
|
||||||
kill(cmd_pid, 9);
|
kill(cmd_pid, 9);
|
||||||
raise(9);
|
abort();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -984,8 +984,8 @@ hard_exit(void) {
|
||||||
void
|
void
|
||||||
dump_stack_trace(void)
|
dump_stack_trace(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
char cmd[256];
|
char cmd[256];
|
||||||
|
struct stat st;
|
||||||
|
|
||||||
#ifdef NO_STACK_TRACE
|
#ifdef NO_STACK_TRACE
|
||||||
return;
|
return;
|
||||||
|
@ -998,7 +998,10 @@ dump_stack_trace(void)
|
||||||
U_STACK_TRACE();
|
U_STACK_TRACE();
|
||||||
return;
|
return;
|
||||||
#elif defined(GDB)
|
#elif defined(GDB)
|
||||||
snprintf(cmd, sizeof(cmd), "/bin/echo '\n\nbacktrace' | " GDB " " APL_NAME " %d", getpid());
|
if (((stat(GDB_CMD_FILE, &st)) != 0) || (!S_ISREG(st.st_mode))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
snprintf(cmd, sizeof(cmd), GDB " -x " GDB_CMD_FILE " " APL_NAME " %d", getpid());
|
||||||
#elif defined(PSTACK)
|
#elif defined(PSTACK)
|
||||||
snprintf(cmd, sizeof(cmd), PSTACK " %d", getpid());
|
snprintf(cmd, sizeof(cmd), PSTACK " %d", getpid());
|
||||||
#elif defined(DBX)
|
#elif defined(DBX)
|
||||||
|
@ -1014,7 +1017,7 @@ dump_stack_trace(void)
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
signal(SIGALRM, (eterm_sighandler_t) hard_exit);
|
signal(SIGALRM, (eterm_sighandler_t) hard_exit);
|
||||||
alarm(10);
|
alarm(3);
|
||||||
system(cmd);
|
system(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1138,7 +1141,9 @@ clean_exit(void)
|
||||||
privileges(REVERT);
|
privileges(REVERT);
|
||||||
#if DEBUG >= DEBUG_MEM
|
#if DEBUG >= DEBUG_MEM
|
||||||
if (DEBUG_LEVEL >= DEBUG_MEM) {
|
if (DEBUG_LEVEL >= DEBUG_MEM) {
|
||||||
memrec_dump();
|
MALLOC_DUMP();
|
||||||
|
PIXMAP_DUMP();
|
||||||
|
GC_DUMP();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
PABLO_STOP_TRACING();
|
PABLO_STOP_TRACING();
|
||||||
|
|
12
src/draw.c
12
src/draw.c
|
@ -54,8 +54,8 @@ draw_shadow_from_colors(Drawable d, Pixel top, Pixel bottom, int x, int y, int w
|
||||||
static GC gc_top = (GC) 0, gc_bottom = (GC) 0;
|
static GC gc_top = (GC) 0, gc_bottom = (GC) 0;
|
||||||
|
|
||||||
if (gc_top == 0) {
|
if (gc_top == 0) {
|
||||||
gc_top = X_CREATE_GC(0, NULL);
|
gc_top = LIBMEJ_X_CREATE_GC(0, NULL);
|
||||||
gc_bottom = X_CREATE_GC(0, NULL);
|
gc_bottom = LIBMEJ_X_CREATE_GC(0, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
XSetForeground(Xdisplay, gc_top, top);
|
XSetForeground(Xdisplay, gc_top, top);
|
||||||
|
@ -109,8 +109,8 @@ draw_arrow_from_colors(Drawable d, Pixel top, Pixel bottom, int x, int y, int w,
|
||||||
static GC gc_top = (GC) 0, gc_bottom = (GC) 0;
|
static GC gc_top = (GC) 0, gc_bottom = (GC) 0;
|
||||||
|
|
||||||
if (gc_top == 0) {
|
if (gc_top == 0) {
|
||||||
gc_top = X_CREATE_GC(0, NULL);
|
gc_top = LIBMEJ_X_CREATE_GC(0, NULL);
|
||||||
gc_bottom = X_CREATE_GC(0, NULL);
|
gc_bottom = LIBMEJ_X_CREATE_GC(0, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
XSetForeground(Xdisplay, gc_top, top);
|
XSetForeground(Xdisplay, gc_top, top);
|
||||||
|
@ -230,8 +230,8 @@ bevel_pixmap(Pixmap p, int w, int h, Imlib_Border *bord, unsigned char up)
|
||||||
MOD_PIXEL_HIGH(x, y, !up);
|
MOD_PIXEL_HIGH(x, y, !up);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gc = X_CREATE_GC(0, NULL);
|
gc = LIBMEJ_X_CREATE_GC(0, NULL);
|
||||||
XPutImage(Xdisplay, p, gc, ximg, 0, 0, 0, 0, w, h);
|
XPutImage(Xdisplay, p, gc, ximg, 0, 0, 0, 0, w, h);
|
||||||
X_FREE_GC(gc);
|
LIBMEJ_X_FREE_GC(gc);
|
||||||
XDestroyImage(ximg);
|
XDestroyImage(ximg);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
backtrace
|
||||||
|
quit
|
|
@ -124,9 +124,9 @@ menu_init(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
gcvalue.foreground = PixColors[menuTopShadowColor];
|
gcvalue.foreground = PixColors[menuTopShadowColor];
|
||||||
topShadowGC = X_CREATE_GC(GCForeground, &gcvalue);
|
topShadowGC = LIBMEJ_X_CREATE_GC(GCForeground, &gcvalue);
|
||||||
gcvalue.foreground = PixColors[menuBottomShadowColor];
|
gcvalue.foreground = PixColors[menuBottomShadowColor];
|
||||||
botShadowGC = X_CREATE_GC(GCForeground, &gcvalue);
|
botShadowGC = LIBMEJ_X_CREATE_GC(GCForeground, &gcvalue);
|
||||||
|
|
||||||
event_register_dispatcher(menu_dispatch_event, menu_event_init_dispatcher);
|
event_register_dispatcher(menu_dispatch_event, menu_event_init_dispatcher);
|
||||||
}
|
}
|
||||||
|
@ -450,7 +450,7 @@ menu_create(char *title)
|
||||||
menu->swin = XCreateWindow(Xdisplay, menu->win, 0, 0, 1, 1, 0, Xdepth, InputOutput, CopyFromParent,
|
menu->swin = XCreateWindow(Xdisplay, menu->win, 0, 0, 1, 1, 0, Xdepth, InputOutput, CopyFromParent,
|
||||||
CWOverrideRedirect | CWSaveUnder | CWBackingStore | CWBorderPixel | CWColormap, &xattr);
|
CWOverrideRedirect | CWSaveUnder | CWBackingStore | CWBorderPixel | CWColormap, &xattr);
|
||||||
|
|
||||||
menu->gc = X_CREATE_GC(0, NULL);
|
menu->gc = LIBMEJ_X_CREATE_GC(0, NULL);
|
||||||
menuitem_clear_current(menu);
|
menuitem_clear_current(menu);
|
||||||
|
|
||||||
return menu;
|
return menu;
|
||||||
|
|
20
src/misc.c
20
src/misc.c
|
@ -226,26 +226,6 @@ parse_escaped_string(char *str)
|
||||||
return (pnew - str);
|
return (pnew - str);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
|
||||||
find_file(const char *file, const char *ext)
|
|
||||||
{
|
|
||||||
|
|
||||||
const char *f;
|
|
||||||
|
|
||||||
#if defined(PIXMAP_SUPPORT)
|
|
||||||
if ((f = search_path(rs_path, file, ext)) != NULL) {
|
|
||||||
return (f);
|
|
||||||
} else if ((f = search_path(getenv(PATH_ENV), file, ext)) != NULL) {
|
|
||||||
return (f);
|
|
||||||
} else {
|
|
||||||
return (search_path(initial_dir, file, ext));
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
return ((const char *) NULL);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
char *
|
char *
|
||||||
safe_print_string(char *str, unsigned long len)
|
safe_print_string(char *str, unsigned long len)
|
||||||
{
|
{
|
||||||
|
|
|
@ -40,8 +40,6 @@ extern const char *my_basename(const char *str);
|
||||||
extern unsigned long str_leading_match(register const char *, register const char *);
|
extern unsigned long str_leading_match(register const char *, register const char *);
|
||||||
extern char *str_trim(char *str);
|
extern char *str_trim(char *str);
|
||||||
extern int parse_escaped_string(char *str);
|
extern int parse_escaped_string(char *str);
|
||||||
extern const char *search_path(const char *pathlist, const char *file, const char *ext);
|
|
||||||
extern const char *find_file(const char *file, const char *ext);
|
|
||||||
extern char *safe_print_string(char *buff, unsigned long len);
|
extern char *safe_print_string(char *buff, unsigned long len);
|
||||||
extern unsigned long add_carriage_returns(unsigned char *buff, unsigned long cnt);
|
extern unsigned long add_carriage_returns(unsigned char *buff, unsigned long cnt);
|
||||||
extern unsigned char mkdirhier(const char *);
|
extern unsigned char mkdirhier(const char *);
|
||||||
|
|
129
src/pixmap.c
129
src/pixmap.c
|
@ -512,8 +512,8 @@ create_trans_pixmap(simage_t *simg, unsigned char which, Drawable d, int x, int
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
XTranslateCoordinates(Xdisplay, d, desktop_window, x, y, &x, &y, &dummy);
|
XTranslateCoordinates(Xdisplay, d, desktop_window, x, y, &x, &y, &dummy);
|
||||||
p = X_CREATE_PIXMAP(width, height);
|
p = LIBMEJ_X_CREATE_PIXMAP(width, height);
|
||||||
gc = X_CREATE_GC(0, NULL);
|
gc = LIBMEJ_X_CREATE_GC(0, NULL);
|
||||||
D_PIXMAP(("Created p [0x%08x] as a %hux%hu pixmap at %d, %d relative to window 0x%08x\n", p, width, height, x, y, desktop_window));
|
D_PIXMAP(("Created p [0x%08x] as a %hux%hu pixmap at %d, %d relative to window 0x%08x\n", p, width, height, x, y, desktop_window));
|
||||||
if (p != None) {
|
if (p != None) {
|
||||||
if (pw < scr->width || ph < scr->height) {
|
if (pw < scr->width || ph < scr->height) {
|
||||||
|
@ -535,7 +535,7 @@ create_trans_pixmap(simage_t *simg, unsigned char which, Drawable d, int x, int
|
||||||
bevel_pixmap(p, width, height, simg->iml->bevel->edges, simg->iml->bevel->up);
|
bevel_pixmap(p, width, height, simg->iml->bevel->edges, simg->iml->bevel->up);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
X_FREE_GC(gc);
|
LIBMEJ_X_FREE_GC(gc);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -609,10 +609,10 @@ create_viewport_pixmap(simage_t *simg, Drawable d, int x, int y, unsigned short
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (p == None) {
|
if (p == None) {
|
||||||
p = X_CREATE_PIXMAP(width, height);
|
p = LIBMEJ_X_CREATE_PIXMAP(width, height);
|
||||||
D_PIXMAP(("Created p == 0x%08x\n", p));
|
D_PIXMAP(("Created p == 0x%08x\n", p));
|
||||||
}
|
}
|
||||||
gc = X_CREATE_GC(0, NULL);
|
gc = LIBMEJ_X_CREATE_GC(0, NULL);
|
||||||
XTranslateCoordinates(Xdisplay, d, desktop_window, x, y, &x, &y, &dummy);
|
XTranslateCoordinates(Xdisplay, d, desktop_window, x, y, &x, &y, &dummy);
|
||||||
D_PIXMAP(("Translated coords are %d, %d\n", x, y));
|
D_PIXMAP(("Translated coords are %d, %d\n", x, y));
|
||||||
if ((images[image_bg].current->pmap->w > 0) || (images[image_bg].current->pmap->op & OP_SCALE)) {
|
if ((images[image_bg].current->pmap->w > 0) || (images[image_bg].current->pmap->op & OP_SCALE)) {
|
||||||
|
@ -623,7 +623,7 @@ create_viewport_pixmap(simage_t *simg, Drawable d, int x, int y, unsigned short
|
||||||
XSetFillStyle(Xdisplay, gc, FillTiled);
|
XSetFillStyle(Xdisplay, gc, FillTiled);
|
||||||
XFillRectangle(Xdisplay, p, gc, 0, 0, width, height);
|
XFillRectangle(Xdisplay, p, gc, 0, 0, width, height);
|
||||||
}
|
}
|
||||||
X_FREE_GC(gc);
|
LIBMEJ_X_FREE_GC(gc);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -668,13 +668,13 @@ paste_simage(simage_t *simg, unsigned char which, Drawable d, unsigned short x,
|
||||||
FREE(reply);
|
FREE(reply);
|
||||||
enl_ipc_sync();
|
enl_ipc_sync();
|
||||||
if (pmap) {
|
if (pmap) {
|
||||||
gc = X_CREATE_GC(0, NULL);
|
gc = LIBMEJ_X_CREATE_GC(0, NULL);
|
||||||
XSetClipMask(Xdisplay, gc, mask);
|
XSetClipMask(Xdisplay, gc, mask);
|
||||||
XSetClipOrigin(Xdisplay, gc, x, y);
|
XSetClipOrigin(Xdisplay, gc, x, y);
|
||||||
XCopyArea(Xdisplay, pmap, d, gc, 0, 0, w, h, x, y);
|
XCopyArea(Xdisplay, pmap, d, gc, 0, 0, w, h, x, y);
|
||||||
snprintf(buff, sizeof(buff), "imageclass %s free_pixmap 0x%08x", iclass, (int) pmap);
|
snprintf(buff, sizeof(buff), "imageclass %s free_pixmap 0x%08x", iclass, (int) pmap);
|
||||||
enl_ipc_send(buff);
|
enl_ipc_send(buff);
|
||||||
X_FREE_GC(gc);
|
LIBMEJ_X_FREE_GC(gc);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
print_error("Enlightenment returned a null pixmap, which I can't use. Disallowing \"auto\" mode for this image.\n");
|
print_error("Enlightenment returned a null pixmap, which I can't use. Disallowing \"auto\" mode for this image.\n");
|
||||||
|
@ -687,23 +687,23 @@ paste_simage(simage_t *simg, unsigned char which, Drawable d, unsigned short x,
|
||||||
} else if (image_mode_is(which, MODE_TRANS) && image_mode_is(which, ALLOW_TRANS)) {
|
} else if (image_mode_is(which, MODE_TRANS) && image_mode_is(which, ALLOW_TRANS)) {
|
||||||
Pixmap p;
|
Pixmap p;
|
||||||
|
|
||||||
gc = X_CREATE_GC(0, NULL);
|
gc = LIBMEJ_X_CREATE_GC(0, NULL);
|
||||||
/* FIXME: The conditional on the next line works, but it's a hack. Worth fixing? :-) */
|
/* FIXME: The conditional on the next line works, but it's a hack. Worth fixing? :-) */
|
||||||
p = create_trans_pixmap(simg, which, ((which == image_st) ? scrollbar.sa_win : d), x, y, w, h);
|
p = create_trans_pixmap(simg, which, ((which == image_st) ? scrollbar.sa_win : d), x, y, w, h);
|
||||||
XCopyArea(Xdisplay, p, d, gc, 0, 0, w, h, x, y);
|
XCopyArea(Xdisplay, p, d, gc, 0, 0, w, h, x, y);
|
||||||
X_FREE_PIXMAP(p);
|
LIBMEJ_X_FREE_PIXMAP(p);
|
||||||
X_FREE_GC(gc);
|
LIBMEJ_X_FREE_GC(gc);
|
||||||
} else if (image_mode_is(which, MODE_VIEWPORT) && image_mode_is(which, ALLOW_VIEWPORT)) {
|
} else if (image_mode_is(which, MODE_VIEWPORT) && image_mode_is(which, ALLOW_VIEWPORT)) {
|
||||||
Pixmap p;
|
Pixmap p;
|
||||||
|
|
||||||
gc = X_CREATE_GC(0, NULL);
|
gc = LIBMEJ_X_CREATE_GC(0, NULL);
|
||||||
p = create_viewport_pixmap(simg, d, x, y, w, h);
|
p = create_viewport_pixmap(simg, d, x, y, w, h);
|
||||||
if (simg->iml->bevel != NULL) {
|
if (simg->iml->bevel != NULL) {
|
||||||
bevel_pixmap(p, w, h, simg->iml->bevel->edges, simg->iml->bevel->up);
|
bevel_pixmap(p, w, h, simg->iml->bevel->edges, simg->iml->bevel->up);
|
||||||
}
|
}
|
||||||
XCopyArea(Xdisplay, p, d, gc, 0, 0, w, h, x, y);
|
XCopyArea(Xdisplay, p, d, gc, 0, 0, w, h, x, y);
|
||||||
X_FREE_PIXMAP(p);
|
LIBMEJ_X_FREE_PIXMAP(p);
|
||||||
X_FREE_GC(gc);
|
LIBMEJ_X_FREE_GC(gc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -730,14 +730,14 @@ paste_simage(simage_t *simg, unsigned char which, Drawable d, unsigned short x,
|
||||||
reset_simage(simg, RESET_ALL_SIMG);
|
reset_simage(simg, RESET_ALL_SIMG);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
gc = X_CREATE_GC(0, NULL);
|
gc = LIBMEJ_X_CREATE_GC(0, NULL);
|
||||||
if (mask) {
|
if (mask) {
|
||||||
XSetClipMask(Xdisplay, gc, mask);
|
XSetClipMask(Xdisplay, gc, mask);
|
||||||
XSetClipOrigin(Xdisplay, gc, x, y);
|
XSetClipOrigin(Xdisplay, gc, x, y);
|
||||||
}
|
}
|
||||||
XCopyArea(Xdisplay, pmap, d, gc, 0, 0, w, h, x, y);
|
XCopyArea(Xdisplay, pmap, d, gc, 0, 0, w, h, x, y);
|
||||||
IMLIB_FREE_PIXMAP(pmap);
|
IMLIB_FREE_PIXMAP(pmap);
|
||||||
X_FREE_GC(gc);
|
LIBMEJ_X_FREE_GC(gc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -796,9 +796,9 @@ copy_buffer_pixmap(unsigned char mode, unsigned long fill, unsigned short width,
|
||||||
XGCValues gcvalue;
|
XGCValues gcvalue;
|
||||||
|
|
||||||
ASSERT(buffer_pixmap == None);
|
ASSERT(buffer_pixmap == None);
|
||||||
buffer_pixmap = X_CREATE_PIXMAP(width, height);
|
buffer_pixmap = LIBMEJ_X_CREATE_PIXMAP(width, height);
|
||||||
gcvalue.foreground = (Pixel) fill;
|
gcvalue.foreground = (Pixel) fill;
|
||||||
gc = X_CREATE_GC(GCForeground, &gcvalue);
|
gc = LIBMEJ_X_CREATE_GC(GCForeground, &gcvalue);
|
||||||
XSetGraphicsExposures(Xdisplay, gc, False);
|
XSetGraphicsExposures(Xdisplay, gc, False);
|
||||||
|
|
||||||
if (mode == MODE_SOLID) {
|
if (mode == MODE_SOLID) {
|
||||||
|
@ -806,15 +806,15 @@ copy_buffer_pixmap(unsigned char mode, unsigned long fill, unsigned short width,
|
||||||
|
|
||||||
simg = images[image_bg].current;
|
simg = images[image_bg].current;
|
||||||
if (simg->pmap->pixmap) {
|
if (simg->pmap->pixmap) {
|
||||||
X_FREE_PIXMAP(simg->pmap->pixmap);
|
LIBMEJ_X_FREE_PIXMAP(simg->pmap->pixmap);
|
||||||
}
|
}
|
||||||
simg->pmap->pixmap = X_CREATE_PIXMAP(width, height);
|
simg->pmap->pixmap = LIBMEJ_X_CREATE_PIXMAP(width, height);
|
||||||
XFillRectangle(Xdisplay, simg->pmap->pixmap, gc, 0, 0, width, height);
|
XFillRectangle(Xdisplay, simg->pmap->pixmap, gc, 0, 0, width, height);
|
||||||
XCopyArea(Xdisplay, simg->pmap->pixmap, buffer_pixmap, gc, 0, 0, width, height, 0, 0);
|
XCopyArea(Xdisplay, simg->pmap->pixmap, buffer_pixmap, gc, 0, 0, width, height, 0, 0);
|
||||||
} else {
|
} else {
|
||||||
XCopyArea(Xdisplay, (Pixmap) fill, buffer_pixmap, gc, 0, 0, width, height, 0, 0);
|
XCopyArea(Xdisplay, (Pixmap) fill, buffer_pixmap, gc, 0, 0, width, height, 0, 0);
|
||||||
}
|
}
|
||||||
X_FREE_GC(gc);
|
LIBMEJ_X_FREE_GC(gc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -852,11 +852,11 @@ render_simage(simage_t * simg, Window win, unsigned short width, unsigned short
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gcvalue.foreground = gcvalue.background = PixColors[bgColor];
|
gcvalue.foreground = gcvalue.background = PixColors[bgColor];
|
||||||
gc = X_CREATE_GC(GCForeground | GCBackground, &gcvalue);
|
gc = LIBMEJ_X_CREATE_GC(GCForeground | GCBackground, &gcvalue);
|
||||||
pixmap = simg->pmap->pixmap; /* Save this for later */
|
pixmap = simg->pmap->pixmap; /* Save this for later */
|
||||||
|
|
||||||
if ((which == image_bg) && (buffer_pixmap != None)) {
|
if ((which == image_bg) && (buffer_pixmap != None)) {
|
||||||
X_FREE_PIXMAP(buffer_pixmap);
|
LIBMEJ_X_FREE_PIXMAP(buffer_pixmap);
|
||||||
buffer_pixmap = None;
|
buffer_pixmap = None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -898,9 +898,9 @@ render_simage(simage_t * simg, Window win, unsigned short width, unsigned short
|
||||||
XSetClipOrigin(Xdisplay, gc, 0, 0);
|
XSetClipOrigin(Xdisplay, gc, 0, 0);
|
||||||
}
|
}
|
||||||
if (simg->pmap->pixmap) {
|
if (simg->pmap->pixmap) {
|
||||||
X_FREE_PIXMAP(simg->pmap->pixmap);
|
LIBMEJ_X_FREE_PIXMAP(simg->pmap->pixmap);
|
||||||
}
|
}
|
||||||
simg->pmap->pixmap = X_CREATE_PIXMAP(width, height);
|
simg->pmap->pixmap = LIBMEJ_X_CREATE_PIXMAP(width, height);
|
||||||
XCopyArea(Xdisplay, pmap, simg->pmap->pixmap, gc, 0, 0, width, height, 0, 0);
|
XCopyArea(Xdisplay, pmap, simg->pmap->pixmap, gc, 0, 0, width, height, 0, 0);
|
||||||
XSetWindowBackgroundPixmap(Xdisplay, win, simg->pmap->pixmap);
|
XSetWindowBackgroundPixmap(Xdisplay, win, simg->pmap->pixmap);
|
||||||
snprintf(buff, sizeof(buff), "imageclass %s free_pixmap 0x%08x", iclass, (int) pmap);
|
snprintf(buff, sizeof(buff), "imageclass %s free_pixmap 0x%08x", iclass, (int) pmap);
|
||||||
|
@ -914,7 +914,7 @@ render_simage(simage_t * simg, Window win, unsigned short width, unsigned short
|
||||||
} else {
|
} else {
|
||||||
snprintf(buff, sizeof(buff), "imageclass %s apply 0x%x %s", iclass, (int) win, state);
|
snprintf(buff, sizeof(buff), "imageclass %s apply 0x%x %s", iclass, (int) win, state);
|
||||||
enl_ipc_send(buff);
|
enl_ipc_send(buff);
|
||||||
X_FREE_GC(gc);
|
LIBMEJ_X_FREE_GC(gc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -924,7 +924,7 @@ render_simage(simage_t * simg, Window win, unsigned short width, unsigned short
|
||||||
# ifdef PIXMAP_OFFSET
|
# ifdef PIXMAP_OFFSET
|
||||||
if (image_mode_is(which, MODE_TRANS) && image_mode_is(which, ALLOW_TRANS)) {
|
if (image_mode_is(which, MODE_TRANS) && image_mode_is(which, ALLOW_TRANS)) {
|
||||||
if (simg->pmap->pixmap != None) {
|
if (simg->pmap->pixmap != None) {
|
||||||
X_FREE_PIXMAP(simg->pmap->pixmap);
|
LIBMEJ_X_FREE_PIXMAP(simg->pmap->pixmap);
|
||||||
}
|
}
|
||||||
simg->pmap->pixmap = create_trans_pixmap(simg, which, win, 0, 0, width, height);
|
simg->pmap->pixmap = create_trans_pixmap(simg, which, win, 0, 0, width, height);
|
||||||
if (simg->pmap->pixmap != None) {
|
if (simg->pmap->pixmap != None) {
|
||||||
|
@ -944,7 +944,7 @@ render_simage(simage_t * simg, Window win, unsigned short width, unsigned short
|
||||||
p = create_viewport_pixmap(simg, win, 0, 0, width, height);
|
p = create_viewport_pixmap(simg, win, 0, 0, width, height);
|
||||||
if (p && (p != simg->pmap->pixmap)) {
|
if (p && (p != simg->pmap->pixmap)) {
|
||||||
if (simg->pmap->pixmap != None) {
|
if (simg->pmap->pixmap != None) {
|
||||||
X_FREE_PIXMAP(simg->pmap->pixmap);
|
LIBMEJ_X_FREE_PIXMAP(simg->pmap->pixmap);
|
||||||
}
|
}
|
||||||
simg->pmap->pixmap = p;
|
simg->pmap->pixmap = p;
|
||||||
}
|
}
|
||||||
|
@ -1038,7 +1038,7 @@ render_simage(simage_t * simg, Window win, unsigned short width, unsigned short
|
||||||
single = ((xscaled < width || yscaled < height) && !(simg->pmap->op & OP_TILE)) ? 1 : 0;
|
single = ((xscaled < width || yscaled < height) && !(simg->pmap->op & OP_TILE)) ? 1 : 0;
|
||||||
|
|
||||||
pixmap = simg->pmap->pixmap;
|
pixmap = simg->pmap->pixmap;
|
||||||
simg->pmap->pixmap = X_CREATE_PIXMAP(width, height);
|
simg->pmap->pixmap = LIBMEJ_X_CREATE_PIXMAP(width, height);
|
||||||
if (single) {
|
if (single) {
|
||||||
XFillRectangle(Xdisplay, simg->pmap->pixmap, gc, 0, 0, width, height);
|
XFillRectangle(Xdisplay, simg->pmap->pixmap, gc, 0, 0, width, height);
|
||||||
}
|
}
|
||||||
|
@ -1053,7 +1053,7 @@ render_simage(simage_t * simg, Window win, unsigned short width, unsigned short
|
||||||
IMLIB_FREE_PIXMAP(pixmap);
|
IMLIB_FREE_PIXMAP(pixmap);
|
||||||
} else if (renderop & RENDER_FORCE_PIXMAP) {
|
} else if (renderop & RENDER_FORCE_PIXMAP) {
|
||||||
pixmap = simg->pmap->pixmap;
|
pixmap = simg->pmap->pixmap;
|
||||||
simg->pmap->pixmap = X_CREATE_PIXMAP(width, height);
|
simg->pmap->pixmap = LIBMEJ_X_CREATE_PIXMAP(width, height);
|
||||||
XCopyArea(Xdisplay, pixmap, simg->pmap->pixmap, gc, 0, 0, width, height, 0, 0);
|
XCopyArea(Xdisplay, pixmap, simg->pmap->pixmap, gc, 0, 0, width, height, 0, 0);
|
||||||
IMLIB_FREE_PIXMAP(pixmap);
|
IMLIB_FREE_PIXMAP(pixmap);
|
||||||
}
|
}
|
||||||
|
@ -1089,9 +1089,9 @@ render_simage(simage_t * simg, Window win, unsigned short width, unsigned short
|
||||||
} else {
|
} else {
|
||||||
if ((renderop & RENDER_FORCE_PIXMAP) || (simg->iml->bevel != NULL)) {
|
if ((renderop & RENDER_FORCE_PIXMAP) || (simg->iml->bevel != NULL)) {
|
||||||
if (simg->pmap->pixmap) {
|
if (simg->pmap->pixmap) {
|
||||||
X_FREE_PIXMAP(simg->pmap->pixmap);
|
LIBMEJ_X_FREE_PIXMAP(simg->pmap->pixmap);
|
||||||
}
|
}
|
||||||
simg->pmap->pixmap = X_CREATE_PIXMAP(width, height);
|
simg->pmap->pixmap = LIBMEJ_X_CREATE_PIXMAP(width, height);
|
||||||
XSetForeground(Xdisplay, gc, ((which == image_bg) ? (PixColors[bgColor]) : (simg->bg)));
|
XSetForeground(Xdisplay, gc, ((which == image_bg) ? (PixColors[bgColor]) : (simg->bg)));
|
||||||
XFillRectangle(Xdisplay, simg->pmap->pixmap, gc, 0, 0, width, height);
|
XFillRectangle(Xdisplay, simg->pmap->pixmap, gc, 0, 0, width, height);
|
||||||
if (simg->iml->bevel != NULL && simg->iml->bevel->edges != NULL) {
|
if (simg->iml->bevel != NULL && simg->iml->bevel->edges != NULL) {
|
||||||
|
@ -1106,13 +1106,13 @@ render_simage(simage_t * simg, Window win, unsigned short width, unsigned short
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
XClearWindow(Xdisplay, win);
|
XClearWindow(Xdisplay, win);
|
||||||
X_FREE_GC(gc);
|
LIBMEJ_X_FREE_GC(gc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PIXMAP_SUPPORT
|
#ifdef PIXMAP_SUPPORT
|
||||||
const char *
|
const char *
|
||||||
search_path(const char *pathlist, const char *file, const char *ext)
|
search_path(const char *pathlist, const char *file)
|
||||||
{
|
{
|
||||||
static char name[PATH_MAX];
|
static char name[PATH_MAX];
|
||||||
char *p;
|
char *p;
|
||||||
|
@ -1123,12 +1123,9 @@ search_path(const char *pathlist, const char *file, const char *ext)
|
||||||
if (!pathlist || !file) { /* If either one is NULL, there really isn't much point in going on.... */
|
if (!pathlist || !file) { /* If either one is NULL, there really isn't much point in going on.... */
|
||||||
return ((const char *) NULL);
|
return ((const char *) NULL);
|
||||||
}
|
}
|
||||||
if (!ext) {
|
|
||||||
ext = "";
|
|
||||||
}
|
|
||||||
getcwd(name, PATH_MAX);
|
getcwd(name, PATH_MAX);
|
||||||
len = strlen(name);
|
len = strlen(name);
|
||||||
D_OPTIONS(("search_path(\"%s\", \"%s\", \"%s\") called from \"%s\".\n", pathlist, file, ext, name));
|
D_OPTIONS(("search_path(\"%s\", \"%s\") called from \"%s\".\n", pathlist, file, name));
|
||||||
if (len < PATH_MAX - 1) {
|
if (len < PATH_MAX - 1) {
|
||||||
strcat(name, "/");
|
strcat(name, "/");
|
||||||
strncat(name, file, PATH_MAX - len - 1);
|
strncat(name, file, PATH_MAX - len - 1);
|
||||||
|
@ -1148,18 +1145,8 @@ search_path(const char *pathlist, const char *file, const char *ext)
|
||||||
p = strchr(file, '\0');
|
p = strchr(file, '\0');
|
||||||
len = (p - file);
|
len = (p - file);
|
||||||
|
|
||||||
/* check about adding a trailing extension */
|
|
||||||
if (ext != NULL) {
|
|
||||||
|
|
||||||
char *dot;
|
|
||||||
|
|
||||||
dot = strrchr(p, '.');
|
|
||||||
path = strrchr(p, '/');
|
|
||||||
if (dot != NULL || (path != NULL && dot <= path))
|
|
||||||
ext = NULL;
|
|
||||||
}
|
|
||||||
/* leave room for an extra '/' and trailing '\0' */
|
/* leave room for an extra '/' and trailing '\0' */
|
||||||
maxpath = sizeof(name) - (len + (ext ? strlen(ext) : 0) + 2);
|
maxpath = sizeof(name) - (len + 2);
|
||||||
if (maxpath <= 0)
|
if (maxpath <= 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -1173,15 +1160,6 @@ search_path(const char *pathlist, const char *file, const char *ext)
|
||||||
if (!S_ISDIR(fst.st_mode))
|
if (!S_ISDIR(fst.st_mode))
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
if (ext) {
|
|
||||||
strcat(name, ext);
|
|
||||||
D_OPTIONS(("Checking for file \"%s\"\n", name));
|
|
||||||
if (!access(name, R_OK)) {
|
|
||||||
stat(name, &fst);
|
|
||||||
if (!S_ISDIR(fst.st_mode))
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (path = pathlist; path != NULL && *path != '\0'; path = p) {
|
for (path = pathlist; path != NULL && *path != '\0'; path = p) {
|
||||||
|
|
||||||
int n;
|
int n;
|
||||||
|
@ -1208,15 +1186,6 @@ search_path(const char *pathlist, const char *file, const char *ext)
|
||||||
if (!S_ISDIR(fst.st_mode))
|
if (!S_ISDIR(fst.st_mode))
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
if (ext) {
|
|
||||||
strcat(name, ext);
|
|
||||||
D_OPTIONS(("Checking for file \"%s\"\n", name));
|
|
||||||
if (!access(name, R_OK)) {
|
|
||||||
stat(name, &fst);
|
|
||||||
if (!S_ISDIR(fst.st_mode))
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
D_OPTIONS(("File \"%s\" not found in path.\n", file));
|
D_OPTIONS(("File \"%s\" not found in path.\n", file));
|
||||||
|
@ -1244,8 +1213,8 @@ load_image(const char *file, simage_t *simg)
|
||||||
if (geom != NULL) {
|
if (geom != NULL) {
|
||||||
set_pixmap_scale(geom, simg->pmap);
|
set_pixmap_scale(geom, simg->pmap);
|
||||||
}
|
}
|
||||||
if ((f = search_path(rs_path, file, PIXMAP_EXT)) == NULL) {
|
if ((f = search_path(rs_path, file)) == NULL) {
|
||||||
f = search_path(getenv(PATH_ENV), file, PIXMAP_EXT);
|
f = search_path(getenv(PATH_ENV), file);
|
||||||
}
|
}
|
||||||
if (f != NULL) {
|
if (f != NULL) {
|
||||||
im = imlib_load_image_immediately(f);
|
im = imlib_load_image_immediately(f);
|
||||||
|
@ -1850,7 +1819,7 @@ get_desktop_pixmap(void)
|
||||||
}
|
}
|
||||||
if (color_pixmap != None) {
|
if (color_pixmap != None) {
|
||||||
D_PIXMAP(("Removing old solid color pixmap 0x%08x.\n", color_pixmap));
|
D_PIXMAP(("Removing old solid color pixmap 0x%08x.\n", color_pixmap));
|
||||||
X_FREE_PIXMAP(color_pixmap);
|
LIBMEJ_X_FREE_PIXMAP(color_pixmap);
|
||||||
color_pixmap = None;
|
color_pixmap = None;
|
||||||
}
|
}
|
||||||
if (prop != None) {
|
if (prop != None) {
|
||||||
|
@ -1875,19 +1844,19 @@ get_desktop_pixmap(void)
|
||||||
Screen *scr = ScreenOfDisplay(Xdisplay, Xscreen);
|
Screen *scr = ScreenOfDisplay(Xdisplay, Xscreen);
|
||||||
|
|
||||||
gcvalue.foreground = gcvalue.background = PixColors[bgColor];
|
gcvalue.foreground = gcvalue.background = PixColors[bgColor];
|
||||||
gc = X_CREATE_GC(GCForeground | GCBackground, &gcvalue);
|
gc = LIBMEJ_X_CREATE_GC(GCForeground | GCBackground, &gcvalue);
|
||||||
XGetGeometry(Xdisplay, p, &w, &px, &py, &pw, &ph, &pb, &pd);
|
XGetGeometry(Xdisplay, p, &w, &px, &py, &pw, &ph, &pb, &pd);
|
||||||
D_PIXMAP(("XGetGeometry() returned w = 0x%08x, pw == %u, ph == %u\n", w, pw, ph));
|
D_PIXMAP(("XGetGeometry() returned w = 0x%08x, pw == %u, ph == %u\n", w, pw, ph));
|
||||||
if (pw < (unsigned int) scr->width || ph < (unsigned int) scr->height) {
|
if (pw < (unsigned int) scr->width || ph < (unsigned int) scr->height) {
|
||||||
desktop_pixmap = X_CREATE_PIXMAP(pw, ph);
|
desktop_pixmap = LIBMEJ_X_CREATE_PIXMAP(pw, ph);
|
||||||
XCopyArea(Xdisplay, p, desktop_pixmap, gc, 0, 0, pw, ph, 0, 0);
|
XCopyArea(Xdisplay, p, desktop_pixmap, gc, 0, 0, pw, ph, 0, 0);
|
||||||
colormod_trans(desktop_pixmap, images[image_bg].current->iml, gc, pw, ph);
|
colormod_trans(desktop_pixmap, images[image_bg].current->iml, gc, pw, ph);
|
||||||
} else {
|
} else {
|
||||||
desktop_pixmap = X_CREATE_PIXMAP(scr->width, scr->height);
|
desktop_pixmap = LIBMEJ_X_CREATE_PIXMAP(scr->width, scr->height);
|
||||||
XCopyArea(Xdisplay, p, desktop_pixmap, gc, 0, 0, scr->width, scr->height, 0, 0);
|
XCopyArea(Xdisplay, p, desktop_pixmap, gc, 0, 0, scr->width, scr->height, 0, 0);
|
||||||
colormod_trans(desktop_pixmap, images[image_bg].current->iml, gc, scr->width, scr->height);
|
colormod_trans(desktop_pixmap, images[image_bg].current->iml, gc, scr->width, scr->height);
|
||||||
}
|
}
|
||||||
X_FREE_GC(gc);
|
LIBMEJ_X_FREE_GC(gc);
|
||||||
desktop_pixmap_is_mine = 1;
|
desktop_pixmap_is_mine = 1;
|
||||||
D_PIXMAP(("Returning 0x%08x\n", (unsigned int) desktop_pixmap));
|
D_PIXMAP(("Returning 0x%08x\n", (unsigned int) desktop_pixmap));
|
||||||
return (desktop_pixmap);
|
return (desktop_pixmap);
|
||||||
|
@ -1913,12 +1882,12 @@ get_desktop_pixmap(void)
|
||||||
D_PIXMAP((" Found solid color 0x%08x\n", pix));
|
D_PIXMAP((" Found solid color 0x%08x\n", pix));
|
||||||
gcvalue.foreground = pix;
|
gcvalue.foreground = pix;
|
||||||
gcvalue.background = pix;
|
gcvalue.background = pix;
|
||||||
gc = X_CREATE_GC(GCForeground | GCBackground, &gcvalue);
|
gc = LIBMEJ_X_CREATE_GC(GCForeground | GCBackground, &gcvalue);
|
||||||
|
|
||||||
color_pixmap = X_CREATE_PIXMAP(16, 16);
|
color_pixmap = LIBMEJ_X_CREATE_PIXMAP(16, 16);
|
||||||
XFillRectangle(Xdisplay, color_pixmap, gc, 0, 0, 16, 16);
|
XFillRectangle(Xdisplay, color_pixmap, gc, 0, 0, 16, 16);
|
||||||
D_PIXMAP(("Created solid color pixmap 0x%08x for desktop_pixmap.\n", color_pixmap));
|
D_PIXMAP(("Created solid color pixmap 0x%08x for desktop_pixmap.\n", color_pixmap));
|
||||||
X_FREE_GC(gc);
|
LIBMEJ_X_FREE_GC(gc);
|
||||||
return (desktop_pixmap = color_pixmap);
|
return (desktop_pixmap = color_pixmap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1933,7 +1902,7 @@ free_desktop_pixmap(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (desktop_pixmap_is_mine && desktop_pixmap != None) {
|
if (desktop_pixmap_is_mine && desktop_pixmap != None) {
|
||||||
X_FREE_PIXMAP(desktop_pixmap);
|
LIBMEJ_X_FREE_PIXMAP(desktop_pixmap);
|
||||||
desktop_pixmap_is_mine = 0;
|
desktop_pixmap_is_mine = 0;
|
||||||
}
|
}
|
||||||
desktop_pixmap = None;
|
desktop_pixmap = None;
|
||||||
|
@ -1990,8 +1959,8 @@ set_icon_pixmap(char *filename, XWMHints * pwm_hints)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filename && *filename) {
|
if (filename && *filename) {
|
||||||
if ((icon_path = search_path(rs_path, filename, NULL)) == NULL)
|
if ((icon_path = search_path(rs_path, filename)) == NULL)
|
||||||
icon_path = search_path(getenv(PATH_ENV), filename, NULL);
|
icon_path = search_path(getenv(PATH_ENV), filename);
|
||||||
|
|
||||||
if (icon_path != NULL) {
|
if (icon_path != NULL) {
|
||||||
XIconSize *icon_sizes;
|
XIconSize *icon_sizes;
|
||||||
|
|
21
src/pixmap.h
21
src/pixmap.h
|
@ -54,7 +54,7 @@ typedef void *Imlib_Color_Modifier;
|
||||||
# define CONVERT_TINT_RED(t) (((t) & 0xff0000) >> 16)
|
# define CONVERT_TINT_RED(t) (((t) & 0xff0000) >> 16)
|
||||||
# define CONVERT_TINT_GREEN(t) (((t) & 0x00ff00) >> 8)
|
# define CONVERT_TINT_GREEN(t) (((t) & 0x00ff00) >> 8)
|
||||||
# define CONVERT_TINT_BLUE(t) ((t) & 0x0000ff)
|
# define CONVERT_TINT_BLUE(t) ((t) & 0x0000ff)
|
||||||
# define IMLIB_FREE_PIXMAP(p) do {D_PIXMAP(("libmej_freeing pixmap: imlib_free_pixmap_and_mask(0x%08x)\n", (p))); imlib_free_pixmap_and_mask(p);} while (0)
|
# define IMLIB_FREE_PIXMAP(p) do {D_PIXMAP(("Freeing pixmap: imlib_free_pixmap_and_mask(0x%08x)\n", (p))); imlib_free_pixmap_and_mask(p);} while (0)
|
||||||
#else
|
#else
|
||||||
# define background_is_image() (0)
|
# define background_is_image() (0)
|
||||||
# define background_is_trans() (0)
|
# define background_is_trans() (0)
|
||||||
|
@ -65,19 +65,10 @@ typedef void *Imlib_Color_Modifier;
|
||||||
# define delete_simage(simg) NOP
|
# define delete_simage(simg) NOP
|
||||||
# define IMLIB_FREE_PIXMAP(p) NOP
|
# define IMLIB_FREE_PIXMAP(p) NOP
|
||||||
#endif
|
#endif
|
||||||
#ifdef __GNUC__
|
#define LIBMEJ_X_CREATE_PIXMAP(w, h) X_CREATE_PIXMAP(Xdisplay, (TermWin.parent ? TermWin.parent : Xroot), (w), (h), Xdepth)
|
||||||
# define X_CREATE_PIXMAP(w, h) __extension__ ({Pixmap __my_tmp_pmap = XCreatePixmap(Xdisplay, (TermWin.parent ? TermWin.parent : Xroot), (w), (h), Xdepth); \
|
#define LIBMEJ_X_FREE_PIXMAP(p) X_FREE_PIXMAP(Xdisplay, (p))
|
||||||
D_PIXMAP(("Created pixmap 0x%08x (width %d, height %d)\n", (__my_tmp_pmap), (w), (h))); \
|
#define LIBMEJ_X_CREATE_GC(f, gcv) X_CREATE_GC(Xdisplay, (TermWin.parent ? TermWin.parent : Xroot), (f), (gcv))
|
||||||
(__my_tmp_pmap);})
|
#define LIBMEJ_X_FREE_GC(gc) X_FREE_GC(Xdisplay, (gc))
|
||||||
# define X_CREATE_GC(flags, gcv) __extension__ ({GC __my_tmp_gc = XCreateGC(Xdisplay, (TermWin.parent ? TermWin.parent : Xroot), (flags), (gcv)); \
|
|
||||||
D_PIXMAP(("Created GC 0x%08x\n", (__my_tmp_gc))); (__my_tmp_gc);})
|
|
||||||
#else
|
|
||||||
# define X_CREATE_PIXMAP(w, h) (XCreatePixmap(Xdisplay, TermWin.parent, (w), (h), Xdepth))
|
|
||||||
# define X_CREATE_GC(flags, gcv) (XCreateGC(Xdisplay, TermWin.parent, (flags), (gcv)))
|
|
||||||
#endif
|
|
||||||
#define X_FREE_PIXMAP(p) do {D_PIXMAP(("libmej_freeing pixmap: XFreePixmap(Xdisplay, 0x%08x)\n", (p))); XFreePixmap(Xdisplay, (p));} while (0)
|
|
||||||
#define X_FREE_GC(gc) do {D_PIXMAP(("libmej_freeing GC: XFreeGC(Xdisplay, 0x%08x)\n", (gc))); XFreeGC(Xdisplay, (gc));} while (0)
|
|
||||||
#define PIXMAP_EXT NULL
|
|
||||||
|
|
||||||
#define GEOM_LEN 19
|
#define GEOM_LEN 19
|
||||||
|
|
||||||
|
@ -244,7 +235,7 @@ extern void redraw_images_by_mode(unsigned char);
|
||||||
#endif
|
#endif
|
||||||
extern void render_simage(simage_t *, Window, unsigned short, unsigned short, unsigned char, renderop_t);
|
extern void render_simage(simage_t *, Window, unsigned short, unsigned short, unsigned char, renderop_t);
|
||||||
#ifdef PIXMAP_SUPPORT
|
#ifdef PIXMAP_SUPPORT
|
||||||
extern const char *search_path(const char *, const char *, const char *);
|
extern const char *search_path(const char *, const char *);
|
||||||
extern unsigned char load_image(const char *, simage_t *);
|
extern unsigned char load_image(const char *, simage_t *);
|
||||||
extern void update_cmod(colormod_t *);
|
extern void update_cmod(colormod_t *);
|
||||||
extern void update_cmod_tables(imlib_t *);
|
extern void update_cmod_tables(imlib_t *);
|
||||||
|
|
|
@ -885,19 +885,19 @@ scrollbar_drawing_init(void) {
|
||||||
gcvalue.fill_style = FillOpaqueStippled;
|
gcvalue.fill_style = FillOpaqueStippled;
|
||||||
gcvalue.foreground = PixColors[fgColor];
|
gcvalue.foreground = PixColors[fgColor];
|
||||||
gcvalue.background = PixColors[bgColor];
|
gcvalue.background = PixColors[bgColor];
|
||||||
gc_stipple = X_CREATE_GC(GCForeground | GCBackground | GCFillStyle | GCStipple, &gcvalue);
|
gc_stipple = LIBMEJ_X_CREATE_GC(GCForeground | GCBackground | GCFillStyle | GCStipple, &gcvalue);
|
||||||
gcvalue.foreground = PixColors[borderColor];
|
gcvalue.foreground = PixColors[borderColor];
|
||||||
gc_border = X_CREATE_GC(GCForeground, &gcvalue);
|
gc_border = LIBMEJ_X_CREATE_GC(GCForeground, &gcvalue);
|
||||||
}
|
}
|
||||||
#endif /* XTERM_SCROLLBAR */
|
#endif /* XTERM_SCROLLBAR */
|
||||||
|
|
||||||
#if defined(MOTIF_SCROLLBAR) || defined(NEXT_SCROLLBAR)
|
#if defined(MOTIF_SCROLLBAR) || defined(NEXT_SCROLLBAR)
|
||||||
gcvalue.foreground = images[image_sb].norm->bg;
|
gcvalue.foreground = images[image_sb].norm->bg;
|
||||||
gc_scrollbar = X_CREATE_GC(GCForeground, &gcvalue);
|
gc_scrollbar = LIBMEJ_X_CREATE_GC(GCForeground, &gcvalue);
|
||||||
gcvalue.foreground = PixColors[topShadowColor];
|
gcvalue.foreground = PixColors[topShadowColor];
|
||||||
gc_top = X_CREATE_GC(GCForeground, &gcvalue);
|
gc_top = LIBMEJ_X_CREATE_GC(GCForeground, &gcvalue);
|
||||||
gcvalue.foreground = PixColors[bottomShadowColor];
|
gcvalue.foreground = PixColors[bottomShadowColor];
|
||||||
gc_bottom = X_CREATE_GC(GCForeground, &gcvalue);
|
gc_bottom = LIBMEJ_X_CREATE_GC(GCForeground, &gcvalue);
|
||||||
#endif /* MOTIF_SCROLLBAR || NEXT_SCROLLBAR */
|
#endif /* MOTIF_SCROLLBAR || NEXT_SCROLLBAR */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1869,7 +1869,7 @@ xterm_seq(int op, const char *str)
|
||||||
if (image_mode_is(which, MODE_TRANS) && (desktop_pixmap != None)) {
|
if (image_mode_is(which, MODE_TRANS) && (desktop_pixmap != None)) {
|
||||||
free_desktop_pixmap();
|
free_desktop_pixmap();
|
||||||
} else if (image_mode_is(which, MODE_VIEWPORT) && (viewport_pixmap != None)) {
|
} else if (image_mode_is(which, MODE_VIEWPORT) && (viewport_pixmap != None)) {
|
||||||
X_FREE_PIXMAP(viewport_pixmap);
|
LIBMEJ_X_FREE_PIXMAP(viewport_pixmap);
|
||||||
viewport_pixmap = None; /* Force the re-read */
|
viewport_pixmap = None; /* Force the re-read */
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
@ -1885,7 +1885,7 @@ xterm_seq(int op, const char *str)
|
||||||
if (image_mode_is(which, MODE_TRANS) && (desktop_pixmap != None)) {
|
if (image_mode_is(which, MODE_TRANS) && (desktop_pixmap != None)) {
|
||||||
free_desktop_pixmap();
|
free_desktop_pixmap();
|
||||||
} else if (image_mode_is(which, MODE_VIEWPORT) && (viewport_pixmap != None)) {
|
} else if (image_mode_is(which, MODE_VIEWPORT) && (viewport_pixmap != None)) {
|
||||||
X_FREE_PIXMAP(viewport_pixmap);
|
LIBMEJ_X_FREE_PIXMAP(viewport_pixmap);
|
||||||
viewport_pixmap = None; /* Force the re-read */
|
viewport_pixmap = None; /* Force the re-read */
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
|
@ -463,7 +463,7 @@ Create_Windows(int argc, char *argv[])
|
||||||
gcvalue.foreground = PixColors[fgColor];
|
gcvalue.foreground = PixColors[fgColor];
|
||||||
gcvalue.background = PixColors[bgColor];
|
gcvalue.background = PixColors[bgColor];
|
||||||
gcvalue.graphics_exposures = 0;
|
gcvalue.graphics_exposures = 0;
|
||||||
TermWin.gc = X_CREATE_GC(GCForeground | GCBackground | GCFont | GCGraphicsExposures, &gcvalue);
|
TermWin.gc = LIBMEJ_X_CREATE_GC(GCForeground | GCBackground | GCFont | GCGraphicsExposures, &gcvalue);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Options & Opt_noCursor) {
|
if (Options & Opt_noCursor) {
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
# $Id$
|
# $Id$
|
||||||
|
|
||||||
INCLUDES = -I. -I../libmej -I.. -I$(includedir) -I$(prefix)/include $(X_CFLAGS)
|
|
||||||
|
|
||||||
bin_PROGRAMS = Esetroot Etbg Ettable
|
bin_PROGRAMS = Esetroot Etbg Ettable
|
||||||
bin_SCRIPTS = Etcolors Etwinop Etsearch kEsetroot
|
bin_SCRIPTS = Etcolors Etwinop Etsearch kEsetroot
|
||||||
|
|
||||||
Esetroot_SOURCES = Esetroot.c
|
Esetroot_SOURCES = Esetroot.c
|
||||||
Esetroot_LDFLAGS = -rpath $(libdir):$(pkglibdir)
|
Esetroot_LDFLAGS = -rpath $(libdir):$(pkglibdir)
|
||||||
Esetroot_LDADD = -L$(DIST_ROOT)/libmej -L$(libdir) -L$(prefix)/lib $(LIBS) $(GRLIBS) $(X_LIBS)
|
Esetroot_LDADD = -L$(DIST_ROOT)/libmej
|
||||||
|
|
||||||
Etbg_SOURCES = Etbg.c
|
Etbg_SOURCES = Etbg.c
|
||||||
Ettable_SOURCES = Ettable.c
|
Ettable_SOURCES = Ettable.c
|
||||||
|
|
Loading…
Reference in New Issue