mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 07:51:11 +02:00
reduce dependencies on driver/rcinput.h
* add new header that only contains neutrino_msg_t and friends, often this
is all that's needed instead of full rcinput.h
* directly include rcinput.h in some cpp files instead of relying on
accidental inclusion in some header
* add class forward declarations to avoid dragging in rcinput indirectly
This could use more work to further reduce the impact; maybe separating
the CRCinput::key_* constants from the rcinput class would be good.
Origin commit data
------------------
Commit: 47fbfbed9b
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2018-01-15 (Mon, 15 Jan 2018)
Origin message was:
------------------
reduce dependencies on driver/rcinput.h
* add new header that only contains neutrino_msg_t and friends, often this
is all that's needed instead of full rcinput.h
* directly include rcinput.h in some cpp files instead of relying on
accidental inclusion in some header
* add class forward declarations to avoid dragging in rcinput indirectly
This could use more work to further reduce the impact; maybe separating
the CRCinput::key_* constants from the rcinput class would be good.
This commit is contained in:
committed by
vanhofen
parent
30fe58dbd9
commit
cfa463f606
@@ -33,7 +33,7 @@
|
||||
#ifndef __remotecontrol__
|
||||
#define __remotecontrol__
|
||||
|
||||
#include <driver/rcinput.h> /* neutrino_msg_t, neutrino_msg_data_t */
|
||||
#include <driver/neutrino_msg_t.h>
|
||||
|
||||
#include <zapit/client/zapitclient.h>
|
||||
|
||||
|
20
src/driver/neutrino_msg_t.h
Normal file
20
src/driver/neutrino_msg_t.h
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* (C) 2018 Stefan Seyfried
|
||||
* SPDX-License-Identifier: GPL-2.0
|
||||
*
|
||||
* define neutrino_msg_t and friends
|
||||
* pulled out of rcinput.h to reduce impact of that header
|
||||
*/
|
||||
|
||||
#ifndef __neutrino_msg_t_h__
|
||||
#define __neutrino_msg_t_h__
|
||||
|
||||
typedef unsigned long neutrino_msg_t;
|
||||
typedef unsigned long neutrino_msg_data_t;
|
||||
|
||||
/* ugly hack to avoid including rcinput.h for key default values */
|
||||
#define RC_NOKEY 0xFFFFFFFE
|
||||
|
||||
#define NEUTRINO_UDS_NAME "/tmp/neutrino.sock"
|
||||
|
||||
#endif
|
@@ -52,6 +52,8 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <driver/neutrino_msg_t.h>
|
||||
|
||||
#ifndef KEY_OK
|
||||
#define KEY_OK 0x160
|
||||
#endif
|
||||
@@ -117,13 +119,6 @@
|
||||
#define KEY_FN_B
|
||||
*/
|
||||
|
||||
|
||||
typedef unsigned long neutrino_msg_t;
|
||||
typedef unsigned long neutrino_msg_data_t;
|
||||
|
||||
#define NEUTRINO_UDS_NAME "/tmp/neutrino.sock"
|
||||
|
||||
|
||||
class CRCInput
|
||||
{
|
||||
private:
|
||||
@@ -275,7 +270,7 @@ class CRCInput
|
||||
RC_zoomout = KEY_ZOOMOUT,
|
||||
|
||||
RC_timeout = 0xFFFFFFFF,
|
||||
RC_nokey = 0xFFFFFFFE
|
||||
RC_nokey = RC_NOKEY
|
||||
};
|
||||
|
||||
//rc-hardware definitions
|
||||
|
@@ -34,7 +34,7 @@
|
||||
#include <gui/widget/icons.h>
|
||||
#include <string>
|
||||
#include <driver/neutrinofonts.h>
|
||||
#include <driver/rcinput.h>
|
||||
#include <driver/neutrino_msg_t.h>
|
||||
|
||||
#define COL_BUTTON_BODY COL_MENUFOOT_PLUS_0
|
||||
#define COL_BUTTON_TEXT_ENABLED COL_MENUCONTENTSELECTED_PLUS_0
|
||||
|
@@ -96,7 +96,7 @@ class CComponentsFooter : public CComponentsHeader, public CCButtonSelect
|
||||
const std::string& text,
|
||||
const int& chain_width = 0,
|
||||
const int& label_width = 0,
|
||||
const neutrino_msg_t& msg = CRCInput::RC_nokey,
|
||||
const neutrino_msg_t& msg = RC_NOKEY /*CRCInput::RC_nokey*/,
|
||||
const int& result_value = -1,
|
||||
const int& alias_value = -1);
|
||||
///add single button label with locale label type as content, chain_width as int, label width as int
|
||||
@@ -104,7 +104,7 @@ class CComponentsFooter : public CComponentsHeader, public CCButtonSelect
|
||||
const neutrino_locale_t& locale,
|
||||
const int& chain_width = 0,
|
||||
const int& label_width = 0,
|
||||
const neutrino_msg_t& msg = CRCInput::RC_nokey,
|
||||
const neutrino_msg_t& msg = RC_NOKEY /*CRCInput::RC_nokey*/,
|
||||
const int& result_value = -1,
|
||||
const int& alias_value = -1);
|
||||
|
||||
|
@@ -89,7 +89,7 @@ class CYourClass : sigc::trackable //<- not forget, requierd by destructor!
|
||||
|
||||
#include <sigc++/signal.h>
|
||||
#include <sigc++/bind.h>
|
||||
#include <driver/rcinput.h>
|
||||
#include <driver/neutrino_msg_t.h>
|
||||
|
||||
class CComponentsSignals : public sigc::trackable
|
||||
{
|
||||
|
@@ -27,8 +27,9 @@
|
||||
#define __CC_TYPES__
|
||||
|
||||
#include <system/localize.h>
|
||||
#include <driver/rcinput.h>
|
||||
#include <driver/neutrino_msg_t.h>
|
||||
#include <gui/color_custom.h>
|
||||
#include <vector>
|
||||
|
||||
struct gradientData_t;
|
||||
class Font;
|
||||
@@ -202,7 +203,7 @@ typedef struct button_label_cc
|
||||
button_label_cc(): button(NULL),
|
||||
text(std::string()),
|
||||
locale(NONEXISTANT_LOCALE),
|
||||
directKeys(1, CRCInput::RC_nokey){}
|
||||
directKeys(1, RC_NOKEY /*CRCInput::RC_nokey*/){}
|
||||
} button_label_cc_struct;
|
||||
|
||||
#define CC_WIDTH_MIN CFrameBuffer::getInstance()->scale2Res(16)
|
||||
|
@@ -28,7 +28,7 @@
|
||||
|
||||
#include <timerdclient/timerdtypes.h>
|
||||
|
||||
#include <driver/rcinput.h>
|
||||
#include <driver/neutrino_msg_t.h>
|
||||
#include <system/settings.h>
|
||||
#include <gui/components/cc.h>
|
||||
#include <gui/widget/navibar.h>
|
||||
|
@@ -38,7 +38,7 @@
|
||||
#endif
|
||||
|
||||
#include <driver/file.h>
|
||||
#include <driver/rcinput.h>
|
||||
#include <driver/neutrino_msg_t.h>
|
||||
|
||||
#include <gui/infoviewer.h>
|
||||
|
||||
|
@@ -35,7 +35,7 @@
|
||||
|
||||
#include <sectionsdclient/sectionsdclient.h>
|
||||
|
||||
#include <driver/rcinput.h>
|
||||
#include <driver/neutrino_msg_t.h>
|
||||
#include <system/settings.h>
|
||||
#include <string>
|
||||
#include <zapit/channel.h>
|
||||
|
@@ -31,10 +31,10 @@
|
||||
|
||||
#include <gui/widget/menue.h>
|
||||
#include <gui/audioplayer.h>
|
||||
#include <gui/personalize.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
class CPersonalizeGui;
|
||||
class CMediaPlayerMenu : public CMenuTarget
|
||||
{
|
||||
private:
|
||||
|
@@ -43,6 +43,7 @@
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
|
||||
#include <driver/rcinput.h>
|
||||
#include "user_menue.h"
|
||||
#include "user_menue_setup.h"
|
||||
#include "subchannel_select.h"
|
||||
|
@@ -35,6 +35,7 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <driver/rcinput.h>
|
||||
#include "user_menue_setup.h"
|
||||
|
||||
#include <global.h>
|
||||
|
@@ -24,7 +24,7 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <driver/rcinput.h>
|
||||
#include <driver/neutrino_msg_t.h>
|
||||
|
||||
#include "menue.h"
|
||||
|
||||
|
@@ -36,7 +36,7 @@
|
||||
#ifndef __MENU__
|
||||
#define __MENU__
|
||||
|
||||
#include <driver/rcinput.h>
|
||||
#include <driver/neutrino_msg_t.h>
|
||||
#include <system/localize.h>
|
||||
#include <gui/widget/buttons.h>
|
||||
#include <gui/widget/icons.h>
|
||||
@@ -141,7 +141,7 @@ class CMenuItem : public CComponentsSignals
|
||||
std::string hintText;
|
||||
neutrino_locale_t hint;
|
||||
|
||||
CMenuItem(bool Active = true, neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName= NULL, const char * const IconName_Info_right = NULL, bool IsStatic = false);
|
||||
CMenuItem(bool Active = true, neutrino_msg_t DirectKey = RC_NOKEY, const char * const IconName= NULL, const char * const IconName_Info_right = NULL, bool IsStatic = false);
|
||||
|
||||
virtual ~CMenuItem(){}
|
||||
|
||||
@@ -256,16 +256,16 @@ class CMenuForwarder : public CMenuItem
|
||||
public:
|
||||
|
||||
CMenuForwarder(const neutrino_locale_t Text, const bool Active, const std::string &Option,
|
||||
CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey,
|
||||
CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = RC_NOKEY,
|
||||
const char * const IconName = NULL, const char * const IconName_Info_right = NULL, bool IsStatic = false);
|
||||
CMenuForwarder(const std::string & Text, const bool Active, const std::string &Option,
|
||||
CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey,
|
||||
CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = RC_NOKEY,
|
||||
const char * const IconName = NULL, const char * const IconName_Info_right = NULL, bool IsStatic = false);
|
||||
CMenuForwarder(const neutrino_locale_t Text, const bool Active = true, const char * const Option=NULL,
|
||||
CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey,
|
||||
CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = RC_NOKEY,
|
||||
const char * const IconName = NULL, const char * const IconName_Info_right = NULL, bool IsStatic = false);
|
||||
CMenuForwarder(const std::string & Text, const bool Active = true, const char * const Option=NULL,
|
||||
CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey,
|
||||
CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = RC_NOKEY,
|
||||
const char * const IconName = NULL, const char * const IconName_Info_right = NULL, bool IsStatic = false);
|
||||
|
||||
virtual ~CMenuForwarder(){}
|
||||
@@ -284,19 +284,19 @@ class CMenuDForwarder : public CMenuForwarder
|
||||
{
|
||||
public:
|
||||
CMenuDForwarder(const neutrino_locale_t Text, const bool Active, const std::string &Option,
|
||||
CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey,
|
||||
CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = RC_NOKEY,
|
||||
const char * const IconName = NULL, const char * const IconName_Info_right = NULL)
|
||||
: CMenuForwarder(Text, Active, Option, Target, ActionKey, DirectKey, IconName, IconName_Info_right) { };
|
||||
CMenuDForwarder(const std::string & Text, const bool Active, const std::string &Option,
|
||||
CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey,
|
||||
CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = RC_NOKEY,
|
||||
const char * const IconName = NULL, const char * const IconName_Info_right = NULL)
|
||||
: CMenuForwarder(Text, Active, Option, Target, ActionKey, DirectKey, IconName, IconName_Info_right) { };
|
||||
CMenuDForwarder(const neutrino_locale_t Text, const bool Active=true, const char * const Option=NULL,
|
||||
CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey,
|
||||
CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = RC_NOKEY,
|
||||
const char * const IconName = NULL, const char * const IconName_Info_right = NULL)
|
||||
: CMenuForwarder(Text, Active, Option, Target, ActionKey, DirectKey, IconName, IconName_Info_right) { };
|
||||
CMenuDForwarder(const std::string & Text, const bool Active=true, const char * const Option=NULL,
|
||||
CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey,
|
||||
CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = RC_NOKEY,
|
||||
const char * const IconName = NULL, const char * const IconName_Info_right = NULL)
|
||||
: CMenuForwarder(Text, Active, Option, Target, ActionKey, DirectKey, IconName, IconName_Info_right) { };
|
||||
|
||||
@@ -347,12 +347,12 @@ private:
|
||||
public:
|
||||
CMenuOptionNumberChooser(const neutrino_locale_t name, int * const OptionValue, const bool Active,
|
||||
const int min_value, const int max_value, CChangeObserver * const Observ = NULL,
|
||||
const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL,
|
||||
const neutrino_msg_t DirectKey = RC_NOKEY, const char * const IconName = NULL,
|
||||
const int print_offset = 0,
|
||||
const int special_value = 0, const neutrino_locale_t special_value_name = NONEXISTANT_LOCALE, bool sliderOn = false );
|
||||
CMenuOptionNumberChooser(const std::string &name, int * const OptionValue, const bool Active,
|
||||
const int min_value, const int max_value, CChangeObserver * const Observ = NULL,
|
||||
const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL,
|
||||
const neutrino_msg_t DirectKey = RC_NOKEY, const char * const IconName = NULL,
|
||||
const int print_offset = 0,
|
||||
const int special_value = 0, const neutrino_locale_t special_value_name = NONEXISTANT_LOCALE, bool sliderOn = false );
|
||||
|
||||
@@ -435,27 +435,27 @@ class CMenuOptionChooser : public CAbstractMenuOptionChooser
|
||||
public:
|
||||
CMenuOptionChooser(const neutrino_locale_t Name, int * const OptionValue, const struct keyval * const Options,
|
||||
const size_t Number_Of_Options, const bool Active = false, CChangeObserver * const Observ = NULL,
|
||||
const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL,
|
||||
const neutrino_msg_t DirectKey = RC_NOKEY, const char * const IconName = NULL,
|
||||
bool Pulldown = false, bool OptionsSort = false);
|
||||
CMenuOptionChooser(const neutrino_locale_t Name, int * const OptionValue, const struct keyval_ext * const Options,
|
||||
const size_t Number_Of_Options, const bool Active = false, CChangeObserver * const Observ = NULL,
|
||||
const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL,
|
||||
const neutrino_msg_t DirectKey = RC_NOKEY, const char * const IconName = NULL,
|
||||
bool Pulldown = false, bool OptionsSort = false);
|
||||
CMenuOptionChooser(const std::string &Name, int * const OptionValue, const struct keyval * const Options,
|
||||
const size_t Number_Of_Options, const bool Active = false, CChangeObserver * const Observ = NULL,
|
||||
const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL,
|
||||
const neutrino_msg_t DirectKey = RC_NOKEY, const char * const IconName = NULL,
|
||||
bool size_t = false, bool OptionsSort = false);
|
||||
CMenuOptionChooser(const std::string &Name, int * const OptionValue, const struct keyval_ext * const Options,
|
||||
const size_t Number_Of_Options, const bool Active = false, CChangeObserver * const Observ = NULL,
|
||||
const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL,
|
||||
const neutrino_msg_t DirectKey = RC_NOKEY, const char * const IconName = NULL,
|
||||
bool Pulldown = false, bool OptionsSort = false);
|
||||
CMenuOptionChooser(const neutrino_locale_t Name, int * const OptionValue, std::vector<keyval_ext> &Options,
|
||||
const bool Active = false, CChangeObserver * const Observ = NULL,
|
||||
const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL,
|
||||
const neutrino_msg_t DirectKey = RC_NOKEY, const char * const IconName = NULL,
|
||||
bool Pulldown = false, bool OptionsSort = false);
|
||||
CMenuOptionChooser(const std::string &Name, int * const OptionValue, std::vector<keyval_ext> &Options,
|
||||
const bool Active = false, CChangeObserver * const Observ = NULL,
|
||||
const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL,
|
||||
const neutrino_msg_t DirectKey = RC_NOKEY, const char * const IconName = NULL,
|
||||
bool Pulldown = false, bool OptionsSort = false);
|
||||
|
||||
~CMenuOptionChooser();
|
||||
@@ -488,10 +488,10 @@ class CMenuOptionStringChooser : public CMenuItem
|
||||
|
||||
public:
|
||||
CMenuOptionStringChooser(const neutrino_locale_t Name, std::string* OptionValue, bool Active = false,
|
||||
CChangeObserver* Observ = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey,
|
||||
CChangeObserver* Observ = NULL, const neutrino_msg_t DirectKey = RC_NOKEY,
|
||||
const char * const IconName = NULL, bool Pulldown = false);
|
||||
CMenuOptionStringChooser(const std::string &Name, std::string* OptionValue, bool Active = false,
|
||||
CChangeObserver* Observ = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey,
|
||||
CChangeObserver* Observ = NULL, const neutrino_msg_t DirectKey = RC_NOKEY,
|
||||
const char * const IconName = NULL, bool Pulldown = false);
|
||||
|
||||
~CMenuOptionStringChooser();
|
||||
@@ -621,7 +621,7 @@ class CMenuWidget : public CMenuTarget, public CComponentsSignals
|
||||
virtual void hide();
|
||||
virtual int exec(CMenuTarget* parent, const std::string & actionKey);
|
||||
virtual const char *getName();
|
||||
virtual void integratePlugins(int integration, const unsigned int shortcut=CRCInput::RC_nokey, bool enabled=true);
|
||||
virtual void integratePlugins(int integration, const unsigned int shortcut=RC_NOKEY, bool enabled=true);
|
||||
void setSelected(const int &Preselected){ selected = Preselected; };
|
||||
void initSelectable();
|
||||
int getSelected()const { return selected; };
|
||||
@@ -691,7 +691,7 @@ class CLockedMenuForwarder : public CMenuForwarder, public CPINProtection
|
||||
public:
|
||||
CLockedMenuForwarder(const neutrino_locale_t Text, std::string &_validPIN, bool ask=true, const bool Active=true, const char * const Option = NULL,
|
||||
CMenuTarget* Target=NULL, const char * const ActionKey = NULL,
|
||||
neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL, const char * const IconName_Info_right = NULL)
|
||||
neutrino_msg_t DirectKey = RC_NOKEY, const char * const IconName = NULL, const char * const IconName_Info_right = NULL)
|
||||
|
||||
: CMenuForwarder(Text, Active, Option, Target, ActionKey, DirectKey, IconName, IconName_Info_right) ,CPINProtection(_validPIN)
|
||||
{
|
||||
|
@@ -26,6 +26,7 @@
|
||||
|
||||
#include <zapit/settings.h>
|
||||
#include <zapit/scan.h>
|
||||
#include <driver/rcinput.h>
|
||||
#include <gui/personalize.h>
|
||||
|
||||
//enum PERSONALIZE_SETTINGS to find in settings.h
|
||||
|
Reference in New Issue
Block a user