gnome-rdp-0.3.0.9/ 0000755 0001750 0001750 00000000000 11566224114 010554 5 0000000 0000000 gnome-rdp-0.3.0.9/gnome-rdp.in 0000644 0001750 0001750 00000000106 11566224111 012706 0000000 0000000 #!/bin/sh
exec mono "@expanded_libdir@/@PACKAGE@/gnome-rdp.exe" "$@"
gnome-rdp-0.3.0.9/configure.ac 0000644 0001750 0001750 00000003051 11566224111 012756 0000000 0000000 dnl Warning: This is an automatically generated file, do not edit!
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ([2.54])
AC_INIT([gnome-rdp], [0.3.0.9])
AM_INIT_AUTOMAKE([foreign])
AM_MAINTAINER_MODE
dnl pkg-config
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test "x$PKG_CONFIG" = "xno"; then
AC_MSG_ERROR([You need to install pkg-config])
fi
SHAMROCK_EXPAND_LIBDIR
SHAMROCK_EXPAND_BINDIR
SHAMROCK_EXPAND_DATADIR
AC_PROG_INSTALL
AC_PATH_PROG(GMCS, gmcs, no)
if test "x$GMCS" = "xno"; then
AC_MSG_ERROR([gmcs Not found])
fi
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug],
[Use 'DEBUG' Configuration [default=NO]]),
enable_debug=yes, enable_debug=no)
AM_CONDITIONAL(ENABLE_DEBUG, test x$enable_debug = xyes)
if test "x$enable_debug" = "xyes" ; then
CONFIG_REQUESTED="yes"
fi
AC_ARG_ENABLE(release,
AC_HELP_STRING([--enable-release],
[Use 'RELEASE' Configuration [default=YES]]),
enable_release=yes, enable_release=no)
AM_CONDITIONAL(ENABLE_RELEASE, test x$enable_release = xyes)
if test "x$enable_release" = "xyes" ; then
CONFIG_REQUESTED="yes"
fi
if test -z "$CONFIG_REQUESTED" ; then
AM_CONDITIONAL(ENABLE_RELEASE, true)
enable_release=yes
fi
dnl package checks, common for all configs
PKG_CHECK_MODULES([GTK_SHARP_20], [gtk-sharp-2.0])
PKG_CHECK_MODULES([GLIB_SHARP_20], [glib-sharp-2.0])
PKG_CHECK_MODULES([GLADE_SHARP_20], [glade-sharp-2.0])
PKG_CHECK_MODULES([GNOME_KEYRING_SHARP_10], [gnome-keyring-sharp-1.0])
dnl package checks, per config
AC_CONFIG_FILES([
gnome-rdp
Makefile
])
AC_OUTPUT
gnome-rdp-0.3.0.9/AssemblyInfo.cs 0000644 0001750 0001750 00000003225 11566224110 013414 0000000 0000000 //
// Copyright (C) 2009 James P Michels III
//
// 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 3 of the License, 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 .
//
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("gnome-rdp")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("1.0.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
gnome-rdp-0.3.0.9/missing 0000755 0001750 0001750 00000026233 11331674343 012104 0000000 0000000 #! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2009-04-28.21; # UTC
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
# 2008, 2009 Free Software Foundation, Inc.
# Originally by Fran,cois Pinard , 1996.
# 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 .
# 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.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
msg="missing on your system"
case $1 in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
# Exit code 63 means version mismatch. This often happens
# when the user try to use an ancient version of a tool on
# a file that requires a minimum version. In this case we
# we should proceed has if the program had been absent, or
# if --run hadn't been passed.
if test $? = 63; then
run=:
msg="probably too old"
fi
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
autom4te touch the output file, or create a stub one
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
\`g' are ignored when checking the name.
Send bug reports to ."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
esac
# normalize program name to check for.
program=`echo "$1" | sed '
s/^gnu-//; t
s/^gnu//; t
s/^g//; t'`
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program). This is about non-GNU programs, so use $1 not
# $program.
case $1 in
lex*|yacc*)
# Not GNU programs, they don't have --version.
;;
tar*)
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
exit 1
fi
;;
*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
# Could not run --version or --help. This is probably someone
# running `$TOOL --version' or `$TOOL --help' to check whether
# $TOOL exists and not knowing $TOOL uses missing.
exit 1
fi
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case $program in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case $f in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
autom4te*)
echo 1>&2 "\
WARNING: \`$1' is needed, but is $msg.
You might have modified some files without having the
proper tools for further handling them.
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison*|yacc*)
echo 1>&2 "\
WARNING: \`$1' $msg. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if test $# -ne 1; then
eval LASTARG="\${$#}"
case $LASTARG in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if test ! -f y.tab.h; then
echo >y.tab.h
fi
if test ! -f y.tab.c; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex*|flex*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if test $# -ne 1; then
eval LASTARG="\${$#}"
case $LASTARG in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if test ! -f lex.yy.c; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit $?
fi
;;
makeinfo*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -z "$file"; then
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '
/^@setfilename/{
s/.* \([^ ]*\) *$/\1/
p
q
}' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
# If the file does not exist, the user really needs makeinfo;
# let's fail without touching anything.
test -f $file || exit 1
touch $file
;;
tar*)
shift
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
gnutar "$@" && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
gtar "$@" && exit 0
fi
firstarg="$1"
if shift; then
case $firstarg in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
case $firstarg in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
;;
esac
fi
echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
You may want to install GNU tar or Free paxutils, or check the
command line arguments."
exit 1
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and is $msg.
You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0
# Local variables:
# 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:
gnome-rdp-0.3.0.9/Makefile.am 0000644 0001750 0001750 00000000345 11566224111 012527 0000000 0000000
EXTRA_DIST = expansions.m4
#Warning: This is an automatically generated file, do not edit!
if ENABLE_DEBUG
SUBDIRS = .
endif
if ENABLE_RELEASE
SUBDIRS = .
endif
# Include project specific makefile
include gnome-rdp.make gnome-rdp-0.3.0.9/install-sh 0000755 0001750 0001750 00000032537 11331674343 012515 0000000 0000000 #!/bin/sh
# install - install a program, script, or datafile
scriptversion=2009-04-28.21; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
no_target_directory=
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
shift;;
-T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
trap '(exit $?); exit' 1 2 13 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writeable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
-*) prefix='./';;
*) prefix='';;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob set -f
set fnord $dstdir
shift
$posix_glob set +f
IFS=$oIFS
prefixes=
for d
do
test -z "$d" && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# 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:
gnome-rdp-0.3.0.9/app.desktop 0000644 0001750 0001750 00000000135 11566224110 012642 0000000 0000000 [Desktop Entry]
Encoding=UTF-8
Type=Application
Name=gnome-rdp
Exec=gnome-rdp
Terminal=false
gnome-rdp-0.3.0.9/Program.cs 0000644 0001750 0001750 00000012221 11566224110 012424 0000000 0000000 //
// Copyright (C) 2009 James P Michels III
//
// 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 3 of the License, 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 .
//
// Contributors
// Stephen Phillips
using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using System.Threading;
using Gtk;
using GnomeRDP.Identies;
using GnomeRDP.Database;
using GnomeRDP.ApplicationDataFiles;
using GnomeRDP.Logging;
using GnomeRDP.Rdp;
using GnomeRDP.Profiles;
using GnomeRDP.Sessions;
namespace GnomeRDP
{
public static class Program
{
[ThreadStatic]
private static bool isMainThread;
private static MainWindow mainWindow;
private static void ShowVersion()
{
Console.WriteLine("GnomeRDP 3.0 alpha");
}
private static void ShowHelp()
{
ShowVersion();
Console.WriteLine("Usage is mono gnome-rdp.exe [arguments]");
Console.WriteLine();
Console.WriteLine(" --help, -h Displays this help message");
Console.WriteLine(" --version, -v Displays the program version");
Console.WriteLine(" --start-hidden, -m Starts GnomeRDP with the main window hidden");
Console.WriteLine(" --databasepath Old Sqlite configuration to import from");
Console.WriteLine(" --configpath, -c Override location to configuration folder");
}
public static void Main (string[] args)
{
bool startHidden;
ParseArgs (args, out startHidden);
Trace.Listeners.Add(new TextWriterTraceListener(Console.Out));
Log.LogLevelFilter = LogLevel.Verbose;
Log.Added += (sender, e) => Trace.WriteLine(string.Format("{0}: {1}", e.logLevel, e.message));
FileManager.VerifyApplicationDataFolderExists();
identityCollection = new IdentityCollection();
profileCollection = new ProfileCollection();
sessionCollection = new SessionCollection();
if (sessionCollection.Count == 0) Sqlite.ImportSessions();
isMainThread = true;
Application.Init();
mainWindow = new MainWindow();
mainWindow.Show();
if (startHidden) mainWindow.Visible = false;
Application.Run();
isClosed = true;
}
private static void ParseArgs (string[] args, out bool startHidden)
{
startHidden = false;
// previousArg allows for arguments that come in pairs
string previousArg = null;
foreach (var arg in args)
{
if (previousArg == null)
{
switch (arg)
{
case "--start-hidden":
case "-m": startHidden = true; break;
case "--version":
case "-v": ShowVersion(); return;
case "--help":
case "-h": ShowHelp(); return;
// In these cases, we just want to save the argument
// because the next argument has the details we need.
case "--databasepath":
case "--configpath":
case "-c": previousArg = arg; break;
}
}
else
{
// Process the second of the pair of arguments
switch (previousArg)
{
case "--databasepath": Sqlite.SetDatabasePath(arg); break;
case "--configpath":
case "-c": FileManager.SetApplicationDataFolderPath(arg); break;
}
previousArg = null;
}
}
}
private static SessionCollection sessionCollection;
public static SessionCollection SessionCollection
{
get
{
return sessionCollection;
}
}
private static ProfileCollection profileCollection;
public static ProfileCollection ProfileCollection
{
get
{
return profileCollection;
}
}
private static IdentityCollection identityCollection;
public static IdentityCollection IdentityCollection
{
get
{
return identityCollection;
}
}
public static string CreateID()
{
string id = Convert.ToBase64String(Guid.NewGuid().ToByteArray());
if (id.EndsWith("==")) id = id.Substring(0, id.Length - 2);
return id;
}
public static void Invoke(System.Action action, TimeSpan timeout)
{
if (isMainThread)
{
action();
return;
}
ManualResetEvent complete = new ManualResetEvent(false);
GLib.Timeout.Add(0, () =>
{
action();
complete.Set();
return false;
});
if (complete.WaitOne(timeout) == false) throw new TimeoutException();
}
public static void ToggleMainWindowVisible()
{
GLib.Timeout.Add(0, () =>
{
mainWindow.Visible = !mainWindow.Visible;
return false;
});
}
public static void SetMainWindowVisible(bool visible)
{
GLib.Timeout.Add(0, () =>
{
mainWindow.Visible = visible;
return false;
});
}
private static bool isClosed = false;
public static bool IsClosed
{
get
{
return isClosed;
}
}
}
} gnome-rdp-0.3.0.9/Protocol.cs 0000644 0001750 0001750 00000001451 11566224110 012621 0000000 0000000 //
// Copyright (C) 2009 James P Michels III
//
// 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 3 of the License, 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 .
//
using System;
namespace GnomeRDP
{
public enum Protocol : byte
{
rdp,
vnc,
ssh,
}
}
gnome-rdp-0.3.0.9/Profiles/ 0000755 0001750 0001750 00000000000 11566224114 012337 5 0000000 0000000 gnome-rdp-0.3.0.9/Profiles/ProfileCollection.cs 0000644 0001750 0001750 00000004234 11566224110 016221 0000000 0000000 //
// ProfileCollection.cs
//
// Author:
// jmichels <${AuthorEmail}>
//
// Copyright (c) 2010 jmichels
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
using System;
using System.Collections;
using System.Collections.Generic;
using GnomeRDP.ApplicationDataFiles;
using GnomeRDP.Rdp;
using GnomeRDP.Vnc;
using GnomeRDP.Ssh;
namespace GnomeRDP.Profiles
{
public class ProfileCollection : Collection
{
protected override Profile[] LoadItems()
{
var items = new List();
items.AddRange(FileManager.LoadRdpProfiles());
items.AddRange(FileManager.LoadVncProfiles());
items.AddRange(FileManager.LoadSshProfiles());
return items.ToArray();
}
public void Save(Protocol protocol)
{
switch (protocol)
{
case Protocol.rdp: FileManager.SaveRdpProfiles(GetProfiles()); break;
case Protocol.vnc: FileManager.SaveVncProfiles(GetProfiles()); break;
case Protocol.ssh: FileManager.SaveSshProfiles(GetProfiles()); break;
default: throw new ArgumentException(string.Format("Unknown protocol {0}", protocol));
}
}
public override void Save ()
{
FileManager.SaveRdpProfiles(GetProfiles());
FileManager.SaveVncProfiles(GetProfiles());
FileManager.SaveSshProfiles(GetProfiles());
}
public IEnumerable GetProfiles() where U : Profile
{
foreach (var item in Items)
{
if (item is U) yield return (U)item;
}
}
}
}
gnome-rdp-0.3.0.9/Profiles/ProfilesWidget.cs 0000644 0001750 0001750 00000017114 11566224110 015535 0000000 0000000 //
// ProfilesWidget.cs
//
// Author:
// James P Michels III
//
// Copyright (c) 2009 James P Michels III
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
using System;
using System.Collections.Generic;
using System.ComponentModel;
using Gtk;
using Gdk;
using GnomeRDP.Identies;
using GnomeRDP.Sessions;
using GnomeRDP.Logging;
using GnomeRDP.Rdp;
using GnomeRDP.Ssh;
using GnomeRDP.Vnc;
namespace GnomeRDP.Profiles
{
[ToolboxItem(true)]
public partial class ProfilesWidget : Bin
{
private Menu menu = new Menu();
public ProfilesWidget ()
{
this.Build ();
Initialize();
}
private static class Columns
{
public const int id = 0;
public const int icon = 1;
public const int protocol = 2;
public const int description = 3;
}
private void Initialize()
{
treeView.AppendColumn(new TreeViewColumn(null, new CellRendererPixbuf(), "pixbuf", Columns.icon));
treeView.AppendColumn(new TreeViewColumn("Protocol", new CellRendererText(), "text", Columns.protocol));
treeView.AppendColumn(new TreeViewColumn("Description", new CellRendererText(), "text", Columns.description));
treeView.Selection.Mode = SelectionMode.Multiple;
treeView.Model = new ListStore(typeof(string), typeof(Pixbuf), typeof(string), typeof(string));
treeView.RulesHint = true;
Resync();
// Initialize Context Menu
var propertiesMenuItem = new MenuItem("Properties");
propertiesMenuItem.Activated += OnMenuPropertiesActivated;
menu.Add(propertiesMenuItem);
var deleteMenuItem = new MenuItem("Delete");
deleteMenuItem.Activated += OnMenuDeleteActivated;
menu.Add(deleteMenuItem);
}
private void Resync()
{
try
{
ListStore listStore = (ListStore)treeView.Model;
listStore.Clear();
foreach (var item in Program.ProfileCollection.Items)
{
listStore.AppendValues(item.Id, item.GetIcon(true), item.Protocol.ToString(), item.Description);
}
}
catch
{
}
}
private Profile[] GetSelectedProfiles()
{
var items = new List();
try
{
foreach (var path in treeView.Selection.GetSelectedRows())
{
TreeIter iter;
treeView.Model.GetIter(out iter, path);
string id = (string)treeView.Model.GetValue(iter, Columns.id);
items.Add(Program.ProfileCollection.Find(id));
}
return items.ToArray();
}
catch
{
return new Profile[0];
}
}
[GLib.ConnectBefore()]
protected virtual void OnTreeViewButtonPressEvent (object o, Gtk.ButtonPressEventArgs args)
{
try
{
if (args.Event.Button != 3)
{
args.RetVal = false;
return;
}
TreePath path;
if (treeView.GetPathAtPos((int)args.Event.X, (int)args.Event.Y, out path) == false) return;
treeView.GrabFocus();
treeView.SetCursor(path, treeView.Columns[0], false);
menu.ShowAll();
menu.Popup();
args.RetVal = true;
}
catch
{
}
}
protected virtual void OnMenuPropertiesActivated (object sender, System.EventArgs e)
{
try
{
foreach (var profile in GetSelectedProfiles())
{
bool result;
switch (profile.Protocol)
{
case Protocol.rdp: result = EditRdpProfile((RdpProfile)profile); break;
case Protocol.vnc: result = EditVncProfile((VncProfile)profile); break;
case Protocol.ssh: result = EditSshProfile((SshProfile)profile); break;
default: result = false; break;
}
if (result == true) Program.ProfileCollection.Save(profile.Protocol);
}
}
catch(Exception ex)
{
Log.Add(ex);
}
Resync();
}
private bool EditRdpProfile(RdpProfile profile)
{
RdpProfileDialog dlg = new RdpProfileDialog(profile);
try
{
if (dlg.Run() != (int)ResponseType.Ok) return false;
profile.Description = dlg.Description;
profile.RdpVersion = dlg.RdpVersion;
profile.KeyboardLayout = dlg.KeyboardLayout;
profile.Width = dlg.RdpWidth;
profile.Height = dlg.RdpHeight;
profile.RdpColorDepth = dlg.RdpColorDepth;
profile.RdpExperience = dlg.RdpExperience;
profile.RdpSound = dlg.RdpSound;
profile.FullScreen = dlg.FullScreen;
profile.EnableRdpCompression = dlg.EnableCompression;
profile.AttachToConsole = dlg.AttachToConsole;
return true;
}
catch(Exception ex)
{
Log.Add(ex);
return false;
}
finally
{
dlg.Destroy();
}
}
private bool EditVncProfile(VncProfile profile)
{
VncProfileDialog dlg = new VncProfileDialog(profile);
try
{
if (dlg.Run() != (int)ResponseType.Ok) return false;
profile.Description = dlg.Description;
profile.ColorDepth = dlg.ColorDepth;
profile.Encoding = dlg.Encoding;
profile.FullScreen = dlg.FullScreen;
profile.Shared = dlg.Shared;
profile.ViewOnly = dlg.ViewOnly;
return true;
}
catch(Exception ex)
{
Log.Add(ex);
return false;
}
finally
{
dlg.Destroy();
}
}
private bool EditSshProfile(SshProfile profile)
{
SshProfileDialog dlg = new SshProfileDialog(profile);
try
{
if (dlg.Run() != (int)ResponseType.Ok) return false;
profile.Description = dlg.Description;
profile.FullScreen = dlg.FullScreen;
profile.X11Forwarding = dlg.X11Forwarding;
return true;
}
catch(Exception ex)
{
Log.Add(ex);
return false;
}
finally
{
dlg.Destroy();
}
}
protected virtual void OnMenuDeleteActivated (object sender, System.EventArgs e)
{
try
{
foreach (var profile in GetSelectedProfiles())
{
MessageDialog dlg = new MessageDialog(null, DialogFlags.Modal, MessageType.Question, ButtonsType.YesNo, "Are you sure you want to delete {0} profile {1}?", profile.Protocol, profile.Description);
try
{
if (dlg.Run() != (int)ResponseType.Yes) continue;
}
finally
{
dlg.Destroy();
}
Program.ProfileCollection.Remove(profile);
}
}
catch(Exception ex)
{
Log.Add(ex);
}
Resync();
}
protected virtual void OnNewRdpActionActivated (object sender, System.EventArgs e)
{
try
{
RdpProfile profile = new RdpProfile();
if (EditRdpProfile(profile)) Program.ProfileCollection.Add(profile);
}
catch (Exception ex)
{
Log.Add(ex);
}
Resync();
}
protected virtual void OnNewVncActionActivated (object sender, System.EventArgs e)
{
try
{
VncProfile profile = new VncProfile();
if (EditVncProfile(profile)) Program.ProfileCollection.Add(profile);
}
catch (Exception ex)
{
Log.Add(ex);
}
Resync();
}
protected virtual void OnNewSshActionActivated (object sender, System.EventArgs e)
{
try
{
SshProfile profile = new SshProfile();
if (EditSshProfile(profile)) Program.ProfileCollection.Add(profile);
}
catch (Exception ex)
{
Log.Add(ex);
}
Resync();
}
}
}
gnome-rdp-0.3.0.9/Profiles/Profile.cs 0000644 0001750 0001750 00000005300 11566224110 014200 0000000 0000000 //
// Profile.cs
//
// Author:
// James P Michels III
//
// Copyright (c) 2009 James P Michels III
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
using System;
using System.Collections.Generic;
using Gdk;
using GnomeRDP.Rdp;
using GnomeRDP.Vnc;
using GnomeRDP.Ssh;
namespace GnomeRDP.Profiles
{
public abstract class Profile : IIdType, IEquatable, ISimiliar
{
public Profile(Protocol protocol, string id, string description)
{
this.protocol = protocol;
this.id = id;
this.description = description;
}
public Profile(Protocol protocol, Dictionary dictionary)
{
this.protocol = protocol;
this.id = dictionary[Fields.id];
this.description = dictionary[Fields.description];
}
protected static class Fields
{
public const string protocol = "Protocol";
public const string id = "Id";
public const string description = "Description";
}
protected readonly Protocol protocol;
public Protocol Protocol
{
get
{
return protocol;
}
}
private readonly string id;
public string Id
{
get
{
return id;
}
}
private string description;
public string Description
{
get
{
return description;
}
set
{
description = value;
}
}
public static Pixbuf GetIcon(Profile item, bool small)
{
if (item == null) return null;
switch (item.Protocol)
{
case Protocol.rdp: return ResourceLoader.Find(small ? ResourceLoader.Icons.rdpSmall: ResourceLoader.Icons.rdp);
case Protocol.ssh: return ResourceLoader.Find(small ? ResourceLoader.Icons.sshSmall: ResourceLoader.Icons.ssh);
case Protocol.vnc: return ResourceLoader.Find(small ? ResourceLoader.Icons.vncSmall: ResourceLoader.Icons.vnc);
default: return null;
}
}
public Pixbuf GetIcon(bool small)
{
return GetIcon(this, small);
}
public bool Equals(Profile other)
{
return id == other.id;
}
public abstract bool IsLike(Profile other);
}
}
gnome-rdp-0.3.0.9/Ssh/ 0000755 0001750 0001750 00000000000 11566224110 011305 5 0000000 0000000 gnome-rdp-0.3.0.9/Ssh/SshProfile.cs 0000644 0001750 0001750 00000006026 11566224110 013636 0000000 0000000 //
// SshProfile.cs
//
// Author:
// James P Michels III
//
// Copyright (c) 2009 James P Michels III
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
using System;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using GnomeRDP.Profiles;
using GnomeRDP.Identies;
namespace GnomeRDP.Ssh
{
public class SshProfile : Profile
{
public SshProfile () : base(Protocol.ssh, Program.CreateID(), "")
{
}
private SshProfile(Dictionary dictionary)
: base(Protocol.ssh, dictionary)
{
fullScreen = bool.Parse(dictionary[Fields.fullScreen]);
x11Forwarding = bool.Parse(dictionary[Fields.x11Forwarding]);
}
private new static class Fields
{
public const string fullScreen = "FullScreen";
public const string x11Forwarding = "X11Forwarding";
}
public static SshProfile Create(Dictionary dictionary)
{
return new SshProfile(dictionary);
}
public static Dictionary ToDictionary(SshProfile item)
{
Dictionary dictionary = new Dictionary();
dictionary[Profile.Fields.id] = item.Id;
dictionary[Profile.Fields.description] = item.Description;
dictionary[Fields.fullScreen] = item.FullScreen.ToString();
dictionary[Fields.x11Forwarding] = item.X11Forwarding.ToString();
return dictionary;
}
private bool fullScreen = false;
public bool FullScreen
{
get
{
return fullScreen;
}
set
{
fullScreen = value;
}
}
private bool x11Forwarding = false;
public bool X11Forwarding
{
get
{
return x11Forwarding;
}
set
{
x11Forwarding = value;
}
}
public override bool IsLike (Profile other)
{
var sshOther = other as SshProfile;
if(sshOther == null) return false;
return FullScreen == sshOther.FullScreen
&& X11Forwarding == sshOther.X11Forwarding;
}
public string ToCommandLineArguements(string server, Identity identity)
{
StringBuilder text = new StringBuilder();
if (identity != null && string.IsNullOrEmpty(identity.Username) ==false)
{
text.AppendFormat(" -l {0}", identity.Username);
}
if (X11Forwarding) text.AppendFormat(" -X");
text.Append(" -e none -t");
text.AppendFormat(" {0}", server);
return text.ToString();
}
}
}
gnome-rdp-0.3.0.9/Ssh/SshProfileDialog.cs 0000644 0001750 0001750 00000002736 11566224110 014762 0000000 0000000 //
// SshProfileDialog.cs
//
// Author:
// James P Michels III
//
// Copyright (c) 2010 James P Michels III
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
using System;
using GnomeRDP.Ssh;
namespace GnomeRDP
{
public partial class SshProfileDialog : Gtk.Dialog
{
public SshProfileDialog (SshProfile profile)
{
this.Build ();
txtDescription.Text = profile.Description;
chkFullScreen.Active = profile.FullScreen;
chkX11Forwarding.Active = profile.X11Forwarding;
}
public string Description
{
get
{
return txtDescription.Text;
}
}
public bool FullScreen
{
get
{
return chkFullScreen.Active;
}
}
public bool X11Forwarding
{
get
{
return chkX11Forwarding.Active;
}
}
}
}
gnome-rdp-0.3.0.9/Collection.cs 0000644 0001750 0001750 00000005153 11566224110 013116 0000000 0000000 //
// Collection.cs
//
// Author:
// James P Michels III
//
// Copyright (c) 2009 James P Michels III
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
using System;
using System.Collections.Generic;
namespace GnomeRDP
{
public abstract class Collection where T : class, IIdType, IEquatable
{
protected readonly Dictionary items = new Dictionary();
public Collection()
{
T[] items = LoadItems();
foreach (var item in items)
{
this.items[item.Id] = item;
}
}
protected abstract T[] LoadItems();
public void Add(T item)
{
lock(this.items)
{
this.items[item.Id] = item;
}
Save();
}
public void Remove(T item)
{
lock(this.items)
{
this.items.Remove(item.Id);
}
Save();
}
public T Find(string id)
{
lock(this.items)
{
T item;
this.items.TryGetValue(id, out item);
return item;
}
}
public T[] ToArray()
{
lock(this.items)
{
T[] array = new T[this.items.Values.Count];
this.items.Values.CopyTo(array, 0);
return array;
}
}
public int Count
{
get
{
lock (this.items)
{
return this.items.Count;
}
}
}
public IEnumerable Items
{
get
{
T[] items = ToArray();
foreach (var item in items)
{
yield return item;
}
}
}
// HACK workaround for mono 2.4.x compiler bug. remove after moving all deployments to mono 2.6 or higher.
public T FindSimiliarOrAdd(T t)
{
ISimiliar u = (ISimiliar) t;
foreach (var item in ToArray())
{
if (u.IsLike(item)) return item;
}
Add(t);
return t;
}
// public U FindSimiliarOrAdd(U u) where U : T ,ISimiliar
// {
// foreach (var item in ToArray())
// {
// if (u.IsLike(item)) return (U)item;
// }
//
// Add(u);
//
// return u;
// }
public abstract void Save();
}
}
gnome-rdp-0.3.0.9/ResourceLoader.cs 0000644 0001750 0001750 00000003635 11566224110 013744 0000000 0000000 //
// ResourceLoader.cs
//
// Author:
// James P Michels III
//
// Copyright (c) 2009 James P Michels III
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
using System;
using System.Collections.Generic;
using Gdk;
namespace GnomeRDP
{
public static class ResourceLoader
{
private static readonly Dictionary pixBufs = new Dictionary();
public static class Icons
{
public const string gnomeRdp = "GnomeRDP.Resources.gnome-rdp-icon.png";
public const string folderSmall = "GnomeRDP.Resources.group_16.png";
public const string rdpSmall = "GnomeRDP.Resources.rdp_16.png";
public const string rdp = "GnomeRDP.Resources.rdp.png";
public const string sshSmall = "GnomeRDP.Resources.ssh_16.png";
public const string ssh = "GnomeRDP.Resources.ssh.png";
public const string vncSmall = "GnomeRDP.Resources.vnc_16.png";
public const string vnc = "GnomeRDP.Resources.vnc.png";
}
public static Pixbuf Find(string name)
{
Pixbuf value;
lock(pixBufs)
{
if (pixBufs.TryGetValue(name, out value) == false)
{
value = Pixbuf.LoadFromResource(name);
pixBufs[name] = value;
}
}
return value;
}
}
}
gnome-rdp-0.3.0.9/Sessions/ 0000755 0001750 0001750 00000000000 11566224110 012356 5 0000000 0000000 gnome-rdp-0.3.0.9/Sessions/Session.cs 0000644 0001750 0001750 00000010541 11566224110 014251 0000000 0000000 //
// Copyright (C) 2009 James P Michels III
//
// 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 3 of the License, 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 .
//
using System;
using System.Collections.Generic;
using GnomeRDP.Identies;
using GnomeRDP.Profiles;
using GnomeRDP.Rdp;
namespace GnomeRDP.Sessions
{
public class Session : IIdType, IEquatable
{
public const string defaultGroupName = "Default";
public Session () : this(Program.CreateID(), null, null, null, null)
{
}
public Session(string server, string identityId, string profileId, string group)
: this(Program.CreateID(), server, identityId, profileId, group)
{
}
private Session(string id, string server, string identityId, string profileId, string group)
{
this.id = id;
this.server = server;
this.identityId = identityId;
this.profileId = profileId;
this.group = group;
}
private static class Fields
{
public const string id = "Id";
public const string server = "Server";
public const string identityId = "IdentityId";
public const string profileId = "ProfileId";
public const string group = "Group";
}
public static Session Create(Dictionary dictionary)
{
string id = dictionary[Fields.id];
string server = dictionary[Fields.server];
string identityId = dictionary[Fields.identityId];
string profileId = dictionary[Fields.profileId];
string group = dictionary[Fields.group];
return new Session(id, server, identityId, profileId, group);
}
public static Dictionary ToDictionary(Session item)
{
Dictionary dictionary = new Dictionary();
dictionary[Fields.id] = item.Id;
dictionary[Fields.server] = item.Server;
dictionary[Fields.identityId] = item.identityId;
dictionary[Fields.profileId] = item.profileId;
dictionary[Fields.group] = item.Group;
return dictionary;
}
public bool Equals(Session other)
{
return id == other.id;
}
public override int GetHashCode ()
{
return id.GetHashCode();
}
private readonly string id;
public string Id
{
get
{
return id;
}
}
private string server;
public string Server
{
get
{
return server;
}
set
{
server = value;
}
}
private string identityId = null;
public Identity Identity
{
get
{
return Program.IdentityCollection.Find(identityId);
}
set
{
identityId = value.Id;
}
}
private string profileId;
public Profile Profile
{
get
{
return Program.ProfileCollection.Find(profileId);
}
set
{
profileId = value.Id;
}
}
private string group;
public string Group
{
get
{
return group;
}
set
{
group = value;
}
}
public string MenuFormat
{
get
{
Identity identity = Identity;
string identityDescription = identity == null ? null : identity.Description;
string identitySeperator = string.IsNullOrEmpty(identityDescription) ? null : " - ";
Profile profile = Profile;
string profileDescription = profile == null ? null : profile.Description;
string profileSeperator = string.IsNullOrEmpty(profileDescription) ? null : " - ";
return string.Format("{0}{1}{2}{3}{4}", server, identitySeperator, identityDescription, profileSeperator, profileDescription);
}
}
public string Tooltip
{
get
{
Identity identity = Identity;
string domainUser = identity == null ? null : string.Format(@"{0}\{1}", identity.Domain, identity.Username);
Profile profile = Profile;
string protocol = profile == null ? null : profile.Protocol.ToString();
string description = profile == null ? null : profile.Description;
return string.Format("{0}@{1}://{2} {3}", domainUser, protocol, server, description);
}
}
}
}
gnome-rdp-0.3.0.9/Sessions/SessionsWidget.cs 0000644 0001750 0001750 00000030231 11566224110 015576 0000000 0000000 //
// SessionsWidget.cs
//
// Author:
// James P Michels III
//
// Copyright (c) 2009 James P Michels III
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using Gtk;
using Gdk;
using GnomeRDP.Identies;
using GnomeRDP.Sessions;
using GnomeRDP.Logging;
using GnomeRDP.Profiles;
using GnomeRDP.Rdp;
using GnomeRDP.Ssh;
using GnomeRDP.Vnc;
namespace GnomeRDP.Sessions
{
[ToolboxItem(true)]
public partial class SessionsWidget : Bin
{
private Menu menu = new Menu();
public SessionsWidget ()
{
this.Build ();
Initialize();
}
private static class Columns
{
public const int item = 0;
public const int icon = 1;
public const int protocol = 2;
public const int server = 3;
public const int identity = 4;
public const int profile = 5;
public const int group = 2;
}
private void Initialize()
{
// Columns
treeView.AppendColumn(new TreeViewColumn(null, new CellRendererPixbuf(), "pixbuf", Columns.icon));
treeView.AppendColumn(new TreeViewColumn("Protocol", new CellRendererText(), "text", Columns.protocol));
treeView.AppendColumn(new TreeViewColumn("Server", new CellRendererText(), "text", Columns.server));
treeView.AppendColumn(new TreeViewColumn("Identity", new CellRendererText(), "text", Columns.identity));
treeView.AppendColumn(new TreeViewColumn("Profile", new CellRendererText(), "text", Columns.profile));
treeView.Selection.Mode = SelectionMode.Single;
treeView.RowActivated += (s, e) => ConnectSelected();
// Model
TreeStore treeStore = new TreeStore(typeof(object), typeof(Pixbuf), typeof(string), typeof(string), typeof(string), typeof(string));
treeStore.AppendValues(null, ResourceLoader.Find(ResourceLoader.Icons.folderSmall), Session.defaultGroupName);
treeStore.SetSortColumnId(Columns.group, SortType.Ascending);
treeStore.SetSortFunc(Columns.group, TreeIterCompareCallback);
treeView.Model = treeStore;
// Drag Drop
TargetEntry[] targets = new TargetEntry[] { new TargetEntry("session", TargetFlags.Widget, 0) };
treeView.EnableModelDragSource(ModifierType.Button1Mask, targets, DragAction.Copy);
treeView.EnableModelDragDest(targets, DragAction.Private);
treeView.DragDataReceived += TreeView_DragDataReceived;
// Tweaks
treeView.EnableTreeLines = true;
treeView.HeadersVisible = false;
treeView.RulesHint = true;
// Initialize Context Menu
var propertiesMenuItem = new MenuItem("Properties");
propertiesMenuItem.Activated += OnMenuPropertiesActivated;
menu.Add(propertiesMenuItem);
var deleteMenuItem = new MenuItem("Delete");
deleteMenuItem.Activated += OnMenuDeleteActivated;
menu.Add(deleteMenuItem);
// Load data into the tree.
Resync();
}
private void TreeView_DragDataReceived(object o, DragDataReceivedArgs args)
{
var selectedItems = GetSelectedItems();
if (selectedItems.Length != 1) return;
Session session = selectedItems[0] as Session;
if (session == null) return;
TreePath path;
TreeViewDropPosition pos;
treeView.GetDestRowAtPos(args.X, args.Y, out path, out pos);
TreeStore treeStore = (TreeStore)treeView.Model;
TreeIter iter;
treeStore.GetIter(out iter, path);
TreeIter groupIter;
if (TryFindGroup(treeStore, iter, out groupIter) == false) return;
session.Group = (string)treeStore.GetValue(groupIter, Columns.group);
Program.SessionCollection.Save();
Resync();
}
private static int TreeIterCompareCallback(TreeModel model, TreeIter leftIter, TreeIter rightIter)
{
TreeStore treeStore = (TreeStore)model;
string left = null;
TreeIter leftGroup;
if (TryFindGroup(treeStore, leftIter, out leftGroup))
{
left = string.Format("{0} {1}", treeStore.GetValue(leftGroup, Columns.group), treeStore.GetValue(leftIter, Columns.server));
}
string right = null;
TreeIter rightGroup;
if (TryFindGroup(treeStore, rightIter, out rightGroup))
{
right = string.Format("{0} {1}", treeStore.GetValue(rightGroup, Columns.group), treeStore.GetValue(rightIter, Columns.server));
}
return string.Compare(left, right);
}
private void Resync()
{
try
{
TreeStore treeStore = (TreeStore)treeView.Model;
var deletedSessions = GetSessions(treeStore);
foreach (var item in Program.SessionCollection.Items)
{
deletedSessions.Remove(item);
string group = item.Group;
TreeIter groupIter = FindGroup(string.IsNullOrEmpty(group) ? Session.defaultGroupName : group);
object[] values = new object[]
{
item,
Profile.GetIcon(item.Profile, true),
item.Profile == null ? null : item.Profile.Protocol.ToString(),
item.Server,
item.Identity == null ? "" : item.Identity.ToString(),
item.Profile == null ? "" : item.Profile.Description
};
TreeIter itemIter;
if (TryFindSession(item, out itemIter) == false)
{
treeStore.AppendValues(groupIter, values);
}
else
{
TreeIter parent;
if (treeStore.IterParent(out parent, itemIter) == false || treeStore.GetPath(parent).Compare(treeStore.GetPath(groupIter)) != 0)
{
treeStore.Remove(ref itemIter);
treeStore.AppendValues(groupIter, values);
}
else
{
treeStore.SetValues(itemIter, values);
}
}
}
foreach (var session in deletedSessions)
{
TreeIter iter;
if (TryFindSession(session, out iter))
{
treeStore.Remove(ref iter);
}
}
}
catch (Exception ex)
{
Log.Add(ex);
}
}
private TreeIter FindGroup(string value)
{
TreeStore treeStore = (TreeStore)treeView.Model;
foreach (var iter in EnumerateChildren(treeStore))
{
string group = (string)treeStore.GetValue(iter, Columns.group);
if (group == value) return iter;
}
return treeStore.AppendValues(null, ResourceLoader.Find(ResourceLoader.Icons.folderSmall), value);
}
private static bool TryFindGroup(TreeStore treeStore, TreeIter iter, out TreeIter groupIter)
{
groupIter = iter;
while (treeStore.GetValue(groupIter, Columns.item) as Session != null)
{
if (treeStore.IterParent(out groupIter, groupIter) == false )
{
groupIter = TreeIter.Zero;
return false;
}
}
return true;
}
private bool TryFindSession(Session item, out TreeIter iter)
{
TreeStore treeStore = (TreeStore)treeView.Model;
foreach (var sessionIter in EnumerateSessions(treeStore))
{
var session = (Session)treeStore.GetValue(sessionIter, Columns.item);
if (session.Id == item.Id)
{
iter = sessionIter;
return true;
}
}
iter = TreeIter.Zero;
return false;
}
private static IEnumerable EnumerateChildren(TreeStore treeStore)
{
TreeIter iter;
if (treeStore.IterChildren(out iter) == false) yield break;
do
{
yield return iter;
}
while (treeStore.IterNext(ref iter));
}
private static IEnumerable EnumerateChildren(TreeStore treeStore, TreeIter parent)
{
TreeIter iter;
if (treeStore.IterChildren(out iter, parent) == false) yield break;
do
{
yield return iter;
}
while (treeStore.IterNext(ref iter));
}
private static HashSet GetSessions(TreeStore treeStore)
{
HashSet sessions = new HashSet();
foreach (var iter in EnumerateSessions(treeStore))
{
var session = (Session)treeStore.GetValue(iter, Columns.item);
sessions.Add(session);
}
return sessions;
}
private static IEnumerable EnumerateSessions(TreeStore treeStore)
{
foreach (var groupIter in EnumerateChildren(treeStore))
{
foreach (var sessionIter in EnumerateChildren(treeStore, groupIter))
{
var value = treeStore.GetValue(sessionIter, Columns.item);
if (value is Session) yield return sessionIter;
}
}
}
private object[] GetSelectedItems()
{
List