#!/usr/bin/perl -X -T ################################################################################ # _____ _ # |_ _| |_ ___ # | | | ' \/ -_) # |_| |_||_\___| # _ _ ____ _ _ # / \ _ __ ___| |_(_) ___ __ _ | _ \ _ __ ___ (_) ___ ___| |_ # / _ \ | '__/ __| __| |/ __/ _` | | |_) | '__/ _ \| |/ _ \/ __| __| # / ___ \| | | (__| |_| | (_| (_| | | __/| | | (_) | | __/ (__| |_ # /_/ \_\_| \___|\__|_|\___\__,_| |_| |_| \___// |\___|\___|\__| # |__/ # The Arctica Modular Remote Computing Framework # ################################################################################ # # Copyright (C) 2015-2017 The Arctica Project # http://http://arctica-project.org/ # # This code is licensed under AGPL-3+. # # 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-2017 Guangzhou Nianguan Electronics Technology Co.Ltd. # # Copyright (C) 2015-2017 Mike Gabriel # # # Note: As this project is licensed under AGPL-3+, all linked-in # shared libraries derived from the Arctica Project must be # considered as licensed under AGPL-3+ in this context, too # (they are normally dual licensed under GPL-2 or AGPL-3+). # # Please consider this, when offering a modified version of # Arctica Browser as a serivce. To comply with AGPL-3+, you have # to make the modified source code of all components of Arctica # Browser available to your users. # ################################################################################ use strict; use Data::Dumper; use Cwd 'abs_path'; use Arctica::Core::eventInit qw(genARandom BugOUT); use Arctica::Telekinesis::Application::Gtk3; my $ACO = Arctica::Core::eventInit->new({ app_name=>'arctica-mediaplayer', app_class =>'tekiapp', app_version=>'0.0.0.1'}); #print "FUP:\t$fullpath\nLID:\t$link_id\n"; #die; my $TeKiGtk3 = Arctica::Telekinesis::Application::Gtk3->new($ACO,{ services => { multimedia => { conf => { files_only => 1, }, }, }, }); LoadCSS(); my $fullpath = abs_path(@ARGV[0]); my $link_id; if (-f $fullpath) { # print "FP: $fullpath\n"; if ($fullpath =~ /(.*)/) { $fullpath = $1; } else { die; } # $link_id = time(); # symlink($fullpath,"/var/lib/arctica-mediaplayer/www/private/$link_id.lnk"); } else { print "PLAY WHAT?!!\n\n";die; } my $main_window = Gtk3::Window->new('toplevel'); $main_window->set_title('aTelePlayer'); my $window_id = $TeKiGtk3->add_window($main_window); my $target_id = $TeKiGtk3->new_target($window_id,"multimedia",$fullpath); $TeKiGtk3->{'targets'}{$target_id}{'tmplnkid'} = $TeKiGtk3->req_file_forwarding($fullpath);#TMP GARBAGE #my $box = Gtk3::Box->new( 'horizontal', 0 ); #$window->add($box); #$box->show(); my $vBox = Gtk3::Box->new( 'vertical', 0 ); #$box->add($box1); $main_window->add($vBox); $vBox->show(); $vBox->pack_start($TeKiGtk3->get_widget($target_id), 1, 1, 0 ); $main_window->set_border_width(0); $main_window->resize(600,300); $main_window->show_all(); # We'll wan't to start this within the Application::Gtk3 thingie... but for now it can stay out here... my $timeout = Glib::Timeout->add(50, sub {$TeKiGtk3->check_n_send();return 1;}); $ACO->{'Glib'}{'MainLoop'}->run; sub LoadCSS { my $Gtk3_CSS_Provider = Gtk3::CssProvider->new; my $Display = Gtk3::Gdk::Display::get_default(); my $Screen = $Display->get_default_screen; $Gtk3_CSS_Provider->load_from_data ([map ord, split //,"GtkSocket{ background-color: #000000;}"]); # Make it easy to see not only TeKi overlay issues but also unavoidable # Gtk3 issues that are most evident on slow systems or systems with artificially induced X latency # $Gtk3_CSS_Provider->load_from_data ([map ord, split //,"GtkSocket{ background-color: #990000;}\nGtkWindow{background-color: #009900;}"]); Gtk3::StyleContext::add_provider_for_screen( $Screen, $Gtk3_CSS_Provider, Gtk3::STYLE_PROVIDER_PRIORITY_USER); }