remove some unused defines
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
//! \~\brief
|
||||
//! \~english Console screen manager with tile layout, drawing, and input routing.
|
||||
//! \~russian Менеджер консольного экрана с раскладкой тайлов, отрисовкой и маршрутизацией ввода.
|
||||
#if !defined(PICO_SDK)
|
||||
|
||||
class PIP_CONSOLE_EXPORT PIScreen
|
||||
: public PIThread
|
||||
, public PIScreenTypes::PIScreenBase {
|
||||
@@ -215,6 +215,6 @@ private:
|
||||
PIScreenTile root;
|
||||
PIScreenTile *tile_focus, *tile_dialog;
|
||||
};
|
||||
#endif // !PICO_SDK
|
||||
|
||||
|
||||
#endif // PISCREEN_H
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#ifndef PISCREENDRAWER_H
|
||||
#define PISCREENDRAWER_H
|
||||
#if !defined(PICO_SDK)
|
||||
|
||||
|
||||
#include "pip_console_export.h"
|
||||
#include "piscreentypes.h"
|
||||
@@ -147,5 +147,5 @@ private:
|
||||
};
|
||||
|
||||
|
||||
#endif // !PICO_SDK
|
||||
|
||||
#endif // PISCREENDRAWER_H
|
||||
|
||||
@@ -38,7 +38,7 @@ class PIScreenDrawer;
|
||||
//! \details
|
||||
//! \~english Base class for all screen tiles providing layout and event handling.
|
||||
//! \~russian Базовый класс для всех экранных тайлов, обеспечивающий компоновку и обработку событий.
|
||||
#if !defined(PICO_SDK)
|
||||
|
||||
class PIP_CONSOLE_EXPORT PIScreenTile: public PIObject {
|
||||
friend class PIScreen;
|
||||
PIOBJECT_SUBCLASS(PIScreenTile, PIObject);
|
||||
@@ -238,6 +238,6 @@ protected:
|
||||
private:
|
||||
int pw, ph;
|
||||
};
|
||||
#endif // !PICO_SDK
|
||||
|
||||
|
||||
#endif // PISCREENTILE_H
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#ifndef PISCREENTILES_H
|
||||
#define PISCREENTILES_H
|
||||
#if !defined(PICO_SDK)
|
||||
|
||||
|
||||
#include "pip_console_export.h"
|
||||
#include "piscreentile.h"
|
||||
@@ -445,5 +445,5 @@ protected:
|
||||
};
|
||||
|
||||
|
||||
#endif // !PICO_SDK
|
||||
|
||||
#endif // PISCREENTILES_H
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#ifndef PISCREENTYPES_H
|
||||
#define PISCREENTYPES_H
|
||||
#if !defined(PICO_SDK)
|
||||
|
||||
|
||||
#include "pip_console_export.h"
|
||||
#include "pivariant.h"
|
||||
@@ -285,5 +285,5 @@ BINARY_STREAM_READ(PIScreenTypes::TileEvent) {
|
||||
|
||||
REGISTER_PIVARIANTSIMPLE(PIScreenTypes::TileEvent)
|
||||
|
||||
#endif // !PICO_SDK
|
||||
|
||||
#endif // PISCREENTYPES_H
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#ifndef PITERMINAL_H
|
||||
#define PITERMINAL_H
|
||||
#if !defined(PICO_SDK)
|
||||
|
||||
|
||||
#include "pikbdlistener.h"
|
||||
#include "pip_console_export.h"
|
||||
@@ -115,5 +115,5 @@ private:
|
||||
};
|
||||
|
||||
|
||||
#endif // !PICO_SDK
|
||||
|
||||
#endif // PITERMINAL_H
|
||||
|
||||
@@ -19,13 +19,13 @@
|
||||
|
||||
#include "piobject.h"
|
||||
|
||||
#include "piconditionvar.h"
|
||||
#include "pithread.h"
|
||||
#include "pitime.h"
|
||||
#ifdef PIP_HAS_THREADS
|
||||
# include "piconditionvar.h"
|
||||
# include "pifile.h"
|
||||
# include "piiostream.h"
|
||||
# include "pisysteminfo.h"
|
||||
# include "pithread.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -176,13 +176,9 @@ PIObject::PIObject(const PIString & name): _signature_(__PIOBJECT_SIGNATURE__),
|
||||
in_event_cnt = 0;
|
||||
setName(name);
|
||||
setDebug(true);
|
||||
#ifdef PIP_HAS_THREADS
|
||||
mutexObjects().lock();
|
||||
#endif
|
||||
objects() << this;
|
||||
#ifdef PIP_HAS_THREADS
|
||||
mutexObjects().unlock();
|
||||
#endif
|
||||
// piCout << "new" << this;
|
||||
}
|
||||
|
||||
@@ -190,13 +186,9 @@ PIObject::PIObject(const PIString & name): _signature_(__PIOBJECT_SIGNATURE__),
|
||||
PIObject::~PIObject() {
|
||||
in_event_cnt = 0;
|
||||
// piCout << "delete" << this;
|
||||
#ifdef PIP_HAS_THREADS
|
||||
mutexObjects().lock();
|
||||
#endif
|
||||
objects().removeAll(this);
|
||||
#ifdef PIP_HAS_THREADS
|
||||
mutexObjects().unlock();
|
||||
#endif
|
||||
deleted(this);
|
||||
piDisconnectAll();
|
||||
_signature_ = 0;
|
||||
@@ -555,7 +547,6 @@ PIMap<uint, PIObject::__MetaData> & PIObject::__meta_data() {
|
||||
}
|
||||
|
||||
|
||||
#ifdef PIP_HAS_THREADS
|
||||
void PIObject::callQueuedEvents() {
|
||||
mutex_queue.lock();
|
||||
PIVector<__QueuedEvent> qe = events_queue;
|
||||
@@ -569,7 +560,6 @@ void PIObject::callQueuedEvents() {
|
||||
if (e.dest_o->thread_safe_) e.dest_o->mutex_.unlock();
|
||||
}
|
||||
}
|
||||
#endif // PIP_HAS_THREADS
|
||||
|
||||
|
||||
//! \details
|
||||
@@ -734,8 +724,7 @@ void PIObject::dump(const PIString & line_prefix) const {
|
||||
PICout(PICoutManipulators::AddNewLine) << line_prefix << " " << src << " -> " << dst->className() << " (" << c.dest
|
||||
<< ", \"" << dst->name() << "\")::" << hf_fn;
|
||||
} else {
|
||||
PICout(PICoutManipulators::AddNewLine) << line_prefix << " " << src << " -> "
|
||||
<< "[lambda]";
|
||||
PICout(PICoutManipulators::AddNewLine) << line_prefix << " " << src << " -> " << "[lambda]";
|
||||
}
|
||||
}
|
||||
// printf("dump %d connections ok\n",connections.size());
|
||||
|
||||
@@ -461,9 +461,7 @@ public:
|
||||
i.performer->postQueuedEvent(__QueuedEvent(i.slot, i.dest, i.dest_o, sender));
|
||||
} else {
|
||||
bool ts = sender->thread_safe_;
|
||||
#ifdef PIP_HAS_THREADS
|
||||
if (ts) i.dest_o->mutex_.lock();
|
||||
#endif
|
||||
i.dest_o->eventBegin();
|
||||
sender->eventBegin();
|
||||
i.dest_o->emitter_ = sender;
|
||||
@@ -471,9 +469,7 @@ public:
|
||||
sender->eventEnd();
|
||||
if (i.dest_o->isPIObject()) {
|
||||
i.dest_o->emitter_ = 0;
|
||||
#ifdef PIP_HAS_THREADS
|
||||
if (ts) i.dest_o->mutex_.unlock();
|
||||
#endif
|
||||
i.dest_o->eventEnd();
|
||||
}
|
||||
}
|
||||
@@ -498,9 +494,7 @@ public:
|
||||
i.performer->postQueuedEvent(__QueuedEvent(i.slot, i.dest, i.dest_o, sender, vl));
|
||||
} else {
|
||||
bool ts = sender->thread_safe_;
|
||||
#ifdef PIP_HAS_THREADS
|
||||
if (ts) i.dest_o->mutex_.lock();
|
||||
#endif
|
||||
i.dest_o->eventBegin();
|
||||
sender->eventBegin();
|
||||
i.dest_o->emitter_ = sender;
|
||||
@@ -511,9 +505,7 @@ public:
|
||||
sender->eventEnd();
|
||||
if (i.dest_o->isPIObject()) {
|
||||
i.dest_o->emitter_ = 0;
|
||||
#ifdef PIP_HAS_THREADS
|
||||
if (ts) i.dest_o->mutex_.unlock();
|
||||
#endif
|
||||
i.dest_o->eventEnd();
|
||||
}
|
||||
}
|
||||
@@ -538,9 +530,7 @@ public:
|
||||
i.performer->postQueuedEvent(__QueuedEvent(i.slot, i.dest, i.dest_o, sender, vl));
|
||||
} else {
|
||||
bool ts = sender->thread_safe_;
|
||||
#ifdef PIP_HAS_THREADS
|
||||
if (ts) i.dest_o->mutex_.lock();
|
||||
#endif
|
||||
i.dest_o->eventBegin();
|
||||
sender->eventBegin();
|
||||
i.dest_o->emitter_ = sender;
|
||||
@@ -552,9 +542,7 @@ public:
|
||||
sender->eventEnd();
|
||||
if (i.dest_o->isPIObject()) {
|
||||
i.dest_o->emitter_ = 0;
|
||||
#ifdef PIP_HAS_THREADS
|
||||
if (ts) i.dest_o->mutex_.unlock();
|
||||
#endif
|
||||
i.dest_o->eventEnd();
|
||||
}
|
||||
}
|
||||
@@ -580,9 +568,7 @@ public:
|
||||
i.performer->postQueuedEvent(__QueuedEvent(i.slot, i.dest, i.dest_o, sender, vl));
|
||||
} else {
|
||||
bool ts = sender->thread_safe_;
|
||||
#ifdef PIP_HAS_THREADS
|
||||
if (ts) i.dest_o->mutex_.lock();
|
||||
#endif
|
||||
i.dest_o->eventBegin();
|
||||
sender->eventBegin();
|
||||
i.dest_o->emitter_ = sender;
|
||||
@@ -595,9 +581,7 @@ public:
|
||||
sender->eventEnd();
|
||||
if (i.dest_o->isPIObject()) {
|
||||
i.dest_o->emitter_ = 0;
|
||||
#ifdef PIP_HAS_THREADS
|
||||
if (ts) i.dest_o->mutex_.unlock();
|
||||
#endif
|
||||
i.dest_o->eventEnd();
|
||||
}
|
||||
}
|
||||
@@ -629,9 +613,7 @@ public:
|
||||
i.performer->postQueuedEvent(__QueuedEvent(i.slot, i.dest, i.dest_o, sender, vl));
|
||||
} else {
|
||||
bool ts = sender->thread_safe_;
|
||||
#ifdef PIP_HAS_THREADS
|
||||
if (ts) i.dest_o->mutex_.lock();
|
||||
#endif
|
||||
i.dest_o->eventBegin();
|
||||
sender->eventBegin();
|
||||
i.dest_o->emitter_ = sender;
|
||||
@@ -645,9 +627,7 @@ public:
|
||||
sender->eventEnd();
|
||||
if (i.dest_o->isPIObject()) {
|
||||
i.dest_o->emitter_ = 0;
|
||||
#ifdef PIP_HAS_THREADS
|
||||
if (ts) i.dest_o->mutex_.unlock();
|
||||
#endif
|
||||
i.dest_o->eventEnd();
|
||||
}
|
||||
}
|
||||
@@ -658,7 +638,6 @@ public:
|
||||
|
||||
//! \~english Returns the first live object with name "name", or \c nullptr.
|
||||
//! \~russian Возвращает первый живой объект с именем "name", либо \c nullptr.
|
||||
#ifdef PIP_HAS_THREADS
|
||||
static PIObject * findByName(const PIString & name) {
|
||||
PIMutexLocker _ml(mutexObjects());
|
||||
for (auto * i: PIObject::objects()) {
|
||||
@@ -667,7 +646,6 @@ public:
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
//! \~english Returns whether this pointer still refers to a live %PIObject instance.
|
||||
//! \~russian Возвращает, указывает ли этот указатель на ещё существующий экземпляр %PIObject.
|
||||
@@ -675,7 +653,6 @@ public:
|
||||
|
||||
//! \~english Returns whether this object belongs to class "T" or one of its registered descendants.
|
||||
//! \~russian Возвращает, принадлежит ли этот объект классу "T" или одному из его зарегистрированных потомков.
|
||||
#ifdef PIP_HAS_THREADS
|
||||
template<typename T>
|
||||
bool isTypeOf() const {
|
||||
if (!isPIObject()) return false;
|
||||
@@ -690,7 +667,6 @@ public:
|
||||
if (!isTypeOf<T>()) return (T *)nullptr;
|
||||
return (T *)this;
|
||||
}
|
||||
#endif
|
||||
|
||||
//! \~english Returns whether "o" points to a live %PIObject instance.
|
||||
//! \~russian Возвращает, указывает ли "o" на ещё существующий экземпляр %PIObject.
|
||||
@@ -859,13 +835,8 @@ private:
|
||||
PIObject * emitter_;
|
||||
std::atomic_int in_event_cnt;
|
||||
|
||||
#ifdef PIP_HAS_THREADS
|
||||
PIMutex mutex_, mutex_connect, mutex_queue;
|
||||
bool thread_safe_, proc_event_queue;
|
||||
#else
|
||||
PIMutex mutex_, mutex_connect, mutex_queue;
|
||||
bool thread_safe_ = false, proc_event_queue = false;
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef PIP_HAS_THREADS
|
||||
|
||||
@@ -20,10 +20,8 @@
|
||||
#include "pivarianttypes.h"
|
||||
|
||||
#include "colors_p.h"
|
||||
#include "piiodevice.h"
|
||||
#include "pipropertystorage.h"
|
||||
#ifdef PIP_HAS_FILESYSTEM
|
||||
# include "piiodevice.h"
|
||||
#endif // PIP_HAS_FILESYSTEM
|
||||
|
||||
|
||||
int PIVariantTypes::Enum::selectedValue() const {
|
||||
@@ -84,11 +82,7 @@ PIStringList PIVariantTypes::Enum::names() const {
|
||||
|
||||
|
||||
PIVariantTypes::IODevice::IODevice() {
|
||||
#ifdef PIP_HAS_FILESYSTEM
|
||||
mode = PIIODevice::ReadWrite;
|
||||
#else
|
||||
mode = 0; // TODO: PIIODevice for PIP_HAS_FILESYSTEM
|
||||
#endif // PIP_HAS_FILESYSTEM
|
||||
mode = PIIODevice::ReadWrite;
|
||||
options = 0;
|
||||
}
|
||||
|
||||
@@ -121,12 +115,10 @@ PIString PIVariantTypes::IODevice::toPICout() const {
|
||||
}
|
||||
if (rwc == 1) s += "o";
|
||||
s += ", flags=";
|
||||
#ifdef PIP_HAS_FILESYSTEM // TODO: PIIODevice for !PIP_HAS_FILESYSTEM
|
||||
if (options != 0) {
|
||||
if (((PIIODevice::DeviceOptions)options)[PIIODevice::BlockingRead]) s += " br";
|
||||
if (((PIIODevice::DeviceOptions)options)[PIIODevice::BlockingWrite]) s += " bw";
|
||||
}
|
||||
#endif // PIP_HAS_FILESYSTEM
|
||||
PIPropertyStorage ps = get();
|
||||
for (const auto & p: ps) {
|
||||
s += ", " + p.name + "=\"" + p.value.toString() + "\"";
|
||||
|
||||
Reference in New Issue
Block a user