Update to editres 1.0.7

This commit is contained in:
matthieu 2018-05-21 15:15:36 +00:00
parent 307bf81e1f
commit d8bf5bd739
21 changed files with 1233 additions and 597 deletions

View File

@ -1,3 +1,220 @@
commit 9644bfe7f56eb8c1cc795b724a6fc95ae4172d43
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun Mar 4 18:43:17 2018 -0800
editres 1.0.7
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 476ad1ea6588e277d59ae6d0fc64a17bc1b5df5a
Author: Mihail Konev <k.mvc@ya.ru>
Date: Thu Jan 26 14:00:20 2017 +1000
autogen: add default patch prefix
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
commit e03471032c584669d06ca4fe47f52cafd9013493
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date: Mon Mar 9 12:00:52 2015 +0000
autogen.sh: use quoted string variables
Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent
fall-outs, when they contain space.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
commit 931b91c5ff7b2dedb149f0a89010b64407baabf3
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue Jan 24 10:32:07 2017 +1000
autogen.sh: use exec instead of waiting for configure to finish
Syncs the invocation of configure with the one from the server.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
commit 3f4d7d388dce6c9783c30bcc006f73d799845c0e
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Fri Jan 1 11:02:42 2016 -0800
Add intro to editres to README
Mostly copied from editres man page
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit a415214bf282dcc8385f2101e6f8c018e188fa41
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat May 9 13:13:32 2015 -0700
Fix -Wmissing-noreturn warnings
editres.c:140:1: warning: function 'Syntax' could be declared with
attribute 'noreturn' [-Wmissing-noreturn]
handler.c:65:1: warning: function 'Quit' could be declared with
attribute 'noreturn' [-Wmissing-noreturn]
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit a6733f76dad52644bd45a8674bf0ea97c6e424ac
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat May 9 12:47:23 2015 -0700
Strip trailing whitespace
'git diff -w' shows no changes for this commit
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit c33a44612947eb91579b24f98848812018dd8c16
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat May 9 11:38:18 2015 -0700
Fix -Wsign-compare warnings
actions.c:291:21: warning: comparison of integers of different signs: 'int' and 'Cardinal' (aka 'unsigned int') [-Wsign-compare]
for ( i = 0 ; i < num_table; i++ )
~ ^ ~~~~~~~~~
actions.c:299:19: warning: comparison of integers of different signs: 'int' and 'Cardinal' (aka 'unsigned int') [-Wsign-compare]
for (i = 0; i < num_table; ) {
~ ^ ~~~~~~~~~
actions.c:302:8: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
if (i == (num_table - 1))
~ ^ ~~~~~~~~~~~~~
actions.c:304:13: warning: comparison of integers of different signs: 'int' and 'Cardinal' (aka 'unsigned int') [-Wsign-compare]
else if (i < num_table)
~ ^ ~~~~~~~~~
geometry.c:150:19: warning: comparison of integers of different signs: 'int' and 'Cardinal' (aka 'unsigned int') [-Wsign-compare]
for (i = 0; i < tree_info->num_nodes; i++)
~ ^ ~~~~~~~~~~~~~~~~~~~~
geometry.c:380:19: warning: comparison of integers of different signs: 'int' and 'Cardinal' (aka 'unsigned int') [-Wsign-compare]
for (i = 0; i < tree_info->num_flash_widgets; i++) {
~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
geometry.c:401:19: warning: comparison of integers of different signs: 'int' and 'Cardinal' (aka 'unsigned int') [-Wsign-compare]
for (i = 0; i < tree_info->num_flash_widgets; i++)
~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
geometry.c:423:19: warning: comparison of integers of different signs: 'int' and 'Cardinal' (aka 'unsigned int') [-Wsign-compare]
for (i = 0; i < tree_info->num_flash_widgets; i++)
~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
geometry.c:428:19: warning: comparison of integers of different signs: 'int' and 'Cardinal' (aka 'unsigned int') [-Wsign-compare]
for (i = 0; i < tree_info->num_flash_widgets; i++)
~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
handler.c:475:13: warning: comparison of integers of different signs: 'int' and 'Cardinal' (aka 'unsigned int') [-Wsign-compare]
if (len > malloc_size) {
~~~ ^ ~~~~~~~~~~~
handler.c:476:58: warning: implicit conversion changes signedness: 'int' to 'unsigned long' [-Wsign-conversion]
malloc_string = XtRealloc(malloc_string, sizeof(char) * len);
~ ^~~
handler.c:477:16: warning: implicit conversion changes signedness: 'int' to 'Cardinal' (aka 'unsigned int') [-Wsign-conversion]
malloc_size = len;
~ ^~~
utils.c:167:37: warning: comparison of integers of different signs: 'int' and 'Cardinal' (aka 'unsigned int') [-Wsign-compare]
for (node = top_node, i = 1 ; i < number; i++) {
~ ^ ~~~~~~
utils.c:170:16: warning: comparison of integers of different signs: 'int' and 'Cardinal' (aka 'unsigned int') [-Wsign-compare]
for (j = 0; j < node->num_children; j++) {
~ ^ ~~~~~~~~~~~~~~~~~~
utils.c:215:19: warning: comparison of integers of different signs: 'int' and 'Cardinal' (aka 'unsigned int') [-Wsign-compare]
for (i = 0; i < node->num_children; i++) {
~ ^ ~~~~~~~~~~~~~~~~~~
utils.c:787:19: warning: comparison of integers of different signs: 'int' and 'Cardinal' (aka 'unsigned int') [-Wsign-compare]
for (i = 0; i < top_node->num_children; i++)
~ ^ ~~~~~~~~~~~~~~~~~~~~~~
wtree.c:129:19: warning: comparison of integers of different signs: 'int' and 'Cardinal' (aka 'unsigned int') [-Wsign-compare]
for (i = 0; i < top->num_children; i++)
~ ^ ~~~~~~~~~~~~~~~~~
wtree.c:194:19: warning: comparison of integers of different signs: 'int' and 'Cardinal' (aka 'unsigned int') [-Wsign-compare]
for (i = 0; i < info->num_nodes; i++) {
~ ^ ~~~~~~~~~~~~~~~
wtree.c:216:19: warning: comparison of integers of different signs: 'int' and 'Cardinal' (aka 'unsigned int') [-Wsign-compare]
for (i = 0; i < info->num_nodes; i++)
~ ^ ~~~~~~~~~~~~~~~
wtree.c:270:19: warning: comparison of integers of different signs: 'int' and 'Cardinal' (aka 'unsigned int') [-Wsign-compare]
for (i = 0; i < top->num_children; i++)
~ ^ ~~~~~~~~~~~~~~~~~
wtree.c:339:19: warning: comparison of integers of different signs: 'int' and 'Cardinal' (aka 'unsigned int') [-Wsign-compare]
for (i = 0; i < num_active_nodes; i++)
~ ^ ~~~~~~~~~~~~~~~~
wtree.c:386:19: warning: comparison of integers of different signs: 'int' and 'Cardinal' (aka 'unsigned int') [-Wsign-compare]
for (i = 0; i < node->num_children; i++)
~ ^ ~~~~~~~~~~~~~~~~~~
wtree.c:446:19: warning: comparison of integers of different signs: 'int' and 'Cardinal' (aka 'unsigned int') [-Wsign-compare]
for (i = 0; i < node->num_children; i++)
~ ^ ~~~~~~~~~~~~~~~~~~
wtree.c:478:16: warning: comparison of integers of different signs: 'int' and 'Cardinal' (aka 'unsigned int') [-Wsign-compare]
for (i = 0; i < node->num_children; i++) {
~ ^ ~~~~~~~~~~~~~~~~~~
wtree.c:607:19: warning: comparison of integers of different signs: 'int' and 'Cardinal' (aka 'unsigned int') [-Wsign-compare]
for (i = 0; i < tree_info->num_nodes; i++)
~ ^ ~~~~~~~~~~~~~~~~~~~~
wtree.c:686:19: warning: comparison of integers of different signs: 'int' and 'Cardinal' (aka 'unsigned int') [-Wsign-compare]
for (i = 0; i < node->num_children; i++)
~ ^ ~~~~~~~~~~~~~~~~~~
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit af90a105ec97c6d856d2e8a80e8822c3e192d1e9
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat May 9 11:19:33 2015 -0700
Replace remaining sprintf calls with snprintf
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 9ffefd5b3d38e9ed2b5ed59bc50e8a7da761fb77
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat May 9 11:17:38 2015 -0700
Replace XtMalloc+sprintf pair with XtAsprintf call
Raises required version of libXt to >= 1.0.99.1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 15f9d88e13bda2617c05c278a1ca9f6ce26df479
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun Jun 1 21:06:47 2014 -0700
autogen.sh: Honor NOCONFIGURE=1
See http://people.gnome.org/~walters/docs/build-api.txt
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit eed2fbbfc5292b5cf02d4c4b9f10266d8a41b787
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun Jun 1 21:06:47 2014 -0700
configure: Drop AM_MAINTAINER_MODE
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 57e1f1c4aa60136ab22e3faf75832c728beee4aa
Author: Eric S. Raymond <esr@thyrsus.com>
Date: Thu Jun 6 15:50:08 2013 -0400
Avoid a spurious warning during XML upconversion.
commit 703edaa26044cfa0a607fa7b93396095fdfdfbaa
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat Jan 19 09:21:50 2013 -0800
config: Add missing AC_CONFIG_SRCDIR
Regroup AC statements under the Autoconf initialization section.
Regroup AM statements under the Automake initialization section.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit c256f5a1e82ed874d8bd068901dd9b138adb6f89 commit c256f5a1e82ed874d8bd068901dd9b138adb6f89
Author: Alan Coopersmith <alan.coopersmith@oracle.com> Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat Jan 12 16:05:16 2013 -0800 Date: Sat Jan 12 16:05:16 2013 -0800

View File

@ -1,6 +1,6 @@
# #
# Copyright 2005 Red Hat, Inc. # Copyright 2005 Red Hat, Inc.
# #
# Permission to use, copy, modify, distribute, and sell this software and its # Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that # documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that # the above copyright notice appear in all copies and that both that
@ -10,7 +10,7 @@
# specific, written prior permission. Red Hat makes no # specific, written prior permission. Red Hat makes no
# representations about the suitability of this software for any purpose. It # representations about the suitability of this software for any purpose. It
# is provided "as is" without express or implied warranty. # is provided "as is" without express or implied warranty.
# #
# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, # RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR # EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR

View File

@ -14,9 +14,9 @@
@SET_MAKE@ @SET_MAKE@
# #
# Copyright 2005 Red Hat, Inc. # Copyright 2005 Red Hat, Inc.
# #
# Permission to use, copy, modify, distribute, and sell this software and its # Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that # documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that # the above copyright notice appear in all copies and that both that
@ -26,7 +26,7 @@
# specific, written prior permission. Red Hat makes no # specific, written prior permission. Red Hat makes no
# representations about the suitability of this software for any purpose. It # representations about the suitability of this software for any purpose. It
# is provided "as is" without express or implied warranty. # is provided "as is" without express or implied warranty.
# #
# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, # RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR # EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
@ -77,8 +77,8 @@ subdir = .
DIST_COMMON = README $(am__configure_deps) $(dist_appdefault_DATA) \ DIST_COMMON = README $(am__configure_deps) $(dist_appdefault_DATA) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/config.h.in $(top_srcdir)/configure AUTHORS COPYING \ $(srcdir)/config.h.in $(top_srcdir)/configure AUTHORS COPYING \
ChangeLog INSTALL config.guess config.sub depcomp install-sh \ ChangeLog INSTALL compile config.guess config.sub depcomp \
missing install-sh missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \

View File

@ -1,6 +1,14 @@
Editres is a tool that allows users and application developers to view
the full widget hierarchy of any Xt Toolkit application that speaks the
Editres protocol. In addition, editres will help the user construct
resource specifications, allow the user to apply the resource to
the application and view the results dynamically. Once the user is
happy with a resource specification editres will append the resource
string to the user's X Resources file.
Instructions for building Editres. For more information on editres usage, see:
http://www.rahul.net/kenton/editres.html
Editres depends on the _EresInsert<something> and Editres depends on the _EresInsert<something> and
_EresRetrieve<something> routines that are are implemented and used by _EresRetrieve<something> routines that are are implemented and used by

View File

@ -1242,7 +1242,7 @@ AC_SUBST([am__untar])
dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
dnl dnl
dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. dnl Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
dnl dnl
dnl Permission is hereby granted, free of charge, to any person obtaining a dnl Permission is hereby granted, free of charge, to any person obtaining a
dnl copy of this software and associated documentation files (the "Software"), dnl copy of this software and associated documentation files (the "Software"),
@ -1279,7 +1279,7 @@ dnl DEALINGS IN THE SOFTWARE.
# See the "minimum version" comment for each macro you use to see what # See the "minimum version" comment for each macro you use to see what
# version you require. # version you require.
m4_defun([XORG_MACROS_VERSION],[ m4_defun([XORG_MACROS_VERSION],[
m4_define([vers_have], [1.19.0]) m4_define([vers_have], [1.19.2])
m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
m4_if(m4_cmp(maj_have, maj_needed), 0,, m4_if(m4_cmp(maj_have, maj_needed), 0,,
@ -1357,6 +1357,17 @@ AC_DEFUN([XORG_MANPAGE_SECTIONS],[
AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AC_PROG_SED]) AC_REQUIRE([AC_PROG_SED])
case $host_os in
solaris*)
# Solaris 2.0 - 11.3 use SysV man page section numbers, so we
# check for a man page file found in later versions that use
# traditional section numbers instead
AC_CHECK_FILE([/usr/share/man/man7/attributes.7],
[SYSV_MAN_SECTIONS=false], [SYSV_MAN_SECTIONS=true])
;;
*) SYSV_MAN_SECTIONS=false ;;
esac
if test x$APP_MAN_SUFFIX = x ; then if test x$APP_MAN_SUFFIX = x ; then
APP_MAN_SUFFIX=1 APP_MAN_SUFFIX=1
fi fi
@ -1372,9 +1383,9 @@ if test x$LIB_MAN_DIR = x ; then
fi fi
if test x$FILE_MAN_SUFFIX = x ; then if test x$FILE_MAN_SUFFIX = x ; then
case $host_os in case $SYSV_MAN_SECTIONS in
solaris*) FILE_MAN_SUFFIX=4 ;; true) FILE_MAN_SUFFIX=4 ;;
*) FILE_MAN_SUFFIX=5 ;; *) FILE_MAN_SUFFIX=5 ;;
esac esac
fi fi
if test x$FILE_MAN_DIR = x ; then if test x$FILE_MAN_DIR = x ; then
@ -1382,9 +1393,9 @@ if test x$FILE_MAN_DIR = x ; then
fi fi
if test x$MISC_MAN_SUFFIX = x ; then if test x$MISC_MAN_SUFFIX = x ; then
case $host_os in case $SYSV_MAN_SECTIONS in
solaris*) MISC_MAN_SUFFIX=5 ;; true) MISC_MAN_SUFFIX=5 ;;
*) MISC_MAN_SUFFIX=7 ;; *) MISC_MAN_SUFFIX=7 ;;
esac esac
fi fi
if test x$MISC_MAN_DIR = x ; then if test x$MISC_MAN_DIR = x ; then
@ -1392,9 +1403,9 @@ if test x$MISC_MAN_DIR = x ; then
fi fi
if test x$DRIVER_MAN_SUFFIX = x ; then if test x$DRIVER_MAN_SUFFIX = x ; then
case $host_os in case $SYSV_MAN_SECTIONS in
solaris*) DRIVER_MAN_SUFFIX=7 ;; true) DRIVER_MAN_SUFFIX=7 ;;
*) DRIVER_MAN_SUFFIX=4 ;; *) DRIVER_MAN_SUFFIX=4 ;;
esac esac
fi fi
if test x$DRIVER_MAN_DIR = x ; then if test x$DRIVER_MAN_DIR = x ; then
@ -1402,9 +1413,9 @@ if test x$DRIVER_MAN_DIR = x ; then
fi fi
if test x$ADMIN_MAN_SUFFIX = x ; then if test x$ADMIN_MAN_SUFFIX = x ; then
case $host_os in case $SYSV_MAN_SECTIONS in
solaris*) ADMIN_MAN_SUFFIX=1m ;; true) ADMIN_MAN_SUFFIX=1m ;;
*) ADMIN_MAN_SUFFIX=8 ;; *) ADMIN_MAN_SUFFIX=8 ;;
esac esac
fi fi
if test x$ADMIN_MAN_DIR = x ; then if test x$ADMIN_MAN_DIR = x ; then
@ -1665,13 +1676,24 @@ m4_ifval([$1],
fi]) fi])
# Test for the ability of xmlto to generate a text target # Test for the ability of xmlto to generate a text target
#
# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the
# following test for empty XML docbook files.
# For compatibility reasons use the following empty XML docbook file and if
# it fails try it again with a non-empty XML file.
have_xmlto_text=no have_xmlto_text=no
cat > conftest.xml << "EOF" cat > conftest.xml << "EOF"
EOF EOF
AS_IF([test "$have_xmlto" = yes], AS_IF([test "$have_xmlto" = yes],
[AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
[have_xmlto_text=yes], [have_xmlto_text=yes],
[AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])]) [# Try it again with a non-empty XML file.
cat > conftest.xml << "EOF"
<x></x>
EOF
AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
[have_xmlto_text=yes],
[AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])])
rm -f conftest.xml rm -f conftest.xml
AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes]) AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes]) AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
@ -3067,8 +3089,9 @@ AC_REQUIRE([PKG_PROG_PKG_CONFIG])
macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \ || (rm -f \$(top_srcdir)/.INSTALL.tmp; test -e \$(top_srcdir)/INSTALL || ( \
echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)" touch \$(top_srcdir)/INSTALL; \
echo 'failed to copy INSTALL from util-macros: installing empty INSTALL.' >&2))"
AC_SUBST([INSTALL_CMD]) AC_SUBST([INSTALL_CMD])
]) # XORG_INSTALL ]) # XORG_INSTALL
dnl Copyright 2005 Red Hat, Inc dnl Copyright 2005 Red Hat, Inc
@ -3129,10 +3152,11 @@ AC_DEFUN([XORG_RELEASE_VERSION],[
# #
# #
AC_DEFUN([XORG_CHANGELOG], [ AC_DEFUN([XORG_CHANGELOG], [
CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \ CHANGELOG_CMD="((GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp) 2>/dev/null && \
mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \ || (rm -f \$(top_srcdir)/.changelog.tmp; test -e \$(top_srcdir)/ChangeLog || ( \
echo 'git directory not found: installing possibly empty changelog.' >&2)" touch \$(top_srcdir)/ChangeLog; \
echo 'git failed to create ChangeLog: installing empty ChangeLog.' >&2))"
AC_SUBST([CHANGELOG_CMD]) AC_SUBST([CHANGELOG_CMD])
]) # XORG_CHANGELOG ]) # XORG_CHANGELOG

View File

@ -28,7 +28,7 @@ in this Software without prior written authorization from The Open Group.
#include <X11/Intrinsic.h> #include <X11/Intrinsic.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <X11/Xaw/Cardinals.h> #include <X11/Xaw/Cardinals.h>
#include <X11/Xmu/CharSet.h> #include <X11/Xmu/CharSet.h>
#include "editresP.h" #include "editresP.h"
@ -61,20 +61,20 @@ static struct ActionValues label_values[] = {
{ "toggle", (int) ToggleLabel } { "toggle", (int) ToggleLabel }
}; };
static void EnableGetVal ( Widget w, XEvent *event, static void EnableGetVal ( Widget w, XEvent *event,
String *params, Cardinal * num_params ); String *params, Cardinal * num_params );
static void SelectAction ( Widget w, XEvent *event, static void SelectAction ( Widget w, XEvent *event,
String *params, Cardinal *num_params ); String *params, Cardinal *num_params );
static void RelabelAction ( Widget w, XEvent *event, static void RelabelAction ( Widget w, XEvent *event,
String *params, Cardinal *num_params ); String *params, Cardinal *num_params );
static void PopdownFileDialogAction ( Widget w, XEvent *event, static void PopdownFileDialogAction ( Widget w, XEvent *event,
String *params, Cardinal *num_params ); String *params, Cardinal *num_params );
static void ActionQuit ( Widget w, XEvent *event, static void ActionQuit ( Widget w, XEvent *event,
String *params, Cardinal *num_params ); String *params, Cardinal *num_params );
static WNode * FindTreeNodeFromWidget ( Widget w ); static WNode * FindTreeNodeFromWidget ( Widget w );
static Boolean CheckAndFindEntry ( String action_name, static Boolean CheckAndFindEntry ( String action_name,
String * params, Cardinal num_params, String * params, Cardinal num_params,
struct ActionValues * table, struct ActionValues * table,
Cardinal num_table, int * type ); Cardinal num_table, int * type );
/* Function Name: EnableGetVal /* Function Name: EnableGetVal
@ -83,7 +83,7 @@ static Boolean CheckAndFindEntry ( String action_name,
* Arguments: w - any widget in the widget tree. * Arguments: w - any widget in the widget tree.
* event - NOT USED. * event - NOT USED.
* params, num_params - the parameters paseed to the action * params, num_params - the parameters paseed to the action
* routine. * routine.
* *
*/ */
@ -97,11 +97,11 @@ EnableGetVal(Widget w, XEvent *event, String *params, Cardinal *num_params)
} }
/* Function Name: SelectAction /* Function Name: SelectAction
* Description: * Description:
* Arguments: w - any widget in the widget tree. * Arguments: w - any widget in the widget tree.
* event - NOT USED. * event - NOT USED.
* params, num_params - the parameters paseed to the action * params, num_params - the parameters paseed to the action
* routine. * routine.
* *
* params[0] - One of "nothing", "parent", "children", "ancestors", * params[0] - One of "nothing", "parent", "children", "ancestors",
* "descendants", "invert", "all" * "descendants", "invert", "all"
@ -115,7 +115,7 @@ SelectAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
WNode * node; WNode * node;
int type; int type;
if (!CheckAndFindEntry("Select", params, *num_params, if (!CheckAndFindEntry("Select", params, *num_params,
select_values, XtNumber(select_values), &type)) select_values, XtNumber(select_values), &type))
return; return;
@ -131,7 +131,7 @@ SelectAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
default: default:
node = FindTreeNodeFromWidget(w); node = FindTreeNodeFromWidget(w);
if (node) if (node)
_TreeActivateNode(node, (SelectTypes)type); _TreeActivateNode(node, (SelectTypes)type);
else else
_TreeSelect(global_tree_info, (SelectTypes)type); _TreeSelect(global_tree_info, (SelectTypes)type);
break; break;
@ -139,11 +139,11 @@ SelectAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
} }
/* Function Name: RelabelAction /* Function Name: RelabelAction
* Description: * Description:
* Arguments: w - any widget in the widget tree. * Arguments: w - any widget in the widget tree.
* event - NOT USED. * event - NOT USED.
* params, num_params - the parameters paseed to the action * params, num_params - the parameters paseed to the action
* routine. * routine.
* *
* params[0] - One of "name", "class", "id" * params[0] - One of "name", "class", "id"
* num_params - must be one. * num_params - must be one.
@ -156,16 +156,16 @@ RelabelAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
WNode * node; WNode * node;
int type; int type;
if (!CheckAndFindEntry("Relabel", params, *num_params, if (!CheckAndFindEntry("Relabel", params, *num_params,
label_values, XtNumber(label_values), &type)) label_values, XtNumber(label_values), &type))
return; return;
if ((node = FindTreeNodeFromWidget(w)) == NULL) if ((node = FindTreeNodeFromWidget(w)) == NULL)
_TreeRelabel(global_tree_info, (LabelTypes)type); _TreeRelabel(global_tree_info, (LabelTypes)type);
else { else {
PrepareToLayoutTree(global_tree_info->tree_widget); PrepareToLayoutTree(global_tree_info->tree_widget);
_TreeRelabelNode(node, (LabelTypes)type, FALSE); _TreeRelabelNode(node, (LabelTypes)type, FALSE);
LayoutTree(global_tree_info->tree_widget); LayoutTree(global_tree_info->tree_widget);
} }
} }
@ -188,8 +188,7 @@ PopdownFileDialogAction(Widget w, XEvent *event,
Boolean val; Boolean val;
if (*num_params != 1) { if (*num_params != 1) {
sprintf(buf, res_labels[2], snprintf(buf, sizeof(buf), res_labels[2], "PopdownFileDialog");
"PopdownFileDialog");
SetMessage(global_screen_data.info_label, buf); SetMessage(global_screen_data.info_label, buf);
return; return;
@ -202,8 +201,7 @@ PopdownFileDialogAction(Widget w, XEvent *event,
else if (streq(buf, "okay")) else if (streq(buf, "okay"))
val = TRUE; val = TRUE;
else { else {
sprintf(buf, res_labels[1], snprintf(buf, sizeof(buf), res_labels[1], "PopdownFileDialog");
"PopdownFileDialog");
SetMessage(global_screen_data.info_label, buf); SetMessage(global_screen_data.info_label, buf);
return; return;
@ -246,7 +244,7 @@ static XtActionsRec actions[] = {
{"EnableGetVal", EnableGetVal}, {"EnableGetVal", EnableGetVal},
{"Select", SelectAction}, {"Select", SelectAction},
{"SVActiveEntry", ModifySVEntry}, {"SVActiveEntry", ModifySVEntry},
{"Relabel", RelabelAction}, {"Relabel", RelabelAction},
{"PopdownFileDialog", PopdownFileDialogAction}, {"PopdownFileDialog", PopdownFileDialogAction},
{"quit", ActionQuit} {"quit", ActionQuit}
}; };
@ -255,13 +253,13 @@ void
SetApplicationActions(XtAppContext app_con) SetApplicationActions(XtAppContext app_con)
{ {
XtAppAddActions(app_con, actions, XtNumber(actions)); XtAppAddActions(app_con, actions, XtNumber(actions));
} }
/************************************************************ /************************************************************
* *
* Private functions * Private functions
* *
************************************************************/ ************************************************************/
@ -281,34 +279,32 @@ CheckAndFindEntry(String action_name, String *params, Cardinal num_params,
struct ActionValues *table, Cardinal num_table, int *type) struct ActionValues *table, Cardinal num_table, int *type)
{ {
char buf[BUFSIZ]; char buf[BUFSIZ];
int i; Cardinal i;
if (num_params != 1) { if (num_params != 1) {
sprintf(buf, res_labels[2], snprintf(buf, sizeof(buf), res_labels[2], action_name);
action_name);
SetMessage(global_screen_data.info_label, buf); SetMessage(global_screen_data.info_label, buf);
return(FALSE); return(FALSE);
} }
XmuCopyISOLatin1Lowered(buf, params[0]); XmuCopyISOLatin1Lowered(buf, params[0]);
for ( i = 0 ; i < num_table; i++ ) for ( i = 0 ; i < num_table; i++ )
if (streq(buf, table[i].name)) { if (streq(buf, table[i].name)) {
*type = table[i].type; *type = table[i].type;
return(TRUE); return(TRUE);
} }
sprintf(buf,res_labels[3], snprintf(buf, sizeof(buf), res_labels[3], action_name);
action_name);
for (i = 0; i < num_table; ) { for (i = 0; i < num_table; ) {
strcat(buf, table[i++].name); strcat(buf, table[i++].name);
if (i == (num_table - 1)) if (i == (num_table - 1))
strcat(buf, ", or "); strcat(buf, ", or ");
else if (i < num_table) else if (i < num_table)
strcat(buf, ", "); strcat(buf, ", ");
} }
SetMessage(global_screen_data.info_label, buf); SetMessage(global_screen_data.info_label, buf);
return(FALSE); return(FALSE);
} }
@ -331,7 +327,7 @@ FindTreeNodeFromWidget(Widget w)
ret_val = XFindContext(XtDisplay(w), (Window) w, NODE_INFO, &data_return); ret_val = XFindContext(XtDisplay(w), (Window) w, NODE_INFO, &data_return);
if (ret_val == 0) if (ret_val == 0)
return((WNode *) data_return); return((WNode *) data_return);
return(NULL); return(NULL);
} }

View File

@ -128,7 +128,7 @@ Editres.Geometry: 500x568
! For the Filename popup dialog. ! For the Filename popup dialog.
*fileDialog*value: *fileDialog*value:
*fileDialog*allowShellResize: True *fileDialog*allowShellResize: True
*fileDialog*Text.baseTranslations: #override \n\ *fileDialog*Text.baseTranslations: #override \n\
<Key>Return: PopdownFileDialog(okay) <Key>Return: PopdownFileDialog(okay)
@ -185,7 +185,7 @@ Editres.Geometry: 500x568
*namesAndClasses*Toggle.baseTranslations: #override \n\ *namesAndClasses*Toggle.baseTranslations: #override \n\
<Btn1Down>,<Btn1Up>: set() notify() <Btn1Down>,<Btn1Up>: set() notify()
*commandBox.skipAdjust: True *commandBox.skipAdjust: True
@ -208,7 +208,7 @@ Editres.Geometry: 500x568
:<Key>N: Relabel(name) \n\ :<Key>N: Relabel(name) \n\
:<Key>C: Relabel(class) \n\ :<Key>C: Relabel(class) \n\
:<Key>I: Relabel(id) \n\ :<Key>I: Relabel(id) \n\
:<Key>W: Relabel(window) :<Key>W: Relabel(window)
*Tree.Toggle.baseTranslations: #override \n\ *Tree.Toggle.baseTranslations: #override \n\
:<Key>space: Select(nothing) \n\ :<Key>space: Select(nothing) \n\

View File

@ -56,13 +56,13 @@ extern Widget CM_entries[NUM_CM_ENTRIES], TM_entries[NUM_TM_ENTRIES];
static void ClientTimedOut ( XtPointer data, XtIntervalId * id ); static void ClientTimedOut ( XtPointer data, XtIntervalId * id );
static void TellUserAboutMessage ( Widget label, ResCommand command ); static void TellUserAboutMessage ( Widget label, ResCommand command );
static Boolean ConvertCommand ( Widget w, Atom * selection, Atom * target, static Boolean ConvertCommand ( Widget w, Atom * selection, Atom * target,
Atom * type_ret, XtPointer *value_ret, Atom * type_ret, XtPointer *value_ret,
unsigned long * length_ret, int * format_ret ); unsigned long * length_ret, int * format_ret );
static void SelectionDone ( Widget w, Atom *sel, Atom *targ ); static void SelectionDone ( Widget w, Atom *sel, Atom *targ );
static void LoseSelection ( Widget w, Atom * sel ); static void LoseSelection ( Widget w, Atom * sel );
static void GetClientValue ( Widget w, XtPointer data, Atom *selection, static void GetClientValue ( Widget w, XtPointer data, Atom *selection,
Atom *type, XtPointer value, Atom *type, XtPointer value,
unsigned long *length, int * format ); unsigned long *length, int * format );
static void BuildHeader ( CurrentClient * client_data ); static void BuildHeader ( CurrentClient * client_data );
static Event * BuildEvent ( ProtocolStream * stream ); static Event * BuildEvent ( ProtocolStream * stream );
@ -73,7 +73,7 @@ static char * DispatchEvent ( Event * event );
/* Function Name: ClientTimedOut /* Function Name: ClientTimedOut
* Description: Called if the client takes too long to take our selection. * Description: Called if the client takes too long to take our selection.
* Arguments: data - The widget that owns the client * Arguments: data - The widget that owns the client
* communication selection. * communication selection.
* id - *** UNUSED *** * id - *** UNUSED ***
* Returns: none. * Returns: none.
@ -85,13 +85,12 @@ ClientTimedOut(XtPointer data, XtIntervalId *id)
{ {
char msg[BUFSIZ]; char msg[BUFSIZ];
Widget w = (Widget) data; Widget w = (Widget) data;
global_client.ident = NO_IDENT; global_client.ident = NO_IDENT;
XtDisownSelection(w, global_client.atom, XtDisownSelection(w, global_client.atom,
XtLastTimestampProcessed(XtDisplay(w))); XtLastTimestampProcessed(XtDisplay(w)));
sprintf(msg, res_labels[4], snprintf(msg, sizeof(msg), res_labels[4], "the Editres Protocol.");
"the Editres Protocol.");
SetMessage(global_screen_data.info_label, msg); SetMessage(global_screen_data.info_label, msg);
} }
@ -103,7 +102,7 @@ ClientTimedOut(XtPointer data, XtIntervalId *id)
* Returns: a clients window, or None. * Returns: a clients window, or None.
*/ */
Window Window
GetClientWindow(Widget w, int *x, int *y) GetClientWindow(Widget w, int *x, int *y)
{ {
int status; int status;
@ -113,10 +112,10 @@ GetClientWindow(Widget w, int *x, int *y)
Display * dpy = XtDisplayOfObject(w); Display * dpy = XtDisplayOfObject(w);
Window target_win = None, root = RootWindowOfScreen(XtScreenOfObject(w)); Window target_win = None, root = RootWindowOfScreen(XtScreenOfObject(w));
XtAppContext app = XtWidgetToApplicationContext(w); XtAppContext app = XtWidgetToApplicationContext(w);
/* Make the target cursor */ /* Make the target cursor */
cursor = XCreateFontCursor(dpy, XC_crosshair); cursor = XCreateFontCursor(dpy, XC_crosshair);
/* Grab the pointer using target cursor, letting it room all over */ /* Grab the pointer using target cursor, letting it room all over */
status = XGrabPointer(dpy, root, False, status = XGrabPointer(dpy, root, False,
ButtonPressMask|ButtonReleaseMask, GrabModeSync, ButtonPressMask|ButtonReleaseMask, GrabModeSync,
@ -125,7 +124,7 @@ GetClientWindow(Widget w, int *x, int *y)
SetMessage(global_screen_data.info_label, res_labels[5]); SetMessage(global_screen_data.info_label, res_labels[5]);
return(None); return(None);
} }
/* Let the user select a window... */ /* Let the user select a window... */
while ((target_win == None) || (buttons != 0)) { while ((target_win == None) || (buttons != 0)) {
/* allow one more event */ /* allow one more event */
@ -137,7 +136,7 @@ GetClientWindow(Widget w, int *x, int *y)
XtDispatchEvent(&event); XtDispatchEvent(&event);
break; break;
} }
if (target_win == None) { if (target_win == None) {
target_win = event.xbutton.subwindow; /* window selected */ target_win = event.xbutton.subwindow; /* window selected */
if (x != NULL) if (x != NULL)
@ -152,7 +151,7 @@ GetClientWindow(Widget w, int *x, int *y)
XtDispatchEvent(&event); XtDispatchEvent(&event);
break; break;
} }
if (buttons > 0) /* There may have been some if (buttons > 0) /* There may have been some
down before we started */ down before we started */
buttons--; buttons--;
@ -161,17 +160,17 @@ GetClientWindow(Widget w, int *x, int *y)
XtDispatchEvent(&event); XtDispatchEvent(&event);
break; break;
} }
} }
XUngrabPointer(dpy, CurrentTime); /* Done with pointer */ XUngrabPointer(dpy, CurrentTime); /* Done with pointer */
return(XmuClientWindow(dpy, target_win)); return(XmuClientWindow(dpy, target_win));
} }
/* Function Name: SetCommand /* Function Name: SetCommand
* Description: Causes this widget to own the resource editor's * Description: Causes this widget to own the resource editor's
* command selection. * command selection.
* Arguments: w - the widget that will own the selection. * Arguments: w - the widget that will own the selection.
* command - command to send to client. * command - command to send to client.
@ -185,24 +184,24 @@ SetCommand(Widget w, ResCommand command, char *msg)
{ {
XClientMessageEvent client_event; XClientMessageEvent client_event;
Display * dpy = XtDisplay(w); Display * dpy = XtDisplay(w);
if (msg == NULL) if (msg == NULL)
msg = res_labels[6]; msg = res_labels[6];
SetMessage(global_screen_data.info_label, msg); SetMessage(global_screen_data.info_label, msg);
if (global_client.window == None) if (global_client.window == None)
if ( (global_client.window = GetClientWindow(w, NULL, NULL)) == None) if ( (global_client.window = GetClientWindow(w, NULL, NULL)) == None)
return; return;
global_client.ident = GetNewIdent(); global_client.ident = GetNewIdent();
global_client.command = command; global_client.command = command;
global_client.atom = atom_comm; global_client.atom = atom_comm;
BuildHeader(&(global_client)); BuildHeader(&(global_client));
if (!XtOwnSelection(w, global_client.atom, CurrentTime, ConvertCommand, if (!XtOwnSelection(w, global_client.atom, CurrentTime, ConvertCommand,
LoseSelection, SelectionDone)) LoseSelection, SelectionDone))
SetMessage(global_screen_data.info_label, SetMessage(global_screen_data.info_label,
res_labels[7]); res_labels[7]);
@ -215,32 +214,31 @@ SetCommand(Widget w, ResCommand command, char *msg)
client_event.data.l[1] = global_client.atom; client_event.data.l[1] = global_client.atom;
client_event.data.l[2] = (long) global_client.ident; client_event.data.l[2] = (long) global_client.ident;
client_event.data.l[3] = global_effective_protocol_version; client_event.data.l[3] = global_effective_protocol_version;
global_error_code = NO_ERROR; /* Reset Error code. */ global_error_code = NO_ERROR; /* Reset Error code. */
global_old_error_handler = XSetErrorHandler(HandleXErrors); global_old_error_handler = XSetErrorHandler(HandleXErrors);
global_serial_num = NextRequest(dpy); global_serial_num = NextRequest(dpy);
XSendEvent(dpy, global_client.window, FALSE, (long) 0, XSendEvent(dpy, global_client.window, FALSE, (long) 0,
(XEvent *) &client_event); (XEvent *) &client_event);
XSync(dpy, FALSE); XSync(dpy, FALSE);
XSetErrorHandler(global_old_error_handler); XSetErrorHandler(global_old_error_handler);
if (global_error_code == NO_WINDOW) { if (global_error_code == NO_WINDOW) {
char error_buf[BUFSIZ]; char error_buf[BUFSIZ] =
"The communication window with the"
" application is no longer available\n"
"Please select a new widget tree.";
global_error_code = NO_ERROR; /* Reset Error code. */ global_error_code = NO_ERROR; /* Reset Error code. */
sprintf(error_buf, "The communication window with%s%s.",
" application is no longer available\n",
"Please select a new widget tree");
global_client.window = None; global_client.window = None;
SetCommand(w, LocalSendWidgetTree, error_buf); SetCommand(w, LocalSendWidgetTree, error_buf);
return; return;
} }
TellUserAboutMessage(global_screen_data.info_label, command); TellUserAboutMessage(global_screen_data.info_label, command);
global_client.timeout = XtAppAddTimeOut(XtWidgetToApplicationContext(w), global_client.timeout = XtAppAddTimeOut(XtWidgetToApplicationContext(w),
CLIENT_TIME_OUT, CLIENT_TIME_OUT,
ClientTimedOut, (XtPointer) w); ClientTimedOut, (XtPointer) w);
} }
@ -280,7 +278,7 @@ TellUserAboutMessage(Widget label, ResCommand command)
break; break;
} }
sprintf(msg, res_labels[8], str); snprintf(msg, sizeof(msg), res_labels[8], str);
SetMessage(label, msg); SetMessage(label, msg);
} }
@ -305,7 +303,7 @@ ConvertCommand(Widget w, Atom *selection, Atom *target, Atom *type_ret,
*value_ret = (XtPointer) global_client.stream.real_top; *value_ret = (XtPointer) global_client.stream.real_top;
*length_ret = global_client.stream.size + HEADER_SIZE; *length_ret = global_client.stream.size + HEADER_SIZE;
*format_ret = EDITRES_FORMAT; *format_ret = EDITRES_FORMAT;
return(TRUE); return(TRUE);
} }
@ -396,15 +394,15 @@ GetClientValue(Widget w, XtPointer data, Atom *selection, Atom *type,
#ifdef DEBUG #ifdef DEBUG
if (global_resources.debug) if (global_resources.debug)
printf("Incorrect ident from client.\n"); printf("Incorrect ident from client.\n");
#endif #endif
if (!XtOwnSelection(w, *selection, CurrentTime, ConvertCommand, if (!XtOwnSelection(w, *selection, CurrentTime, ConvertCommand,
LoseSelection, SelectionDone)) LoseSelection, SelectionDone))
SetMessage(global_screen_data.info_label, SetMessage(global_screen_data.info_label,
res_labels[10]); res_labels[10]);
return; return;
} }
(void) _XEditResGet8(stream, &error_code); (void) _XEditResGet8(stream, &error_code);
(void) _XEditResGet32(stream, &(stream->size)); (void) _XEditResGet32(stream, &(stream->size));
stream->top = stream->current; /* reset stream to top of value.*/ stream->top = stream->current; /* reset stream to top of value.*/
@ -420,7 +418,7 @@ GetClientValue(Widget w, XtPointer data, Atom *selection, Atom *type,
FreeEvent(event); FreeEvent(event);
} }
else { else {
sprintf(msg, "Unable to unpack protocol request."); snprintf(msg, sizeof(msg), "Unable to unpack protocol request.");
error_str = XtNewString(msg); error_str = XtNewString(msg);
} }
break; break;
@ -438,19 +436,19 @@ GetClientValue(Widget w, XtPointer data, Atom *selection, Atom *type,
SetCommand(w, LocalSendWidgetTree, NULL); SetCommand(w, LocalSendWidgetTree, NULL);
break; break;
default: default:
sprintf(msg, res_labels[11], (int) error_code); snprintf(msg, sizeof(msg), res_labels[11], (int) error_code);
SetMessage(global_screen_data.info_label, msg); SetMessage(global_screen_data.info_label, msg);
break; break;
} }
if (error_str == NULL) { if (error_str == NULL) {
WNode * top; WNode * top;
if (global_tree_info == NULL) if (global_tree_info == NULL)
return; return;
top = global_tree_info->top_node; top = global_tree_info->top_node;
sprintf(msg, res_labels[12], top->name, top->class); snprintf(msg, sizeof(msg), res_labels[12], top->name, top->class);
SetMessage(global_screen_data.info_label, msg); SetMessage(global_screen_data.info_label, msg);
return; return;
} }
@ -480,22 +478,22 @@ BuildHeader(CurrentClient *client_data)
* fill in the space. * fill in the space.
*/ */
/* /*
* Fool the insert routines into putting the header in the right * Fool the insert routines into putting the header in the right
* place while being damn sure not to realloc (that would be very bad. * place while being damn sure not to realloc (that would be very bad.
*/ */
old_current = stream->current; old_current = stream->current;
old_alloc = stream->alloc; old_alloc = stream->alloc;
old_size = stream->size; old_size = stream->size;
stream->current = stream->real_top; stream->current = stream->real_top;
stream->alloc = stream->size + (2 * HEADER_SIZE); stream->alloc = stream->size + (2 * HEADER_SIZE);
_XEditResPut8(stream, client_data->ident); _XEditResPut8(stream, client_data->ident);
switch(client_data->command) { switch(client_data->command) {
case LocalSendWidgetTree: case LocalSendWidgetTree:
if (reset_protocol_level) global_effective_protocol_version = if (reset_protocol_level) global_effective_protocol_version =
CURRENT_PROTOCOL_VERSION; CURRENT_PROTOCOL_VERSION;
reset_protocol_level = True; reset_protocol_level = True;
command = SendWidgetTree; command = SendWidgetTree;
@ -519,7 +517,7 @@ BuildHeader(CurrentClient *client_data)
command = SendWidgetTree; command = SendWidgetTree;
break; break;
} }
_XEditResPut8(stream, (unsigned char) command); _XEditResPut8(stream, (unsigned char) command);
_XEditResPut32(stream, old_size); _XEditResPut32(stream, old_size);
@ -531,12 +529,12 @@ BuildHeader(CurrentClient *client_data)
/* Function Name: BuildEvent /* Function Name: BuildEvent
* Description: Builds the event structure from the * Description: Builds the event structure from the
* Arguments: stream - the protocol data stream. * Arguments: stream - the protocol data stream.
* Returns: event - the event. * Returns: event - the event.
*/ */
static Event * static Event *
BuildEvent(ProtocolStream *stream) BuildEvent(ProtocolStream *stream)
{ {
int i; int i;
@ -556,7 +554,7 @@ BuildEvent(ProtocolStream *stream)
if (!_XEditResGet16(stream, &(send_event->num_entries))) if (!_XEditResGet16(stream, &(send_event->num_entries)))
goto done; goto done;
send_event->info = (WidgetTreeInfo *) send_event->info = (WidgetTreeInfo *)
XtCalloc(sizeof(WidgetTreeInfo), XtCalloc(sizeof(WidgetTreeInfo),
send_event->num_entries); send_event->num_entries);
@ -566,13 +564,13 @@ BuildEvent(ProtocolStream *stream)
if (!(_XEditResGetWidgetInfo(stream, &(info->widgets)) && if (!(_XEditResGetWidgetInfo(stream, &(info->widgets)) &&
_XEditResGetString8(stream, &(info->name)) && _XEditResGetString8(stream, &(info->name)) &&
_XEditResGetString8(stream, &(info->class)) && _XEditResGetString8(stream, &(info->class)) &&
_XEditResGet32(stream, &(info->window)))) _XEditResGet32(stream, &(info->window))))
{ {
goto done; goto done;
} }
} }
if (global_effective_protocol_version == if (global_effective_protocol_version ==
CURRENT_PROTOCOL_VERSION) { CURRENT_PROTOCOL_VERSION) {
/* get toolkit type and reset if necessary */ /* get toolkit type and reset if necessary */
if (!_XEditResGetString8(stream, &(send_event->toolkit))) if (!_XEditResGetString8(stream, &(send_event->toolkit)))
@ -582,11 +580,11 @@ BuildEvent(ProtocolStream *stream)
SetEntriesSensitive(&CM_entries[CM_OFFSET], CM_NUM, True); SetEntriesSensitive(&CM_entries[CM_OFFSET], CM_NUM, True);
/* set the tree menu entries senitive */ /* set the tree menu entries senitive */
SetEntriesSensitive(TM_entries, TM_NUM, True); SetEntriesSensitive(TM_entries, TM_NUM, True);
if (global_effective_protocol_version == if (global_effective_protocol_version ==
CURRENT_PROTOCOL_VERSION) { CURRENT_PROTOCOL_VERSION) {
if (!strcmp(send_event->toolkit, "InterViews")) if (!strcmp(send_event->toolkit, "InterViews"))
RebuildMenusAndLabel("iv"); RebuildMenusAndLabel("iv");
} }
else else
RebuildMenusAndLabel("xt"); RebuildMenusAndLabel("xt");
} }
@ -599,7 +597,7 @@ BuildEvent(ProtocolStream *stream)
if (!_XEditResGet16(stream, &(sv_event->num_entries))) if (!_XEditResGet16(stream, &(sv_event->num_entries)))
goto done; goto done;
sv_event->info = (SetValuesInfo *) XtCalloc(sizeof(SetValuesInfo), sv_event->info = (SetValuesInfo *) XtCalloc(sizeof(SetValuesInfo),
sv_event->num_entries); sv_event->num_entries);
@ -616,13 +614,13 @@ BuildEvent(ProtocolStream *stream)
case LocalGetResources: case LocalGetResources:
{ {
GetResourcesEvent * res_event = (GetResourcesEvent *) event; GetResourcesEvent * res_event = (GetResourcesEvent *) event;
res_event->type = GetGeometry; res_event->type = GetGeometry;
if (!_XEditResGet16(stream, &(res_event->num_entries))) if (!_XEditResGet16(stream, &(res_event->num_entries)))
goto done; goto done;
res_event->info = (GetResourcesInfo *) res_event->info = (GetResourcesInfo *)
XtCalloc(sizeof(GetResourcesInfo), XtCalloc(sizeof(GetResourcesInfo),
res_event->num_entries); res_event->num_entries);
@ -634,7 +632,7 @@ BuildEvent(ProtocolStream *stream)
goto done; goto done;
} }
if (res_info->error) { if (res_info->error) {
if (!_XEditResGetString8(stream, &(res_info->message))) if (!_XEditResGetString8(stream, &(res_info->message)))
goto done; goto done;
} }
else { else {
@ -643,7 +641,7 @@ BuildEvent(ProtocolStream *stream)
if (!_XEditResGet16(stream, &(res_info->num_resources))) if (!_XEditResGet16(stream, &(res_info->num_resources)))
goto done; goto done;
res_info->res_info = (ResourceInfo *) res_info->res_info = (ResourceInfo *)
XtCalloc(sizeof(ResourceInfo), XtCalloc(sizeof(ResourceInfo),
res_info->num_resources); res_info->num_resources);
@ -673,7 +671,7 @@ BuildEvent(ProtocolStream *stream)
if (!_XEditResGet16(stream, &(geom_event->num_entries))) if (!_XEditResGet16(stream, &(geom_event->num_entries)))
goto done; goto done;
geom_event->info = (GetGeomInfo *) XtCalloc(sizeof(GetGeomInfo), geom_event->info = (GetGeomInfo *) XtCalloc(sizeof(GetGeomInfo),
geom_event->num_entries); geom_event->num_entries);
@ -716,9 +714,9 @@ BuildEvent(ProtocolStream *stream)
{ {
Arg args[1]; Arg args[1];
GetValuesEvent * gv_event = (GetValuesEvent *) event; GetValuesEvent * gv_event = (GetValuesEvent *) event;
gv_event->type = GetValues; gv_event->type = GetValues;
if (!_XEditResGet16(stream, &(gv_event->num_entries))) if (!_XEditResGet16(stream, &(gv_event->num_entries)))
goto done; goto done;
@ -760,7 +758,7 @@ BuildEvent(ProtocolStream *stream)
/* Function Name: FreeEvent /* Function Name: FreeEvent
* Description: Frees all memory associated with the event. * Description: Frees all memory associated with the event.
* Arguments: event - the event. * Arguments: event - the event.
* Returns: none. * Returns: none.
* *
@ -777,7 +775,7 @@ FreeEvent(Event *event)
{ {
SendWidgetTreeEvent * send_event = (SendWidgetTreeEvent *) event; SendWidgetTreeEvent * send_event = (SendWidgetTreeEvent *) event;
WidgetTreeInfo * info = send_event->info; WidgetTreeInfo * info = send_event->info;
if (info != NULL) { if (info != NULL) {
for (i = 0; i < send_event->num_entries; i++, info++) { for (i = 0; i < send_event->num_entries; i++, info++) {
XtFree((char *)info->widgets.ids); XtFree((char *)info->widgets.ids);
@ -792,7 +790,7 @@ FreeEvent(Event *event)
{ {
SetValuesEvent * sv_event = (SetValuesEvent *) event; SetValuesEvent * sv_event = (SetValuesEvent *) event;
SetValuesInfo * info = sv_event->info; SetValuesInfo * info = sv_event->info;
if (info != NULL) { if (info != NULL) {
for (i = 0; i < sv_event->num_entries; i++, info++) { for (i = 0; i < sv_event->num_entries; i++, info++) {
XtFree((char *)info->widgets.ids); XtFree((char *)info->widgets.ids);
@ -810,15 +808,15 @@ FreeEvent(Event *event)
if (info != NULL) { if (info != NULL) {
for (i = 0; i < get_event->num_entries; i++, info++) { for (i = 0; i < get_event->num_entries; i++, info++) {
XtFree((char *)info->widgets.ids); XtFree((char *)info->widgets.ids);
if (info->error) if (info->error)
XtFree(info->message); XtFree(info->message);
else { else {
unsigned int j; unsigned int j;
ResourceInfo * res_info = info->res_info; ResourceInfo * res_info = info->res_info;
if (res_info != NULL) { if (res_info != NULL) {
for (j = 0; for (j = 0;
j < info->num_resources; j++, res_info++) j < info->num_resources; j++, res_info++)
{ {
XtFree(res_info->name); XtFree(res_info->name);
XtFree(res_info->class); XtFree(res_info->class);
@ -827,7 +825,7 @@ FreeEvent(Event *event)
XtFree((char *)info->res_info); XtFree((char *)info->res_info);
} }
} }
} }
XtFree((char *)get_event->info); XtFree((char *)get_event->info);
} }
} }
@ -840,7 +838,7 @@ FreeEvent(Event *event)
if (info != NULL) { if (info != NULL) {
for (i = 0; i < geom_event->num_entries; i++, info++) { for (i = 0; i < geom_event->num_entries; i++, info++) {
XtFree((char *)info->widgets.ids); XtFree((char *)info->widgets.ids);
if (info->error) if (info->error)
XtFree(info->message); XtFree(info->message);
} }
XtFree((char *)geom_event->info); XtFree((char *)geom_event->info);
@ -850,7 +848,7 @@ FreeEvent(Event *event)
case FindChild: case FindChild:
{ {
FindChildEvent * find_event = (FindChildEvent *) event; FindChildEvent * find_event = (FindChildEvent *) event;
XtFree((char *)find_event->widgets.ids); XtFree((char *)find_event->widgets.ids);
} }
break; break;
@ -866,7 +864,7 @@ FreeEvent(Event *event)
* Arguments: event - the event. * Arguments: event - the event.
* Returns: one. * Returns: one.
*/ */
static char * static char *
DispatchEvent(Event *event) DispatchEvent(Event *event)
{ {
@ -893,8 +891,8 @@ DispatchEvent(Event *event)
default: default:
{ {
char msg[BUFSIZ]; char msg[BUFSIZ];
sprintf(msg, "Internal error: Unknown command %d.", snprintf(msg, sizeof(msg), "Internal error: Unknown command %d.",
global_client.command); global_client.command);
error = XtNewString(msg); error = XtNewString(msg);
} }
break; break;

347
app/editres/compile Normal file
View File

@ -0,0 +1,347 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2012-10-14.11; # UTC
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
nl='
'
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" "" $nl"
file_conv=
# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
;;
CYGWIN*)
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv/,$2, in
*,$file_conv,*)
;;
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
func_file_conv "$1"
if test -z "$lib_path"; then
lib_path=$file
else
lib_path="$lib_path;$file"
fi
linker_opts="$linker_opts -LIBPATH:$file"
}
# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
lib=$1
found=no
save_IFS=$IFS
IFS=';'
for dir in $lib_path $LIB
do
IFS=$save_IFS
if $shared && test -f "$dir/$lib.dll.lib"; then
found=yes
lib=$dir/$lib.dll.lib
break
fi
if test -f "$dir/$lib.lib"; then
found=yes
lib=$dir/$lib.lib
break
fi
if test -f "$dir/lib$lib.a"; then
found=yes
lib=$dir/lib$lib.a
break
fi
done
IFS=$save_IFS
if test "$found" != yes; then
lib=$lib.lib
fi
}
# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
# Assume a capable shell
lib_path=
shared=:
linker_opts=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
eat=1
case $2 in
*.o | *.[oO][bB][jJ])
func_file_conv "$2"
set x "$@" -Fo"$file"
shift
;;
*)
func_file_conv "$2"
set x "$@" -Fe"$file"
shift
;;
esac
;;
-I)
eat=1
func_file_conv "$2" mingw
set x "$@" -I"$file"
shift
;;
-I*)
func_file_conv "${1#-I}" mingw
set x "$@" -I"$file"
shift
;;
-l)
eat=1
func_cl_dashl "$2"
set x "$@" "$lib"
shift
;;
-l*)
func_cl_dashl "${1#-l}"
set x "$@" "$lib"
shift
;;
-L)
eat=1
func_cl_dashL "$2"
;;
-L*)
func_cl_dashL "${1#-L}"
;;
-static)
shared=false
;;
-Wl,*)
arg=${1#-Wl,}
save_ifs="$IFS"; IFS=','
for flag in $arg; do
IFS="$save_ifs"
linker_opts="$linker_opts $flag"
done
IFS="$save_ifs"
;;
-Xlinker)
eat=1
linker_opts="$linker_opts $2"
;;
-*)
set x "$@" "$1"
shift
;;
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
func_file_conv "$1"
set x "$@" -Tp"$file"
shift
;;
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
func_file_conv "$1" mingw
set x "$@" "$file"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -n "$linker_opts"; then
linker_opts="-link$linker_opts"
fi
exec "$@" $linker_opts
exit 1
}
eat=
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand '-c -o'.
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file 'INSTALL'.
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "compile $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
ofile=
cfile=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
# So we strip '-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
ofile=$2
;;
*)
set x "$@" -o "$2"
shift
;;
esac
;;
*.c)
cfile=$1
set x "$@" "$1"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no '-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# '.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
# Create the lock directory.
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15
# Run the compile.
"$@"
ret=$?
if test -f "$cofile"; then
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
fi
rmdir "$lockdir"
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

115
app/editres/configure vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for editres 1.0.6. # Generated by GNU Autoconf 2.69 for editres 1.0.7.
# #
# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>. # Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
# #
@ -581,11 +581,12 @@ MAKEFLAGS=
# Identity of this package. # Identity of this package.
PACKAGE_NAME='editres' PACKAGE_NAME='editres'
PACKAGE_TARNAME='editres' PACKAGE_TARNAME='editres'
PACKAGE_VERSION='1.0.6' PACKAGE_VERSION='1.0.7'
PACKAGE_STRING='editres 1.0.6' PACKAGE_STRING='editres 1.0.7'
PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
PACKAGE_URL='' PACKAGE_URL=''
ac_unique_file="Makefile.am"
# Factoring default headers for most tests. # Factoring default headers for most tests.
ac_includes_default="\ ac_includes_default="\
#include <stdio.h> #include <stdio.h>
@ -1316,7 +1317,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing. # Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh. # This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF cat <<_ACEOF
\`configure' configures editres 1.0.6 to adapt to many kinds of systems. \`configure' configures editres 1.0.7 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]... Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1386,7 +1387,7 @@ fi
if test -n "$ac_init_help"; then if test -n "$ac_init_help"; then
case $ac_init_help in case $ac_init_help in
short | recursive ) echo "Configuration of editres 1.0.6:";; short | recursive ) echo "Configuration of editres 1.0.7:";;
esac esac
cat <<\_ACEOF cat <<\_ACEOF
@ -1506,7 +1507,7 @@ fi
test -n "$ac_init_help" && exit $ac_status test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then if $ac_init_version; then
cat <<\_ACEOF cat <<\_ACEOF
editres configure 1.0.6 editres configure 1.0.7
generated by GNU Autoconf 2.69 generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc. Copyright (C) 2012 Free Software Foundation, Inc.
@ -1763,7 +1764,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. running configure, to aid debugging if configure makes a mistake.
It was created by editres $as_me 1.0.6, which was It was created by editres $as_me 1.0.7, which was
generated by GNU Autoconf 2.69. Invocation command line was generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@ $ $0 $@
@ -2111,6 +2112,11 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_config_headers="$ac_config_headers config.h"
# Initialize Automake
am__api_version='1.12' am__api_version='1.12'
ac_aux_dir= ac_aux_dir=
@ -2587,7 +2593,7 @@ fi
# Define the identity of the package. # Define the identity of the package.
PACKAGE='editres' PACKAGE='editres'
VERSION='1.0.6' VERSION='1.0.7'
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
@ -10254,10 +10260,11 @@ _ACEOF
CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \ CHANGELOG_CMD="((GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp) 2>/dev/null && \
mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \ || (rm -f \$(top_srcdir)/.changelog.tmp; test -e \$(top_srcdir)/ChangeLog || ( \
echo 'git directory not found: installing possibly empty changelog.' >&2)" touch \$(top_srcdir)/ChangeLog; \
echo 'git failed to create ChangeLog: installing empty ChangeLog.' >&2))"
@ -10265,14 +10272,45 @@ echo 'git directory not found: installing possibly empty changelog.' >&2)"
macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \ || (rm -f \$(top_srcdir)/.INSTALL.tmp; test -e \$(top_srcdir)/INSTALL || ( \
echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)" touch \$(top_srcdir)/INSTALL; \
echo 'failed to copy INSTALL from util-macros: installing empty INSTALL.' >&2))"
case $host_os in
solaris*)
# Solaris 2.0 - 11.3 use SysV man page section numbers, so we
# check for a man page file found in later versions that use
# traditional section numbers instead
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/man/man7/attributes.7" >&5
$as_echo_n "checking for /usr/share/man/man7/attributes.7... " >&6; }
if ${ac_cv_file__usr_share_man_man7_attributes_7+:} false; then :
$as_echo_n "(cached) " >&6
else
test "$cross_compiling" = yes &&
as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
if test -r "/usr/share/man/man7/attributes.7"; then
ac_cv_file__usr_share_man_man7_attributes_7=yes
else
ac_cv_file__usr_share_man_man7_attributes_7=no
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_man_man7_attributes_7" >&5
$as_echo "$ac_cv_file__usr_share_man_man7_attributes_7" >&6; }
if test "x$ac_cv_file__usr_share_man_man7_attributes_7" = xyes; then :
SYSV_MAN_SECTIONS=false
else
SYSV_MAN_SECTIONS=true
fi
;;
*) SYSV_MAN_SECTIONS=false ;;
esac
if test x$APP_MAN_SUFFIX = x ; then if test x$APP_MAN_SUFFIX = x ; then
APP_MAN_SUFFIX=1 APP_MAN_SUFFIX=1
fi fi
@ -10288,9 +10326,9 @@ if test x$LIB_MAN_DIR = x ; then
fi fi
if test x$FILE_MAN_SUFFIX = x ; then if test x$FILE_MAN_SUFFIX = x ; then
case $host_os in case $SYSV_MAN_SECTIONS in
solaris*) FILE_MAN_SUFFIX=4 ;; true) FILE_MAN_SUFFIX=4 ;;
*) FILE_MAN_SUFFIX=5 ;; *) FILE_MAN_SUFFIX=5 ;;
esac esac
fi fi
if test x$FILE_MAN_DIR = x ; then if test x$FILE_MAN_DIR = x ; then
@ -10298,9 +10336,9 @@ if test x$FILE_MAN_DIR = x ; then
fi fi
if test x$MISC_MAN_SUFFIX = x ; then if test x$MISC_MAN_SUFFIX = x ; then
case $host_os in case $SYSV_MAN_SECTIONS in
solaris*) MISC_MAN_SUFFIX=5 ;; true) MISC_MAN_SUFFIX=5 ;;
*) MISC_MAN_SUFFIX=7 ;; *) MISC_MAN_SUFFIX=7 ;;
esac esac
fi fi
if test x$MISC_MAN_DIR = x ; then if test x$MISC_MAN_DIR = x ; then
@ -10308,9 +10346,9 @@ if test x$MISC_MAN_DIR = x ; then
fi fi
if test x$DRIVER_MAN_SUFFIX = x ; then if test x$DRIVER_MAN_SUFFIX = x ; then
case $host_os in case $SYSV_MAN_SECTIONS in
solaris*) DRIVER_MAN_SUFFIX=7 ;; true) DRIVER_MAN_SUFFIX=7 ;;
*) DRIVER_MAN_SUFFIX=4 ;; *) DRIVER_MAN_SUFFIX=4 ;;
esac esac
fi fi
if test x$DRIVER_MAN_DIR = x ; then if test x$DRIVER_MAN_DIR = x ; then
@ -10318,9 +10356,9 @@ if test x$DRIVER_MAN_DIR = x ; then
fi fi
if test x$ADMIN_MAN_SUFFIX = x ; then if test x$ADMIN_MAN_SUFFIX = x ; then
case $host_os in case $SYSV_MAN_SECTIONS in
solaris*) ADMIN_MAN_SUFFIX=1m ;; true) ADMIN_MAN_SUFFIX=1m ;;
*) ADMIN_MAN_SUFFIX=8 ;; *) ADMIN_MAN_SUFFIX=8 ;;
esac esac
fi fi
if test x$ADMIN_MAN_DIR = x ; then if test x$ADMIN_MAN_DIR = x ; then
@ -10400,9 +10438,6 @@ AM_BACKSLASH='\'
ac_config_headers="$ac_config_headers config.h"
# Obtain compiler/linker options from depedencies # Obtain compiler/linker options from depedencies
pkg_failed=no pkg_failed=no
@ -10413,12 +10448,12 @@ if test -n "$EDITRES_CFLAGS"; then
pkg_cv_EDITRES_CFLAGS="$EDITRES_CFLAGS" pkg_cv_EDITRES_CFLAGS="$EDITRES_CFLAGS"
elif test -n "$PKG_CONFIG"; then elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \ if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xaw7 x11 xt xmu\""; } >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xaw7 x11 xt >= 1.0.99.1 xmu xproto >= 7.0.17\""; } >&5
($PKG_CONFIG --exists --print-errors "xaw7 x11 xt xmu") 2>&5 ($PKG_CONFIG --exists --print-errors "xaw7 x11 xt >= 1.0.99.1 xmu xproto >= 7.0.17") 2>&5
ac_status=$? ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then test $ac_status = 0; }; then
pkg_cv_EDITRES_CFLAGS=`$PKG_CONFIG --cflags "xaw7 x11 xt xmu" 2>/dev/null` pkg_cv_EDITRES_CFLAGS=`$PKG_CONFIG --cflags "xaw7 x11 xt >= 1.0.99.1 xmu xproto >= 7.0.17" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes test "x$?" != "x0" && pkg_failed=yes
else else
pkg_failed=yes pkg_failed=yes
@ -10430,12 +10465,12 @@ if test -n "$EDITRES_LIBS"; then
pkg_cv_EDITRES_LIBS="$EDITRES_LIBS" pkg_cv_EDITRES_LIBS="$EDITRES_LIBS"
elif test -n "$PKG_CONFIG"; then elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \ if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xaw7 x11 xt xmu\""; } >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xaw7 x11 xt >= 1.0.99.1 xmu xproto >= 7.0.17\""; } >&5
($PKG_CONFIG --exists --print-errors "xaw7 x11 xt xmu") 2>&5 ($PKG_CONFIG --exists --print-errors "xaw7 x11 xt >= 1.0.99.1 xmu xproto >= 7.0.17") 2>&5
ac_status=$? ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then test $ac_status = 0; }; then
pkg_cv_EDITRES_LIBS=`$PKG_CONFIG --libs "xaw7 x11 xt xmu" 2>/dev/null` pkg_cv_EDITRES_LIBS=`$PKG_CONFIG --libs "xaw7 x11 xt >= 1.0.99.1 xmu xproto >= 7.0.17" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes test "x$?" != "x0" && pkg_failed=yes
else else
pkg_failed=yes pkg_failed=yes
@ -10456,14 +10491,14 @@ else
_pkg_short_errors_supported=no _pkg_short_errors_supported=no
fi fi
if test $_pkg_short_errors_supported = yes; then if test $_pkg_short_errors_supported = yes; then
EDITRES_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "xaw7 x11 xt xmu" 2>&1` EDITRES_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "xaw7 x11 xt >= 1.0.99.1 xmu xproto >= 7.0.17" 2>&1`
else else
EDITRES_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "xaw7 x11 xt xmu" 2>&1` EDITRES_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "xaw7 x11 xt >= 1.0.99.1 xmu xproto >= 7.0.17" 2>&1`
fi fi
# Put the nasty error message in config.log where it belongs # Put the nasty error message in config.log where it belongs
echo "$EDITRES_PKG_ERRORS" >&5 echo "$EDITRES_PKG_ERRORS" >&5
as_fn_error $? "Package requirements (xaw7 x11 xt xmu) were not met: as_fn_error $? "Package requirements (xaw7 x11 xt >= 1.0.99.1 xmu xproto >= 7.0.17) were not met:
$EDITRES_PKG_ERRORS $EDITRES_PKG_ERRORS
@ -11138,7 +11173,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their # report actual input values of CONFIG_FILES etc. instead of their
# values after options handling. # values after options handling.
ac_log=" ac_log="
This file was extended by editres $as_me 1.0.6, which was This file was extended by editres $as_me 1.0.7, which was
generated by GNU Autoconf 2.69. Invocation command line was generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES CONFIG_FILES = $CONFIG_FILES
@ -11204,7 +11239,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\ ac_cs_version="\\
editres config.status 1.0.6 editres config.status 1.0.7
configured by $0, generated by GNU Autoconf 2.69, configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\" with options \\"\$ac_cs_config\\"
@ -11333,8 +11368,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
for ac_config_target in $ac_config_targets for ac_config_target in $ac_config_targets
do do
case $ac_config_target in case $ac_config_target in
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;

View File

@ -1,6 +1,6 @@
dnl Copyright 2005 Red Hat, Inc. dnl Copyright 2005 Red Hat, Inc.
dnl dnl
dnl Permission to use, copy, modify, distribute, and sell this software and its dnl Permission to use, copy, modify, distribute, and sell this software and its
dnl documentation for any purpose is hereby granted without fee, provided that dnl documentation for any purpose is hereby granted without fee, provided that
dnl the above copyright notice appear in all copies and that both that dnl the above copyright notice appear in all copies and that both that
@ -10,7 +10,7 @@ dnl advertising or publicity pertaining to distribution of the software without
dnl specific, written prior permission. Red Hat makes no dnl specific, written prior permission. Red Hat makes no
dnl representations about the suitability of this software for any purpose. It dnl representations about the suitability of this software for any purpose. It
dnl is provided "as is" without express or implied warranty. dnl is provided "as is" without express or implied warranty.
dnl dnl
dnl RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, dnl RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
dnl EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR dnl EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
@ -21,9 +21,14 @@ dnl PERFORMANCE OF THIS SOFTWARE.
dnl dnl
dnl Process this file with autoconf to create configure. dnl Process this file with autoconf to create configure.
# Initialize Autoconf
AC_PREREQ([2.60]) AC_PREREQ([2.60])
AC_INIT([editres], [1.0.6], AC_INIT([editres], [1.0.7],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [editres]) [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [editres])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
# Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-bzip2]) AM_INIT_AUTOMAKE([foreign dist-bzip2])
AM_MAINTAINER_MODE AM_MAINTAINER_MODE
@ -33,10 +38,8 @@ m4_ifndef([XORG_MACROS_VERSION],
XORG_MACROS_VERSION(1.8) XORG_MACROS_VERSION(1.8)
XORG_DEFAULT_OPTIONS XORG_DEFAULT_OPTIONS
AC_CONFIG_HEADERS([config.h])
# Obtain compiler/linker options from depedencies # Obtain compiler/linker options from depedencies
PKG_CHECK_MODULES(EDITRES, xaw7 x11 xt xmu) PKG_CHECK_MODULES(EDITRES, [xaw7 x11 xt >= 1.0.99.1 xmu xproto >= 7.0.17])
PKG_CHECK_MODULES(APPDEFS, xt) PKG_CHECK_MODULES(APPDEFS, xt)
xt_appdefaultdir=`$PKG_CONFIG --variable=appdefaultdir xt` xt_appdefaultdir=`$PKG_CONFIG --variable=appdefaultdir xt`

View File

@ -27,7 +27,7 @@ in this Software without prior written authorization from The Open Group.
#include <stdlib.h> #include <stdlib.h>
#include <X11/Intrinsic.h> #include <X11/Intrinsic.h>
#include <X11/StringDefs.h> #include <X11/StringDefs.h>
#include <X11/Xaw/Cardinals.h> #include <X11/Xaw/Cardinals.h>
#define THIS_IS_MAIN /* Don't get extern definitions of global #define THIS_IS_MAIN /* Don't get extern definitions of global
variables. */ variables. */
@ -35,7 +35,7 @@ in this Software without prior written authorization from The Open Group.
#include "editresP.h" #include "editresP.h"
/* /*
* Global variables. * Global variables.
*/ */
/* array of toolkit dependent labels taken from the resource file */ /* array of toolkit dependent labels taken from the resource file */
@ -61,9 +61,9 @@ Widget global_toplevel;
AppResources global_resources; AppResources global_resources;
static void Syntax ( XtAppContext app_con, char *call ); static void Syntax ( XtAppContext app_con, char *call ) _X_NORETURN;
static String fallback_resources[] = { static String fallback_resources[] = {
NULL, NULL,
}; };
@ -73,9 +73,9 @@ static XtResource editres_resources[] = {
{"debug", "Debug", XtRBoolean, sizeof(Boolean), {"debug", "Debug", XtRBoolean, sizeof(Boolean),
Offset(debug), XtRImmediate, (XtPointer) FALSE}, Offset(debug), XtRImmediate, (XtPointer) FALSE},
{"numFlashes", "NumFlashes", XtRInt, sizeof(int), {"numFlashes", "NumFlashes", XtRInt, sizeof(int),
Offset(num_flashes), XtRImmediate, (XtPointer) NUM_FLASHES}, Offset(num_flashes), XtRImmediate, (XtPointer) NUM_FLASHES},
{"flashTime", "FlashTime", XtRInt, sizeof(int), {"flashTime", "FlashTime", XtRInt, sizeof(int),
Offset(flash_time), XtRImmediate, (XtPointer) FLASH_TIME}, Offset(flash_time), XtRImmediate, (XtPointer) FLASH_TIME},
{"flashColor", XtCForeground, XtRPixel, sizeof(Pixel), {"flashColor", XtCForeground, XtRPixel, sizeof(Pixel),
Offset(flash_color), XtRImmediate, (XtPointer) XtDefaultForeground}, Offset(flash_color), XtRImmediate, (XtPointer) XtDefaultForeground},
{"saveResourceFile", "SaveResourcesFile", XtRString, sizeof(String), {"saveResourceFile", "SaveResourcesFile", XtRString, sizeof(String),
@ -93,23 +93,23 @@ main(int argc, char **argv)
&argc, argv, fallback_resources, &argc, argv, fallback_resources,
NULL, ZERO); NULL, ZERO);
if (argc != 1) if (argc != 1)
Syntax(app_con, argv[0]); Syntax(app_con, argv[0]);
SetApplicationActions(app_con); SetApplicationActions(app_con);
XtGetApplicationResources(global_toplevel, (XtPointer) &global_resources, XtGetApplicationResources(global_toplevel, (XtPointer) &global_resources,
editres_resources, XtNumber(editres_resources), editres_resources, XtNumber(editres_resources),
NULL, (Cardinal) 0); NULL, (Cardinal) 0);
global_resources.allocated_save_resources_file = FALSE; global_resources.allocated_save_resources_file = FALSE;
XtOverrideTranslations XtOverrideTranslations
(global_toplevel, (global_toplevel,
XtParseTranslationTable ("<Message>WM_PROTOCOLS: quit()")); XtParseTranslationTable ("<Message>WM_PROTOCOLS: quit()"));
/* build tree for Xt intrinsics */ /* build tree for Xt intrinsics */
BuildWidgetTree(global_toplevel); BuildWidgetTree(global_toplevel);
SetMessage(global_screen_data.info_label, SetMessage(global_screen_data.info_label,
res_labels[13]); res_labels[13]);
global_screen_data.set_values_popup = NULL; global_screen_data.set_values_popup = NULL;
@ -118,10 +118,10 @@ main(int argc, char **argv)
XtRealizeWidget(global_toplevel); XtRealizeWidget(global_toplevel);
wm_delete_window = wm_delete_window =
XInternAtom(XtDisplay(global_toplevel), "WM_DELETE_WINDOW", XInternAtom(XtDisplay(global_toplevel), "WM_DELETE_WINDOW",
False); False);
(void) XSetWMProtocols (XtDisplay(global_toplevel), (void) XSetWMProtocols (XtDisplay(global_toplevel),
XtWindow(global_toplevel), XtWindow(global_toplevel),
&wm_delete_window, 1); &wm_delete_window, 1);
XtAppMainLoop(app_con); XtAppMainLoop(app_con);
@ -135,7 +135,7 @@ main(int argc, char **argv)
* Returns: none - exits tho. * Returns: none - exits tho.
*/ */
static void static void
Syntax(XtAppContext app_con, char *call) Syntax(XtAppContext app_con, char *call)
{ {
XtDestroyApplicationContext(app_con); XtDestroyApplicationContext(app_con);

View File

@ -28,6 +28,7 @@ in this Software without prior written authorization from The Open Group.
#include <X11/Xmu/EditresP.h> #include <X11/Xmu/EditresP.h>
#include <X11/Xresource.h> #include <X11/Xresource.h>
#include <X11/Xfuncproto.h>
#define DEBUG #define DEBUG
@ -40,9 +41,9 @@ in this Software without prior written authorization from The Open Group.
#define PROTOCOL_VERSION_ONE_POINT_ONE 5 /* version 1.1 */ #define PROTOCOL_VERSION_ONE_POINT_ONE 5 /* version 1.1 */
#define ONE_POINT_ONE_STRING "1.1" #define ONE_POINT_ONE_STRING "1.1"
#define PROTOCOL_VERSION_ONE_POINT_ZERO 4 /* version 1.0 */ #define PROTOCOL_VERSION_ONE_POINT_ZERO 4 /* version 1.0 */
#define ONE_POINT_ZERO_STRING "1.0" ONE_POINT_ONE_STRING #define ONE_POINT_ZERO_STRING "1.0" ONE_POINT_ONE_STRING
#define CURRENT_PROTOCOL_VERSION PROTOCOL_VERSION_ONE_POINT_ONE #define CURRENT_PROTOCOL_VERSION PROTOCOL_VERSION_ONE_POINT_ONE
#define CURRENT_PROTOCOL_VERSION_STRING ONE_POINT_ONE_STRING #define CURRENT_PROTOCOL_VERSION_STRING ONE_POINT_ONE_STRING
#define FLASH_TIME 1000 /* Default flash time in microseconds */ #define FLASH_TIME 1000 /* Default flash time in microseconds */
@ -71,19 +72,19 @@ in this Software without prior written authorization from The Open Group.
#define NODE_INFO ((XContext) 42) #define NODE_INFO ((XContext) 42)
/* /*
* Error codes for X Server errors. * Error codes for X Server errors.
*/ */
#define NO_ERROR 0 #define NO_ERROR 0
#define NO_WINDOW 1 #define NO_WINDOW 1
typedef enum {LocalSendWidgetTree, LocalSetValues, LocalFindChild, typedef enum {LocalSendWidgetTree, LocalSetValues, LocalFindChild,
LocalFlashWidget, LocalGetGeometry, LocalGetResources, LocalFlashWidget, LocalGetGeometry, LocalGetResources,
LocalGetValues} ResCommand; LocalGetValues} ResCommand;
typedef enum {ClassLabel, NameLabel, IDLabel, WindowLabel, typedef enum {ClassLabel, NameLabel, IDLabel, WindowLabel,
ToggleLabel} LabelTypes; ToggleLabel} LabelTypes;
typedef enum {SelectWidget, SelectAll, SelectNone, SelectInvert, SelectParent, typedef enum {SelectWidget, SelectAll, SelectNone, SelectInvert, SelectParent,
SelectChildren, SelectDescendants, SelectAncestors} SelectTypes; SelectChildren, SelectDescendants, SelectAncestors} SelectTypes;
typedef struct _NameInfo { typedef struct _NameInfo {
@ -97,16 +98,16 @@ typedef struct _ResourceBoxInfo {
Widget res_label; /* The label containing current resoruce. */ Widget res_label; /* The label containing current resoruce. */
Widget shell; /* Shell widget containing resource box. */ Widget shell; /* Shell widget containing resource box. */
Widget norm_list; /* The List widget for the normal list. */ Widget norm_list; /* The List widget for the normal list. */
Widget cons_list; /* The List widget for the Widget cons_list; /* The List widget for the
Constriaint Resources */ Constriaint Resources */
NameInfo * name_info; /* The info about the widgets for each NameInfo * name_info; /* The info about the widgets for each
name and class in the instance heirarchy. */ name and class in the instance heirarchy. */
} ResourceBoxInfo; } ResourceBoxInfo;
typedef struct _WidgetResourceInfo { typedef struct _WidgetResourceInfo {
char * name, * class, *type; /* Name, Class and Type of each resource. */ char * name, * class, *type; /* Name, Class and Type of each resource. */
} WidgetResourceInfo; } WidgetResourceInfo;
typedef struct _WidgetResources { typedef struct _WidgetResources {
int num_normal, num_constraint; int num_normal, num_constraint;
WidgetResourceInfo *normal, *constraint; WidgetResourceInfo *normal, *constraint;
@ -196,7 +197,7 @@ typedef struct _ApplyResourcesInfo {
ProtocolStream * stream; ProtocolStream * stream;
XrmDatabase database; XrmDatabase database;
} ApplyResourcesInfo; } ApplyResourcesInfo;
/* /*
* Information needed to get a resource string from a widget. * Information needed to get a resource string from a widget.
*/ */
@ -236,7 +237,7 @@ typedef struct _SetValuesInfo {
WidgetInfo widgets; WidgetInfo widgets;
char * message; char * message;
} SetValuesInfo; } SetValuesInfo;
typedef struct _SetValuesEvent { typedef struct _SetValuesEvent {
EditresCommand type; EditresCommand type;
unsigned short num_entries; unsigned short num_entries;
@ -247,7 +248,7 @@ typedef struct _GetValuesInfo {
WidgetInfo widgets; WidgetInfo widgets;
char * value; char * value;
} GetValuesInfo; } GetValuesInfo;
typedef struct _GetValuesEvent { typedef struct _GetValuesEvent {
EditresCommand type; EditresCommand type;
unsigned short num_entries; unsigned short num_entries;
@ -303,7 +304,7 @@ typedef union _Event {
FindChildEvent find_child_event; FindChildEvent find_child_event;
GetValuesEvent get_values_event; GetValuesEvent get_values_event;
} Event; } Event;
/* /*
* number of application resource labels. * number of application resource labels.
*/ */
@ -311,7 +312,7 @@ typedef union _Event {
#define NUM_RES_LABELS 37 #define NUM_RES_LABELS 37
/* /*
* Global variables. * Global variables.
*/ */
extern int global_effective_protocol_version; extern int global_effective_protocol_version;
extern char* global_effective_toolkit; extern char* global_effective_toolkit;
@ -393,7 +394,7 @@ extern void LayoutTree ( Widget tree );
extern int main ( int argc, char **argv ); extern int main ( int argc, char **argv );
extern void ModifySVEntry ( Widget w, XEvent *event, String * params, Cardinal * num_params ); extern void ModifySVEntry ( Widget w, XEvent *event, String * params, Cardinal * num_params );
extern void PannerCallback ( Widget w, XtPointer closure, XtPointer report_ptr ); extern void PannerCallback ( Widget w, XtPointer closure, XtPointer report_ptr );
extern void PerformTreeToFileDump ( WNode * node, int num_tabs, FILE * fp ); extern void PerformTreeToFileDump ( WNode * node, Cardinal num_tabs, FILE * fp );
extern void PopdownResBox ( Widget w, XtPointer shell_ptr, XtPointer junk ); extern void PopdownResBox ( Widget w, XtPointer shell_ptr, XtPointer junk );
extern void PopupCentered ( XEvent * event, Widget w, XtGrabKind mode ); extern void PopupCentered ( XEvent * event, Widget w, XtGrabKind mode );
extern void PopupSetValues ( Widget parent, XEvent * event ); extern void PopupSetValues ( Widget parent, XEvent * event );
@ -403,7 +404,7 @@ extern void PrintNodes ( WNode * top );
extern char * PrintSetValuesError ( Event * event ); extern char * PrintSetValuesError ( Event * event );
extern char * ProtocolFailure ( ProtocolStream * stream ); extern char * ProtocolFailure ( ProtocolStream * stream );
extern XrmQuarkList Quarkify ( char ** list, char * ptr ); extern XrmQuarkList Quarkify ( char ** list, char * ptr );
extern void Quit ( Widget w, XtPointer client_data, XtPointer call_data ); extern void Quit ( Widget w, XtPointer client_data, XtPointer call_data ) _X_NORETURN;
extern void RebuildMenusAndLabel ( String toolkit ); extern void RebuildMenusAndLabel ( String toolkit );
extern void ResourceListCallback ( Widget list, XtPointer node_ptr, XtPointer junk ); extern void ResourceListCallback ( Widget list, XtPointer node_ptr, XtPointer junk );
extern void SaveResource ( Widget w, XtPointer res_box_ptr, XtPointer junk ); extern void SaveResource ( Widget w, XtPointer res_box_ptr, XtPointer junk );

View File

@ -30,19 +30,19 @@ in this Software without prior written authorization from The Open Group.
#include <X11/Shell.h> #include <X11/Shell.h>
#include <stdio.h> #include <stdio.h>
#include <X11/Xaw/Cardinals.h> #include <X11/Xaw/Cardinals.h>
#include "editresP.h" #include "editresP.h"
/* /*
* Local function definitions * Local function definitions
*/ */
static void AddToFlashList ( TreeInfo * tree_info, GetGeomInfo * geom_info, static void AddToFlashList ( TreeInfo * tree_info, GetGeomInfo * geom_info,
char ** errors ); char ** errors );
static void _AddToFlashList ( TreeInfo * tree_info, char ** errors, static void _AddToFlashList ( TreeInfo * tree_info, char ** errors,
WNode * node, int x, int y, unsigned int width, WNode * node, int x, int y, unsigned int width,
unsigned int height ); unsigned int height );
static void CreateFlashWidget ( TreeInfo * tree_info, int x, int y, static void CreateFlashWidget ( TreeInfo * tree_info, int x, int y,
unsigned int width, unsigned int height ); unsigned int width, unsigned int height );
static void FlashWidgets ( TreeInfo * tree_info ); static void FlashWidgets ( TreeInfo * tree_info );
static void FlashWidgetsOn ( XtPointer info_ptr, XtIntervalId * id ); static void FlashWidgetsOn ( XtPointer info_ptr, XtIntervalId * id );
@ -55,7 +55,7 @@ static void FlashWidgetsCleanup ( XtPointer info_ptr, XtIntervalId * id );
* Returns: none. * Returns: none.
*/ */
void void
_FindWidget(Widget w) _FindWidget(Widget w)
{ {
char msg[BUFSIZ]; char msg[BUFSIZ];
@ -63,15 +63,15 @@ _FindWidget(Widget w)
Window win; Window win;
int x, y; /* location of event in root coordinates. */ int x, y; /* location of event in root coordinates. */
sprintf(msg, res_labels[14]); snprintf(msg, sizeof(msg), res_labels[14]);
SetMessage(global_screen_data.info_label, msg); SetMessage(global_screen_data.info_label, msg);
if ( (win = GetClientWindow(w, &x, &y)) != None) { if ( (win = GetClientWindow(w, &x, &y)) != None) {
node = FindWidgetFromWindow(global_tree_info, win); node = FindWidgetFromWindow(global_tree_info, win);
if (node != NULL) { if (node != NULL) {
ProtocolStream * stream = &(global_client.stream); ProtocolStream * stream = &(global_client.stream);
_XEditResResetStream(stream); _XEditResResetStream(stream);
InsertWidgetFromNode(stream, node); InsertWidgetFromNode(stream, node);
_XEditResPut16(stream, (short) x); _XEditResPut16(stream, (short) x);
@ -81,7 +81,7 @@ _FindWidget(Widget w)
} }
} }
SetMessage(global_screen_data.info_label, SetMessage(global_screen_data.info_label,
res_labels[15]); res_labels[15]);
} }
@ -103,16 +103,16 @@ DisplayChild(Event *event)
find_event->widgets.num_widgets); find_event->widgets.num_widgets);
if (node == NULL) { if (node == NULL) {
sprintf(msg, res_labels[13]); snprintf(msg, sizeof(msg), res_labels[13]);
SetMessage(global_screen_data.info_label, msg); SetMessage(global_screen_data.info_label, msg);
return; return;
} }
SetAndCenterTreeNode(node); SetAndCenterTreeNode(node);
node = node->tree_info->top_node; node = node->tree_info->top_node;
sprintf(msg, res_labels[12], node->name, node->class); snprintf(msg, sizeof(msg), res_labels[12], node->name, node->class);
SetMessage(global_screen_data.info_label, msg); SetMessage(global_screen_data.info_label, msg);
_FlashActiveWidgets(global_tree_info); _FlashActiveWidgets(global_tree_info);
@ -127,7 +127,7 @@ DisplayChild(Event *event)
void void
_FlashActiveWidgets(TreeInfo *tree_info) _FlashActiveWidgets(TreeInfo *tree_info)
{ {
int i; Cardinal i;
ProtocolStream * stream = &(global_client.stream); ProtocolStream * stream = &(global_client.stream);
if (tree_info == NULL) { if (tree_info == NULL) {
@ -140,14 +140,14 @@ _FlashActiveWidgets(TreeInfo *tree_info)
SetMessage(global_screen_data.info_label,res_labels[18]); SetMessage(global_screen_data.info_label,res_labels[18]);
return; return;
} }
_XEditResResetStream(stream); _XEditResResetStream(stream);
/* /*
* Insert the number of widgets. * Insert the number of widgets.
*/ */
_XEditResPut16(stream, (unsigned short) tree_info->num_nodes); _XEditResPut16(stream, (unsigned short) tree_info->num_nodes);
for (i = 0; i < tree_info->num_nodes; i++) for (i = 0; i < tree_info->num_nodes; i++)
InsertWidgetFromNode(stream, global_tree_info->active_nodes[i]); InsertWidgetFromNode(stream, global_tree_info->active_nodes[i]);
SetCommand(tree_info->tree_widget, LocalFlashWidget, NULL); SetCommand(tree_info->tree_widget, LocalFlashWidget, NULL);
@ -167,7 +167,7 @@ HandleFlashWidget(Event *event)
char * errors = NULL; char * errors = NULL;
int i; int i;
for (i = 0; i < (int)geom_event->num_entries; i++) for (i = 0; i < (int)geom_event->num_entries; i++)
AddToFlashList(global_tree_info, geom_event->info + i, &errors); AddToFlashList(global_tree_info, geom_event->info + i, &errors);
FlashWidgets(global_tree_info); FlashWidgets(global_tree_info);
@ -189,30 +189,31 @@ AddToFlashList(TreeInfo *tree_info, GetGeomInfo *geom_info, char **errors)
WNode * node; WNode * node;
char buf[BUFSIZ]; char buf[BUFSIZ];
node = FindNode(tree_info->top_node, node = FindNode(tree_info->top_node,
geom_info->widgets.ids, geom_info->widgets.num_widgets); geom_info->widgets.ids, geom_info->widgets.num_widgets);
if (node == NULL) { if (node == NULL) {
sprintf(buf, "Editres Internal Error: Unable to FindNode.\n"); snprintf(buf, sizeof(buf),
AddString(errors, buf); "Editres Internal Error: Unable to FindNode.\n");
return; AddString(errors, buf);
}
if (geom_info->error) {
AddString(errors, geom_info->message);
return;
}
if (!geom_info->visable) {
sprintf(buf, "%s(0x%lx) - This widget is not mapped\n",
node->name, node->id);
AddString(errors, buf);
return; return;
} }
_AddToFlashList(tree_info, errors, node, if (geom_info->error) {
geom_info->x, geom_info->y, AddString(errors, geom_info->message);
geom_info->width + geom_info->border_width, return;
}
if (!geom_info->visable) {
snprintf(buf, sizeof(buf), "%s(0x%lx) - This widget is not mapped\n",
node->name, node->id);
AddString(errors, buf);
return;
}
_AddToFlashList(tree_info, errors, node,
geom_info->x, geom_info->y,
geom_info->width + geom_info->border_width,
geom_info->height + geom_info->border_width); geom_info->height + geom_info->border_width);
} }
@ -239,14 +240,16 @@ _AddToFlashList(TreeInfo *tree_info, char **errors, WNode *node,
if (window == EDITRES_IS_UNREALIZED) { if (window == EDITRES_IS_UNREALIZED) {
char buf[BUFSIZ]; char buf[BUFSIZ];
if (node->window == EDITRES_IS_OBJECT) if (node->window == EDITRES_IS_OBJECT)
sprintf(buf, "%s(0x%lx) - This object's parent is unrealized\n", snprintf(buf, sizeof(buf),
node->name, node->id); "%s(0x%lx) - This object's parent is unrealized\n",
node->name, node->id);
else else
sprintf(buf, "%s(0x%lx) - This widget is unrealized\n", snprintf(buf, sizeof(buf),
node->name, node->id); "%s(0x%lx) - This widget is unrealized\n",
node->name, node->id);
AddString(errors, buf); AddString(errors, buf);
return; return;
} }
@ -261,20 +264,21 @@ _AddToFlashList(TreeInfo *tree_info, char **errors, WNode *node,
if (global_error_code == NO_WINDOW) { if (global_error_code == NO_WINDOW) {
char buf[BUFSIZ]; char buf[BUFSIZ];
sprintf(buf, "%s(0x%lx) - This widget's window no longer exists.\n", snprintf(buf, sizeof(buf),
node->name, node->id); "%s(0x%lx) - This widget's window no longer exists.\n",
AddString(errors, buf); node->name, node->id);
AddString(errors, buf);
return; return;
} }
if (attrs.map_state != IsViewable) { if (attrs.map_state != IsViewable) {
char buf[BUFSIZ]; char buf[BUFSIZ];
sprintf(buf, "%s(0x%lx) - This widget is not mapped.\n", snprintf(buf, sizeof(buf), "%s(0x%lx) - This widget is not mapped.\n",
node->name, node->id); node->name, node->id);
AddString(errors, buf); AddString(errors, buf);
return; return;
} }
CreateFlashWidget(tree_info, x, y, width, height); CreateFlashWidget(tree_info, x, y, width, height);
} }
@ -287,7 +291,7 @@ _AddToFlashList(TreeInfo *tree_info, char **errors, WNode *node,
* x,y,width, height - size and location of the flash widget. * x,y,width, height - size and location of the flash widget.
* Returns: none. * Returns: none.
*/ */
#define MORE_FLASH_WIDGETS 5 #define MORE_FLASH_WIDGETS 5
static void static void
@ -303,20 +307,20 @@ CreateFlashWidget(TreeInfo *tree_info, int x, int y,
XtSetArg(args[num], XtNy, y); num++; XtSetArg(args[num], XtNy, y); num++;
XtSetArg(args[num], XtNbackground, global_resources.flash_color); num++; XtSetArg(args[num], XtNbackground, global_resources.flash_color); num++;
shell = XtCreatePopupShell("flash", overrideShellWidgetClass, shell = XtCreatePopupShell("flash", overrideShellWidgetClass,
tree_info->tree_widget, args, num); tree_info->tree_widget, args, num);
num = 0; num = 0;
XtSetArg(args[num], XtNborderWidth, &bw); num++; XtSetArg(args[num], XtNborderWidth, &bw); num++;
XtGetValues(shell, args, num); XtGetValues(shell, args, num);
bw *= 2; bw *= 2;
num = 0; num = 0;
XtSetArg(args[num], XtNwidth, (width - bw)); num++; XtSetArg(args[num], XtNwidth, (width - bw)); num++;
XtSetArg(args[num], XtNheight, (height - bw)); num++; XtSetArg(args[num], XtNheight, (height - bw)); num++;
XtSetValues(shell, args, num); XtSetValues(shell, args, num);
if (tree_info->num_flash_widgets + 1 > tree_info->alloc_flash_widgets) { if (tree_info->num_flash_widgets + 1 > tree_info->alloc_flash_widgets) {
tree_info->alloc_flash_widgets += MORE_FLASH_WIDGETS; tree_info->alloc_flash_widgets += MORE_FLASH_WIDGETS;
tree_info->flash_widgets = tree_info->flash_widgets =
@ -357,7 +361,7 @@ FlashWidgets(TreeInfo *tree_info)
FlashWidgetsOn((XtPointer) tree_info, (XtIntervalId *) NULL); FlashWidgetsOn((XtPointer) tree_info, (XtIntervalId *) NULL);
} }
/* Function Name: FlashWidgetsOn /* Function Name: FlashWidgetsOn
* Description: Turns on all the Flash Widgets. * Description: Turns on all the Flash Widgets.
* Arguments: info_ptr - pointer to the tree info. * Arguments: info_ptr - pointer to the tree info.
@ -370,9 +374,9 @@ static void
FlashWidgetsOn(XtPointer info_ptr, XtIntervalId *id) FlashWidgetsOn(XtPointer info_ptr, XtIntervalId *id)
{ {
int i; Cardinal i;
TreeInfo * tree_info = (TreeInfo *) info_ptr; TreeInfo * tree_info = (TreeInfo *) info_ptr;
for (i = 0; i < tree_info->num_flash_widgets; i++) { for (i = 0; i < tree_info->num_flash_widgets; i++) {
XtRealizeWidget(tree_info->flash_widgets[i]); XtRealizeWidget(tree_info->flash_widgets[i]);
XMapRaised(XtDisplay(tree_info->flash_widgets[i]), XMapRaised(XtDisplay(tree_info->flash_widgets[i]),
@ -391,9 +395,9 @@ FlashWidgetsOn(XtPointer info_ptr, XtIntervalId *id)
static void static void
FlashWidgetsOff(XtPointer info_ptr, XtIntervalId *id) FlashWidgetsOff(XtPointer info_ptr, XtIntervalId *id)
{ {
int i; Cardinal i;
TreeInfo * tree_info = (TreeInfo *) info_ptr; TreeInfo * tree_info = (TreeInfo *) info_ptr;
for (i = 0; i < tree_info->num_flash_widgets; i++) for (i = 0; i < tree_info->num_flash_widgets; i++)
XtUnmapWidget(tree_info->flash_widgets[i]); XtUnmapWidget(tree_info->flash_widgets[i]);
} }
@ -409,19 +413,19 @@ FlashWidgetsOff(XtPointer info_ptr, XtIntervalId *id)
static void static void
FlashWidgetsCleanup(XtPointer info_ptr, XtIntervalId *id) FlashWidgetsCleanup(XtPointer info_ptr, XtIntervalId *id)
{ {
int i; Cardinal i;
TreeInfo * tree_info = (TreeInfo *) info_ptr; TreeInfo * tree_info = (TreeInfo *) info_ptr;
/* /*
* Unmap 'em first for consistency. * Unmap 'em first for consistency.
*/ */
for (i = 0; i < tree_info->num_flash_widgets; i++) for (i = 0; i < tree_info->num_flash_widgets; i++)
XtUnmapWidget(tree_info->flash_widgets[i]); XtUnmapWidget(tree_info->flash_widgets[i]);
XFlush(XtDisplay(tree_info->tree_widget)); XFlush(XtDisplay(tree_info->tree_widget));
for (i = 0; i < tree_info->num_flash_widgets; i++) for (i = 0; i < tree_info->num_flash_widgets; i++)
XtDestroyWidget(tree_info->flash_widgets[i]); XtDestroyWidget(tree_info->flash_widgets[i]);
XtFree((char *)tree_info->flash_widgets); XtFree((char *)tree_info->flash_widgets);

View File

@ -39,13 +39,13 @@ in this Software without prior written authorization from The Open Group.
#include "editresP.h" #include "editresP.h"
/* /*
* Local function definitions. * Local function definitions.
*/ */
static char * GetResourceName ( ResourceBoxInfo * res_box ); static char * GetResourceName ( ResourceBoxInfo * res_box );
static void _AppendResourceString ( Widget w, XtPointer res_box_ptr, static void _AppendResourceString ( Widget w, XtPointer res_box_ptr,
XtPointer filename_ptr ); XtPointer filename_ptr );
static void _SetResourcesFile ( Widget w, XtPointer junk, static void _SetResourcesFile ( Widget w, XtPointer junk,
XtPointer filename_ptr ); XtPointer filename_ptr );
static void ObtainResource ( XtPointer node_ptr ); static void ObtainResource ( XtPointer node_ptr );
static void CreateSetValuesCommand ( WNode * node, XtPointer info_ptr ); static void CreateSetValuesCommand ( WNode * node, XtPointer info_ptr );
@ -89,8 +89,8 @@ SendTree(Widget w, XtPointer value, XtPointer call_data)
w = XtParent(w); w = XtParent(w);
_XEditResResetStream(&(global_client.stream)); /* an empty message. */ _XEditResResetStream(&(global_client.stream)); /* an empty message. */
SetCommand(w, LocalSendWidgetTree, NULL); SetCommand(w, LocalSendWidgetTree, NULL);
} }
/* Function Name: FindWidget /* Function Name: FindWidget
@ -171,13 +171,13 @@ TreeRelabel(Widget w, XtPointer client_data, XtPointer call_data)
*/ */
/* ARGSUSED */ /* ARGSUSED */
void void
PannerCallback(Widget w, XtPointer closure, XtPointer report_ptr) PannerCallback(Widget w, XtPointer closure, XtPointer report_ptr)
{ {
Arg args[2]; Arg args[2];
XawPannerReport *report = (XawPannerReport *) report_ptr; XawPannerReport *report = (XawPannerReport *) report_ptr;
if (global_tree_info == NULL) if (global_tree_info == NULL)
return; return;
XtSetArg (args[0], XtNx, -report->slider_x); XtSetArg (args[0], XtNx, -report->slider_x);
@ -188,7 +188,7 @@ PannerCallback(Widget w, XtPointer closure, XtPointer report_ptr)
/* Function Name: PortholeCallback /* Function Name: PortholeCallback
* Description: called when the porthole or its child has * Description: called when the porthole or its child has
* changed * changed
* Arguments: porthole - the porthole widget. * Arguments: porthole - the porthole widget.
* panner_ptr - the panner widget. * panner_ptr - the panner widget.
* report_ptr - the porthole record. * report_ptr - the porthole record.
@ -196,7 +196,7 @@ PannerCallback(Widget w, XtPointer closure, XtPointer report_ptr)
*/ */
/* ARGSUSED */ /* ARGSUSED */
void void
PortholeCallback(Widget w, XtPointer panner_ptr, XtPointer report_ptr) PortholeCallback(Widget w, XtPointer panner_ptr, XtPointer report_ptr)
{ {
Arg args[10]; Arg args[10];
@ -222,7 +222,7 @@ PortholeCallback(Widget w, XtPointer panner_ptr, XtPointer report_ptr)
*/ */
/* ARGSUSED */ /* ARGSUSED */
void void
FlashActiveWidgets(Widget w, XtPointer junk, XtPointer garbage) FlashActiveWidgets(Widget w, XtPointer junk, XtPointer garbage)
{ {
_FlashActiveWidgets(global_tree_info); _FlashActiveWidgets(global_tree_info);
@ -268,7 +268,7 @@ GetResourceList(Widget w, XtPointer junk, XtPointer garbage)
* No resoruces, fetch them from the client. * No resoruces, fetch them from the client.
*/ */
_XEditResResetStream(stream); _XEditResResetStream(stream);
_XEditResPut16(stream, (unsigned short) 1); _XEditResPut16(stream, (unsigned short) 1);
InsertWidgetFromNode(stream, node); InsertWidgetFromNode(stream, node);
SetCommand(global_tree_info->tree_widget, LocalGetResources, NULL); SetCommand(global_tree_info->tree_widget, LocalGetResources, NULL);
@ -282,7 +282,7 @@ GetResourceList(Widget w, XtPointer junk, XtPointer garbage)
*/ */
/* ARGSUSED */ /* ARGSUSED */
void void
DumpTreeToFile(Widget w, XtPointer junk, XtPointer garbage) DumpTreeToFile(Widget w, XtPointer junk, XtPointer garbage)
{ {
_PopupFileDialog(XtParent(w), "Enter the filename:", "", _PopupFileDialog(XtParent(w), "Enter the filename:", "",
@ -290,24 +290,24 @@ DumpTreeToFile(Widget w, XtPointer junk, XtPointer garbage)
} }
/************************************************************ /************************************************************
* *
* Callbacks for the Resource Box. * Callbacks for the Resource Box.
* *
************************************************************/ ************************************************************/
/* Function Name: AnyChosen /* Function Name: AnyChosen
* Description: Callback that is called when the "any" widget * Description: Callback that is called when the "any" widget
* is activated. * is activated.
* Arguments: w - the "any" widget that activated this callback. * Arguments: w - the "any" widget that activated this callback.
* any_info_ptr - pointer to struct containing * any_info_ptr - pointer to struct containing
* dot and star widgets to lock. * dot and star widgets to lock.
* state_ptr - state of the any toggle. * state_ptr - state of the any toggle.
* Returns: none. * Returns: none.
*/ */
/* ARGSUSED */ /* ARGSUSED */
void void
AnyChosen(Widget w, XtPointer any_info_ptr, XtPointer state_ptr) AnyChosen(Widget w, XtPointer any_info_ptr, XtPointer state_ptr)
{ {
AnyInfo * any_info = (AnyInfo *) any_info_ptr; AnyInfo * any_info = (AnyInfo *) any_info_ptr;
@ -337,9 +337,9 @@ AnyChosen(Widget w, XtPointer any_info_ptr, XtPointer state_ptr)
(*any_info->right_count)++; (*any_info->right_count)++;
} }
else { /* state == 0 */ else { /* state == 0 */
if (any_info->left_count > 0) if (any_info->left_count > 0)
any_info->left_count--; any_info->left_count--;
if ((any_info->right_count != NULL)&&(*any_info->right_count > 0)) if ((any_info->right_count != NULL)&&(*any_info->right_count > 0))
(*any_info->right_count)--; (*any_info->right_count)--;
if (any_info->left_count == 0) { if (any_info->left_count == 0) {
@ -374,17 +374,17 @@ GetResourceName(ResourceBoxInfo *res_box)
{ {
XawListReturnStruct * list_info; XawListReturnStruct * list_info;
char * result; char * result;
list_info = XawListShowCurrent(res_box->norm_list); list_info = XawListShowCurrent(res_box->norm_list);
if ((list_info->list_index == XAW_LIST_NONE) && if ((list_info->list_index == XAW_LIST_NONE) &&
(res_box->cons_list != NULL)) { (res_box->cons_list != NULL)) {
list_info = XawListShowCurrent(res_box->cons_list); list_info = XawListShowCurrent(res_box->cons_list);
} }
if (list_info->list_index == XAW_LIST_NONE) if (list_info->list_index == XAW_LIST_NONE)
result = "unknown"; result = "unknown";
else else
result = list_info->string; result = list_info->string;
return(result); return(result);
} }
@ -431,12 +431,12 @@ SetResourceString(Widget w, XtPointer node_ptr, XtPointer junk)
char * temp, buf[BUFSIZ * 10]; /* here's hoping it's big enough. */ char * temp, buf[BUFSIZ * 10]; /* here's hoping it's big enough. */
NameInfo * name_node = res_box->name_info; NameInfo * name_node = res_box->name_info;
Arg args[1]; Arg args[1];
int len; Cardinal len;
if ((w != NULL) && XtIsSubclass(w, toggleWidgetClass)) { if ((w != NULL) && XtIsSubclass(w, toggleWidgetClass)) {
/* /*
* Only set resources when toggles are activated, not when they are * Only set resources when toggles are activated, not when they are
* deactivated. * deactivated.
*/ */
if (!((Boolean)(long) junk)) if (!((Boolean)(long) junk))
return; return;
@ -456,13 +456,13 @@ SetResourceString(Widget w, XtPointer node_ptr, XtPointer junk)
if ( (temp != NULL) && !streq(temp, ANY_RADIO_DATA) ) { if ( (temp != NULL) && !streq(temp, ANY_RADIO_DATA) ) {
strcat(buf, temp); strcat(buf, temp);
temp = (char *) XawToggleGetCurrent(name_node->next->sep_leader); temp = (char *) XawToggleGetCurrent(name_node->next->sep_leader);
if (temp == NULL) if (temp == NULL)
strcat(buf, "!"); strcat(buf, "!");
else else
strcat(buf, temp); strcat(buf, temp);
} }
} }
strcat(buf, GetResourceName(res_box)); strcat(buf, GetResourceName(res_box));
len = strlen(buf) + 2; /* Leave space for ':' and '\0' */ len = strlen(buf) + 2; /* Leave space for ':' and '\0' */
@ -476,7 +476,7 @@ SetResourceString(Widget w, XtPointer node_ptr, XtPointer junk)
malloc_string = XtRealloc(malloc_string, sizeof(char) * len); malloc_string = XtRealloc(malloc_string, sizeof(char) * len);
malloc_size = len; malloc_size = len;
} }
strcpy(malloc_string, buf); strcpy(malloc_string, buf);
strcat(malloc_string, ":"); strcat(malloc_string, ":");
#ifdef notdef #ifdef notdef
@ -486,9 +486,9 @@ SetResourceString(Widget w, XtPointer node_ptr, XtPointer junk)
XtSetArg(args[0], XtNlabel, malloc_string); XtSetArg(args[0], XtNlabel, malloc_string);
XtSetValues(res_box->res_label, args, ONE); XtSetValues(res_box->res_label, args, ONE);
} }
/* Function Name: ResourceListCallback /* Function Name: ResourceListCallback
* Description: Callback functions for the resource lists. This * Description: Callback functions for the resource lists. This
* routine is essentialy called by the list widgets * routine is essentialy called by the list widgets
* Notify action. If action EnableGetVal has been * Notify action. If action EnableGetVal has been
* invoked, ResourceListCallback will perform a * invoked, ResourceListCallback will perform a
@ -508,7 +508,7 @@ ResourceListCallback(Widget list, XtPointer node_ptr, XtPointer junk)
WNode * node = (WNode *) node_ptr; WNode * node = (WNode *) node_ptr;
ResourceBoxInfo * res_box = node->resources->res_box; ResourceBoxInfo * res_box = node->resources->res_box;
if (list == res_box->norm_list) if (list == res_box->norm_list)
o_list = res_box->cons_list; o_list = res_box->cons_list;
else else
o_list = res_box->norm_list; o_list = res_box->norm_list;
@ -555,17 +555,18 @@ _AppendResourceString(Widget w, XtPointer res_box_ptr, XtPointer filename_ptr)
char *value_ptr; char *value_ptr;
if (filename != NULL) { if (filename != NULL) {
if (global_resources.allocated_save_resources_file) if (global_resources.allocated_save_resources_file)
XtFree(global_resources.save_resources_file); XtFree(global_resources.save_resources_file);
else else
global_resources.allocated_save_resources_file = TRUE; global_resources.allocated_save_resources_file = TRUE;
global_resources.save_resources_file = XtNewString(filename); global_resources.save_resources_file = XtNewString(filename);
} }
if ((fp = fopen(global_resources.save_resources_file, "a+")) == NULL) { if ((fp = fopen(global_resources.save_resources_file, "a+")) == NULL) {
sprintf(buf, "Unable to open this file for writing, would %s", snprintf(buf, sizeof(buf), "%s",
"you like To try again?"); "Unable to open this file for writing, would "
"you like To try again?");
_PopupFileDialog(global_toplevel ,buf, _PopupFileDialog(global_toplevel ,buf,
global_resources.save_resources_file, global_resources.save_resources_file,
_AppendResourceString, res_box_ptr); _AppendResourceString, res_box_ptr);
@ -595,7 +596,7 @@ _AppendResourceString(Widget w, XtPointer res_box_ptr, XtPointer filename_ptr)
void void
SaveResource(Widget w, XtPointer res_box_ptr, XtPointer junk) SaveResource(Widget w, XtPointer res_box_ptr, XtPointer junk)
{ {
/* /*
* If there is no filename the ask for one, otherwise just save to * If there is no filename the ask for one, otherwise just save to
* current file. * current file.
*/ */
@ -622,7 +623,7 @@ _SetResourcesFile(Widget w, XtPointer junk, XtPointer filename_ptr)
{ {
char *filename = (char *) filename_ptr; char *filename = (char *) filename_ptr;
if (global_resources.allocated_save_resources_file) if (global_resources.allocated_save_resources_file)
XtFree(global_resources.save_resources_file); XtFree(global_resources.save_resources_file);
else else
global_resources.allocated_save_resources_file = TRUE; global_resources.allocated_save_resources_file = TRUE;
@ -642,7 +643,7 @@ _SetResourcesFile(Widget w, XtPointer junk, XtPointer filename_ptr)
void void
SetFile(Widget w, XtPointer junk, XtPointer garbage) SetFile(Widget w, XtPointer junk, XtPointer garbage)
{ {
/* /*
* If there is no filename the ask for one, otherwise just save to * If there is no filename the ask for one, otherwise just save to
* current file. * current file.
*/ */
@ -655,7 +656,7 @@ SetFile(Widget w, XtPointer junk, XtPointer garbage)
/* Function Name: ApplyResource /* Function Name: ApplyResource
* Description: Apply the current resource to the running application. * Description: Apply the current resource to the running application.
* Arguments: w - any widget in the application. * Arguments: w - any widget in the application.
* node_ptr - a pointer to the node containing * node_ptr - a pointer to the node containing
* the current resouce box. * the current resouce box.
* junk - UNUSED. * junk - UNUSED.
* Returns: none * Returns: none
@ -667,7 +668,7 @@ ApplyResource(Widget w, XtPointer node_ptr, XtPointer junk)
{ {
ProtocolStream * stream = &(global_client.stream); ProtocolStream * stream = &(global_client.stream);
ApplyResourcesInfo info; ApplyResourcesInfo info;
WNode * node = (WNode *) node_ptr; WNode * node = (WNode *) node_ptr;
char * value; char * value;
unsigned short size, i; unsigned short size, i;
long len; long len;
@ -694,37 +695,37 @@ ApplyResource(Widget w, XtPointer node_ptr, XtPointer junk)
*/ */
value = GetResourceValueForSetValues(node, &size); value = GetResourceValueForSetValues(node, &size);
_XEditResPut16(stream, size); _XEditResPut16(stream, size);
for (i = 0; i < size; i++) for (i = 0; i < size; i++)
_XEditResPut8(stream, value[i]); _XEditResPut8(stream, value[i]);
XtFree(value); XtFree(value);
len = stream->current - stream->top; len = stream->current - stream->top;
/* /*
* Insert the widget count, overriden later. * Insert the widget count, overriden later.
*/ */
_XEditResPut16(stream, 0); _XEditResPut16(stream, 0);
ExecuteOverAllNodes(node->tree_info->top_node, ExecuteOverAllNodes(node->tree_info->top_node,
CreateSetValuesCommand, (XtPointer) &info); CreateSetValuesCommand, (XtPointer) &info);
if (info.count > 0) { if (info.count > 0) {
*(stream->top + len++) = info.count >> XER_NBBY; /* Set the correct */ *(stream->top + len++) = info.count >> XER_NBBY; /* Set the correct */
*(stream->top + len) = info.count; /* count. */ *(stream->top + len) = info.count; /* count. */
SetCommand(node->tree_info->tree_widget, LocalSetValues, NULL); SetCommand(node->tree_info->tree_widget, LocalSetValues, NULL);
} }
else else
SetMessage(global_screen_data.info_label, SetMessage(global_screen_data.info_label,
res_labels[20]); res_labels[20]);
XrmDestroyDatabase(info.database); XrmDestroyDatabase(info.database);
} }
/* Function Name: ObtainResource /* Function Name: ObtainResource
* Description: Obtain the current resource from the running application. * Description: Obtain the current resource from the running application.
* Arguments: node_ptr - a pointer to the node containing * Arguments: node_ptr - a pointer to the node containing
* the current resouce box. * the current resouce box.
* Returns: none * Returns: none
*/ */
@ -735,7 +736,7 @@ ObtainResource(XtPointer node_ptr)
{ {
ProtocolStream * stream = &(global_client.stream); ProtocolStream * stream = &(global_client.stream);
ObtainResourcesInfo info; ObtainResourcesInfo info;
WNode * node = (WNode *) node_ptr; WNode * node = (WNode *) node_ptr;
char * value; char * value;
Arg args[1]; Arg args[1];
@ -753,11 +754,11 @@ ObtainResource(XtPointer node_ptr)
_XEditResResetStream(stream); _XEditResResetStream(stream);
_XEditResPutString8(stream, info.name); /* insert name */ _XEditResPutString8(stream, info.name); /* insert name */
/* /*
* Insert the widget count, always 1 * Insert the widget count, always 1
*/ */
_XEditResPut16(stream, 1); _XEditResPut16(stream, 1);
/*CreateGetValuesCommand(node, (XtPointer)&info); Inserts widget */ /*CreateGetValuesCommand(node, (XtPointer)&info); Inserts widget */
@ -836,7 +837,7 @@ CreateGetValuesCommand(WNode *node, XtPointer info_ptr)
* Description: Activates all widgets that match this resource. * Description: Activates all widgets that match this resource.
* Arguments: w - UNUSED. * Arguments: w - UNUSED.
* node_ptr - the node that owns this resource box. * node_ptr - the node that owns this resource box.
* junk - UNUSED. * junk - UNUSED.
* Returns: none. * Returns: none.
*/ */
@ -844,7 +845,7 @@ CreateGetValuesCommand(WNode *node, XtPointer info_ptr)
void void
ActivateResourceWidgets(Widget w, XtPointer node_ptr, XtPointer junk) ActivateResourceWidgets(Widget w, XtPointer node_ptr, XtPointer junk)
{ {
WNode * node = (WNode *) node_ptr; WNode * node = (WNode *) node_ptr;
ApplyResourcesInfo info; ApplyResourcesInfo info;
char * line; char * line;
Arg args[1]; Arg args[1];
@ -852,7 +853,7 @@ ActivateResourceWidgets(Widget w, XtPointer node_ptr, XtPointer junk)
info.name = GetResourceName(node->resources->res_box); info.name = GetResourceName(node->resources->res_box);
info.class = "IGNORE_ME"; /* Not currently used. */ info.class = "IGNORE_ME"; /* Not currently used. */
/* /*
* Unused fields. * Unused fields.
*/ */
@ -868,7 +869,7 @@ ActivateResourceWidgets(Widget w, XtPointer node_ptr, XtPointer junk)
ExecuteOverAllNodes(node->tree_info->top_node, ExecuteOverAllNodes(node->tree_info->top_node,
SetOnlyMatchingWidgets, (XtPointer) &info); SetOnlyMatchingWidgets, (XtPointer) &info);
XrmDestroyDatabase(info.database); XrmDestroyDatabase(info.database);
} }

View File

@ -325,6 +325,8 @@ the widgets which compose \fIeditres\fP. In the notation below,
indentation indicates hierarchical structure. The widget class name indentation indicates hierarchical structure. The widget class name
is given first, followed by the widget instance name. is given first, followed by the widget instance name.
.sp .sp
.\" Default tab stops will work for this display,
.\" which allows us to avoid spurious a warning duriing XML upconversion.
.nf .nf
.TA .5i 1.0i 1.5i 2.0i .TA .5i 1.0i 1.5i 2.0i
.ta .5i 1.0i 1.5i 2.0i .ta .5i 1.0i 1.5i 2.0i

View File

@ -32,7 +32,7 @@ in this Software without prior written authorization from The Open Group.
#include <stdio.h> #include <stdio.h>
#include <X11/Xaw/AsciiText.h> #include <X11/Xaw/AsciiText.h>
#include <X11/Xaw/Cardinals.h> #include <X11/Xaw/Cardinals.h>
#include <X11/Xfuncs.h> #include <X11/Xfuncs.h>
#include <X11/Xos.h> #include <X11/Xos.h>
#include "editresP.h" #include "editresP.h"
@ -55,22 +55,23 @@ PrintSetValuesError(Event *event)
SetValuesEvent * sv_event = (SetValuesEvent *) event; SetValuesEvent * sv_event = (SetValuesEvent *) event;
char buf[BUFSIZ]; char buf[BUFSIZ];
if (sv_event->num_entries == 0) if (sv_event->num_entries == 0)
return(XtNewString("SetValues was Successful.")); return(XtNewString("SetValues was Successful."));
for (i = 0 ; i < (int)sv_event->num_entries ; i++) { for (i = 0 ; i < (int)sv_event->num_entries ; i++) {
node = FindNode(global_tree_info->top_node, node = FindNode(global_tree_info->top_node,
sv_event->info[i].widgets.ids, sv_event->info[i].widgets.ids,
sv_event->info[i].widgets.num_widgets); sv_event->info[i].widgets.num_widgets);
if (node == NULL) { if (node == NULL) {
sprintf(buf, "Editres Internal Error: Unable to FindNode.\n"); snprintf(buf, sizeof(buf),
AddString(&errors, buf); "Editres Internal Error: Unable to FindNode.\n");
AddString(&errors, buf);
continue; continue;
} }
sprintf(buf, "%s(0x%lx) - %s\n", node->name, node->id, snprintf(buf, sizeof(buf), "%s(0x%lx) - %s\n", node->name, node->id,
sv_event->info[i].message); sv_event->info[i].message);
AddString(&errors, buf); AddString(&errors, buf);
} }
return(errors); return(errors);
@ -99,8 +100,7 @@ GetResourceValueForSetValues(WNode *node, unsigned short *size)
* the resource database. * the resource database.
*/ */
temp = XtMalloc(sizeof(char) * (strlen(ptr) + strlen(RESOURCE_NAME) + 2)); XtAsprintf(&temp, "%s:%s", RESOURCE_NAME, ptr);
sprintf(temp, "%s:%s", RESOURCE_NAME, ptr);
XrmPutLineResource(&db, temp); XrmPutLineResource(&db, temp);
XtFree(temp); XtFree(temp);
@ -109,7 +109,7 @@ GetResourceValueForSetValues(WNode *node, unsigned short *size)
ptr = XtMalloc(sizeof(char) * value.size); ptr = XtMalloc(sizeof(char) * value.size);
memmove( ptr, value.addr, value.size); memmove( ptr, value.addr, value.size);
XrmDestroyDatabase(db); XrmDestroyDatabase(db);
*size = (unsigned short) value.size; *size = (unsigned short) value.size;
return(ptr); return(ptr);
} }

View File

@ -32,10 +32,10 @@ in this Software without prior written authorization from The Open Group.
#include <X11/Shell.h> #include <X11/Shell.h>
#include <X11/Xaw/AsciiText.h> #include <X11/Xaw/AsciiText.h>
#include <X11/Xaw/Cardinals.h> #include <X11/Xaw/Cardinals.h>
#include <X11/Xaw/Command.h> #include <X11/Xaw/Command.h>
#include <X11/Xaw/Form.h> #include <X11/Xaw/Form.h>
#include <X11/Xaw/Label.h> #include <X11/Xaw/Label.h>
#include <stdio.h> #include <stdio.h>
@ -69,7 +69,7 @@ PopupSetValues(Widget parent, XEvent *event)
return; return;
} }
/* /*
* Check and possibly create the popup. * Check and possibly create the popup.
*/ */
@ -94,27 +94,27 @@ PopupSetValues(Widget parent, XEvent *event)
} }
/* Function Name: ModifySVEntry /* Function Name: ModifySVEntry
* Description: Action routine that can be bound to the set values * Description: Action routine that can be bound to the set values
* dialog box's Text Widget that will send input to the * dialog box's Text Widget that will send input to the
* field specified. * field specified.
* Arguments: (Standard Action Routine args) * Arguments: (Standard Action Routine args)
* Returns: none. * Returns: none.
*/ */
/* ARGSUSED */ /* ARGSUSED */
void void
ModifySVEntry(Widget w, XEvent *event, String *params, Cardinal *num_params) ModifySVEntry(Widget w, XEvent *event, String *params, Cardinal *num_params)
{ {
Widget new, old; Widget new, old;
char msg[BUFSIZ]; char msg[BUFSIZ];
if (*num_params != 1) { if (*num_params != 1) {
strcpy(msg, strcpy(msg,
res_labels[21]); res_labels[21]);
SetMessage(global_screen_data.info_label, msg); SetMessage(global_screen_data.info_label, msg);
return; return;
} }
switch (params[0][0]) { switch (params[0][0]) {
case 'r': case 'r':
case 'R': case 'R':
@ -127,11 +127,11 @@ ModifySVEntry(Widget w, XEvent *event, String *params, Cardinal *num_params)
old = global_screen_data.res_text; old = global_screen_data.res_text;
break; break;
default: default:
sprintf(msg, res_labels[22]); snprintf(msg, sizeof(msg), res_labels[22]);
SetMessage(global_screen_data.info_label, msg); SetMessage(global_screen_data.info_label, msg);
return; return;
} }
_SetField(new, old); _SetField(new, old);
} }
@ -152,26 +152,26 @@ _SetField(Widget new, Widget old)
{ {
Arg args[2]; Arg args[2];
Pixel new_border, old_border, old_bg; Pixel new_border, old_border, old_bg;
if (!XtIsSensitive(new)) { if (!XtIsSensitive(new)) {
#ifdef XKB #ifdef XKB
/* Don't set field to an inactive Widget. */ /* Don't set field to an inactive Widget. */
XkbStdBell(XtDisplay(old), XtWindow(new), 0, XkbBI_InvalidLocation); XkbStdBell(XtDisplay(old), XtWindow(new), 0, XkbBI_InvalidLocation);
#else #else
XBell(XtDisplay(old), 0); /* Don't set field to an inactive Widget. */ XBell(XtDisplay(old), 0); /* Don't set field to an inactive Widget. */
#endif #endif
return; return;
} }
XtSetKeyboardFocus(XtParent(new), new); XtSetKeyboardFocus(XtParent(new), new);
XtSetArg(args[0], XtNborderColor, &old_border); XtSetArg(args[0], XtNborderColor, &old_border);
XtSetArg(args[1], XtNbackground, &old_bg); XtSetArg(args[1], XtNbackground, &old_bg);
XtGetValues(new, args, TWO); XtGetValues(new, args, TWO);
XtSetArg(args[0], XtNborderColor, &new_border); XtSetArg(args[0], XtNborderColor, &new_border);
XtGetValues(old, args, ONE); XtGetValues(old, args, ONE);
if (old_border != old_bg) /* Colors are already correct, return. */ if (old_border != old_bg) /* Colors are already correct, return. */
return; return;
@ -196,12 +196,12 @@ CreateSetValuesPopup(Widget parent, ScreenData *scr_data)
Widget res_label; Widget res_label;
Arg args[10]; Arg args[10];
Cardinal num_args; Cardinal num_args;
scr_data->set_values_popup = XtCreatePopupShell("setValuesPopup", scr_data->set_values_popup = XtCreatePopupShell("setValuesPopup",
transientShellWidgetClass, transientShellWidgetClass,
parent, NULL, ZERO); parent, NULL, ZERO);
form = XtCreateManagedWidget("form", formWidgetClass, form = XtCreateManagedWidget("form", formWidgetClass,
scr_data->set_values_popup, NULL, ZERO); scr_data->set_values_popup, NULL, ZERO);
num_args = 0; num_args = 0;
@ -217,7 +217,7 @@ CreateSetValuesPopup(Widget parent, ScreenData *scr_data)
num_args = 0; num_args = 0;
XtSetArg(args[num_args], XtNfromVert, label); num_args++; XtSetArg(args[num_args], XtNfromVert, label); num_args++;
XtSetArg(args[num_args], XtNfromHoriz, res_label); num_args++; XtSetArg(args[num_args], XtNfromHoriz, res_label); num_args++;
scr_data->res_text = XtCreateManagedWidget("resourceText", scr_data->res_text = XtCreateManagedWidget("resourceText",
asciiTextWidgetClass, asciiTextWidgetClass,
form, args, num_args); form, args, num_args);
@ -229,13 +229,13 @@ CreateSetValuesPopup(Widget parent, ScreenData *scr_data)
num_args = 0; num_args = 0;
XtSetArg(args[num_args], XtNfromHoriz, res_label); num_args++; XtSetArg(args[num_args], XtNfromHoriz, res_label); num_args++;
XtSetArg(args[num_args], XtNfromVert, scr_data->res_text); num_args++; XtSetArg(args[num_args], XtNfromVert, scr_data->res_text); num_args++;
scr_data->val_text = XtCreateManagedWidget("valueText", scr_data->val_text = XtCreateManagedWidget("valueText",
asciiTextWidgetClass, asciiTextWidgetClass,
form, args, num_args); form, args, num_args);
num_args = 0; num_args = 0;
XtSetArg(args[num_args], XtNfromVert, scr_data->val_text); num_args++; XtSetArg(args[num_args], XtNfromVert, scr_data->val_text); num_args++;
do_it = XtCreateManagedWidget("setValues", commandWidgetClass, do_it = XtCreateManagedWidget("setValues", commandWidgetClass,
form, args, num_args); form, args, num_args);
num_args = 0; num_args = 0;
@ -287,20 +287,20 @@ DoSetValues(Widget w, XtPointer junk, XtPointer garbage)
res_labels[23]); res_labels[23]);
return; return;
} }
XtSetArg(args[0], XtNstring, &res_name); XtSetArg(args[0], XtNstring, &res_name);
XtGetValues(global_screen_data.res_text, args, ONE); XtGetValues(global_screen_data.res_text, args, ONE);
XtSetArg(args[0], XtNstring, &res_value); XtSetArg(args[0], XtNstring, &res_value);
XtGetValues(global_screen_data.val_text, args, ONE); XtGetValues(global_screen_data.val_text, args, ONE);
_XEditResResetStream(stream); _XEditResResetStream(stream);
_XEditResPutString8(stream, res_name); _XEditResPutString8(stream, res_name);
_XEditResPutString8(stream, XtRString); _XEditResPutString8(stream, XtRString);
_XEditResPutString8(stream, res_value); _XEditResPutString8(stream, res_value);
_XEditResPut16(stream, global_tree_info->num_nodes); _XEditResPut16(stream, global_tree_info->num_nodes);
for (i = 0; i < global_tree_info->num_nodes; i++) for (i = 0; i < global_tree_info->num_nodes; i++)
InsertWidgetFromNode(stream, global_tree_info->active_nodes[i]); InsertWidgetFromNode(stream, global_tree_info->active_nodes[i]);
SetCommand(w, LocalSetValues, NULL); SetCommand(w, LocalSetValues, NULL);
@ -317,5 +317,5 @@ DoSetValues(Widget w, XtPointer junk, XtPointer garbage)
static void static void
CancelSetValues(Widget w, XtPointer junk, XtPointer garbage) CancelSetValues(Widget w, XtPointer junk, XtPointer garbage)
{ {
XtPopdown(XtParent(XtParent(w))); XtPopdown(XtParent(XtParent(w)));
} }

View File

@ -39,11 +39,11 @@ in this Software without prior written authorization from The Open Group.
#include "editresP.h" #include "editresP.h"
static WNode * FindWidgetFromWindowGivenNode ( WNode * node, Window win ); static WNode * FindWidgetFromWindowGivenNode ( WNode * node, Window win );
static WidgetResources * ParseResources ( GetResourcesInfo * info, static WidgetResources * ParseResources ( GetResourcesInfo * info,
char **error ); char **error );
static int CompareResourceEntries ( const void *e1, static int CompareResourceEntries ( const void *e1,
const void *e2 ); const void *e2 );
static void AddResource ( ResourceInfo * res_info, static void AddResource ( ResourceInfo * res_info,
WidgetResourceInfo * resource ); WidgetResourceInfo * resource );
static void FreeResources ( WidgetResources * resources ); static void FreeResources ( WidgetResources * resources );
@ -144,7 +144,7 @@ AddString(char ** str, char *add)
ptr = *str + len_str; ptr = *str + len_str;
strcpy(ptr, add); strcpy(ptr, add);
} }
/* Function Name: FindNode /* Function Name: FindNode
* Description: Finds a node give the top node, and a node id number. * Description: Finds a node give the top node, and a node id number.
* Arguments: top_node - the top node. * Arguments: top_node - the top node.
@ -155,7 +155,7 @@ AddString(char ** str, char *add)
WNode * WNode *
FindNode(WNode *top_node, unsigned long *ids, Cardinal number) FindNode(WNode *top_node, unsigned long *ids, Cardinal number)
{ {
int i, j; Cardinal i, j;
WNode *node; WNode *node;
if (top_node == NULL) if (top_node == NULL)
@ -176,7 +176,7 @@ FindNode(WNode *top_node, unsigned long *ids, Cardinal number)
} }
if (!found_it) if (!found_it)
return(NULL); return(NULL);
} }
return(node); return(node);
} }
@ -187,7 +187,7 @@ FindNode(WNode *top_node, unsigned long *ids, Cardinal number)
* Returns: node - the node corrosponding to this widget. * Returns: node - the node corrosponding to this widget.
*/ */
WNode * WNode *
FindWidgetFromWindow(TreeInfo *tree_info, Window win) FindWidgetFromWindow(TreeInfo *tree_info, Window win)
{ {
if (tree_info == NULL) if (tree_info == NULL)
@ -206,7 +206,7 @@ FindWidgetFromWindow(TreeInfo *tree_info, Window win)
static WNode * static WNode *
FindWidgetFromWindowGivenNode(WNode *node, Window win) FindWidgetFromWindowGivenNode(WNode *node, Window win)
{ {
int i; Cardinal i;
WNode * ret_node; WNode * ret_node;
if (node->window == win) if (node->window == win)
@ -237,7 +237,7 @@ HandleXErrors(Display *display, XErrorEvent *error)
} }
if (error->error_code == BadWindow) if (error->error_code == BadWindow)
global_error_code = NO_WINDOW; global_error_code = NO_WINDOW;
else { else {
if (XmuPrintDefaultErrorMessage(display, error, stderr) != 0) if (XmuPrintDefaultErrorMessage(display, error, stderr) != 0)
exit(1); exit(1);
@ -260,7 +260,7 @@ void
_DumpTreeToFile(Widget w, XtPointer tree_ptr, XtPointer filename) _DumpTreeToFile(Widget w, XtPointer tree_ptr, XtPointer filename)
{ {
TreeInfo * tree_info = (TreeInfo *) tree_ptr; TreeInfo * tree_info = (TreeInfo *) tree_ptr;
FILE * fp; FILE * fp;
if (tree_info == NULL) { if (tree_info == NULL) {
SetMessage(global_screen_data.info_label, SetMessage(global_screen_data.info_label,
@ -271,7 +271,7 @@ _DumpTreeToFile(Widget w, XtPointer tree_ptr, XtPointer filename)
if ( (fp = fopen((char *)filename, "w")) == NULL ) { if ( (fp = fopen((char *)filename, "w")) == NULL ) {
char buf[BUFSIZ]; char buf[BUFSIZ];
sprintf(buf, res_labels[24], (char *)filename); snprintf(buf, sizeof(buf), res_labels[24], (char *)filename);
SetMessage(global_screen_data.info_label, buf); SetMessage(global_screen_data.info_label, buf);
return; return;
} }
@ -281,7 +281,7 @@ _DumpTreeToFile(Widget w, XtPointer tree_ptr, XtPointer filename)
} }
/************************************************************ /************************************************************
* *
* The file dialog boxes are handled with this code. * The file dialog boxes are handled with this code.
* *
* It automatically calls the function specified when the * It automatically calls the function specified when the
@ -325,7 +325,7 @@ _PopupFileDialog(Widget w, String str, String default_value,
num_args = 0; num_args = 0;
XtSetArg(args[num_args], XtNlabel, str); num_args++; XtSetArg(args[num_args], XtNlabel, str); num_args++;
XtSetArg(args[num_args], XtNvalue, default_value); num_args++; XtSetArg(args[num_args], XtNvalue, default_value); num_args++;
dialog = XtCreateManagedWidget("dialog", dialogWidgetClass, dialog = XtCreateManagedWidget("dialog", dialogWidgetClass,
shell, args, num_args); shell, args, num_args);
file_info = XtNew(FileDialogInfo); file_info = XtNew(FileDialogInfo);
@ -333,7 +333,7 @@ _PopupFileDialog(Widget w, String str, String default_value,
file_info->func = func; file_info->func = func;
file_info->data = data; file_info->data = data;
if (XSaveContext(XtDisplay(dialog), (Window) dialog, file_dialog_context, if (XSaveContext(XtDisplay(dialog), (Window) dialog, file_dialog_context,
(XPointer) file_info) != 0) { (XPointer) file_info) != 0) {
SetMessage(global_screen_data.info_label, SetMessage(global_screen_data.info_label,
"Error while trying to save Context\nAborting file dialog popup."); "Error while trying to save Context\nAborting file dialog popup.");
@ -391,7 +391,7 @@ PopupCentered(XEvent *event, Widget w, XtGrabKind mode)
Window root, child; Window root, child;
int win_x, win_y; int win_x, win_y;
unsigned int mask; unsigned int mask;
XQueryPointer(XtDisplay(w), XtWindow(w), XQueryPointer(XtDisplay(w), XtWindow(w),
&root, &child, &x, &y, &win_x, &win_y, &mask); &root, &child, &x, &y, &win_x, &win_y, &mask);
} }
@ -406,17 +406,17 @@ PopupCentered(XEvent *event, Widget w, XtGrabKind mode)
height += 2 * b_width; height += 2 * b_width;
x -= ((int) width/2); x -= ((int) width/2);
if (x < 0) if (x < 0)
x = 0; x = 0;
if ( x > (max_x = (int) (XtScreen(w)->width - width)) ) if ( x > (max_x = (int) (XtScreen(w)->width - width)) )
x = max_x; x = max_x;
y -= ( (Position) height/2 ); y -= ( (Position) height/2 );
if (y < 0) if (y < 0)
y = 0; y = 0;
if ( y > (max_y = (int) (XtScreen(w)->height - height)) ) if ( y > (max_y = (int) (XtScreen(w)->height - height)) )
y = max_y; y = max_y;
num_args = 0; num_args = 0;
XtSetArg(args[num_args], XtNx, x); num_args++; XtSetArg(args[num_args], XtNx, x); num_args++;
XtSetArg(args[num_args], XtNy, y); num_args++; XtSetArg(args[num_args], XtNy, y); num_args++;
@ -435,7 +435,7 @@ PopupCentered(XEvent *event, Widget w, XtGrabKind mode)
/* ARGSUSED */ /* ARGSUSED */
void void
_PopdownFileDialog(Widget w, XtPointer client_data, XtPointer junk) _PopdownFileDialog(Widget w, XtPointer client_data, XtPointer junk)
{ {
Widget dialog = XtParent(w); Widget dialog = XtParent(w);
@ -444,11 +444,11 @@ _PopdownFileDialog(Widget w, XtPointer client_data, XtPointer junk)
if (XFindContext(XtDisplay(dialog), (Window) dialog, file_dialog_context, if (XFindContext(XtDisplay(dialog), (Window) dialog, file_dialog_context,
&file_info_ptr) == XCNOENT) { &file_info_ptr) == XCNOENT) {
SetMessage(global_screen_data.info_label, SetMessage(global_screen_data.info_label,
"Error while trying to find Context\nAborting..."); "Error while trying to find Context\nAborting...");
} }
(void) XDeleteContext(XtDisplay(dialog), (Window)dialog, (void) XDeleteContext(XtDisplay(dialog), (Window)dialog,
file_dialog_context); file_dialog_context);
file_info = (FileDialogInfo *) file_info_ptr; file_info = (FileDialogInfo *) file_info_ptr;
@ -514,16 +514,16 @@ HandleGetResources(Event *event)
for (i = 0; i < (int)get_event->num_entries; i++) { for (i = 0; i < (int)get_event->num_entries; i++) {
node = FindNode(global_tree_info->top_node, node = FindNode(global_tree_info->top_node,
get_event->info[i].widgets.ids, get_event->info[i].widgets.ids,
get_event->info[i].widgets.num_widgets); get_event->info[i].widgets.num_widgets);
if (node == NULL) { if (node == NULL) {
sprintf(buf, res_labels[16]); snprintf(buf, sizeof(buf), res_labels[16]);
AddString(&errors, buf); AddString(&errors, buf);
continue; continue;
} }
if (node->resources != NULL) if (node->resources != NULL)
FreeResources(node->resources); FreeResources(node->resources);
if (!get_event->info[i].error) { if (!get_event->info[i].error) {
@ -563,7 +563,7 @@ CreateResourceBox(WNode *node, char **errors)
if (resources->num_normal > 0) { if (resources->num_normal > 0) {
names = (char **) XtMalloc(sizeof(char *) * names = (char **) XtMalloc(sizeof(char *) *
(resources->num_normal + 1)); (resources->num_normal + 1));
for (i = 0 ; i < resources->num_normal ; i++) for (i = 0 ; i < resources->num_normal ; i++)
names[i] = resources->normal[i].name; names[i] = resources->normal[i].name;
names[i] = NULL; names[i] = NULL;
} }
@ -573,8 +573,8 @@ CreateResourceBox(WNode *node, char **errors)
if (resources->num_constraint > 0) { if (resources->num_constraint > 0) {
cons_names = (char **) XtMalloc(sizeof(char *) * cons_names = (char **) XtMalloc(sizeof(char *) *
(resources->num_constraint + 1)); (resources->num_constraint + 1));
for (i = 0 ; i < resources->num_constraint ; i++) for (i = 0 ; i < resources->num_constraint ; i++)
cons_names[i] = resources->constraint[i].name; cons_names[i] = resources->constraint[i].name;
cons_names[i] = NULL; cons_names[i] = NULL;
} }
@ -592,15 +592,15 @@ CreateResourceBox(WNode *node, char **errors)
* Returns: The resource information. * Returns: The resource information.
*/ */
static WidgetResources * static WidgetResources *
ParseResources(GetResourcesInfo *info, char **error) ParseResources(GetResourcesInfo *info, char **error)
{ {
WidgetResources * resources; WidgetResources * resources;
WidgetResourceInfo * normal; WidgetResourceInfo * normal;
int i; int i;
resources = (WidgetResources *) XtMalloc(sizeof(WidgetResources)); resources = (WidgetResources *) XtMalloc(sizeof(WidgetResources));
/* /*
* Allocate enough space for both the normal and constraint resources, * Allocate enough space for both the normal and constraint resources,
* then add the normal resources from the top, and the constraint resources * then add the normal resources from the top, and the constraint resources
@ -608,7 +608,7 @@ ParseResources(GetResourcesInfo *info, char **error)
* that there is no overlap. * that there is no overlap.
*/ */
resources->normal = (WidgetResourceInfo *) resources->normal = (WidgetResourceInfo *)
XtMalloc(sizeof(WidgetResourceInfo) * info->num_resources); XtMalloc(sizeof(WidgetResourceInfo) * info->num_resources);
normal = resources->normal; normal = resources->normal;
@ -620,7 +620,7 @@ ParseResources(GetResourcesInfo *info, char **error)
switch((int) info->res_info[i].res_type) { switch((int) info->res_info[i].res_type) {
case NormalResource: case NormalResource:
resources->num_normal++; resources->num_normal++;
AddResource(info->res_info + i, normal++); AddResource(info->res_info + i, normal++);
break; break;
case ConstraintResource: case ConstraintResource:
resources->num_constraint++; resources->num_constraint++;
@ -629,8 +629,8 @@ ParseResources(GetResourcesInfo *info, char **error)
default: default:
{ {
char buf[BUFSIZ]; char buf[BUFSIZ];
sprintf(buf, "Unknown resource type %d\n", snprintf(buf, sizeof(buf), "Unknown resource type %d\n",
info->res_info[i].res_type); info->res_info[i].res_type);
AddString(error, buf); AddString(error, buf);
} }
break; break;
@ -638,7 +638,7 @@ ParseResources(GetResourcesInfo *info, char **error)
} }
/* /*
* Sort the resources alphabetically. * Sort the resources alphabetically.
*/ */
qsort(resources->normal, resources->num_normal, qsort(resources->normal, resources->num_normal,
@ -661,10 +661,10 @@ ParseResources(GetResourcesInfo *info, char **error)
* Returns: an integer >, < or = 0. * Returns: an integer >, < or = 0.
*/ */
static int static int
CompareResourceEntries(const void *e1, const void *e2) CompareResourceEntries(const void *e1, const void *e2)
{ {
return (strcmp(((WidgetResourceInfo *)e1)->name, return (strcmp(((WidgetResourceInfo *)e1)->name,
((WidgetResourceInfo *)e2)->name)); ((WidgetResourceInfo *)e2)->name));
} }
@ -719,7 +719,7 @@ FreeResources(WidgetResources *resources)
XFree((char *)resources); XFree((char *)resources);
} }
/* Function Name: CheckDatabase /* Function Name: CheckDatabase
* Description: Checks to see if the node is in the database. * Description: Checks to see if the node is in the database.
@ -758,12 +758,12 @@ Quarkify(char **list, char *ptr)
quarks = (XrmQuarkList) XtMalloc(sizeof(XrmQuark) * i); quarks = (XrmQuarkList) XtMalloc(sizeof(XrmQuark) * i);
for (tlist = list, tquarks = quarks; *tlist != NULL; tlist++, tquarks++) for (tlist = list, tquarks = quarks; *tlist != NULL; tlist++, tquarks++)
*tquarks = XrmStringToQuark(*tlist); *tquarks = XrmStringToQuark(*tlist);
if (ptr != NULL) if (ptr != NULL)
*tquarks++ = XrmStringToQuark(ptr); *tquarks++ = XrmStringToQuark(ptr);
*tquarks = NULLQUARK; *tquarks = NULLQUARK;
return(quarks); return(quarks);
} }
@ -780,11 +780,11 @@ void
ExecuteOverAllNodes(WNode *top_node, void (*func)(WNode *, XtPointer), ExecuteOverAllNodes(WNode *top_node, void (*func)(WNode *, XtPointer),
XtPointer data) XtPointer data)
{ {
int i; Cardinal i;
(*func)(top_node, data); (*func)(top_node, data);
for (i = 0; i < top_node->num_children; i++) for (i = 0; i < top_node->num_children; i++)
ExecuteOverAllNodes(top_node->children[i], func, data); ExecuteOverAllNodes(top_node->children[i], func, data);
} }
@ -806,7 +806,7 @@ InsertWidgetFromNode(ProtocolStream *stream, WNode *node)
for (temp = node, i = 0; temp != NULL; temp = temp->parent, i++) {} for (temp = node, i = 0; temp != NULL; temp = temp->parent, i++) {}
num_widgets = i; num_widgets = i;
widget_list = (unsigned long *) widget_list = (unsigned long *)
XtMalloc(sizeof(unsigned long) * num_widgets); XtMalloc(sizeof(unsigned long) * num_widgets);
/* /*
@ -814,13 +814,13 @@ InsertWidgetFromNode(ProtocolStream *stream, WNode *node)
* Make sure that they are inserted in the list from parent -> child. * Make sure that they are inserted in the list from parent -> child.
*/ */
for (i--, temp = node; temp != NULL; temp = temp->parent, i--) for (i--, temp = node; temp != NULL; temp = temp->parent, i--)
widget_list[i] = temp->id; widget_list[i] = temp->id;
_XEditResPut16(stream, num_widgets); /* insert number of widgets. */ _XEditResPut16(stream, num_widgets); /* insert number of widgets. */
for (i = 0; i < num_widgets; i++) /* insert Widgets themselves. */ for (i = 0; i < num_widgets; i++) /* insert Widgets themselves. */
_XEditResPut32(stream, widget_list[i]); _XEditResPut32(stream, widget_list[i]);
XtFree((char *)widget_list); XtFree((char *)widget_list);
} }
@ -830,12 +830,12 @@ InsertWidgetFromNode(ProtocolStream *stream, WNode *node)
* Returns: message to show. * Returns: message to show.
*/ */
char * char *
GetFailureMessage(ProtocolStream *stream) GetFailureMessage(ProtocolStream *stream)
{ {
char * return_str; char * return_str;
if (_XEditResGetString8(stream, &return_str)) if (_XEditResGetString8(stream, &return_str))
return(return_str); return(return_str);
return(XtNewString(res_labels[35])); return(XtNewString(res_labels[35]));
@ -848,23 +848,23 @@ GetFailureMessage(ProtocolStream *stream)
* Returns: message to show. * Returns: message to show.
*/ */
char * char *
ProtocolFailure(ProtocolStream *stream) ProtocolFailure(ProtocolStream *stream)
{ {
char buf[BUFSIZ]; char buf[BUFSIZ];
unsigned char version; unsigned char version;
char* old_version_string; char* old_version_string;
if (!_XEditResGet8(stream, &version)) if (!_XEditResGet8(stream, &version))
return(XtNewString(res_labels[35])); return(XtNewString(res_labels[35]));
switch ((int)version) { switch ((int)version) {
case PROTOCOL_VERSION_ONE_POINT_ZERO: old_version_string = "1.0"; break; case PROTOCOL_VERSION_ONE_POINT_ZERO: old_version_string = "1.0"; break;
default: old_version_string = "1.0"; default: old_version_string = "1.0";
} }
sprintf(buf, res_labels[36], snprintf(buf, sizeof(buf), res_labels[36],
CURRENT_PROTOCOL_VERSION_STRING, old_version_string); CURRENT_PROTOCOL_VERSION_STRING, old_version_string);
return(XtNewString(buf)); return(XtNewString(buf));
} }

View File

@ -32,20 +32,20 @@ in this Software without prior written authorization from The Open Group.
#include <X11/StringDefs.h> /* Get standard string definations. */ #include <X11/StringDefs.h> /* Get standard string definations. */
#include <X11/Xaw/AsciiText.h> #include <X11/Xaw/AsciiText.h>
#include <X11/Xaw/Box.h> #include <X11/Xaw/Box.h>
#include <X11/Xaw/Cardinals.h> #include <X11/Xaw/Cardinals.h>
#include <X11/Xaw/Label.h> #include <X11/Xaw/Label.h>
#include <X11/Xaw/List.h> #include <X11/Xaw/List.h>
#include <X11/Xaw/MenuButton.h> #include <X11/Xaw/MenuButton.h>
#include <X11/Xaw/Paned.h> #include <X11/Xaw/Paned.h>
#include <X11/Xaw/Panner.h> #include <X11/Xaw/Panner.h>
#include <X11/Xaw/Porthole.h> #include <X11/Xaw/Porthole.h>
#include <X11/Xaw/SmeBSB.h> #include <X11/Xaw/SmeBSB.h>
#include <X11/Xaw/SmeLine.h> #include <X11/Xaw/SmeLine.h>
#include <X11/Xaw/SimpleMenu.h> #include <X11/Xaw/SimpleMenu.h>
#include <X11/Xaw/Toggle.h> #include <X11/Xaw/Toggle.h>
#include <X11/Xaw/Tree.h> #include <X11/Xaw/Tree.h>
#include <X11/Xaw/Viewport.h> #include <X11/Xaw/Viewport.h>
#include "editresP.h" #include "editresP.h"
@ -60,10 +60,10 @@ static void CreateCommandMenu ( Widget parent, String toolkit );
static void CreateTreeCommandMenu ( Widget parent, String toolkit ); static void CreateTreeCommandMenu ( Widget parent, String toolkit );
static void CreateResourceNameForm ( Widget parent, WNode * node ); static void CreateResourceNameForm ( Widget parent, WNode * node );
static void SetToggleGroupLeaders ( WNode * node ); static void SetToggleGroupLeaders ( WNode * node );
static void MakeBoxLookNice ( Widget dot, Widget star, Widget any, static void MakeBoxLookNice ( Widget dot, Widget star, Widget any,
Widget single, Widget name, Widget class, Widget single, Widget name, Widget class,
int endbox ); int endbox );
static void CreateLists ( Widget parent, WNode * node, char **names, static void CreateLists ( Widget parent, WNode * node, char **names,
char **cons_names ); char **cons_names );
static void CreateValueWidget ( Widget parent, WNode * node ); static void CreateValueWidget ( Widget parent, WNode * node );
static void PopupOnNode ( WNode * node, Widget shell ); static void PopupOnNode ( WNode * node, Widget shell );
@ -133,21 +133,21 @@ static XtResource resources[] = {
#undef Offset #undef Offset
void void
RebuildMenusAndLabel(String toolkit) RebuildMenusAndLabel(String toolkit)
{ {
if (strcmp(global_effective_toolkit, toolkit)) { if (strcmp(global_effective_toolkit, toolkit)) {
CreateCommandMenu(box, toolkit); CreateCommandMenu(box, toolkit);
CreateTreeCommandMenu(box, toolkit); CreateTreeCommandMenu(box, toolkit);
XtDestroyWidget(global_screen_data.info_label); XtDestroyWidget(global_screen_data.info_label);
global_screen_data.info_label = XtCreateManagedWidget(toolkit, global_screen_data.info_label = XtCreateManagedWidget(toolkit,
labelWidgetClass, labelWidgetClass,
hPane, NULL, ZERO); hPane, NULL, ZERO);
/* get the new toolkit label application resources for info_label */ /* get the new toolkit label application resources for info_label */
XtGetApplicationResources(global_screen_data.info_label, XtGetApplicationResources(global_screen_data.info_label,
res_labels, resources, res_labels, resources,
XtNumber(resources), NULL, 0); XtNumber(resources), NULL, 0);
global_effective_toolkit = toolkit; global_effective_toolkit = toolkit;
} }
} }
@ -160,7 +160,7 @@ RebuildMenusAndLabel(String toolkit)
* Returns: none. * Returns: none.
*/ */
void void
BuildWidgetTree(Widget parent) BuildWidgetTree(Widget parent)
{ {
Widget paned, porthole, panner; Widget paned, porthole, panner;
@ -177,9 +177,9 @@ BuildWidgetTree(Widget parent)
* Allow the panner and porthole to talk to each other. * Allow the panner and porthole to talk to each other.
*/ */
XtAddCallback(porthole, XtAddCallback(porthole,
XtNreportCallback, PortholeCallback, (XtPointer) panner); XtNreportCallback, PortholeCallback, (XtPointer) panner);
XtAddCallback(panner, XtAddCallback(panner,
XtNreportCallback, PannerCallback, (XtPointer) porthole); XtNreportCallback, PannerCallback, (XtPointer) porthole);
global_tree_parent = porthole; global_tree_parent = porthole;
@ -191,7 +191,7 @@ BuildWidgetTree(Widget parent)
/* Function Name: CreateTopArea /* Function Name: CreateTopArea
* Description: Creates the top part of the display * Description: Creates the top part of the display
* Arguments: parent - widget to put this menu bar into. * Arguments: parent - widget to put this menu bar into.
* Returns: none. * Returns: none.
*/ */
@ -208,10 +208,10 @@ CreateTopArea(Widget parent)
hPane = XtCreateManagedWidget("hPane",panedWidgetClass, parent, NULL,ZERO); hPane = XtCreateManagedWidget("hPane",panedWidgetClass, parent, NULL,ZERO);
{ {
panner = XtCreateManagedWidget("panner", pannerWidgetClass, panner = XtCreateManagedWidget("panner", pannerWidgetClass,
hPane, NULL, ZERO); hPane, NULL, ZERO);
global_screen_data.info_label = XtCreateManagedWidget("xt", global_screen_data.info_label = XtCreateManagedWidget("xt",
labelWidgetClass, labelWidgetClass,
hPane, NULL,ZERO); hPane, NULL,ZERO);
@ -219,7 +219,7 @@ CreateTopArea(Widget parent)
XtGetApplicationResources(global_screen_data.info_label, XtGetApplicationResources(global_screen_data.info_label,
res_labels, resources, res_labels, resources,
XtNumber(resources), NULL, 0); XtNumber(resources), NULL, 0);
} }
return(panner); return(panner);
@ -237,7 +237,7 @@ CreateTopArea(Widget parent)
void void
SetEntriesSensitive(Widget *entries, int num, Boolean sensitive) SetEntriesSensitive(Widget *entries, int num, Boolean sensitive)
{ {
int i; for (i=0; i<num; i++) XtSetSensitive(entries[i], sensitive); int i; for (i=0; i<num; i++) XtSetSensitive(entries[i], sensitive);
} }
@ -260,7 +260,7 @@ CreateCommandMenu(Widget parent, String toolkit)
Arg args[1]; Arg args[1];
if (cmenu) { XtDestroyWidget(cmenu); CM_set_insensitive = False; } if (cmenu) { XtDestroyWidget(cmenu); CM_set_insensitive = False; }
else else
cbutton = XtCreateManagedWidget("commands", menuButtonWidgetClass, cbutton = XtCreateManagedWidget("commands", menuButtonWidgetClass,
parent, NULL, ZERO); parent, NULL, ZERO);
@ -270,7 +270,7 @@ CreateCommandMenu(Widget parent, String toolkit)
cmenu = XtCreatePopupShell(toolkit, simpleMenuWidgetClass, cbutton, cmenu = XtCreatePopupShell(toolkit, simpleMenuWidgetClass, cbutton,
NULL, ZERO); NULL, ZERO);
CM_entries[0] = XtCreateManagedWidget("sendTree", smeBSBObjectClass,cmenu, CM_entries[0] = XtCreateManagedWidget("sendTree", smeBSBObjectClass,cmenu,
NULL, ZERO); NULL, ZERO);
XtAddCallback(CM_entries[0], XtNcallback, SendTree, (XtPointer) TRUE); XtAddCallback(CM_entries[0], XtNcallback, SendTree, (XtPointer) TRUE);
@ -279,19 +279,19 @@ CreateCommandMenu(Widget parent, String toolkit)
NULL, ZERO); NULL, ZERO);
XtAddCallback(CM_entries[1], XtNcallback, SendTree, (XtPointer) FALSE); XtAddCallback(CM_entries[1], XtNcallback, SendTree, (XtPointer) FALSE);
CM_entries[2] = XtCreateManagedWidget("dumpTreeToFile", CM_entries[2] = XtCreateManagedWidget("dumpTreeToFile",
smeBSBObjectClass,cmenu, smeBSBObjectClass,cmenu,
NULL, ZERO); NULL, ZERO);
XtAddCallback(CM_entries[2], XtNcallback, DumpTreeToFile, NULL); XtAddCallback(CM_entries[2], XtNcallback, DumpTreeToFile, NULL);
CM_entries[3] = XtCreateManagedWidget("line", smeLineObjectClass, cmenu, CM_entries[3] = XtCreateManagedWidget("line", smeLineObjectClass, cmenu,
NULL, ZERO); NULL, ZERO);
CM_entries[4]= XtCreateManagedWidget("getResourceList", CM_entries[4]= XtCreateManagedWidget("getResourceList",
smeBSBObjectClass,cmenu, smeBSBObjectClass,cmenu,
NULL, ZERO); NULL, ZERO);
XtAddCallback(CM_entries[4], XtNcallback, GetResourceList, NULL); XtAddCallback(CM_entries[4], XtNcallback, GetResourceList, NULL);
CM_entries[5] = XtCreateManagedWidget("setValues", smeBSBObjectClass, CM_entries[5] = XtCreateManagedWidget("setValues", smeBSBObjectClass,
cmenu, cmenu,
NULL, ZERO); NULL, ZERO);
XtAddCallback(CM_entries[5], XtNcallback, InitSetValues, NULL); XtAddCallback(CM_entries[5], XtNcallback, InitSetValues, NULL);
@ -303,7 +303,7 @@ CreateCommandMenu(Widget parent, String toolkit)
NULL, ZERO); NULL, ZERO);
XtAddCallback(CM_entries[7], XtNcallback, Quit, NULL); XtAddCallback(CM_entries[7], XtNcallback, Quit, NULL);
if (CM_set_insensitive) if (CM_set_insensitive)
SetEntriesSensitive(&CM_entries[CM_OFFSET], CM_NUM, False); SetEntriesSensitive(&CM_entries[CM_OFFSET], CM_NUM, False);
} }
@ -395,7 +395,7 @@ CreateTreeCommandMenu(Widget parent, String toolkit)
TM_entries[i] = XtCreateManagedWidget(tree_menu[i].name, class, tmenu, TM_entries[i] = XtCreateManagedWidget(tree_menu[i].name, class, tmenu,
NULL, ZERO); NULL, ZERO);
if (func != NULL) if (func != NULL)
XtAddCallback(TM_entries[i], XtNcallback, func,tree_menu[i].data); XtAddCallback(TM_entries[i], XtNcallback, func,tree_menu[i].data);
} }
if (TM_set_insensitive) SetEntriesSensitive(&TM_entries[TM_OFFSET], if (TM_set_insensitive) SetEntriesSensitive(&TM_entries[TM_OFFSET],
@ -438,9 +438,9 @@ void
LayoutTree(Widget tree) LayoutTree(Widget tree)
{ {
Arg args[1]; Arg args[1];
XawTreeForceLayout(tree); XawTreeForceLayout(tree);
XtMapWidget(tree); XtMapWidget(tree);
XtSetArg(args[0], XtNbackgroundPixmap, old_pixmap); XtSetArg(args[0], XtNbackgroundPixmap, old_pixmap);
XtSetValues(XtParent(tree), args, ONE); XtSetValues(XtParent(tree), args, ONE);
@ -458,8 +458,8 @@ LayoutTree(Widget tree)
* Description: Creates the widgets that make up the resource box. * Description: Creates the widgets that make up the resource box.
* Arguments: node - the widget node. * Arguments: node - the widget node.
* names - the list of names that make up the normal resources. * names - the list of names that make up the normal resources.
* cons_names - the list of names that make up * cons_names - the list of names that make up
* the constraint resources. * the constraint resources.
* Returns: none. * Returns: none.
*/ */
@ -483,16 +483,16 @@ CreateResourceBoxWidgets(WNode *node, char **names, char **cons_names)
XtAddCallback(res_box->shell, XtNdestroyCallback, XtAddCallback(res_box->shell, XtNdestroyCallback,
FreeResBox, (XtPointer) node); FreeResBox, (XtPointer) node);
pane = XtCreateManagedWidget("pane", panedWidgetClass, pane = XtCreateManagedWidget("pane", panedWidgetClass,
res_box->shell, NULL, ZERO); res_box->shell, NULL, ZERO);
viewport = XtCreateManagedWidget("mainViewport", viewportWidgetClass, viewport = XtCreateManagedWidget("mainViewport", viewportWidgetClass,
pane, NULL, 0); pane, NULL, 0);
pane_child = XtCreateManagedWidget("pane", panedWidgetClass, pane_child = XtCreateManagedWidget("pane", panedWidgetClass,
viewport, NULL, ZERO); viewport, NULL, ZERO);
res_box->res_label = XtCreateManagedWidget("resourceLabel", res_box->res_label = XtCreateManagedWidget("resourceLabel",
labelWidgetClass, labelWidgetClass,
pane_child, NULL, ZERO); pane_child, NULL, ZERO);
CreateResourceNameForm(pane_child, node); CreateResourceNameForm(pane_child, node);
@ -565,9 +565,9 @@ CreateResourceNameForm(Widget parent, WNode *node)
num_args = 0; num_args = 0;
XtSetArg(args[num_args], XtNfromHoriz, name); num_args++; XtSetArg(args[num_args], XtNfromHoriz, name); num_args++;
XtSetArg(args[num_args], XtNradioData, "."); num_args++; XtSetArg(args[num_args], XtNradioData, "."); num_args++;
dot = XtCreateManagedWidget("dot", toggleWidgetClass, dot = XtCreateManagedWidget("dot", toggleWidgetClass,
form, args, num_args); form, args, num_args);
XtAddCallback(dot, XtNcallback, XtAddCallback(dot, XtNcallback,
ActivateWidgetsAndSetResourceString,(XtPointer) node); ActivateWidgetsAndSetResourceString,(XtPointer) node);
num_args = 0; num_args = 0;
@ -575,9 +575,9 @@ CreateResourceNameForm(Widget parent, WNode *node)
XtSetArg(args[num_args], XtNfromVert, dot); num_args++; XtSetArg(args[num_args], XtNfromVert, dot); num_args++;
XtSetArg(args[num_args], XtNradioGroup, dot); num_args++; XtSetArg(args[num_args], XtNradioGroup, dot); num_args++;
XtSetArg(args[num_args], XtNradioData, "*"); num_args++; XtSetArg(args[num_args], XtNradioData, "*"); num_args++;
star = XtCreateManagedWidget("star", toggleWidgetClass, star = XtCreateManagedWidget("star", toggleWidgetClass,
form, args, num_args); form, args, num_args);
XtAddCallback(star,XtNcallback, XtAddCallback(star,XtNcallback,
ActivateWidgetsAndSetResourceString, (XtPointer) node); ActivateWidgetsAndSetResourceString, (XtPointer) node);
if (name_info != NULL) { if (name_info != NULL) {
@ -585,7 +585,7 @@ CreateResourceNameForm(Widget parent, WNode *node)
name_info = name_info->next; name_info = name_info->next;
} }
else else
res_box->name_info = res_box->name_info =
name_info = (NameInfo *) XtMalloc(sizeof(NameInfo)); name_info = (NameInfo *) XtMalloc(sizeof(NameInfo));
name_info->sep_leader = dot; name_info->sep_leader = dot;
@ -597,10 +597,10 @@ CreateResourceNameForm(Widget parent, WNode *node)
new_info->left_dot = dot; new_info->left_dot = dot;
new_info->left_star = star; new_info->left_star = star;
new_info->left_count = 0; new_info->left_count = 0;
if (old_info != NULL) if (old_info != NULL)
old_info->right_count = &(new_info->left_count); old_info->right_count = &(new_info->left_count);
} }
else if (old_info != NULL) else if (old_info != NULL)
old_info->right_count = NULL; old_info->right_count = NULL;
if (old_info != NULL) { if (old_info != NULL) {
@ -608,7 +608,7 @@ CreateResourceNameForm(Widget parent, WNode *node)
old_info->right_star = star; old_info->right_star = star;
XtAddCallback(any, XtNcallback, AnyChosen, (XtPointer) old_info); XtAddCallback(any, XtNcallback, AnyChosen, (XtPointer) old_info);
XtAddCallback(any, XtNdestroyCallback, XtAddCallback(any, XtNdestroyCallback,
FreeClientData, (XtPointer) old_info); FreeClientData, (XtPointer) old_info);
} }
@ -621,7 +621,7 @@ CreateResourceNameForm(Widget parent, WNode *node)
XtSetArg(args[num_args], XtNfromHoriz, dot); num_args++; XtSetArg(args[num_args], XtNfromHoriz, dot); num_args++;
XtSetArg(args[num_args], XtNlabel, names[i]); num_args++; XtSetArg(args[num_args], XtNlabel, names[i]); num_args++;
XtSetArg(args[num_args], XtNradioData, names[i]); num_args++; XtSetArg(args[num_args], XtNradioData, names[i]); num_args++;
name = XtCreateManagedWidget("name", toggleWidgetClass, name = XtCreateManagedWidget("name", toggleWidgetClass,
form, args, num_args); form, args, num_args);
XtAddCallback(name,XtNcallback, XtAddCallback(name,XtNcallback,
ActivateWidgetsAndSetResourceString,(XtPointer) node); ActivateWidgetsAndSetResourceString,(XtPointer) node);
@ -632,7 +632,7 @@ CreateResourceNameForm(Widget parent, WNode *node)
XtSetArg(args[num_args], XtNlabel, classes[i]); num_args++; XtSetArg(args[num_args], XtNlabel, classes[i]); num_args++;
XtSetArg(args[num_args], XtNradioGroup, name); num_args++; XtSetArg(args[num_args], XtNradioGroup, name); num_args++;
XtSetArg(args[num_args], XtNradioData, classes[i]); num_args++; XtSetArg(args[num_args], XtNradioData, classes[i]); num_args++;
class = XtCreateManagedWidget("class", toggleWidgetClass, class = XtCreateManagedWidget("class", toggleWidgetClass,
form,args,num_args); form,args,num_args);
XtAddCallback(class, XtNcallback, XtAddCallback(class, XtNcallback,
ActivateWidgetsAndSetResourceString,(XtPointer) node); ActivateWidgetsAndSetResourceString,(XtPointer) node);
@ -642,7 +642,7 @@ CreateResourceNameForm(Widget parent, WNode *node)
XtSetArg(args[num_args], XtNfromVert, class); num_args++; XtSetArg(args[num_args], XtNfromVert, class); num_args++;
XtSetArg(args[num_args], XtNradioData, "?"); num_args++; XtSetArg(args[num_args], XtNradioData, "?"); num_args++;
XtSetArg(args[num_args], XtNradioGroup, name); num_args++; XtSetArg(args[num_args], XtNradioGroup, name); num_args++;
single = XtCreateManagedWidget("single", toggleWidgetClass, single = XtCreateManagedWidget("single", toggleWidgetClass,
form, args, num_args); form, args, num_args);
XtAddCallback(single,XtNcallback, XtAddCallback(single,XtNcallback,
ActivateWidgetsAndSetResourceString,(XtPointer) node); ActivateWidgetsAndSetResourceString,(XtPointer) node);
@ -652,7 +652,7 @@ CreateResourceNameForm(Widget parent, WNode *node)
XtSetArg(args[num_args], XtNfromVert, single); num_args++; XtSetArg(args[num_args], XtNfromVert, single); num_args++;
XtSetArg(args[num_args], XtNradioGroup, name); num_args++; XtSetArg(args[num_args], XtNradioGroup, name); num_args++;
XtSetArg(args[num_args], XtNradioData, ANY_RADIO_DATA); num_args++; XtSetArg(args[num_args], XtNradioData, ANY_RADIO_DATA); num_args++;
any = XtCreateManagedWidget("any", toggleWidgetClass, any = XtCreateManagedWidget("any", toggleWidgetClass,
form, args, num_args); form, args, num_args);
name_info->name_leader = name; name_info->name_leader = name;
@ -703,7 +703,7 @@ SetToggleGroupLeaders(WNode *node)
* name and class of this object. * name and class of this object.
* Returns: none. * Returns: none.
*/ */
static void static void
MakeBoxLookNice(Widget dot, Widget star, Widget any, Widget single, MakeBoxLookNice(Widget dot, Widget star, Widget any, Widget single,
Widget name, Widget class, int endbox) Widget name, Widget class, int endbox)
@ -736,7 +736,7 @@ MakeBoxLookNice(Widget dot, Widget star, Widget any, Widget single,
XtSetArg(args[num_args], XtNhorizDistance, &(h_dist[2])); num_args++; XtSetArg(args[num_args], XtNhorizDistance, &(h_dist[2])); num_args++;
XtSetArg(args[num_args], XtNwidth, &any_width); num_args++; XtSetArg(args[num_args], XtNwidth, &any_width); num_args++;
XtGetValues(any, args, num_args); XtGetValues(any, args, num_args);
dot_star_width = (width_1 > width_2) ? width_1 : width_2; dot_star_width = (width_1 > width_2) ? width_1 : width_2;
for (i = 1 ; i < MAX_HDIST; i++) { for (i = 1 ; i < MAX_HDIST; i++) {
if (h_dist[i] > h_dist[0]) h_dist[0] = h_dist[i]; if (h_dist[i] > h_dist[0]) h_dist[0] = h_dist[i];
@ -745,11 +745,11 @@ MakeBoxLookNice(Widget dot, Widget star, Widget any, Widget single,
num_args = 0; num_args = 0;
XtSetArg(args[num_args], XtNhorizDistance, h_dist[0]); num_args++; XtSetArg(args[num_args], XtNhorizDistance, h_dist[0]); num_args++;
XtSetValues(any, args, num_args); XtSetValues(any, args, num_args);
/* /*
* Add a new arg, and continue... * Add a new arg, and continue...
*/ */
XtSetArg(args[num_args], XtNwidth, dot_star_width); num_args++; XtSetArg(args[num_args], XtNwidth, dot_star_width); num_args++;
XtSetValues(star, args, num_args); XtSetValues(star, args, num_args);
XtSetValues(dot, args, num_args); XtSetValues(dot, args, num_args);
@ -793,20 +793,20 @@ MakeBoxLookNice(Widget dot, Widget star, Widget any, Widget single,
} }
XtSetArg(args[num_args], XtNwidth, any_width); num_args++; XtSetArg(args[num_args], XtNwidth, any_width); num_args++;
XtSetValues(any, args, num_args); XtSetValues(any, args, num_args);
num_args = 0; num_args = 0;
XtSetArg(args[num_args], XtNwidth, name_class_width); num_args++; XtSetArg(args[num_args], XtNwidth, name_class_width); num_args++;
XtSetArg(args[num_args], XtNhorizDistance, h_dist[0]); num_args++; XtSetArg(args[num_args], XtNhorizDistance, h_dist[0]); num_args++;
XtSetValues(name, args, num_args); XtSetValues(name, args, num_args);
XtSetValues(class, args, num_args); XtSetValues(class, args, num_args);
XtSetValues(single, args, num_args); XtSetValues(single, args, num_args);
} }
/* Function Name: CreateLists /* Function Name: CreateLists
* Description: Creates the list widgets for the normal and constraint * Description: Creates the list widgets for the normal and constraint
* resources * resources
* Arguments: parent - parent of the lists. * Arguments: parent - parent of the lists.
* node - The widget node containing this res box. * node - The widget node containing this res box.
@ -824,9 +824,9 @@ CreateLists(Widget parent, WNode *node, char **names, char **cons_names)
ResourceBoxInfo * res_box = node->resources->res_box; ResourceBoxInfo * res_box = node->resources->res_box;
Arg args[3]; Arg args[3];
(void) XtCreateManagedWidget("namesLabel", labelWidgetClass, (void) XtCreateManagedWidget("namesLabel", labelWidgetClass,
parent, NULL, ZERO); parent, NULL, ZERO);
num_args = 0; num_args = 0;
/* if the first list item is the widget name we want an empty /* if the first list item is the widget name we want an empty
* list. * list.
@ -839,30 +839,30 @@ CreateLists(Widget parent, WNode *node, char **names, char **cons_names)
else { XtSetArg(args[num_args], XtNlist, names); num_args++; } else { XtSetArg(args[num_args], XtNlist, names); num_args++; }
viewport = XtCreateManagedWidget("normalViewport", viewportWidgetClass, viewport = XtCreateManagedWidget("normalViewport", viewportWidgetClass,
parent, NULL, 0); parent, NULL, 0);
res_box->norm_list = XtCreateManagedWidget("namesList", listWidgetClass, res_box->norm_list = XtCreateManagedWidget("namesList", listWidgetClass,
viewport, args, num_args); viewport, args, num_args);
XtAddCallback(res_box->norm_list, XtNcallback, XtAddCallback(res_box->norm_list, XtNcallback,
ResourceListCallback, (XtPointer) node); ResourceListCallback, (XtPointer) node);
XtAddCallback(res_box->norm_list, XtNdestroyCallback, XtAddCallback(res_box->norm_list, XtNdestroyCallback,
FreeClientData, (XtPointer) names); FreeClientData, (XtPointer) names);
if (cons_names != NULL) { if (cons_names != NULL) {
(void) XtCreateManagedWidget("constraintLabel", labelWidgetClass, (void) XtCreateManagedWidget("constraintLabel", labelWidgetClass,
parent, NULL, ZERO); parent, NULL, ZERO);
num_args = 0; num_args = 0;
XtSetArg(args[num_args], XtNlist, cons_names); num_args++; XtSetArg(args[num_args], XtNlist, cons_names); num_args++;
viewport = XtCreateManagedWidget("constraintViewport", viewportWidgetClass, viewport = XtCreateManagedWidget("constraintViewport", viewportWidgetClass,
parent, NULL, 0); parent, NULL, 0);
res_box->cons_list = XtCreateManagedWidget("constraintList", res_box->cons_list = XtCreateManagedWidget("constraintList",
listWidgetClass, listWidgetClass,
viewport, args, num_args); viewport, args, num_args);
XtAddCallback(res_box->cons_list, XtNcallback, XtAddCallback(res_box->cons_list, XtNcallback,
ResourceListCallback, (XtPointer) node); ResourceListCallback, (XtPointer) node);
XtAddCallback(res_box->cons_list, XtNdestroyCallback, XtAddCallback(res_box->cons_list, XtNdestroyCallback,
FreeClientData, (XtPointer) cons_names); FreeClientData, (XtPointer) cons_names);
} }
else else
res_box->cons_list = NULL; res_box->cons_list = NULL;
} }
@ -880,7 +880,7 @@ CreateValueWidget(Widget parent, WNode *node)
Cardinal num_args; Cardinal num_args;
Arg args[10]; Arg args[10];
ResourceBoxInfo * res_box = node->resources->res_box; ResourceBoxInfo * res_box = node->resources->res_box;
form = XtCreateManagedWidget("valueForm", formWidgetClass, form = XtCreateManagedWidget("valueForm", formWidgetClass,
parent, NULL, ZERO); parent, NULL, ZERO);
@ -889,7 +889,7 @@ CreateValueWidget(Widget parent, WNode *node)
XtSetArg(args[num_args], XtNright, XawChainLeft); num_args++; XtSetArg(args[num_args], XtNright, XawChainLeft); num_args++;
XtSetArg(args[num_args], XtNtop, XawChainTop); num_args++; XtSetArg(args[num_args], XtNtop, XawChainTop); num_args++;
XtSetArg(args[num_args], XtNbottom, XawChainBottom); num_args++; XtSetArg(args[num_args], XtNbottom, XawChainBottom); num_args++;
label = XtCreateManagedWidget("valueLabel", labelWidgetClass, label = XtCreateManagedWidget("valueLabel", labelWidgetClass,
form, args, num_args); form, args, num_args);
num_args = 0; num_args = 0;
@ -898,8 +898,8 @@ CreateValueWidget(Widget parent, WNode *node)
XtSetArg(args[num_args], XtNright, XawChainRight); num_args++; XtSetArg(args[num_args], XtNright, XawChainRight); num_args++;
XtSetArg(args[num_args], XtNtop, XawChainTop); num_args++; XtSetArg(args[num_args], XtNtop, XawChainTop); num_args++;
XtSetArg(args[num_args], XtNbottom, XawChainBottom); num_args++; XtSetArg(args[num_args], XtNbottom, XawChainBottom); num_args++;
res_box->value_wid = XtCreateManagedWidget("valueText", res_box->value_wid = XtCreateManagedWidget("valueText",
asciiTextWidgetClass, asciiTextWidgetClass,
form, args, num_args); form, args, num_args);
#ifdef notdef #ifdef notdef
XtAddCallback(XawTextGetSource(res_box->value_wid), XtNcallback, XtAddCallback(XawTextGetSource(res_box->value_wid), XtNcallback,
@ -929,10 +929,10 @@ PopupOnNode(WNode *node, Widget shell)
XtSetArg(args[num_args], XtNheight, &height); num_args++; XtSetArg(args[num_args], XtNheight, &height); num_args++;
XtSetArg(args[num_args], XtNborderWidth, &bw); num_args++; XtSetArg(args[num_args], XtNborderWidth, &bw); num_args++;
XtGetValues(node->widget, args, num_args); XtGetValues(node->widget, args, num_args);
XtTranslateCoords(node->widget, XtTranslateCoords(node->widget,
(Position) (width/2 + bw), (Position) (height/2 + bw), (Position) (width/2 + bw), (Position) (height/2 + bw),
&x, &y); &x, &y);
XtOverrideTranslations XtOverrideTranslations
(shell, XtParseTranslationTable ("<Message>WM_PROTOCOLS: quit()")); (shell, XtParseTranslationTable ("<Message>WM_PROTOCOLS: quit()"));
XtRealizeWidget(shell); XtRealizeWidget(shell);
@ -954,7 +954,7 @@ PopupOnNode(WNode *node, Widget shell)
max_loc = HeightOfScreen(XtScreen(shell)) - (Position) (height + 2 * bw); max_loc = HeightOfScreen(XtScreen(shell)) - (Position) (height + 2 * bw);
if (y > max_loc) if (y > max_loc)
y = max_loc; y = max_loc;
if (y < 0) if (y < 0)
y = 0; y = 0;
num_args = 0; num_args = 0;
@ -1000,7 +1000,7 @@ FreeResBox(Widget w, XtPointer ptr, XtPointer junk)
NameInfo *old_name, *name = node->resources->res_box->name_info; NameInfo *old_name, *name = node->resources->res_box->name_info;
global_resource_box_up = FALSE; global_resource_box_up = FALSE;
XtFree((XtPointer) node->resources->res_box); XtFree((XtPointer) node->resources->res_box);
node->resources->res_box = NULL; node->resources->res_box = NULL;
@ -1008,8 +1008,8 @@ FreeResBox(Widget w, XtPointer ptr, XtPointer junk)
old_name = name; old_name = name;
name = name->next; name = name->next;
XtFree((XtPointer) old_name); XtFree((XtPointer) old_name);
} }
} }

View File

@ -30,7 +30,7 @@ in this Software without prior written authorization from The Open Group.
#include <X11/Xaw/Cardinals.h> #include <X11/Xaw/Cardinals.h>
#include <X11/Xaw/Toggle.h> #include <X11/Xaw/Toggle.h>
#include <X11/Xaw/Viewport.h> #include <X11/Xaw/Viewport.h>
#include <X11/Xaw/Tree.h> #include <X11/Xaw/Tree.h>
#include "editresP.h" #include "editresP.h"
@ -38,9 +38,9 @@ in this Software without prior written authorization from The Open Group.
static void AddNodeToActiveList ( WNode * node ); static void AddNodeToActiveList ( WNode * node );
static void RemoveNodeFromActiveList ( WNode * node ); static void RemoveNodeFromActiveList ( WNode * node );
static Boolean IsActiveNode ( WNode * node ); static Boolean IsActiveNode ( WNode * node );
static void AddNode ( WNode ** top_node, WidgetTreeInfo * info, static void AddNode ( WNode ** top_node, WidgetTreeInfo * info,
TreeInfo * tree_info ); TreeInfo * tree_info );
static void FillNode ( WidgetTreeInfo * info, WNode * node, static void FillNode ( WidgetTreeInfo * info, WNode * node,
TreeInfo * tree_info ); TreeInfo * tree_info );
static void AddChild ( WNode * parent, WNode * child ); static void AddChild ( WNode * parent, WNode * child );
static WNode ** CopyActiveNodes ( TreeInfo * tree_info ); static WNode ** CopyActiveNodes ( TreeInfo * tree_info );
@ -84,7 +84,7 @@ BuildVisualTree(Widget tree_parent, Event *event)
XtManageChild(global_tree_info->tree_widget); XtManageChild(global_tree_info->tree_widget);
sprintf(msg, res_labels[11], top->name, top->class); snprintf(msg, sizeof(msg), res_labels[11], top->name, top->class);
SetMessage(global_screen_data.info_label, msg); SetMessage(global_screen_data.info_label, msg);
} }
@ -100,15 +100,15 @@ BuildVisualTree(Widget tree_parent, Event *event)
void void
AddTreeNode(Widget tree, WNode *top) AddTreeNode(Widget tree, WNode *top)
{ {
int i; Cardinal i;
Arg args[1]; Arg args[1];
Cardinal num_args = 0; Cardinal num_args = 0;
char msg[BUFSIZ]; char msg[BUFSIZ];
if (top->parent != NULL) { if (top->parent != NULL) {
if (top->parent->widget == NULL) { if (top->parent->widget == NULL) {
sprintf( msg, res_labels[28], snprintf(msg, sizeof(msg), res_labels[28],
top->name, top->parent->name, "not been created yet"); top->name, top->parent->name, "not been created yet");
SetMessage(global_screen_data.info_label, msg); SetMessage(global_screen_data.info_label, msg);
} }
XtSetArg(args[num_args], XtNtreeParent, top->parent->widget); XtSetArg(args[num_args], XtNtreeParent, top->parent->widget);
@ -118,15 +118,15 @@ AddTreeNode(Widget tree, WNode *top)
top->widget = XtCreateManagedWidget(top->name, toggleWidgetClass, tree, top->widget = XtCreateManagedWidget(top->name, toggleWidgetClass, tree,
args, num_args); args, num_args);
if (XSaveContext(XtDisplay(top->widget), (Window) top->widget, if (XSaveContext(XtDisplay(top->widget), (Window) top->widget,
NODE_INFO, (XPointer) top) != 0) { NODE_INFO, (XPointer) top) != 0) {
sprintf( msg, res_labels[29], top->name); snprintf(msg, sizeof(msg), res_labels[29], top->name);
SetMessage(global_screen_data.info_label, msg); SetMessage(global_screen_data.info_label, msg);
} }
XtAddCallback(top->widget, XtNcallback, TreeToggle, (XtPointer) top); XtAddCallback(top->widget, XtNcallback, TreeToggle, (XtPointer) top);
for (i = 0; i < top->num_children; i++) for (i = 0; i < top->num_children; i++)
AddTreeNode(tree, top->children[i]); AddTreeNode(tree, top->children[i]);
} }
@ -145,7 +145,7 @@ TreeToggle(Widget w, XtPointer node_ptr, XtPointer state_ptr)
Boolean state = (Boolean)(long) state_ptr; Boolean state = (Boolean)(long) state_ptr;
WNode * node = (WNode *) node_ptr; WNode * node = (WNode *) node_ptr;
if (state) if (state)
AddNodeToActiveList(node); AddNodeToActiveList(node);
else else
RemoveNodeFromActiveList(node); RemoveNodeFromActiveList(node);
@ -168,7 +168,7 @@ AddNodeToActiveList(WNode *node)
if (info->num_nodes >= info->alloc_nodes) { if (info->num_nodes >= info->alloc_nodes) {
info->alloc_nodes += NUM_INC; info->alloc_nodes += NUM_INC;
info->active_nodes =(WNode **)XtRealloc((XtPointer) info->active_nodes, info->active_nodes =(WNode **)XtRealloc((XtPointer) info->active_nodes,
sizeof(WNode *) * sizeof(WNode *) *
info->alloc_nodes); info->alloc_nodes);
} }
@ -186,7 +186,7 @@ RemoveNodeFromActiveList(WNode *node)
{ {
TreeInfo * info = node->tree_info; TreeInfo * info = node->tree_info;
Boolean found_node = FALSE; Boolean found_node = FALSE;
int i; Cardinal i;
if (!IsActiveNode(node)) /* This node is not active. */ if (!IsActiveNode(node)) /* This node is not active. */
return; return;
@ -194,7 +194,7 @@ RemoveNodeFromActiveList(WNode *node)
for (i = 0; i < info->num_nodes; i++) { for (i = 0; i < info->num_nodes; i++) {
if (found_node) if (found_node)
info->active_nodes[i - 1] = info->active_nodes[i]; info->active_nodes[i - 1] = info->active_nodes[i];
else if (info->active_nodes[i] == node) else if (info->active_nodes[i] == node)
found_node = TRUE; found_node = TRUE;
} }
@ -211,26 +211,26 @@ static Boolean
IsActiveNode(WNode *node) IsActiveNode(WNode *node)
{ {
TreeInfo * info = node->tree_info; TreeInfo * info = node->tree_info;
int i; Cardinal i;
for (i = 0; i < info->num_nodes; i++) for (i = 0; i < info->num_nodes; i++)
if (info->active_nodes[i] == node) if (info->active_nodes[i] == node)
return(TRUE); return(TRUE);
return(FALSE); return(FALSE);
} }
/* Function Name: CreateTree /* Function Name: CreateTree
* Description: Creates a widget tree give a list of names and classes. * Description: Creates a widget tree give a list of names and classes.
* Arguments: event - the information from the client. * Arguments: event - the information from the client.
* Returns: The tree_info about this new tree. * Returns: The tree_info about this new tree.
*/ */
TreeInfo * TreeInfo *
CreateTree(Event *event) CreateTree(Event *event)
{ {
SendWidgetTreeEvent * send_event = (SendWidgetTreeEvent *) event; SendWidgetTreeEvent * send_event = (SendWidgetTreeEvent *) event;
int i; unsigned short i;
TreeInfo * tree_info; TreeInfo * tree_info;
@ -243,7 +243,7 @@ CreateTree(Event *event)
tree_info->flash_widgets = NULL; tree_info->flash_widgets = NULL;
tree_info->num_flash_widgets = tree_info->alloc_flash_widgets = 0; tree_info->num_flash_widgets = tree_info->alloc_flash_widgets = 0;
for ( i = 0; i < (int)send_event->num_entries; i++) for ( i = 0; i < send_event->num_entries; i++)
AddNode(&(tree_info->top_node), (send_event->info + i), tree_info); AddNode(&(tree_info->top_node), (send_event->info + i), tree_info);
return(tree_info); return(tree_info);
@ -258,16 +258,16 @@ CreateTree(Event *event)
void void
PrintNodes(WNode *top) PrintNodes(WNode *top)
{ {
int i; Cardinal i;
if (top->parent == NULL) if (top->parent == NULL)
printf("Top of Tree, Name: %10s, ID: %10ld, Class: %10s\n", printf("Top of Tree, Name: %10s, ID: %10ld, Class: %10s\n",
top->name, top->id, top->class); top->name, top->id, top->class);
else else
printf("Parent %10s, Name: %10s, ID: %10ld, Class: %10s\n", printf("Parent %10s, Name: %10s, ID: %10ld, Class: %10s\n",
top->parent->name, top->name, top->id, top->class); top->parent->name, top->name, top->id, top->class);
for (i = 0; i < top->num_children; i++) for (i = 0; i < top->num_children; i++)
PrintNodes(top->children[i]); PrintNodes(top->children[i]);
} }
@ -291,9 +291,9 @@ _TreeRelabel(TreeInfo *tree_info, LabelTypes type)
top = tree_info->top_node; top = tree_info->top_node;
PrepareToLayoutTree(tree_info->tree_widget); PrepareToLayoutTree(tree_info->tree_widget);
_TreeRelabelNode(top, type, TRUE); _TreeRelabelNode(top, type, TRUE);
LayoutTree(tree_info->tree_widget); LayoutTree(tree_info->tree_widget);
} }
/* Function Name: _TreeSelect /* Function Name: _TreeSelect
@ -309,7 +309,7 @@ _TreeSelect(TreeInfo *tree_info, SelectTypes type)
{ {
WNode ** active_nodes; WNode ** active_nodes;
Cardinal num_active_nodes; Cardinal num_active_nodes;
int i; Cardinal i;
if (tree_info == NULL) { if (tree_info == NULL) {
SetMessage(global_screen_data.info_label, SetMessage(global_screen_data.info_label,
@ -353,7 +353,7 @@ _TreeSelect(TreeInfo *tree_info, SelectTypes type)
void void
_TreeSelectNode(WNode *node, SelectTypes type, Boolean recurse) _TreeSelectNode(WNode *node, SelectTypes type, Boolean recurse)
{ {
int i; Cardinal i;
Arg args[1]; Arg args[1];
Boolean state; Boolean state;
@ -367,7 +367,7 @@ _TreeSelectNode(WNode *node, SelectTypes type, Boolean recurse)
case SelectInvert: case SelectInvert:
XtSetArg(args[0], XtNstate, &state); XtSetArg(args[0], XtNstate, &state);
XtGetValues(node->widget, args, ONE); XtGetValues(node->widget, args, ONE);
state = !state; state = !state;
break; break;
default: default:
@ -383,7 +383,7 @@ _TreeSelectNode(WNode *node, SelectTypes type, Boolean recurse)
if (!recurse) if (!recurse)
return; return;
for (i = 0; i < node->num_children; i++) for (i = 0; i < node->num_children; i++)
_TreeSelectNode(node->children[i], type, recurse); _TreeSelectNode(node->children[i], type, recurse);
} }
@ -398,7 +398,7 @@ _TreeSelectNode(WNode *node, SelectTypes type, Boolean recurse)
void void
_TreeRelabelNode(WNode *node, LabelTypes type, Boolean recurse) _TreeRelabelNode(WNode *node, LabelTypes type, Boolean recurse)
{ {
int i; Cardinal i;
Arg args[1]; Arg args[1];
char buf[30]; char buf[30];
char *label; char *label;
@ -411,17 +411,17 @@ _TreeRelabelNode(WNode *node, LabelTypes type, Boolean recurse)
XtSetArg(args[0], XtNlabel, node->name); XtSetArg(args[0], XtNlabel, node->name);
break; break;
case IDLabel: case IDLabel:
sprintf(buf, "id: 0x%lx", node->id); snprintf(buf, sizeof(buf), "id: 0x%lx", node->id);
XtSetArg(args[0], XtNlabel, buf); XtSetArg(args[0], XtNlabel, buf);
break; break;
case WindowLabel: case WindowLabel:
if (node->window == EDITRES_IS_UNREALIZED) if (node->window == EDITRES_IS_UNREALIZED)
strcpy(buf, "unrealized widget"); strcpy(buf, "unrealized widget");
else if (node->window == EDITRES_IS_OBJECT) else if (node->window == EDITRES_IS_OBJECT)
strcpy(buf, "non windowed object"); strcpy(buf, "non windowed object");
else else
sprintf(buf, "win: 0x%lx", node->window); snprintf(buf, sizeof(buf), "win: 0x%lx", node->window);
XtSetArg(args[0], XtNlabel, buf); XtSetArg(args[0], XtNlabel, buf);
break; break;
case ToggleLabel: case ToggleLabel:
@ -443,7 +443,7 @@ _TreeRelabelNode(WNode *node, LabelTypes type, Boolean recurse)
if (!recurse) if (!recurse)
return; return;
for (i = 0; i < node->num_children; i++) for (i = 0; i < node->num_children; i++)
_TreeRelabelNode(node->children[i], type, recurse); _TreeRelabelNode(node->children[i], type, recurse);
} }
@ -459,7 +459,7 @@ void
_TreeActivateNode(WNode* node, SelectTypes type) _TreeActivateNode(WNode* node, SelectTypes type)
{ {
Arg args[1]; Arg args[1];
int i; Cardinal i;
XtSetArg(args[0], XtNstate, TRUE); XtSetArg(args[0], XtNstate, TRUE);
@ -468,13 +468,13 @@ _TreeActivateNode(WNode* node, SelectTypes type)
if (node == NULL) if (node == NULL)
return; return;
XtSetValues(node->widget, args, ONE); XtSetValues(node->widget, args, ONE);
AddNodeToActiveList(node); AddNodeToActiveList(node);
if (type == SelectAncestors) if (type == SelectAncestors)
_TreeActivateNode(node, type); _TreeActivateNode(node, type);
} }
else if ((type == SelectChildren) || (type == SelectDescendants)) else if ((type == SelectChildren) || (type == SelectDescendants))
for (i = 0; i < node->num_children; i++) { for (i = 0; i < node->num_children; i++) {
AddNodeToActiveList(node->children[i]); AddNodeToActiveList(node->children[i]);
XtSetValues(node->children[i]->widget, args, ONE); XtSetValues(node->children[i]->widget, args, ONE);
@ -483,12 +483,12 @@ _TreeActivateNode(WNode* node, SelectTypes type)
} }
else else
SetMessage(global_screen_data.info_label, SetMessage(global_screen_data.info_label,
res_labels[33]); res_labels[33]);
} }
/************************************************************ /************************************************************
* *
* Non - Exported Functions. * Non - Exported Functions.
* *
************************************************************/ ************************************************************/
@ -525,7 +525,7 @@ AddNode(WNode **top_node, WidgetTreeInfo *info, TreeInfo *tree_info)
AddChild(parent, node); AddChild(parent, node);
if (early_break) if (early_break)
break; break;
} }
@ -571,7 +571,7 @@ AddChild(WNode *parent, WNode *child)
{ {
if (parent->num_children >= parent->alloc_children) { if (parent->num_children >= parent->alloc_children) {
parent->alloc_children += NUM_INC; parent->alloc_children += NUM_INC;
parent->children = (WNode **) XtRealloc((char *)parent->children, parent->children = (WNode **) XtRealloc((char *)parent->children,
sizeof(WNode *) * parent->alloc_children); sizeof(WNode *) * parent->alloc_children);
} }
@ -584,20 +584,20 @@ AddChild(WNode *parent, WNode *child)
/************************************************************ /************************************************************
* *
* Functions that operate of the current tree. * Functions that operate of the current tree.
* *
************************************************************/ ************************************************************/
/* Function Name: CopyActiveNodes /* Function Name: CopyActiveNodes
* Description: returns a copy of the currently selected nodes. * Description: returns a copy of the currently selected nodes.
* Arguments: tree_info - the tree info struct. * Arguments: tree_info - the tree info struct.
* Returns: a copy of the selected nodes. * Returns: a copy of the selected nodes.
*/ */
static WNode ** static WNode **
CopyActiveNodes(TreeInfo *tree_info) CopyActiveNodes(TreeInfo *tree_info)
{ {
WNode ** list; WNode ** list;
int i; Cardinal i;
if ( (tree_info == NULL) || (tree_info->num_nodes == 0)) if ( (tree_info == NULL) || (tree_info->num_nodes == 0))
return(NULL); return(NULL);
@ -654,19 +654,19 @@ SetAndCenterTreeNode(WNode *node)
* reset the node x and y location to be the new x and y location of * reset the node x and y location to be the new x and y location of
* the tree relative to the porthole. * the tree relative to the porthole.
*/ */
node_x = port_width/2 - (node_x + node_width/2 + node_bw); node_x = port_width/2 - (node_x + node_width/2 + node_bw);
node_y = port_height/2 - (node_y + node_height/2 + node_bw); node_y = port_height/2 - (node_y + node_height/2 + node_bw);
num_args = 0; num_args = 0;
XtSetArg(args[num_args], XtNx, node_x); num_args++; XtSetArg(args[num_args], XtNx, node_x); num_args++;
XtSetArg(args[num_args], XtNy, node_y); num_args++; XtSetArg(args[num_args], XtNy, node_y); num_args++;
XtSetValues(node->tree_info->tree_widget, args, num_args); XtSetValues(node->tree_info->tree_widget, args, num_args);
} }
/* Function Name: PerformTreeToFileDump /* Function Name: PerformTreeToFileDump
* Description: Dumps the contents of the current widget tree to * Description: Dumps the contents of the current widget tree to
* the file specified. * the file specified.
* Arguments: node - node to dump. * Arguments: node - node to dump.
* num_tabs - number of spaces to indent. * num_tabs - number of spaces to indent.
* fp - pointer to the file to write to. * fp - pointer to the file to write to.
@ -674,11 +674,11 @@ SetAndCenterTreeNode(WNode *node)
*/ */
void void
PerformTreeToFileDump(WNode *node, int num_tabs, FILE *fp) PerformTreeToFileDump(WNode *node, Cardinal num_tabs, FILE *fp)
{ {
int i; Cardinal i;
for (i = 0; i < num_tabs; i++) for (i = 0; i < num_tabs; i++)
fprintf(fp, "\t"); fprintf(fp, "\t");
fprintf(fp, "%s %s\n", node->class, node->name); fprintf(fp, "%s %s\n", node->class, node->name);