Commit acf002d4 authored by Claes Sjofors's avatar Claes Sjofors

Merge branch 'master' of claes@pwrcvs:/data1/git/pwr

parents cfc534d4 7bad33d8
......@@ -40,7 +40,8 @@
kill -9 `ps ax | grep "rt_qmon" | awk '{ print $1}'`
kill -9 `ps ax | grep "rt_emon" | awk '{ print $1}'`
kill -9 `ps ax | grep "rt_tmon" | awk '{ print $1}'`
kill -9 `ps ax | grep "rt_\|/pwr/exe/rs" | awk '{ print $1}'`
kill -9 `ps ax | grep "[0-9] rt_" | awk '{ print $1}'`
kill -9 `ps ax | grep "/pwr/exe/rs" | awk '{ print $1}'`
kill -9 `ps ax | grep "\[rt_" | awk '{ print $1}'`
kill -9 `ps ax | grep "plc_" | awk '{ print $1}'`
kill -9 `ps ax | grep "jpwr.rt" | awk '{ print $1}'`
......@@ -54,13 +55,14 @@
user=$USER
fi
user=`eval whoami`
echo "User $user"
eval `ipcs -s|grep ^s|grep "[ \t]$user[ \t]"|awk '{printf "ipcrm -s %s;", $2
}'`
# remove message queues
eval `ipcs -q|grep ^q|grep "[ \t]$user[ \t]"|awk '{printf "ipcrm -q %s;", $2
eval `ipcs -q|grep ^q|grep "[ \t]$user[ \t]"|awk '{printf "ipcrm -Q %s;", $3
}'`
# remove shared memory
......
......@@ -75,20 +75,20 @@ pwrc_get_variables()
local socket
if [ -e /etc/proview.cnf ]; then
socket=`eval cat /etc/proview.cnf | grep "\bmysql_socket\b" | awk '{print $2}'`
socket=`eval cat /etc/proview.cnf | grep "[[:<:]]mysql_socket[[:>:]]" | awk '{print $2}'`
if [ ! -z $socket ]; then
mysql_socket="--socket $socket"
fi
pwr_projectroot=`eval cat /etc/proview.cnf | grep "\bprojectroot\b" | awk '{print $2}'`
pwr_projectroot=`eval cat /etc/proview.cnf | grep "[[:<:]]projectroot[[:>:]]" | awk '{print $2}'`
if [ -z $pwr_projectroot ]; then
pwr_projectroot=/home/pwrp
fi
fi
if [ -e $pwr_inc/pwr_version.h ]; then
# pwr_dbversion=`eval grep "\bpwrv_cWbdbVersionShortStr\b" $pwr_inc/pwr_version.h | awk '{print $2}'`
pwr_dbversion=`eval cat $pwr_inc/pwr_version.h | grep "\bpwrv_cWbdbVersionShortStr\b" | awk '{print $3}'`
# pwr_dbversion=`eval grep "[[:<:]]pwrv_cWbdbVersionShortStr[[:>:]]" $pwr_inc/pwr_version.h | awk '{print $2}'`
pwr_dbversion=`eval cat $pwr_inc/pwr_version.h | grep "[[:<:]]pwrv_cWbdbVersionShortStr[[:>:]]" | awk '{print $3}'`
if [ -z $pwr_dbversion ]; then
echo "Unable to get pwr db version"
......@@ -475,7 +475,7 @@ pwrc_get_projectname()
let found=0
# if [ -e $pwrp_db/pwrp_cnf_sysobject.dat ]; then
# pname=`eval cat -n $pwrp_db/pwrp_cnf_sysobject.dat | grep "\b1\b" | awk '{print $2}'`
# pname=`eval cat -n $pwrp_db/pwrp_cnf_sysobject.dat | grep "[[:<:]]1[[:>:]]" | awk '{print $2}'`
# if [ ! -z $pname ]; then
# found=1
# fi
......@@ -640,12 +640,12 @@ EndVolume
EOF
# Set ownership to user and group pwrp
user_pwrp=`eval cat /etc/passwd | grep "\bpwrp:"`
user_pwrp=`eval cat /etc/passwd | grep "[[:<:]]pwrp:"`
#if [ ! -z "$user_pwrp" ]; then
# chown -R pwrp $proot/
#fi
user_pwrp=`eval cat /etc/group | grep "\bpwrp:"`
user_pwrp=`eval cat /etc/group | grep "[[:<:]]pwrp:"`
if [ ! -z "$user_pwrp" ]; then
chgrp -R pwrp $proot/
chmod -R g+w $proot/
......@@ -965,7 +965,7 @@ pwrc_set_func()
if [ "$bus_id" == "" ]; then
if [ -e /etc/proview.cnf ]; then
bus_id=`eval cat /etc/proview.cnf | grep "\\bqcomBusId\\b" | awk '{print $2}'`
bus_id=`eval cat /etc/proview.cnf | grep "[[:<:]]qcomBusId[[:>:]]" | awk '{print $2}'`
fi
fi
export PWR_BUS_ID=$bus_id
......
......@@ -91,6 +91,9 @@ errl_Init (
int policy;
struct sched_param param;
key_t key;
int fd;
int flags = O_RDWR | O_CREAT;
mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP;
errl_log_cb = log_cb;
errl_log_userdata = userdata;
......@@ -125,7 +128,12 @@ errl_Init (
#endif
sprintf(name, "%s_%s", LOG_QUEUE_NAME, busid ? busid : "");
fd = open(name, flags, mode);
if ( fd == -1) {
printf("Message Queue, open failed on %s, errno: %d\n", name, errno);
}
key = ftok(name, 'm');
close( fd);
mqid = msgget( key, IPC_CREAT | 0660);
if (mqid == -1) {
......@@ -247,8 +255,10 @@ log_thread (void *arg)
while (1) {
len = msgrcv(mqid, (char *)&buf, LOG_MAX_MSG_SIZE, 0, 0);
if (len == -1) {
if (errno != EINTR)
if (errno != EINTR) {
perror("rt_logmod.c: mq_receive ");
sleep(1);
}
} else {
switch ( buf.message_type) {
case errh_eMsgType_Log:
......
......@@ -91,6 +91,9 @@ errl_Init (
int policy;
struct sched_param param;
key_t key;
int fd;
int flags = O_RDWR | O_CREAT;
mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP;
errl_log_cb = log_cb;
errl_log_userdata = userdata;
......@@ -125,7 +128,12 @@ errl_Init (
#endif
sprintf(name, "%s_%s", LOG_QUEUE_NAME, busid ? busid : "");
fd = open(name, flags, mode);
if ( fd == -1) {
printf("Message Queue, open failed on %s, errno: %d\n", name, errno);
}
key = ftok(name, 'm');
close( fd);
mqid = msgget( key, IPC_CREAT | 0660);
if (mqid == -1) {
......@@ -247,8 +255,10 @@ log_thread (void *arg)
while (1) {
len = msgrcv(mqid, (char *)&buf, LOG_MAX_MSG_SIZE, 0, 0);
if (len == -1) {
if (errno != EINTR)
if (errno != EINTR) {
perror("rt_logmod.c: mq_receive ");
sleep(1);
}
} else {
switch ( buf.message_type) {
case errh_eMsgType_Log:
......
......@@ -91,6 +91,9 @@ errl_Init (
int policy;
struct sched_param param;
key_t key;
int fd;
int flags = O_RDWR | O_CREAT;
mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP;
errl_log_cb = log_cb;
errl_log_userdata = userdata;
......@@ -125,7 +128,12 @@ errl_Init (
#endif
sprintf(name, "%s_%s", LOG_QUEUE_NAME, busid ? busid : "");
fd = open(name, flags, mode);
if ( fd == -1) {
printf("Message Queue, open failed on %s, errno: %d\n", name, errno);
}
key = ftok(name, 'm');
close( fd);
mqid = msgget( key, IPC_CREAT | 0660);
if (mqid == -1) {
......@@ -134,7 +142,7 @@ errl_Init (
}
pthread_attr_init(&pthreadattr);
if (pthread_create(&tid, /* &pthreadattr */ NULL, log_thread, NULL) == -1) {
if (pthread_create(&tid, /* &pthreadattr*/ NULL, log_thread, NULL) == -1) {
perror("rt_logmod: pthread_create ");
pthread_attr_destroy(&pthreadattr);
return;
......@@ -244,11 +252,14 @@ log_thread (void *arg)
int len;
errh_sMsg buf;
sleep( 1);
while (1) {
len = msgrcv(mqid, (char *)&buf, LOG_MAX_MSG_SIZE, 0, 0);
if (len == -1) {
if (errno != EINTR)
if (errno != EINTR) {
perror("rt_logmod.c: mq_receive ");
sleep(1);
}
} else {
switch ( buf.message_type) {
case errh_eMsgType_Log:
......
......@@ -645,9 +645,17 @@ openLog ()
char name[64];
char *busid = getenv(pwr_dEnvBusId);
key_t key;
int fd;
int flags = O_RDWR | O_CREAT;
mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP;
sprintf(name, "%s_%s", LOG_QUEUE_NAME, busid ? busid : "");
fd = open(name, flags, mode);
if ( fd == -1) {
printf("Message Queue, open failed on %s, errno: %d\n", name, errno);
}
key = ftok(name, 'm');
close( fd);
mqid = msgget( key, IPC_CREAT | 0660);
if (mqid == -1) {
......
......@@ -315,7 +315,7 @@ sect_Alloc (
shm_id = shmget(shm_key, size, IPC_CREAT | 0660);
if (shm_id == -1) {
lsts = 2;
errh_Error("sect_Alloc: Couldn't attach/create shm section");
errh_Error("sect_Alloc: Couldn't attach/create shm section size: %d. Check shmmax.", size);
break;
}
......
......@@ -160,7 +160,7 @@ else
tools_msg2cmsg := $(eexe_dir)/tools_msg2cmsg
tools_cmsg2c := $(eexe_dir)/tools_cmsg2c
tools_pdrgen := $(eexe_dir)/tools_pdrgen
wb_rtt := $(eexe_dir)/wb_rtt
wb_rtt := $(exe_dir)/wb_rtt
co_convert := $(eexe_dir)/co_convert
co_merge := $(eexe_dir)/co_merge
endif
......
......@@ -160,7 +160,7 @@ else
tools_msg2cmsg := $(eexe_dir)/tools_msg2cmsg
tools_cmsg2c := $(eexe_dir)/tools_cmsg2c
tools_pdrgen := $(eexe_dir)/tools_pdrgen
wb_rtt := $(eexe_dir)/wb_rtt
wb_rtt := $(exe_dir)/wb_rtt
co_convert := $(eexe_dir)/co_convert
co_merge := $(eexe_dir)/co_merge
endif
......
......@@ -44,8 +44,8 @@ char prefix[][10] = {"gdhr", "gdh", "cdhr", "cdh", "pwrb", "pwrt", "pwr",
int main( int argc, char *argv[])
{
char filename[80];
char destination[80];
char filename[256];
char destination[256];
char cmd[200];
char *s, *t;
int i;
......@@ -53,7 +53,7 @@ int main( int argc, char *argv[])
if ( argc > 3 && strcmp( argv[1], "-d") == 0)
{
strcpy( destination, argv[2]);
strncpy( destination, argv[2], sizeof(destination));
/* Cut last to segments in directory (package name) */
if ((s = strrchr( destination, '/')))
......@@ -66,12 +66,12 @@ int main( int argc, char *argv[])
*s = 0;
}
}
strcpy( filename, argv[3]);
strncpy( filename, argv[3], sizeof(filename));
}
else if ( argc > 1)
{
strcpy( filename, argv[1]);
strcpy( destination, "");
strncpy( filename, argv[1], sizeof(filename));
strncpy( destination, "", sizeof(destination));
}
else
{
......@@ -144,9 +144,9 @@ int main( int argc, char *argv[])
if ( strcmp( destination, "") == 0)
sprintf( cmd, "javac %s", filename);
snprintf( cmd, sizeof(cmd), "javac %s", filename);
else
sprintf( cmd, "javac -d %s %s", destination, filename);
snprintf( cmd, sizeof(cmd), "javac -d %s %s", destination, filename);
printf( "Cmd: %s\n", cmd);
sts = system( cmd);
......
......@@ -59,7 +59,7 @@
#include "msg2cmsg.h"
#define MSG_NEW_STRING(str) strcpy(malloc(strlen(str) + 1), str)
#define MSG_NEW_STRING(str) strncpy(malloc(strlen(str) + 1), str, strlen(str) + 1)
typedef struct s_FacilityCB sFacilityCB;
......@@ -171,9 +171,9 @@ int main(int argc, char **argv)
fname[i] = '\0';
#else
if ((p = strrchr(argv[2], '/')))
strcpy(fname, p+1);
strncpy(fname, p+1, sizeof(fname));
else
strcpy(fname, argv[2]);
strncpy(fname, argv[2], sizeof(fname));
#endif
......@@ -282,19 +282,19 @@ static void WriteFiles(char *fname, FILE *cfp, FILE *hfp)
for (fl = LstFir(&lFacH); fl != LstEnd(&lFacH); fl = LstNex(fl)) {
facid = 0x800 + LstObj(fl)->f.FacNum;
#if defined OS_VMS || OS_ELN
sprintf(name, "%s$_FACILITY", LstObj(fl)->f.FacName);
snprintf(name, sizeof(name), "%s$_FACILITY", LstObj(fl)->f.FacName);
#else
sprintf(name, "%s_FACILITY", LstObj(fl)->f.FacName);
snprintf(name, sizeof(name), "%s_FACILITY", LstObj(fl)->f.FacName);
#endif
fprintf(hfp, "#define %-29s %9d /* x%08x */\n", name, facid, facid);
facid = facid << 16;
if (LstObj(fl)->f.Prefix)
strcpy(prefix, LstObj(fl)->f.Prefix);
strncpy(prefix, LstObj(fl)->f.Prefix, sizeof(prefix));
else
sprintf(prefix, "%s_", LstObj(fl)->f.FacName);
snprintf(prefix, sizeof(prefix), "%s_", LstObj(fl)->f.FacName);
sprintf(msgName, "%smsg", LstObj(fl)->f.FacName);
snprintf(msgName, sizeof(msgName), "%smsg", LstObj(fl)->f.FacName);
fprintf(cfp, "static msg_sMsg %s[] = {\n", msgName);
......@@ -303,7 +303,7 @@ static void WriteFiles(char *fname, FILE *cfp, FILE *hfp)
fprintf(cfp, ",\n");
msg = facid + 0x8000 + (idx << 3) + LstObj(ml)->Severity;
sprintf(name, "%s%s", prefix, LstObj(ml)->m.MsgName);
snprintf(name, sizeof(name), "%s%s", prefix, LstObj(ml)->m.MsgName);
fprintf(hfp, "#define %-29s %9.9d /* x%08x */\n", name, msg, msg);
fprintf(cfp, "\t{\"%s\", \"%s\"}", LstObj(ml)->m.MsgName, LstObj(ml)->m.MsgTxt);
}
......
......@@ -151,7 +151,7 @@ sub configure()
exit 1;
}
my $fname = $ENV{"pwre_bin"} . "/pwre_configure.sh";
my $fname = $ENV{"pwre_bin"} . "/pwre_configure.sh"." ".$_[0]." ".$_[1]." ".$_[2];
system( $fname);
}
......
#!/bin/bash
pwre_help()
{
cat <<EOF
pwre_configure.h
Arguments
--help Display help.
--version State fix version of loadfiles, eg
> pwre configure --version "29-MAY-2011 16:00:00"
--reset-version Reset previous version
EOF
}
pwre_config_init()
{
d=`eval date +\"%F %X\"`
......@@ -225,32 +243,55 @@ if test ! -e $pwre_croot; then
exit
fi
# Options
if [ "$1" = "--help" ]; then
pwre_help
exit
elif [ "$1" = "--version" ] && [ "$2" != "" ] && [ "$3" != "" ]; then
buildversion=$2" "$3
elif [ "$1" = "--reset-version" ]; then
buildversion=""
elif [ "$1" != "" ]; then
echo "Unknown option \"$1\""
exit
else
# Catch current version
if [ -e $cfile ]; then
ver=`eval cat $cfile | grep "[[:<:]]export PWRE_CONF_BUILDVERSION"`
ver=${ver#*=\"}
ver=${ver%\"}
buildversion=$ver
fi
fi
pwre_create_blddir
pwre_create_makedir
pwre_config_init
if [ "$buildversion" != "" ]; then
echo "export PWRE_CONF_BUILDVERSION=\"$buildversion\"" >> $cfile
else
echo "export PWRE_CONF_BUILDVERSION=\"0\"" >> $cfile
fi
#Gtk
echo ""
echo "Mandatory :"
pwre_config_check_lib gtk GTK gtk gtk 0 /usr/local/lib/libgtk-x11-2.0.a
pwre_config_check_lib libantlr LIBANTLR lib lib 0 /usr/local/lib/libantlr.a
pwre_config_check_lib librpcsvc LIBRPCSVC lib lib 0 /usr/lib/librpcsvc.so:/usr/lib/librpcsvc.a
pwre_config_check_lib libasound LIBASOUND lib lib 0 /usr/lib/libasound.so:/usr/lib/libasound.a
#pwre_config_check_lib libasound LIBASOUND lib lib 0 /usr/lib/libasound.so:/usr/lib/libasound.a
pwre_config_check_lib libpthread LIBPTHREAD lib lib 0 /usr/lib/libpthread.so:/usr/lib/libpthread.a
pwre_config_check_lib libm LIBM lib lib 0 /usr/lib/libm.so:/usr/lib/libm.a
pwre_config_check_lib libdb_cxx LIBDB_CXX lib lib 0 /usr/local/lib/libdb_cxx.so.6.0
pwre_config_check_lib libz LIBZ lib lib 0 /usr/lib/libz.so:/usr/lib/libz.a
pwre_config_check_lib libcrypt LIBCRYPT lib lib 0 /usr/lib/libcrypt.so:/usr/lib/libcrypt.a
pwre_config_check_lib mysql MYSQL lib lib 1 /usr/lib/libmysqlclient.so
pwre_config_check_lib mq MQ lib lib 1 /usr/lib/libdmq.so
pwre_config_check_lib libpnioif PNAK lib lib 1 /usr/lib/libpnioif.so:/usr/local/lib/libpnioif.a
pwre_config_check_lib libusb LIBUSB lib lib 1 /usr/lib/libusb-1.0.so
pwre_config_check_lib librt LIBRT lib lib 0 /usr/lib/librt.dylib:/usr/lib/librt.a
#pwre_config_check_lib libcrypt LIBCRYPT lib lib 0 /usr/lib/libcrypt.so:/usr/lib/libcrypt.a
#pwre_config_check_lib librt LIBRT lib lib 0 /usr/lib/librt.dylib:/usr/lib/librt.a
pwre_config_check_lib libiconv LIBICONV lib lib 0 /usr/local/lib/libiconv.so:/usr/local/lib/libiconv.a
pwre_config_check_lib libfl LIBFL lib lib 0 /usr/lib/libfl.os:/usr/lib/libfl.a
#set -o xtrace
pwre_config_check_include antlr ANTLR 1 /usr/local/include/antlr/CommonAST.hpp
pwre_config_check_include gtk GTK 1 /usr/local/include/gtk-2.0/gtk/gtk.h
pwre_config_check_include iconv ICONV 1 /usr/local/include/iconv.h
......@@ -258,6 +299,13 @@ pwre_config_check_include jni JNI 1 /usr/local/jdk-1.7.0/include/jni.h
pwre_config_check_include jni JNI 0 /usr/local/jdk-1.7.0/include/openbsd/jni_md.h
pwre_config_check_include libdb_cxx LIBDB_CXX 0 /usr/local/include/db4/db_cxx.h
echo ""
echo "Optional :"
pwre_config_check_lib mysql MYSQL lib lib 1 /usr/lib/libmysqlclient.so
pwre_config_check_lib mq MQ lib lib 1 /usr/lib/libdmq.so
pwre_config_check_lib libpnioif PNAK lib lib 1 /usr/lib/libpnioif.so:/usr/local/lib/libpnioif.a
pwre_config_check_lib libusb LIBUSB lib lib 1 /usr/lib/libusb-1.0.so
export pwre_conf_alsa=1
......
......@@ -304,8 +304,8 @@ int exo_exec_m0( exo_ctx exoctx, vldh_t_node node)
"RtBody", 1, &bodydef, &rows);
if ( ODD(sts) ) {
i = 0;
while( (bodydef[i].ParClass == pwr_eClass_Input) &&
(i < rows)) {
while( i < rows &&
bodydef[i].ParClass == pwr_eClass_Input) {
/* Get the point for this parameter if there is one */
sts = gcg_get_inputpoint( node, i, &point, &par_inverted);
if ( ODD( sts)) {
......@@ -435,8 +435,8 @@ int exo_exec_m2( exo_ctx exoctx, vldh_t_node node)
if ( EVEN(sts) ) return sts;
i = 0;
while( (bodydef[i].ParClass == pwr_eClass_Input) &&
(i < rows)) {
while( i < rows &&
bodydef[i].ParClass == pwr_eClass_Input) {
/* Get the point for this parameter if there is one */
sts = gcg_get_inputpoint( node, i, &point, &par_inverted);
if ( ODD( sts)) {
......
......@@ -40,7 +40,7 @@
#include <vector>
#include "glow_std.h"
#if defined OS_VMS || defined OS_LINUX
#if defined OS_VMS || defined OS_POSIX
#define LDH 1
#endif
......
......@@ -64,7 +64,7 @@
#include "ge_attr.h"
#endif
#if defined OS_VMS || defined OS_LINUX
#if defined OS_VMS || defined OS_POSIX
#define LDH 1
#endif
......
......@@ -287,8 +287,10 @@ static void curvewidgetgtk_destroy( GtkObject *object)
curvew->destroyed = 1;
if ( curvew->scroll_timerid)
g_source_remove( curvew->scroll_timerid);
if ( curvew->is_navigator && curvew->curve_ctx)
((CurveCtx *)curvew->curve_ctx)->no_nav = 1;
if ( curvew->is_navigator) {
if ( curvew->curve_ctx && !((CurveWidgetGtk *)curvew->main_curve_widget)->destroyed)
((CurveCtx *)curvew->curve_ctx)->no_nav = 1;
}
else
delete (GlowDrawGtk *)curvew->draw_ctx;
}
......
......@@ -859,20 +859,28 @@ int GlowDrawGtk::event_handler( GdkEvent event)
if ( (event.button.state & GDK_SHIFT_MASK) &&
!(event.button.state & GDK_CONTROL_MASK)) {
sts = ctx->event_handler( glow_eEvent_MB1ClickShift, (int)event.button.x, (int)event.button.y, 0, 0);
if ( sts == GLOW__TERMINATED || sts == GLOW__DESTROYED)
return 1;
click_sensitivity = 0;
}
else if ( !(event.button.state & GDK_SHIFT_MASK) &&
(event.button.state & GDK_CONTROL_MASK)) {
sts = ctx->event_handler( glow_eEvent_MB1ClickCtrl, (int)event.button.x, (int)event.button.y, 0, 0);
if ( sts == GLOW__TERMINATED || sts == GLOW__DESTROYED)
return 1;
click_sensitivity = 0;
}
else if ( (event.button.state & GDK_SHIFT_MASK) &&
(event.button.state & GDK_CONTROL_MASK)) {
sts = ctx->event_handler( glow_eEvent_MB1ClickShiftCtrl, (int)event.button.x, (int)event.button.y, 0, 0);
if ( sts == GLOW__TERMINATED || sts == GLOW__DESTROYED)
return 1;
click_sensitivity = 0;
}
else {
sts = ctx->event_handler( glow_eEvent_MB1Click, (int)event.button.x, (int)event.button.y, 0, 0);
if ( sts == GLOW__TERMINATED || sts == GLOW__DESTROYED)
return 1;
click_sensitivity = 0;
}
break;
......@@ -880,20 +888,28 @@ int GlowDrawGtk::event_handler( GdkEvent event)
if ( (event.button.state & GDK_SHIFT_MASK) &&
!(event.button.state & GDK_CONTROL_MASK)) {
sts = ctx->event_handler( glow_eEvent_MB2ClickShift, (int)event.button.x, (int)event.button.y, 0, 0);
if ( sts == GLOW__TERMINATED || sts == GLOW__DESTROYED)
return 1;
click_sensitivity = 0;
}
else if ( !(event.button.state & GDK_SHIFT_MASK) &&
(event.button.state & GDK_CONTROL_MASK)) {
sts = ctx->event_handler( glow_eEvent_MB2ClickCtrl, (int)event.button.x, (int)event.button.y, 0, 0);
if ( sts == GLOW__TERMINATED || sts == GLOW__DESTROYED)
return 1;
click_sensitivity = 0;
}
else if ( (event.button.state & GDK_SHIFT_MASK) &&
(event.button.state & GDK_CONTROL_MASK)) {
sts = ctx->event_handler( glow_eEvent_MB2ClickShiftCtrl, (int)event.button.x, (int)event.button.y, 0, 0);
if ( sts == GLOW__TERMINATED || sts == GLOW__DESTROYED)
return 1;
click_sensitivity = 0;
}
else {
sts = ctx->event_handler( glow_eEvent_MB2Click, (int)event.button.x, (int)event.button.y, 0, 0);
if ( sts == GLOW__TERMINATED || sts == GLOW__DESTROYED)
return 1;
click_sensitivity = 0;
}
break;
......@@ -911,6 +927,8 @@ int GlowDrawGtk::event_handler( GdkEvent event)
else
#endif
sts = ctx->event_handler( glow_eEvent_MB3Click, (int)event.button.x, (int)event.button.y, 0, 0);
if ( sts == GLOW__TERMINATED || sts == GLOW__DESTROYED)
return 1;
click_sensitivity = 0;
break;
}
......@@ -919,6 +937,8 @@ int GlowDrawGtk::event_handler( GdkEvent event)
/* Button release */
// cout << "Button release detected" << endl;
sts = ctx->event_handler( glow_eEvent_ButtonRelease, (int)event.button.x, (int)event.button.y, 0, 0);
if ( sts == GLOW__TERMINATED || sts == GLOW__DESTROYED)
return 1;
}
}
else {
......@@ -945,20 +965,28 @@ int GlowDrawGtk::event_handler( GdkEvent event)
if ( (event.button.state & GDK_SHIFT_MASK) &&
!(event.button.state & GDK_CONTROL_MASK)) {
sts = ctx->event_handler( glow_eEvent_MB1DoubleClickShift, (int)event.button.x, (int)event.button.y, 0, 0);
if ( sts == GLOW__TERMINATED || sts == GLOW__DESTROYED)
return 1;
click_sensitivity = 0;
}
else if ( !(event.button.state & GDK_SHIFT_MASK) &&
(event.button.state & GDK_CONTROL_MASK)) {
sts = ctx->event_handler( glow_eEvent_MB1DoubleClickCtrl, (int)event.button.x, (int)event.button.y, 0, 0);
if ( sts == GLOW__TERMINATED || sts == GLOW__DESTROYED)
return 1;
click_sensitivity = 0;
}
else if ( (event.button.state & GDK_SHIFT_MASK) &&
(event.button.state & GDK_CONTROL_MASK)) {
sts = ctx->event_handler( glow_eEvent_MB1DoubleClickShiftCtrl, (int)event.button.x, (int)event.button.y, 0, 0);
if ( sts == GLOW__TERMINATED || sts == GLOW__DESTROYED)
return 1;
click_sensitivity = 0;
}
else {
sts = ctx->event_handler( glow_eEvent_MB1DoubleClick, (int)event.button.x, (int)event.button.y, 0, 0);
if ( sts == GLOW__TERMINATED || sts == GLOW__DESTROYED)
return 1;
click_sensitivity = 0;
}
break;
......@@ -966,20 +994,28 @@ int GlowDrawGtk::event_handler( GdkEvent event)
if ( (event.button.state & GDK_SHIFT_MASK) &&
!(event.button.state & GDK_CONTROL_MASK)) {
sts = ctx->event_handler( glow_eEvent_MB2DoubleClickShift, (int)event.button.x, (int)event.button.y, 0, 0);
if ( sts == GLOW__TERMINATED || sts == GLOW__DESTROYED)
return 1;
click_sensitivity = 0;
}
else if ( !(event.button.state & GDK_SHIFT_MASK) &&
(event.button.state & GDK_CONTROL_MASK)) {
sts = ctx->event_handler( glow_eEvent_MB2DoubleClickCtrl, (int)event.button.x, (int)event.button.y, 0, 0);
if ( sts == GLOW__TERMINATED || sts == GLOW__DESTROYED)
return 1;
click_sensitivity = 0;
}
else if ( (event.button.state & GDK_SHIFT_MASK) &&
(event.button.state & GDK_CONTROL_MASK)) {
sts = ctx->event_handler( glow_eEvent_MB2DoubleClickShiftCtrl, (int)event.button.x, (int)event.button.y, 0, 0);
if ( sts == GLOW__TERMINATED || sts == GLOW__DESTROYED)
return 1;
click_sensitivity = 0;
}
else {
sts = ctx->event_handler( glow_eEvent_MB2DoubleClick, (int)event.button.x, (int)event.button.y, 0, 0);
if ( sts == GLOW__TERMINATED || sts == GLOW__DESTROYED)
return 1;
click_sensitivity = 0;
}
break;
......
......@@ -291,8 +291,10 @@ static void growwidgetgtk_destroy( GtkObject *object)
grow->destroyed = 1;
if ( grow->scroll_timerid)
g_source_remove( grow->scroll_timerid);
if ( grow->is_navigator && grow->grow_ctx)
((GrowCtx *)grow->grow_ctx)->no_nav = 1;
if ( grow->is_navigator) {
if ( grow->grow_ctx && !((GrowWidgetGtk *)grow->main_grow_widget)->destroyed)
((GrowCtx *)grow->grow_ctx)->no_nav = 1;
}
else
delete (GlowDrawGtk *)grow->draw_ctx;
}
......
......@@ -266,7 +266,9 @@ int GrowCtx::event_handler( glow_eEvent event, int x, int y, int w, int h)
case glow_eEvent_MB1Up:
case glow_eEvent_MB1Click:
sts = a[a.a_size-1]->event_handler( &mw, event, x, y, fx, fy);
if ( sts)
if ( sts == GLOW__TERMINATED || sts == GLOW__DESTROYED)
return sts;
else if ( sts)
return 1;
break;
default: ;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment