mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 07:51:11 +02:00
Merge branch 'ni/tuxbox' into ni/mp/tuxbox
Conflicts:
src/gui/plugins.cpp
src/gui/plugins.h
Origin commit data
------------------
Branch: ni/coolstream
Commit: a11e7df409
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-09-08 (Fri, 08 Sep 2017)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -9,3 +9,6 @@ SUBDIRS = \
|
|||||||
slider \
|
slider \
|
||||||
status \
|
status \
|
||||||
various
|
various
|
||||||
|
|
||||||
|
install-data-hook:
|
||||||
|
$(INSTALL) -d $(DESTDIR)/$(ICONSDIR)/logo
|
||||||
|
@@ -123,8 +123,8 @@ int CInfoMenu::showMenu()
|
|||||||
mf->setHint(NEUTRINO_ICON_HINT_HDD_INFO, LOCALE_MENU_HINT_HDD_INFO);
|
mf->setHint(NEUTRINO_ICON_HINT_HDD_INFO, LOCALE_MENU_HINT_HDD_INFO);
|
||||||
info->addItem(mf);
|
info->addItem(mf);
|
||||||
|
|
||||||
//add I_TYPE_INFORMATION plugins
|
//add PLUGIN_INTEGRATION_INFORMATION plugins
|
||||||
info->integratePlugins(CPlugins::I_TYPE_INFORMATION, 1);
|
info->integratePlugins(PLUGIN_INTEGRATION_INFORMATION, 1);
|
||||||
|
|
||||||
int res = info->exec(NULL, "");
|
int res = info->exec(NULL, "");
|
||||||
delete info;
|
delete info;
|
||||||
|
@@ -266,9 +266,9 @@ int CMediaPlayerMenu::initMenuMedia(CMenuWidget *m, CPersonalizeGui *p)
|
|||||||
//adding personalized items
|
//adding personalized items
|
||||||
personalize->addPersonalizedItems();
|
personalize->addPersonalizedItems();
|
||||||
|
|
||||||
//add I_TYPE_MULTIMEDIA plugins
|
//add PLUGIN_INTEGRATION_MULTIMEDIA plugins
|
||||||
unsigned int nextShortcut = (unsigned int)media->getNextShortcut();
|
unsigned int nextShortcut = (unsigned int)media->getNextShortcut();
|
||||||
media->integratePlugins(CPlugins::I_TYPE_MULTIMEDIA, nextShortcut, enabled);
|
media->integratePlugins(PLUGIN_INTEGRATION_MULTIMEDIA, nextShortcut, enabled);
|
||||||
|
|
||||||
res = media->exec(NULL, "");
|
res = media->exec(NULL, "");
|
||||||
delete media;
|
delete media;
|
||||||
|
@@ -455,8 +455,8 @@ int CNIMenu::show()
|
|||||||
mf->setHint(NEUTRINO_ICON_HINT_LCD4L, LOCALE_MENU_HINT_LCD4L_SUPPORT);
|
mf->setHint(NEUTRINO_ICON_HINT_LCD4L, LOCALE_MENU_HINT_LCD4L_SUPPORT);
|
||||||
ni_menu->addItem(mf);
|
ni_menu->addItem(mf);
|
||||||
|
|
||||||
//add I_TYPE_NI_MENU plugins
|
//add PLUGIN_INTEGRATION_NI_MENU plugins
|
||||||
ni_menu->integratePlugins(CPlugins::I_TYPE_NI_MENU, shortcut);
|
ni_menu->integratePlugins(PLUGIN_INTEGRATION_NI_MENU, shortcut);
|
||||||
|
|
||||||
int res = ni_menu->exec(NULL, "");
|
int res = ni_menu->exec(NULL, "");
|
||||||
|
|
||||||
|
@@ -4,38 +4,28 @@
|
|||||||
Copyright (C) 2001 Steffen Hehn 'McClean'
|
Copyright (C) 2001 Steffen Hehn 'McClean'
|
||||||
Homepage: http://dbox.cyberphoria.org/
|
Homepage: http://dbox.cyberphoria.org/
|
||||||
|
|
||||||
Kommentar:
|
|
||||||
|
|
||||||
Diese GUI wurde von Grund auf neu programmiert und sollte nun vom
|
|
||||||
Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert
|
|
||||||
auf der Client-Server Idee, diese GUI ist also von der direkten DBox-
|
|
||||||
Steuerung getrennt. Diese wird dann von Daemons uebernommen.
|
|
||||||
|
|
||||||
|
|
||||||
License: GPL
|
License: GPL
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or
|
||||||
it under the terms of the GNU General Public License as published by
|
modify it under the terms of the GNU General Public
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
License as published by the Free Software Foundation; either
|
||||||
(at your option) any later version.
|
version 2 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
GNU General Public License for more details.
|
General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <plugin.h>
|
|
||||||
|
|
||||||
#include <gui/pluginlist.h>
|
#include <gui/pluginlist.h>
|
||||||
|
#include <gui/plugins.h>
|
||||||
#include <gui/components/cc.h>
|
#include <gui/components/cc.h>
|
||||||
#include <gui/widget/msgbox.h>
|
#include <gui/widget/msgbox.h>
|
||||||
#include <gui/widget/icons.h>
|
#include <gui/widget/icons.h>
|
||||||
@@ -59,8 +49,6 @@
|
|||||||
#include <zapit/client/zapittools.h>
|
#include <zapit/client/zapittools.h>
|
||||||
#include <system/helpers.h>
|
#include <system/helpers.h>
|
||||||
|
|
||||||
#include "plugins.h"
|
|
||||||
|
|
||||||
extern CPlugins * g_Plugins; /* neutrino.cpp */
|
extern CPlugins * g_Plugins; /* neutrino.cpp */
|
||||||
|
|
||||||
CPluginList::CPluginList(const neutrino_locale_t Title, const uint32_t listtype)
|
CPluginList::CPluginList(const neutrino_locale_t Title, const uint32_t listtype)
|
||||||
@@ -111,7 +99,7 @@ int CPluginList::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
int nop = g_Plugins->getNumberOfPlugins();
|
int nop = g_Plugins->getNumberOfPlugins();
|
||||||
|
|
||||||
for(int count = 0; count < nop; count++) {
|
for(int count = 0; count < nop; count++) {
|
||||||
if ((g_Plugins->getType(count) & pluginlisttype) && !g_Plugins->isHidden(count) && (g_Plugins->getIntegration(count) == CPlugins::I_TYPE_DISABLED)) {
|
if ((g_Plugins->getType(count) & pluginlisttype) && !g_Plugins->isHidden(count) && (g_Plugins->getIntegration(count) == PLUGIN_INTEGRATION_DISABLED)) {
|
||||||
neutrino_msg_t d_key = g_Plugins->getKey(count);
|
neutrino_msg_t d_key = g_Plugins->getKey(count);
|
||||||
keyhelper.get(&key, &dummy, d_key);
|
keyhelper.get(&key, &dummy, d_key);
|
||||||
CMenuForwarder *f = new CMenuForwarder(std::string(g_Plugins->getName(count)), true, NULL, this, to_string(count).c_str(), key);
|
CMenuForwarder *f = new CMenuForwarder(std::string(g_Plugins->getName(count)), true, NULL, this, to_string(count).c_str(), key);
|
||||||
@@ -170,7 +158,7 @@ int CPluginsExec::exec(CMenuTarget* parent, const std::string & actionKey)
|
|||||||
if (!g_Plugins->getScriptOutput().empty())
|
if (!g_Plugins->getScriptOutput().empty())
|
||||||
ShowMsg(LOCALE_PLUGINS_RESULT, g_Plugins->getScriptOutput(), CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_SHELL);
|
ShowMsg(LOCALE_PLUGINS_RESULT, g_Plugins->getScriptOutput(), CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_SHELL);
|
||||||
|
|
||||||
if (g_Plugins->getIntegration(sel) == CPlugins::I_TYPE_DISABLED)
|
if (g_Plugins->getIntegration(sel) == PLUGIN_INTEGRATION_DISABLED)
|
||||||
return menu_return::RETURN_EXIT;
|
return menu_return::RETURN_EXIT;
|
||||||
|
|
||||||
return menu_return::RETURN_REPAINT;
|
return menu_return::RETURN_REPAINT;
|
||||||
|
@@ -4,29 +4,20 @@
|
|||||||
Copyright (C) 2001 Steffen Hehn 'McClean'
|
Copyright (C) 2001 Steffen Hehn 'McClean'
|
||||||
Homepage: http://dbox.cyberphoria.org/
|
Homepage: http://dbox.cyberphoria.org/
|
||||||
|
|
||||||
Kommentar:
|
|
||||||
|
|
||||||
Diese GUI wurde von Grund auf neu programmiert und sollte nun vom
|
|
||||||
Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert
|
|
||||||
auf der Client-Server Idee, diese GUI ist also von der direkten DBox-
|
|
||||||
Steuerung getrennt. Diese wird dann von Daemons uebernommen.
|
|
||||||
|
|
||||||
|
|
||||||
License: GPL
|
License: GPL
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or
|
||||||
it under the terms of the GNU General Public License as published by
|
modify it under the terms of the GNU General Public
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
License as published by the Free Software Foundation; either
|
||||||
(at your option) any later version.
|
version 2 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
GNU General Public License for more details.
|
General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __pluginlist__
|
#ifndef __pluginlist__
|
||||||
@@ -41,7 +32,6 @@
|
|||||||
|
|
||||||
class CPluginList : public CMenuTarget
|
class CPluginList : public CMenuTarget
|
||||||
{
|
{
|
||||||
|
|
||||||
private:
|
private:
|
||||||
neutrino_locale_t title;
|
neutrino_locale_t title;
|
||||||
uint32_t pluginlisttype;
|
uint32_t pluginlisttype;
|
||||||
|
@@ -8,19 +8,18 @@
|
|||||||
|
|
||||||
License: GPL
|
License: GPL
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or
|
||||||
it under the terms of the GNU General Public License as published by
|
modify it under the terms of the GNU General Public
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
License as published by the Free Software Foundation; either
|
||||||
(at your option) any later version.
|
version 2 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
GNU General Public License for more details.
|
General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
@@ -193,18 +192,10 @@ bool CPlugins::parseCfg(plugin *plugin_data)
|
|||||||
plugin_data->key = CRCInput::RC_nokey;
|
plugin_data->key = CRCInput::RC_nokey;
|
||||||
plugin_data->name = "";
|
plugin_data->name = "";
|
||||||
plugin_data->description = "";
|
plugin_data->description = "";
|
||||||
#if 0
|
|
||||||
plugin_data->fb = false;
|
|
||||||
plugin_data->rc = false;
|
|
||||||
plugin_data->lcd = false;
|
|
||||||
plugin_data->vtxtpid = false;
|
|
||||||
plugin_data->showpig = false;
|
|
||||||
plugin_data->needoffset = false;
|
|
||||||
#endif
|
|
||||||
plugin_data->shellwindow = false;
|
plugin_data->shellwindow = false;
|
||||||
plugin_data->hide = false;
|
plugin_data->hide = false;
|
||||||
plugin_data->type = CPlugins::P_TYPE_DISABLED;
|
plugin_data->type = CPlugins::P_TYPE_DISABLED;
|
||||||
plugin_data->integration = CPlugins::I_TYPE_DISABLED;
|
plugin_data->integration = PLUGIN_INTEGRATION_DISABLED;
|
||||||
plugin_data->hinticon = NEUTRINO_ICON_HINT_PLUGIN;
|
plugin_data->hinticon = NEUTRINO_ICON_HINT_PLUGIN;
|
||||||
|
|
||||||
std::string _hintIcon = plugin_data->plugindir + "/" + plugin_data->filename + "_hint.png";
|
std::string _hintIcon = plugin_data->plugindir + "/" + plugin_data->filename + "_hint.png";
|
||||||
@@ -260,34 +251,8 @@ bool CPlugins::parseCfg(plugin *plugin_data)
|
|||||||
}
|
}
|
||||||
else if (cmd == "integration")
|
else if (cmd == "integration")
|
||||||
{
|
{
|
||||||
plugin_data->integration = getPluginIntegration(atoi(parm));
|
plugin_data->integration = atoi(parm);
|
||||||
}
|
}
|
||||||
#if 0
|
|
||||||
else if (cmd == "needfb")
|
|
||||||
{
|
|
||||||
plugin_data->fb = atoi(parm);
|
|
||||||
}
|
|
||||||
else if (cmd == "needrc")
|
|
||||||
{
|
|
||||||
plugin_data->rc = atoi(parm);
|
|
||||||
}
|
|
||||||
else if (cmd == "needlcd")
|
|
||||||
{
|
|
||||||
plugin_data->lcd = atoi(parm);
|
|
||||||
}
|
|
||||||
else if (cmd == "needvtxtpid")
|
|
||||||
{
|
|
||||||
plugin_data->vtxtpid = atoi(parm);
|
|
||||||
}
|
|
||||||
else if (cmd == "pigon")
|
|
||||||
{
|
|
||||||
plugin_data->showpig = atoi(parm);
|
|
||||||
}
|
|
||||||
else if (cmd == "needoffsets")
|
|
||||||
{
|
|
||||||
plugin_data->needoffset = atoi(parm);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
else if (cmd == "shellwindow")
|
else if (cmd == "shellwindow")
|
||||||
{
|
{
|
||||||
plugin_data->shellwindow = atoi(parm);
|
plugin_data->shellwindow = atoi(parm);
|
||||||
@@ -300,7 +265,6 @@ bool CPlugins::parseCfg(plugin *plugin_data)
|
|||||||
{
|
{
|
||||||
reject = atoi(parm);
|
reject = atoi(parm);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inFile.close();
|
inFile.close();
|
||||||
@@ -321,28 +285,6 @@ bool CPlugins::parseCfg(plugin *plugin_data)
|
|||||||
return !reject;
|
return !reject;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
PluginParam * CPlugins::makeParam(const char * const id, const char * const value, PluginParam * const next)
|
|
||||||
{
|
|
||||||
PluginParam * startparam = new PluginParam;
|
|
||||||
|
|
||||||
startparam->next = next;
|
|
||||||
startparam->id = id;
|
|
||||||
startparam->val = strdup(value);
|
|
||||||
|
|
||||||
return startparam;
|
|
||||||
}
|
|
||||||
|
|
||||||
PluginParam * CPlugins::makeParam(const char * const id, const int value, PluginParam * const next)
|
|
||||||
{
|
|
||||||
char aval[10];
|
|
||||||
|
|
||||||
sprintf(aval, "%d", value);
|
|
||||||
|
|
||||||
return makeParam(id, aval, next);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void CPlugins::startPlugin_by_name(const std::string & name)
|
void CPlugins::startPlugin_by_name(const std::string & name)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < (int) plugin_list.size(); i++)
|
for (int i = 0; i < (int) plugin_list.size(); i++)
|
||||||
@@ -362,7 +304,6 @@ void CPlugins::startPlugin(const char * const filename)
|
|||||||
startPlugin(pluginnr);
|
startPlugin(pluginnr);
|
||||||
else
|
else
|
||||||
printf("[CPlugins] could not find %s\n", filename);
|
printf("[CPlugins] could not find %s\n", filename);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPlugins::popenScriptPlugin(const char * script)
|
void CPlugins::popenScriptPlugin(const char * script)
|
||||||
@@ -551,38 +492,6 @@ CPlugins::p_type_t CPlugins::getPluginType(int type)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CPlugins::i_type_t CPlugins::getPluginIntegration(int integration)
|
|
||||||
{
|
|
||||||
switch (integration)
|
|
||||||
{
|
|
||||||
case INTEGRATION_TYPE_DISABLED:
|
|
||||||
return I_TYPE_DISABLED;
|
|
||||||
break;
|
|
||||||
/*
|
|
||||||
case INTEGRATION_TYPE_MAIN:
|
|
||||||
return I_TYPE_MAIN;
|
|
||||||
break;
|
|
||||||
*/
|
|
||||||
case INTEGRATION_TYPE_MULTIMEDIA:
|
|
||||||
return I_TYPE_MULTIMEDIA;
|
|
||||||
break;
|
|
||||||
case INTEGRATION_TYPE_SETTING:
|
|
||||||
return I_TYPE_SETTING;
|
|
||||||
break;
|
|
||||||
case INTEGRATION_TYPE_SERVICE:
|
|
||||||
return I_TYPE_SERVICE;
|
|
||||||
break;
|
|
||||||
case INTEGRATION_TYPE_INFORMATION:
|
|
||||||
return I_TYPE_INFORMATION;
|
|
||||||
break;
|
|
||||||
case INTEGRATION_TYPE_NI_MENU: //NI
|
|
||||||
return I_TYPE_NI_MENU;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return I_TYPE_DISABLED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
neutrino_msg_t CPlugins::getPluginKey(std::string key)
|
neutrino_msg_t CPlugins::getPluginKey(std::string key)
|
||||||
{
|
{
|
||||||
if (key == "red")
|
if (key == "red")
|
||||||
|
@@ -4,29 +4,20 @@
|
|||||||
Copyright (C) 2001 Steffen Hehn 'McClean'
|
Copyright (C) 2001 Steffen Hehn 'McClean'
|
||||||
Homepage: http://dbox.cyberphoria.org/
|
Homepage: http://dbox.cyberphoria.org/
|
||||||
|
|
||||||
Kommentar:
|
|
||||||
|
|
||||||
Diese GUI wurde von Grund auf neu programmiert und sollte nun vom
|
|
||||||
Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert
|
|
||||||
auf der Client-Server Idee, diese GUI ist also von der direkten DBox-
|
|
||||||
Steuerung getrennt. Diese wird dann von Daemons uebernommen.
|
|
||||||
|
|
||||||
|
|
||||||
License: GPL
|
License: GPL
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or
|
||||||
it under the terms of the GNU General Public License as published by
|
modify it under the terms of the GNU General Public
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
License as published by the Free Software Foundation; either
|
||||||
(at your option) any later version.
|
version 2 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
GNU General Public License for more details.
|
General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __plugins__
|
#ifndef __plugins__
|
||||||
@@ -42,8 +33,8 @@
|
|||||||
class CFrameBuffer;
|
class CFrameBuffer;
|
||||||
class CPlugins
|
class CPlugins
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
// neutrino-internal plugin-type conversion
|
||||||
typedef enum p_type
|
typedef enum p_type
|
||||||
{
|
{
|
||||||
P_TYPE_DISABLED = 0x1,
|
P_TYPE_DISABLED = 0x1,
|
||||||
@@ -55,22 +46,7 @@ class CPlugins
|
|||||||
}
|
}
|
||||||
p_type_t;
|
p_type_t;
|
||||||
|
|
||||||
typedef enum i_type
|
|
||||||
{
|
|
||||||
I_TYPE_DISABLED = 0x1,
|
|
||||||
/*
|
|
||||||
I_TYPE_MAIN = 0x2,
|
|
||||||
*/
|
|
||||||
I_TYPE_MULTIMEDIA = 0x4,
|
|
||||||
I_TYPE_SETTING = 0x8,
|
|
||||||
I_TYPE_SERVICE = 0x10,
|
|
||||||
I_TYPE_INFORMATION = 0x20,
|
|
||||||
I_TYPE_NI_MENU = 0x400 //NI
|
|
||||||
}
|
|
||||||
i_type_t;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
CFrameBuffer *frameBuffer;
|
CFrameBuffer *frameBuffer;
|
||||||
|
|
||||||
struct plugin
|
struct plugin
|
||||||
@@ -87,16 +63,7 @@ class CPlugins
|
|||||||
std::string description; // UTF-8 encoded
|
std::string description; // UTF-8 encoded
|
||||||
std::string depend;
|
std::string depend;
|
||||||
CPlugins::p_type_t type;
|
CPlugins::p_type_t type;
|
||||||
CPlugins::i_type_t integration;
|
int integration;
|
||||||
#if 0
|
|
||||||
bool fb;
|
|
||||||
bool rc;
|
|
||||||
bool lcd;
|
|
||||||
bool vtxtpid;
|
|
||||||
int posx, posy, sizex, sizey;
|
|
||||||
bool showpig;
|
|
||||||
bool needoffset;
|
|
||||||
#endif
|
|
||||||
bool shellwindow;
|
bool shellwindow;
|
||||||
bool hide;
|
bool hide;
|
||||||
bool operator< (const plugin& a) const
|
bool operator< (const plugin& a) const
|
||||||
@@ -116,8 +83,8 @@ class CPlugins
|
|||||||
bool plugin_exists(const std::string & filename);
|
bool plugin_exists(const std::string & filename);
|
||||||
int find_plugin(const std::string & filename);
|
int find_plugin(const std::string & filename);
|
||||||
CPlugins::p_type_t getPluginType(int type);
|
CPlugins::p_type_t getPluginType(int type);
|
||||||
CPlugins::i_type_t getPluginIntegration(int integration);
|
|
||||||
neutrino_msg_t getPluginKey(std::string key="auto");
|
neutrino_msg_t getPluginKey(std::string key="auto");
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CPlugins();
|
CPlugins();
|
||||||
~CPlugins();
|
~CPlugins();
|
||||||
@@ -126,11 +93,6 @@ class CPlugins
|
|||||||
|
|
||||||
void setPluginDir(const std::string & dir) { plugin_dir = dir; }
|
void setPluginDir(const std::string & dir) { plugin_dir = dir; }
|
||||||
|
|
||||||
#if 0
|
|
||||||
PluginParam * makeParam(const char * const id, const char * const value, PluginParam * const next);
|
|
||||||
PluginParam * makeParam(const char * const id, const int value, PluginParam * const next);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
inline int getNumberOfPlugins (void ) const { return plugin_list.size() ; }
|
inline int getNumberOfPlugins (void ) const { return plugin_list.size() ; }
|
||||||
inline const char * getName (const int number) const { return plugin_list[number].name.c_str() ; }
|
inline const char * getName (const int number) const { return plugin_list[number].name.c_str() ; }
|
||||||
inline const char * getPluginFile (const int number) const { return plugin_list[number].pluginfile.c_str(); }
|
inline const char * getPluginFile (const int number) const { return plugin_list[number].pluginfile.c_str(); }
|
||||||
|
@@ -128,8 +128,8 @@ void CRCLock::lockRC()
|
|||||||
if (lockIcon == NULL)
|
if (lockIcon == NULL)
|
||||||
{
|
{
|
||||||
lockIcon = new CComponentsPicture(
|
lockIcon = new CComponentsPicture(
|
||||||
g_settings.screen_StartX + 10,
|
g_settings.screen_StartX + OFFSET_INNER_MID,
|
||||||
g_settings.screen_StartY + 10,
|
g_settings.screen_StartY + OFFSET_INNER_MID,
|
||||||
NEUTRINO_ICON_RCLOCK);
|
NEUTRINO_ICON_RCLOCK);
|
||||||
lockIcon->doPaintBg(false);
|
lockIcon->doPaintBg(false);
|
||||||
}
|
}
|
||||||
|
@@ -355,7 +355,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
|||||||
if (g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_LUA])
|
if (g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_LUA])
|
||||||
show = show || g_Plugins->getType(count) == CPlugins::P_TYPE_LUA;
|
show = show || g_Plugins->getType(count) == CPlugins::P_TYPE_LUA;
|
||||||
|
|
||||||
if (show && !g_Plugins->isHidden(count) && (g_Plugins->getIntegration(count) == CPlugins::I_TYPE_DISABLED))
|
if (show && !g_Plugins->isHidden(count) && (g_Plugins->getIntegration(count) == PLUGIN_INTEGRATION_DISABLED))
|
||||||
{
|
{
|
||||||
menu_items++;
|
menu_items++;
|
||||||
neutrino_msg_t d_key = g_Plugins->getKey(count);
|
neutrino_msg_t d_key = g_Plugins->getKey(count);
|
||||||
|
@@ -1058,7 +1058,7 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &)
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMenuWidget::integratePlugins(CPlugins::i_type_t integration, const unsigned int shortcut, bool enabled)
|
void CMenuWidget::integratePlugins(int integration, const unsigned int shortcut, bool enabled)
|
||||||
{
|
{
|
||||||
bool separatorline = false;
|
bool separatorline = false;
|
||||||
unsigned int number_of_plugins = (unsigned int) g_Plugins->getNumberOfPlugins();
|
unsigned int number_of_plugins = (unsigned int) g_Plugins->getNumberOfPlugins();
|
||||||
@@ -1225,7 +1225,7 @@ void CMenuWidget::calcSize()
|
|||||||
//scrollbar width
|
//scrollbar width
|
||||||
scrollbar_width=0;
|
scrollbar_width=0;
|
||||||
if (total_pages > 1)
|
if (total_pages > 1)
|
||||||
scrollbar_width = scrollbar_width;
|
scrollbar_width = SCROLLBAR_WIDTH;
|
||||||
|
|
||||||
full_width = width + scrollbar_width + OFFSET_SHADOW;
|
full_width = width + scrollbar_width + OFFSET_SHADOW;
|
||||||
full_height = height + fbutton_height + OFFSET_SHADOW + OFFSET_INTER; // hintbox is handled separately
|
full_height = height + fbutton_height + OFFSET_SHADOW + OFFSET_INTER; // hintbox is handled separately
|
||||||
|
@@ -616,7 +616,7 @@ class CMenuWidget : public CMenuTarget, public CComponentsSignals
|
|||||||
virtual void hide();
|
virtual void hide();
|
||||||
virtual int exec(CMenuTarget* parent, const std::string & actionKey);
|
virtual int exec(CMenuTarget* parent, const std::string & actionKey);
|
||||||
virtual const char *getName();
|
virtual const char *getName();
|
||||||
virtual void integratePlugins(CPlugins::i_type_t integration, const unsigned int shortcut=CRCInput::RC_nokey, bool enabled=true);
|
virtual void integratePlugins(int integration, const unsigned int shortcut=CRCInput::RC_nokey, bool enabled=true);
|
||||||
void setSelected(const int &Preselected){ selected = Preselected; };
|
void setSelected(const int &Preselected){ selected = Preselected; };
|
||||||
void initSelectable();
|
void initSelectable();
|
||||||
int getSelected()const { return selected; };
|
int getSelected()const { return selected; };
|
||||||
|
@@ -114,16 +114,16 @@ void CNeutrinoApp::InitMenu()
|
|||||||
|
|
||||||
personalize.addPersonalizedItems();
|
personalize.addPersonalizedItems();
|
||||||
|
|
||||||
//add I_TYPE_SETTING plugins
|
//add PLUGIN_INTEGRATION_SETTING plugins
|
||||||
unsigned int nextShortcut;
|
unsigned int nextShortcut;
|
||||||
CMenuWidget &menuSettings = personalize.getWidget(MENU_SETTINGS);
|
CMenuWidget &menuSettings = personalize.getWidget(MENU_SETTINGS);
|
||||||
nextShortcut = (unsigned int)menuSettings.getNextShortcut();
|
nextShortcut = (unsigned int)menuSettings.getNextShortcut();
|
||||||
menuSettings.integratePlugins(CPlugins::I_TYPE_SETTING, nextShortcut);
|
menuSettings.integratePlugins(PLUGIN_INTEGRATION_SETTING, nextShortcut);
|
||||||
|
|
||||||
//add I_TYPE_SERVICE plugins
|
//add PLUGIN_INTEGRATION_SERVICE plugins
|
||||||
CMenuWidget &menuService = personalize.getWidget(MENU_SERVICE);
|
CMenuWidget &menuService = personalize.getWidget(MENU_SERVICE);
|
||||||
nextShortcut = (unsigned int)menuService.getNextShortcut();
|
nextShortcut = (unsigned int)menuService.getNextShortcut();
|
||||||
menuService.integratePlugins(CPlugins::I_TYPE_SERVICE, nextShortcut);
|
menuService.integratePlugins(PLUGIN_INTEGRATION_SERVICE, nextShortcut);
|
||||||
}
|
}
|
||||||
|
|
||||||
//init main menu
|
//init main menu
|
||||||
|
64
src/plugin.h
64
src/plugin.h
@@ -1,61 +1,29 @@
|
|||||||
|
|
||||||
#ifndef TPLUGIN_H
|
#ifndef __plugin_h__
|
||||||
#define TPLUGIN_H
|
#define __plugin_h__
|
||||||
|
|
||||||
typedef struct _PluginParam
|
// plugin type as defined in plugin's cfg
|
||||||
{
|
enum
|
||||||
const char * id;
|
|
||||||
char * val;
|
|
||||||
struct _PluginParam * next;
|
|
||||||
|
|
||||||
} PluginParam;
|
|
||||||
|
|
||||||
typedef int (*PluginExec)( PluginParam *par );
|
|
||||||
/* das dlsym kann auf PluginExec gecastet werden */
|
|
||||||
|
|
||||||
/* NOTE : alle Plugins haben uebergangs-weise neue und alte schnittstelle */
|
|
||||||
/* neues Symbol : plugin_exec */
|
|
||||||
/* es muessen nur benutzte ids gesetzt werden : nicht genannt = nicht benutzt */
|
|
||||||
|
|
||||||
/* fixed ID definitions */
|
|
||||||
#define P_ID_FBUFFER "fd_framebuffer"
|
|
||||||
#define P_ID_RCINPUT "fd_rcinput"
|
|
||||||
#define P_ID_LCD "fd_lcd"
|
|
||||||
#define P_ID_NOPIG "no_pig" // 1: plugin dont show internal pig
|
|
||||||
#define P_ID_VTXTPID "pid_vtxt"
|
|
||||||
#define P_ID_PROXY "proxy" // set proxy for save into highscore
|
|
||||||
#define P_ID_PROXY_USER "proxy_user" // format "user:pass"
|
|
||||||
#define P_ID_HSCORE "hscore" // highscore-server (as url)
|
|
||||||
#define P_ID_VFORMAT "video_format" // videoformat (0 = auto, 1 = 16:9, 2 = 4:3)
|
|
||||||
#define P_ID_OFF_X "off_x" // screen-top-offset x
|
|
||||||
#define P_ID_OFF_Y "off_y" // screen-top-offset y
|
|
||||||
#define P_ID_END_X "end_x" // screen-end-offset x
|
|
||||||
#define P_ID_END_Y "end_y" // screen-end-offset y
|
|
||||||
#define P_ID_RCBLK_ANF "rcblk_anf" // Key-Repeatblocker Anfang
|
|
||||||
#define P_ID_RCBLK_REP "rcblk_rep" // Key-Repeatblocker Wiederholung
|
|
||||||
|
|
||||||
typedef enum plugin_type
|
|
||||||
{
|
{
|
||||||
PLUGIN_TYPE_DISABLED = 0,
|
PLUGIN_TYPE_DISABLED = 0,
|
||||||
PLUGIN_TYPE_GAME = 1,
|
PLUGIN_TYPE_GAME = 1,
|
||||||
PLUGIN_TYPE_TOOL = 2,
|
PLUGIN_TYPE_TOOL = 2,
|
||||||
PLUGIN_TYPE_SCRIPT = 3,
|
PLUGIN_TYPE_SCRIPT = 3,
|
||||||
PLUGIN_TYPE_LUA = 4
|
PLUGIN_TYPE_LUA = 4
|
||||||
}
|
};
|
||||||
plugin_type_t;
|
|
||||||
|
|
||||||
typedef enum integration_type
|
// plugin integration as defined in plugin's cfg
|
||||||
|
enum
|
||||||
{
|
{
|
||||||
INTEGRATION_TYPE_DISABLED = 0,
|
PLUGIN_INTEGRATION_DISABLED = 0,
|
||||||
/*
|
/*
|
||||||
INTEGRATION_TYPE_MAIN = 1,
|
PLUGIN_INTEGRATION_MAIN = 1,
|
||||||
*/
|
*/
|
||||||
INTEGRATION_TYPE_MULTIMEDIA = 2,
|
PLUGIN_INTEGRATION_MULTIMEDIA = 2,
|
||||||
INTEGRATION_TYPE_SETTING = 3,
|
PLUGIN_INTEGRATION_SETTING = 3,
|
||||||
INTEGRATION_TYPE_SERVICE = 4,
|
PLUGIN_INTEGRATION_SERVICE = 4,
|
||||||
INTEGRATION_TYPE_INFORMATION = 5,
|
PLUGIN_INTEGRATION_INFORMATION = 5,
|
||||||
INTEGRATION_TYPE_NI_MENU = 10 //NI
|
PLUGIN_INTEGRATION_NI_MENU = 10
|
||||||
}
|
};
|
||||||
integration_type_t;
|
|
||||||
|
|
||||||
#endif
|
#endif // __plugin_h__
|
||||||
|
Reference in New Issue
Block a user