Refactored CMakeLists.txt

* new pip_module() macro
 * fixed exports
 * automatic gather all exports and pass them to Doxygen and PICodeParser
This commit is contained in:
2020-08-01 21:29:32 +03:00
parent 21111b3e67
commit c7ac4fa551
79 changed files with 389 additions and 531 deletions

View File

@@ -228,7 +228,7 @@ private:
static const EscSeq esc_seq[];
#endif
PRIVATE_DECLARATION
PRIVATE_DECLARATION(PIP_EXPORT)
KBFunc ret_func;
int exit_key;
bool exit_enabled, is_active;

View File

@@ -23,11 +23,12 @@
#ifndef PISCREEN_H
#define PISCREEN_H
#include "pip_console_export.h"
#include "piscreentile.h"
#include "piscreendrawer.h"
class PIP_EXPORT PIScreen: public PIThread, public PIScreenTypes::PIScreenBase
class PIP_CONSOLE_EXPORT PIScreen: public PIThread, public PIScreenTypes::PIScreenBase
{
PIOBJECT_SUBCLASS(PIScreen, PIThread)
class SystemConsole;
@@ -100,7 +101,7 @@ public:
//! \}
private:
class SystemConsole {
class PIP_CONSOLE_EXPORT SystemConsole {
public:
SystemConsole();
~SystemConsole();
@@ -124,7 +125,7 @@ private:
#else
PIString formatString(const PIScreenTypes::Cell & c);
#endif
PRIVATE_DECLARATION
PRIVATE_DECLARATION(PIP_CONSOLE_EXPORT)
int width, height, pwidth, pheight;
int mouse_x, mouse_y;
PIVector<PIVector<PIScreenTypes::Cell> > cells, pcells;

View File

@@ -25,12 +25,13 @@
#ifndef PISCREENCONSOLE_H
#define PISCREENCONSOLE_H
#include "pip_console_export.h"
#include "piscreentiles.h"
/// NOTE: incomplete class
/// TODO: write TileVars
class PIP_EXPORT TileVars: public PIScreenTile {
class PIP_CONSOLE_EXPORT TileVars: public PIScreenTile {
public:
TileVars(const PIString & n = PIString());
protected:
@@ -68,7 +69,7 @@ protected:
class PIP_EXPORT PIScreenConsoleTile : public PIScreenTile
class PIP_CONSOLE_EXPORT PIScreenConsoleTile : public PIScreenTile
{
public:
PIScreenConsoleTile();

View File

@@ -23,10 +23,11 @@
#ifndef PISCREENDRAWER_H
#define PISCREENDRAWER_H
#include "pip_console_export.h"
#include "piscreentypes.h"
#include "pistring.h"
class PIP_EXPORT PIScreenDrawer
class PIP_CONSOLE_EXPORT PIScreenDrawer
{
friend class PIScreen;
PIScreenDrawer(PIVector<PIVector<PIScreenTypes::Cell> > & c);

View File

@@ -23,12 +23,13 @@
#ifndef PISCREENTILE_H
#define PISCREENTILE_H
#include "pip_console_export.h"
#include "piscreentypes.h"
#include "pikbdlistener.h"
class PIScreenDrawer;
class PIP_EXPORT PIScreenTile: public PIObject {
class PIP_CONSOLE_EXPORT PIScreenTile: public PIObject {
friend class PIScreen;
PIOBJECT_SUBCLASS(PIScreenTile, PIObject)
public:

View File

@@ -23,10 +23,11 @@
#ifndef PISCREENTILES_H
#define PISCREENTILES_H
#include "pip_console_export.h"
#include "piscreentile.h"
class PIP_EXPORT TileSimple: public PIScreenTile {
class PIP_CONSOLE_EXPORT TileSimple: public PIScreenTile {
PIOBJECT_SUBCLASS(TileSimple, PIScreenTile)
public:
typedef PIPair<PIString, PIScreenTypes::CellFormat> Row;
@@ -43,7 +44,7 @@ protected:
class TileList;
class PIP_EXPORT TileScrollBar: public PIScreenTile {
class PIP_CONSOLE_EXPORT TileScrollBar: public PIScreenTile {
PIOBJECT_SUBCLASS(TileScrollBar, PIScreenTile)
friend class TileList;
public:
@@ -66,7 +67,7 @@ protected:
};
class PIP_EXPORT TileList: public PIScreenTile {
class PIP_CONSOLE_EXPORT TileList: public PIScreenTile {
PIOBJECT_SUBCLASS(TileList, PIScreenTile)
public:
TileList(const PIString & n = PIString());
@@ -98,7 +99,7 @@ protected:
};
class PIP_EXPORT TileButton: public PIScreenTile {
class PIP_CONSOLE_EXPORT TileButton: public PIScreenTile {
PIOBJECT_SUBCLASS(TileButton, PIScreenTile)
public:
TileButton(const PIString & n = PIString());
@@ -118,7 +119,7 @@ protected:
class PIP_EXPORT TileButtons: public PIScreenTile {
class PIP_CONSOLE_EXPORT TileButtons: public PIScreenTile {
PIOBJECT_SUBCLASS(TileButtons, PIScreenTile)
public:
TileButtons(const PIString & n = PIString());
@@ -143,7 +144,7 @@ protected:
};
class PIP_EXPORT TileCheck: public PIScreenTile {
class PIP_CONSOLE_EXPORT TileCheck: public PIScreenTile {
PIOBJECT_SUBCLASS(TileCheck, PIScreenTile)
public:
TileCheck(const PIString & n = PIString());
@@ -162,7 +163,7 @@ protected:
};
class PIP_EXPORT TileProgress: public PIScreenTile {
class PIP_CONSOLE_EXPORT TileProgress: public PIScreenTile {
PIOBJECT_SUBCLASS(TileProgress, PIScreenTile)
public:
TileProgress(const PIString & n = PIString());
@@ -178,7 +179,7 @@ protected:
};
class PIP_EXPORT TilePICout: public TileList {
class PIP_CONSOLE_EXPORT TilePICout: public TileList {
PIOBJECT_SUBCLASS(TilePICout, PIScreenTile)
public:
TilePICout(const PIString & n = PIString());
@@ -191,7 +192,7 @@ protected:
};
class PIP_EXPORT TileInput: public PIScreenTile {
class PIP_CONSOLE_EXPORT TileInput: public PIScreenTile {
PIOBJECT_SUBCLASS(TileInput, PIScreenTile)
public:
TileInput(const PIString & n = PIString());

View File

@@ -23,6 +23,7 @@
#ifndef PISCREENTYPES_H
#define PISCREENTYPES_H
#include "pip_console_export.h"
#include "pivariant.h"
class PIScreenTile;
@@ -30,7 +31,7 @@ class PIScreenTile;
namespace PIScreenTypes {
//! Color for chars or background
enum PIP_EXPORT Color {
enum Color {
Default /** Default */,
Black /** Black */,
Red /** Red */,
@@ -44,7 +45,7 @@ namespace PIScreenTypes {
};
//! Flags for chars
enum PIP_EXPORT CharFlag {
enum CharFlag {
Bold /** Bold or bright */ = 0x1,
Blink /** Blink text */ = 0x2,
Underline /** Underline text */ = 0x4,
@@ -52,14 +53,14 @@ namespace PIScreenTypes {
};
//! Alignment
enum PIP_EXPORT Alignment {
enum Alignment {
Left /** Left */ ,
Center /** Center */ ,
Right /** Right */
};
//! Size policy
enum PIP_EXPORT SizePolicy {
enum SizePolicy {
Fixed /** Fixed size */ ,
Preferred /** Preferred size */ ,
Expanding /** Maximum available size */ ,
@@ -67,13 +68,13 @@ namespace PIScreenTypes {
};
//! Direction
enum PIP_EXPORT Direction {
enum Direction {
Horizontal /** Horizontal */ ,
Vertical /** Vertical */
};
//! Focus flags
enum PIP_EXPORT FocusFlag {
enum FocusFlag {
CanHasFocus /** Tile can has focus */ = 0x1,
NextByTab /** Focus passed to next tile by tab key */ = 0x2,
NextByArrowsHorizontal /** Focus passed to next tile by arrow keys left or right */ = 0x4,
@@ -87,7 +88,7 @@ namespace PIScreenTypes {
typedef PIFlags<CharFlag> CharFlags;
typedef PIFlags<FocusFlag> FocusFlags;
union PIP_EXPORT CellFormat {
union PIP_CONSOLE_EXPORT CellFormat {
CellFormat(ushort f = 0) {raw_format = f;}
CellFormat(Color col_char, Color col_back = Default, CharFlags flags_ = 0) {
color_char = col_char;
@@ -104,7 +105,7 @@ namespace PIScreenTypes {
bool operator !=(const CellFormat & c) const {return raw_format != c.raw_format;}
};
struct PIP_EXPORT Cell {
struct PIP_CONSOLE_EXPORT Cell {
Cell(PIChar c = PIChar(' '), CellFormat f = CellFormat()) {symbol = c; format = f;}
CellFormat format;
PIChar symbol;
@@ -120,7 +121,7 @@ namespace PIScreenTypes {
}
};
struct PIP_EXPORT TileEvent {
struct PIP_CONSOLE_EXPORT TileEvent {
TileEvent(int t = -1, const PIVariant & d = PIVariant()): type(t), data(d) {}
int type;
PIVariant data;

View File

@@ -23,11 +23,12 @@
#ifndef PITERMINAL_H
#define PITERMINAL_H
#include "pip_console_export.h"
#include "pikbdlistener.h"
#include "piscreentypes.h"
class PIP_EXPORT PITerminal: public PIThread
class PIP_CONSOLE_EXPORT PITerminal: public PIThread
{
PIOBJECT_SUBCLASS(PITerminal, PIThread)
public:
@@ -63,7 +64,7 @@ private:
int termType(const PIString & t);
#endif
PRIVATE_DECLARATION
PRIVATE_DECLARATION(PIP_CONSOLE_EXPORT)
int dsize_x, dsize_y;
int size_x, size_y, cursor_x, cursor_y;
bool cursor_blink, cursor_visible;