function template(screen_key,list_of_uniq_id,focus_func,isPowerOn){
var map=[
[0,0,0,0],
[0,0,0,0],
[0,0,0,0],
[1,1,1,1]
];
this._create_map(map);
this._mapping[0]={pos_x:0,pos_y:0,width:1920,height:1080,map_x:0,map_y:0,map_h:4,map_w:4};
this._mapping[1]={pos_x:0,pos_y:0,width:1920,height:1080,map_x:0,map_y:0,map_h:4,map_w:4};
if(isPowerOn){
var player=new BroadcastPlayer();
player.df_disconnect();
player.osd_control(OSD_NORMAL);}
this.superClass=Screen;
this.superClass(screen_key,list_of_uniq_id,focus_func,isPowerOn);};
template.prototype=new Screen();
template.prototype.createGadgets=function (list_of_product_id,is_force){
if(!isActiveStatus()&&!is_force)return;
Screen.prototype.createGadgets.apply(this,arguments);
var screen_obj=this;
var gadget_obj0=this.gadgets[0];
gadget_obj0.translate=[0,0,0];
gadget_obj0.setMySize(1920,1080);
if(gadget_obj0.gadget){
gadget_obj0.gadget.df_disconnect_req=true;}else{
gadget_obj0.getMySize=function(){
gadget_obj0.gadget.df_disconnect_req=true;
return gadget_obj0._size||null;};}
var gadget_obj1=this.gadgets[1];
var extend=function(){
gadget_obj1.gadget.startApp=function(){
return screen_obj.startApp.apply(screen_obj,arguments);};
gadget_obj1.gadget.stopApp=function(){
return screen_obj.stopApp.apply(screen_obj,arguments);};
gadget_obj1.gadget.isAppRunning=function(){
return screen_obj["@isRunning"];};
gadget_obj1.gadget.startApp.toString=NULL_FUNCTION;
gadget_obj1.gadget.stopApp.toString=NULL_FUNCTION;
gadget_obj1.gadget.isAppRunning.toString=NULL_FUNCTION;}
gadget_obj1.translate=[0,0,0];
gadget_obj1.setMySize(1920,1080);
if(gadget_obj1.gadget){
extend();}else{
gadget_obj1.getMySize=function(){
extend();
return gadget_obj1._size||null;};}
this.cursor=this.gadgets[1];};
template.prototype.getTemplateName=function (){
return this._template_name||"xumolive";};
template.prototype.setScreenName=function (name){
if(!isString(name)){
name="";}
this._screen_name=name.toString();};
template.prototype.setWallPaper=function(){
var data="iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVQI12NgYGAAAAAEAAEnNCcKAAAAAElFTkSuQmCC";
var bin=sysutil.base64.decode(data);
Screen.prototype.setWallPaper.apply(this,[bin]);};
template.prototype.activate=function(bool){
Screen.prototype.activate.apply(this,arguments);
var bplayer=new BroadcastPlayer();
bplayer.connect(VideoDev,AudioDev);
if(bool&&this.status["fullscreen"]){
bplayer.df_disconnect();}else{
bplayer.df_connect();}
};
template.prototype._my_df_control=function (pos){
var bplayer=new BroadcastPlayer();
if(-100<pos[2]&&pos[2]<100){
bplayer.df_disconnect();}else{
bplayer.df_connect();}
};
template.prototype._my_launch_with_transit_effect=function(target,func){
var report=this._collectAccessReportInfo(target);
this._do_gadget(target,"launchApl",[null,report]);
if(func)func();};
template.prototype._set_mask=function (bool){
this.upper_mask.visible_p=bool;
this.under_mask.visible_p=bool;};
template.prototype.key_hook=function (up_down,keysym){
if(this.getMoveStatus()==true)return true;
if(this._SMAd_status()==true){
var ret=false;
switch(keysym){
case TXK_ENTER:
this._do_SMAd("launchApl",["use_gwin",null]);
ret=true;
break;
case TXK_RETURN:
case TXK_EXIT:
this._SMAd_destroy();
ret=false;
break;
case TXK_UP:
case TXK_DOWN:
case TXK_LEFT:
case TXK_RIGHT:
this._do_SMAd("key_hook",[up_down,keysym]);
ret=true;
break;}
return ret;}
var screen_obj=this;
if(this.status["error"]
||this.status["unlock"]
||this.status["confirm"]){
if(this.cursor&&this.cursor.key_hook){
if(this.cursor.key_hook(up_down,keysym)){
if(keysym==TXK_RETURN){
HOME.HomeSoundPlay("cancel");}else{
HOME.HomeSoundPlay("enter");}
return true;}
if((this.status["unlock"])&&(keysym==TXK_EXIT)){
this.cursor=screen_obj._last_cursor;
this._showPasswordPanel(false);}
}
return false;}
var last_state=this["@isRunning"];
if(!this.status["editmode"]&&!return_home_anim){
var ret=this._do_gadget(this.cursor,"key_hook",[up_down,keysym]);
switch(keysym){
case TXK_EXIT:
if(up_down!=KEY_PRESS)return false;
var ret_kill=this._do_gadget(this.cursor,"killApp");
if(!ret_kill){
this.stopApp();
launch_appli(TV_GADGET);}
return true;
case TXK_HOME:
if(!last_state&&!this["@isRunning"]){
return false;}
}
if(ret)return true;}
if((up_down!=KEY_PRESS)||(this.status["launching"]))
return false;
return false;};
template.prototype.startApp=function (){
this["@isRunning"]=true;
if(this.status["activate"]&&this.status["fullscreen"]&&!this.status["suspend"]){
return this._doStartApp();}
};
template.prototype.stopApp=function (){
this["@isRunning"]=false;
if(this.status["activate"]&&this.status["fullscreen"]&&!this.status["suspend"]){
return this._doEndApp();}
};
template.prototype.activate=function (bool){
Screen.prototype.activate.apply(this,arguments);
if(this["@isRunning"]){
if(this.status["activate"]&&this.status["fullscreen"]&&!this.status["suspend"]){
this._doStartApp();}else{
this._doEndApp();}
}
};
template.prototype.reset=function (){
Screen.prototype.reset.apply(this,arguments);
if(this["@isRunning"]){
if(this.status["activate"]&&this.status["fullscreen"]&&!this.status["suspend"]){
this._doStartApp();}else{
this._doEndApp();}
}
}
template.prototype._my_transit_return_HOME=function(){
Screen.prototype._my_transit_return_HOME.apply(this,arguments);
this._do_gadget(this.cursor,"returnFromTV");};
template.prototype._doStartApp=function (){
var bplayer=new BroadcastPlayer();
try{
system.key_control.set_key_mode(system.key_control.MODE_OTHER);
system.key_control.color=true;
bplayer.osd_control(OSD_INVISIBLE);
bplayer.disconnect();
bplayer.set_browser_mode(BR_SRC_VS);}catch(e){
console.log(e.message);}
HOME.toolbar.visible_p=false;};
template.prototype._doEndApp=function (){
var bplayer=new BroadcastPlayer();
try{
system.key_control.set_key_mode(system.key_control.MODE_HOME);
system.key_control.color=false;
bplayer.connect(VideoDev,AudioDev);
bplayer.osd_control(OSD_NORMAL);
bplayer.set_browser_mode(BR_SRC_DEFAULT);}catch(e){
console.log(e.message);}
HOME.toolbar.visible_p=true;
delEventHook(ebus.kbd);};
