diff options
author | GZNGET FOSS Team <opensource@gznianguan.com> | 2016-10-20 14:42:47 +0200 |
---|---|---|
committer | GZNGET FOSS Team <opensource@gznianguan.com> | 2016-10-20 14:42:47 +0200 |
commit | 3cdb0b2cd2fd76d9f9bc586be56ec77b03c1002b (patch) | |
tree | c4f43674398a9f0b845d20b605398e20336fca68 /bin | |
download | perl-Arctica-Telekinesis-Client-3cdb0b2cd2fd76d9f9bc586be56ec77b03c1002b.tar.gz perl-Arctica-Telekinesis-Client-3cdb0b2cd2fd76d9f9bc586be56ec77b03c1002b.tar.bz2 perl-Arctica-Telekinesis-Client-3cdb0b2cd2fd76d9f9bc586be56ec77b03c1002b.zip |
Initial Commit
Diffstat (limited to 'bin')
-rw-r--r-- | bin/telekinesis-client | 131 |
1 files changed, 131 insertions, 0 deletions
diff --git a/bin/telekinesis-client b/bin/telekinesis-client new file mode 100644 index 0000000..4a65b9c --- /dev/null +++ b/bin/telekinesis-client @@ -0,0 +1,131 @@ +#!/usr/bin/perl -T +################################################################################ +# _____ _ +# |_ _| |_ ___ +# | | | ' \/ -_) +# |_| |_||_\___| +# _ _ ____ _ _ +# / \ _ __ ___| |_(_) ___ __ _ | _ \ _ __ ___ (_) ___ ___| |_ +# / _ \ | '__/ __| __| |/ __/ _` | | |_) | '__/ _ \| |/ _ \/ __| __| +# / ___ \| | | (__| |_| | (_| (_| | | __/| | | (_) | | __/ (__| |_ +# /_/ \_\_| \___|\__|_|\___\__,_| |_| |_| \___// |\___|\___|\__| +# |__/ +# The Arctica Modular Remote Computing Framework +# +################################################################################ +# +# Copyright (C) 2015-2016 The Arctica Project +# http://arctica-project.org/ +# +# This code is dual licensed: strictly GPL-2 or AGPL-3+ +# +# GPL-2 +# ----- +# 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; version 2 of the License. +# +# 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, write to the +# Free Software Foundation, Inc., +# +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. +# +# AGPL-3+ +# ------- +# This programm is free software; you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This programm 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Copyright (C) 2015-2016 Guangzhou Nianguan Electronics Technology Co.Ltd. +# <opensource@gznianguan.com> +# Copyright (C) 2015-2016 Mike Gabriel <mike.gabriel@das-netzwerkteam.de> +# +################################################################################ +use strict; +use Data::Dumper; +use Arctica::Core::eventInit qw(genARandom BugOUT); +use Arctica::Core::JABus::Socket; +use Arctica::Telekinesis::Client; +#use POSIX;daemonize(); + +my $ACO = Arctica::Core::eventInit->new({ + app_name=>'telekinesis-client', + app_class =>'telekinesis-core', + app_version=>'0.0.1.1'}); + +my $TeKiClient = Arctica::Telekinesis::Core::Client->new($ACO); +my $server_sock_id = $TeKiClient->get_tmp_servers_socket_id; + + +$TeKiClient->{'socks'}{'local'} = Arctica::Core::JABus::Socket->new($ACO,{ + type => "unix", + destination => "local", + is_server => 1, + handle_in_dispatch => { +# csappreg => sub {$TeKiClient->csapp_reg(@_)}, + appcom => \&my_Own_Sub2, + treg => sub {$TeKiClient->target_reg($_[0],$_[1]);}, + qvdcmd => \&my_Own_Sub2, + }, +}); + +$TeKiClient->{'socks'}{'remote'} = Arctica::Core::JABus::Socket->new($ACO,{ + type => "unix", + destination => "local", # FIX ME (change to remote!!!) + is_client => 1, + connect_to => $server_sock_id, + handle_in_dispatch => { + csappreg => sub {$TeKiClient->csapp_reg(@_)}, + srvcneg => sub {$TeKiClient->c2s_service_neg(@_)}, + appctrl => \&teki_client2s_appctrl, + }, + hooks => { + on_ready => sub {$TeKiClient->init_c2s_service_neg;}, + on_client_errhup => sub {print "\tLOST CONN!\n"}, + }, + +}); + + +sub teki_client2s_appctrl { + my $app_id = $_[0]->{'appid'}; + my $ctrldata = $_[0]->{'ctrldata'}; +# print "APPCTRL: $app_id",Dumper($ctrldata); + if ($ctrldata->{'action'} eq "app_init") { +# print "YAY APPARAPPARAPPAPA INIT LA!\n"; + $TeKiClient->app_init_win_and_targets($app_id,$ctrldata); + } elsif ($ctrldata->{'action'} eq "state_change") { + $TeKiClient->target_state_change($app_id,$ctrldata); + }else { + warn("Unknown 'action': '$ctrldata->{'action'}'"); + } +} + +$ACO->{'Glib'}{'MainLoop'}->run; + + + +sub my_Own_Sub1 { + +} + +sub my_Own_Sub2 { + +} |