mirror of
https://github.com/YACReader/yacreader
synced 2025-07-19 05:24:57 -04:00
fixed some build issues
This commit is contained in:
@ -1,311 +0,0 @@
|
||||
#include "comic_flow_widget.h"
|
||||
|
||||
ComicFlowWidget::ComicFlowWidget(QWidget * parent)
|
||||
:QWidget(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
ComicFlowWidgetSW::ComicFlowWidgetSW(QWidget * parent)
|
||||
:ComicFlowWidget(parent)
|
||||
{
|
||||
flow = new ComicFlow(parent);
|
||||
|
||||
connect(flow,SIGNAL(centerIndexChanged(int)),this,SIGNAL(centerIndexChanged(int)));
|
||||
connect(flow,SIGNAL(selected(unsigned int)),this,SIGNAL(selected(unsigned int)));
|
||||
|
||||
QVBoxLayout * l = new QVBoxLayout;
|
||||
l->addWidget(flow);
|
||||
setLayout(l);
|
||||
|
||||
//TODO eleminar "padding"
|
||||
QPalette Pal(palette());
|
||||
// set black background
|
||||
Pal.setColor(QPalette::Background, Qt::black);
|
||||
setAutoFillBackground(true);
|
||||
setPalette(Pal);
|
||||
}
|
||||
|
||||
QSize ComicFlowWidgetSW::minimumSizeHint() const
|
||||
{
|
||||
return flow->minimumSizeHint();
|
||||
}
|
||||
QSize ComicFlowWidgetSW::sizeHint() const
|
||||
{
|
||||
return flow->sizeHint();
|
||||
}
|
||||
|
||||
void ComicFlowWidgetSW::setShowMarks(bool value)
|
||||
{
|
||||
flow->setShowMarks(value);
|
||||
}
|
||||
void ComicFlowWidgetSW::setMarks(QVector<bool> marks)
|
||||
{
|
||||
flow->setMarks(marks);
|
||||
}
|
||||
void ComicFlowWidgetSW::setMarkImage(QImage & image)
|
||||
{
|
||||
flow->setMarkImage(image);
|
||||
}
|
||||
void ComicFlowWidgetSW::markSlide(int index)
|
||||
{
|
||||
flow->markSlide(index);
|
||||
}
|
||||
void ComicFlowWidgetSW::unmarkSlide(int index)
|
||||
{
|
||||
flow->unmarkSlide(index);
|
||||
}
|
||||
void ComicFlowWidgetSW::setSlideSize(QSize size)
|
||||
{
|
||||
flow->setSlideSize(size);
|
||||
}
|
||||
void ComicFlowWidgetSW::clear()
|
||||
{
|
||||
flow->clear();
|
||||
}
|
||||
void ComicFlowWidgetSW::setImagePaths(QStringList paths)
|
||||
{
|
||||
flow->setImagePaths(paths);
|
||||
}
|
||||
void ComicFlowWidgetSW::setCenterIndex(int index)
|
||||
{
|
||||
flow->setCenterIndex(index);
|
||||
}
|
||||
void ComicFlowWidgetSW::showSlide(int index)
|
||||
{
|
||||
flow->showSlide(index);
|
||||
}
|
||||
int ComicFlowWidgetSW::centerIndex()
|
||||
{
|
||||
return flow->centerIndex();
|
||||
}
|
||||
void ComicFlowWidgetSW::updateMarks()
|
||||
{
|
||||
flow->updateMarks();
|
||||
}
|
||||
void ComicFlowWidgetSW::setFlowType(PictureFlow::FlowType flowType)
|
||||
{
|
||||
flow->setFlowType(flowType);
|
||||
}
|
||||
void ComicFlowWidgetSW::render()
|
||||
{
|
||||
flow->render();
|
||||
}
|
||||
void ComicFlowWidgetSW::keyPressEvent(QKeyEvent* event)
|
||||
{
|
||||
flow->keyPressEvent(event);
|
||||
}
|
||||
void ComicFlowWidgetSW::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
flow->paintEvent(event);
|
||||
}
|
||||
void ComicFlowWidgetSW::mousePressEvent(QMouseEvent* event)
|
||||
{
|
||||
flow->mousePressEvent(event);
|
||||
}
|
||||
void ComicFlowWidgetSW::resizeEvent(QResizeEvent* event)
|
||||
{
|
||||
flow->resizeEvent(event);
|
||||
}
|
||||
void ComicFlowWidgetSW::mouseDoubleClickEvent(QMouseEvent* event)
|
||||
{
|
||||
flow->mouseDoubleClickEvent(event);
|
||||
}
|
||||
void ComicFlowWidgetSW::updateConfig(QSettings * settings)
|
||||
{
|
||||
//flow->setFlowType(flowType);
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
///OpenGL ComicFlow
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
ComicFlowWidgetGL::ComicFlowWidgetGL(QWidget * parent)
|
||||
:ComicFlowWidget(parent)
|
||||
{
|
||||
flow = new YACReaderComicFlowGL(parent);
|
||||
|
||||
connect(flow,SIGNAL(centerIndexChanged(int)),this,SIGNAL(centerIndexChanged(int)));
|
||||
connect(flow,SIGNAL(selected(unsigned int)),this,SIGNAL(selected(unsigned int)));
|
||||
|
||||
QVBoxLayout * l = new QVBoxLayout;
|
||||
l->addWidget(flow);
|
||||
l->setContentsMargins(0,0,0,0);
|
||||
setLayout(l);
|
||||
|
||||
//TODO eleminar "padding"
|
||||
QPalette Pal(palette());
|
||||
// set black background
|
||||
Pal.setColor(QPalette::Background, Qt::black);
|
||||
setAutoFillBackground(true);
|
||||
setPalette(Pal);
|
||||
}
|
||||
|
||||
QSize ComicFlowWidgetGL::minimumSizeHint() const
|
||||
{
|
||||
return flow->minimumSizeHint();
|
||||
}
|
||||
QSize ComicFlowWidgetGL::sizeHint() const
|
||||
{
|
||||
return flow->sizeHint();
|
||||
}
|
||||
|
||||
void ComicFlowWidgetGL::setShowMarks(bool value)
|
||||
{
|
||||
flow->setShowMarks(value);
|
||||
}
|
||||
void ComicFlowWidgetGL::setMarks(QVector<bool> marks)
|
||||
{
|
||||
flow->setMarks(marks);
|
||||
}
|
||||
void ComicFlowWidgetGL::setMarkImage(QImage & image)
|
||||
{
|
||||
flow->setMarkImage(image);
|
||||
}
|
||||
void ComicFlowWidgetGL::markSlide(int index)
|
||||
{
|
||||
flow->markSlide(index);
|
||||
}
|
||||
void ComicFlowWidgetGL::unmarkSlide(int index)
|
||||
{
|
||||
flow->unmarkSlide(index);
|
||||
}
|
||||
void ComicFlowWidgetGL::setSlideSize(QSize size)
|
||||
{
|
||||
flow->setSlideSize(size);
|
||||
}
|
||||
void ComicFlowWidgetGL::clear()
|
||||
{
|
||||
flow->clear();
|
||||
}
|
||||
void ComicFlowWidgetGL::setImagePaths(QStringList paths)
|
||||
{
|
||||
flow->setImagePaths(paths);
|
||||
}
|
||||
void ComicFlowWidgetGL::setCenterIndex(int index)
|
||||
{
|
||||
flow->setCenterIndex(index);
|
||||
}
|
||||
void ComicFlowWidgetGL::showSlide(int index)
|
||||
{
|
||||
flow->showSlide(index);
|
||||
}
|
||||
int ComicFlowWidgetGL::centerIndex()
|
||||
{
|
||||
return flow->centerIndex();
|
||||
}
|
||||
void ComicFlowWidgetGL::updateMarks()
|
||||
{
|
||||
flow->updateMarks();
|
||||
}
|
||||
void ComicFlowWidgetGL::setFlowType(PictureFlow::FlowType flowType)
|
||||
{
|
||||
if(flowType == PictureFlow::CoverFlowLike)
|
||||
flow->setPreset(presetYACReaderFlowClassicConfig);
|
||||
else if(flowType == PictureFlow::Strip)
|
||||
flow->setPreset(presetYACReaderFlowStripeConfig);
|
||||
else if(flowType == PictureFlow::StripOverlapped)
|
||||
flow->setPreset(presetYACReaderFlowOverlappedStripeConfig);
|
||||
else
|
||||
flow->setPreset(defaultYACReaderFlowConfig);
|
||||
}
|
||||
void ComicFlowWidgetGL::render()
|
||||
{
|
||||
flow->render();
|
||||
}
|
||||
void ComicFlowWidgetGL::keyPressEvent(QKeyEvent* event)
|
||||
{
|
||||
flow->keyPressEvent(event);
|
||||
}
|
||||
void ComicFlowWidgetGL::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
//flow->paintEvent(event);
|
||||
}
|
||||
void ComicFlowWidgetGL::mousePressEvent(QMouseEvent* event)
|
||||
{
|
||||
flow->mousePressEvent(event);
|
||||
}
|
||||
void ComicFlowWidgetGL::resizeEvent(QResizeEvent* event)
|
||||
{
|
||||
flow->resizeGL(event->size().width(),event->size().height());
|
||||
}
|
||||
void ComicFlowWidgetGL::mouseDoubleClickEvent(QMouseEvent* event)
|
||||
{
|
||||
flow->mouseDoubleClickEvent(event);
|
||||
}
|
||||
|
||||
void ComicFlowWidgetGL::updateConfig(QSettings * settings)
|
||||
{
|
||||
Performance performance = medium;
|
||||
|
||||
switch (settings->value("performance").toInt())
|
||||
{
|
||||
case 0:
|
||||
performance = low;
|
||||
break;
|
||||
case 1:
|
||||
performance = medium;
|
||||
break;
|
||||
case 2:
|
||||
performance = high;
|
||||
break;
|
||||
case 3:
|
||||
performance = ultraHigh;
|
||||
break;
|
||||
}
|
||||
|
||||
flow->setPerformance(performance);
|
||||
|
||||
switch (settings->value("flowType").toInt())
|
||||
{
|
||||
case 0:
|
||||
flow->setPreset(presetYACReaderFlowClassicConfig);
|
||||
return;
|
||||
case 1:
|
||||
flow->setPreset(presetYACReaderFlowStripeConfig);
|
||||
return;
|
||||
case 2:
|
||||
flow->setPreset(presetYACReaderFlowOverlappedStripeConfig);
|
||||
return;
|
||||
case 3:
|
||||
flow->setPreset(defaultYACReaderFlowConfig);
|
||||
return;
|
||||
case 4:
|
||||
flow->setPreset(pressetYACReaderFlowDownConfig);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//custom config
|
||||
|
||||
flow->setCF_RX(settings->value("xRotation").toInt());
|
||||
flow->setCF_Y(settings->value("yPosition").toInt());
|
||||
flow->setX_Distance(settings->value("coverDistance").toInt());
|
||||
flow->setCenter_Distance(settings->value("centralDistance").toInt());
|
||||
flow->setCF_Z(settings->value("zoomLevel").toInt());
|
||||
flow->setY_Distance(settings->value("yCoverOffset").toInt());
|
||||
flow->setZ_Distance(settings->value("zCoverOffset").toInt());
|
||||
flow->setRotation(settings->value("coverRotation").toInt());
|
||||
flow->setFadeOutDist(settings->value("fadeOutDist").toInt());
|
||||
flow->setLightStrenght(settings->value("lightStrength").toInt());
|
||||
flow->setMaxAngle(settings->value("maxAngle").toInt());
|
||||
|
||||
/* flow->setVisibility(settings->value("visibilityDistance").toInt());
|
||||
flow->setLightStrenght(settings->value("lightStrength").toInt())*/;
|
||||
|
||||
}
|
||||
|
||||
//void ComicFlowWidgetGL::setCF_RX(int value){ flow->setCF_RX(value);}
|
||||
//void ComicFlowWidgetGL::setCF_RY(int value){ flow->setCF_RY(value);}
|
||||
//void ComicFlowWidgetGL::setCF_RZ(int value){ flow->setCF_RZ(value);}
|
||||
//void ComicFlowWidgetGL::setZoom(int zoom){ flow->setZoom(zoom);}
|
||||
//void ComicFlowWidgetGL::setRotation(int angle){ flow->setRotation(angle);}
|
||||
//void ComicFlowWidgetGL::setX_Distance(int distance){ flow->setX_Distance(distance);}
|
||||
//void ComicFlowWidgetGL::setCenter_Distance(int distance){ flow->setCenter_Distance(distance);}
|
||||
//void ComicFlowWidgetGL::setZ_Distance(int distance){ flow->setZ_Distance(distance);}
|
||||
//void ComicFlowWidgetGL::setCF_Y(int value){ flow->setCF_Y(value);}
|
||||
//void ComicFlowWidgetGL::setY_Distance(int value){ flow->setY_Distance(value);}
|
||||
//void ComicFlowWidgetGL::setPreset(const Preset & p){ flow->setPreset(p);}
|
@ -1,119 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include "pictureflow.h"
|
||||
#include "comic_flow.h"
|
||||
#include "yacreader_flow_gl.h"
|
||||
|
||||
class ComicFlowWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ComicFlowWidget(QWidget * paret = 0);
|
||||
|
||||
public slots:
|
||||
virtual void setShowMarks(bool value) = 0;
|
||||
virtual void setMarks(QVector<bool> marks) = 0;
|
||||
virtual void setMarkImage(QImage & image) = 0;
|
||||
virtual void markSlide(int index) = 0;
|
||||
virtual void unmarkSlide(int index) = 0;
|
||||
virtual void setSlideSize(QSize size) = 0;
|
||||
virtual void clear() = 0;
|
||||
virtual void setImagePaths(QStringList paths) = 0;
|
||||
virtual void setCenterIndex(int index) = 0;
|
||||
virtual void showSlide(int index) = 0;
|
||||
virtual int centerIndex() = 0;
|
||||
virtual void updateMarks() = 0;
|
||||
virtual void setFlowType(PictureFlow::FlowType flowType) = 0;
|
||||
virtual void render() = 0;
|
||||
virtual void updateConfig(QSettings * settings) = 0;
|
||||
signals:
|
||||
void centerIndexChanged(int);
|
||||
void selected(unsigned int);
|
||||
};
|
||||
|
||||
|
||||
class ComicFlowWidgetSW : public ComicFlowWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
ComicFlow * flow;
|
||||
public:
|
||||
ComicFlowWidgetSW(QWidget * parent = 0);
|
||||
|
||||
void setShowMarks(bool value);
|
||||
void setMarks(QVector<bool> marks);
|
||||
void setMarkImage(QImage & image);
|
||||
void markSlide(int index);
|
||||
void unmarkSlide(int index);
|
||||
void setSlideSize(QSize size);
|
||||
void clear();
|
||||
void setImagePaths(QStringList paths);
|
||||
void setCenterIndex(int index);
|
||||
void showSlide(int index);
|
||||
int centerIndex();
|
||||
void updateMarks();
|
||||
void setFlowType(PictureFlow::FlowType flowType);
|
||||
void render();
|
||||
void updateConfig(QSettings * settings);
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent* event);
|
||||
void paintEvent(QPaintEvent *event);
|
||||
void mousePressEvent(QMouseEvent* event);
|
||||
void resizeEvent(QResizeEvent* event);
|
||||
void mouseDoubleClickEvent(QMouseEvent* event);
|
||||
QSize minimumSizeHint() const;
|
||||
QSize sizeHint() const;
|
||||
};
|
||||
|
||||
class ComicFlowWidgetGL : public ComicFlowWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
YACReaderComicFlowGL * flow;
|
||||
public:
|
||||
ComicFlowWidgetGL(QWidget * parent = 0);
|
||||
|
||||
void setShowMarks(bool value);
|
||||
void setMarks(QVector<bool> marks);
|
||||
void setMarkImage(QImage & image);
|
||||
void markSlide(int index);
|
||||
void unmarkSlide(int index);
|
||||
void setSlideSize(QSize size);
|
||||
void clear();
|
||||
void setImagePaths(QStringList paths);
|
||||
void setCenterIndex(int index);
|
||||
void showSlide(int index);
|
||||
int centerIndex();
|
||||
void updateMarks();
|
||||
void setFlowType(PictureFlow::FlowType flowType);
|
||||
void render();
|
||||
void updateConfig(QSettings * settings);
|
||||
//public slots:
|
||||
// void setCF_RX(int value);
|
||||
// //the Y Rotation of the Coverflow
|
||||
// void setCF_RY(int value);
|
||||
// //the Z Rotation of the Coverflow
|
||||
// void setCF_RZ(int value);
|
||||
// //perspective
|
||||
// void setZoom(int zoom);
|
||||
// void setRotation(int angle);
|
||||
// //sets the distance between the covers
|
||||
// void setX_Distance(int distance);
|
||||
// //sets the distance between the centered and the non centered covers
|
||||
// void setCenter_Distance(int distance);
|
||||
// //sets the pushback amount
|
||||
// void setZ_Distance(int distance);
|
||||
// void setCF_Y(int value);
|
||||
// void setY_Distance(int value);
|
||||
// void setPreset(const Preset & p);
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent* event);
|
||||
void paintEvent(QPaintEvent *event);
|
||||
void mousePressEvent(QMouseEvent* event);
|
||||
void resizeEvent(QResizeEvent* event);
|
||||
void mouseDoubleClickEvent(QMouseEvent* event);
|
||||
QSize minimumSizeHint() const;
|
||||
QSize sizeHint() const;
|
||||
};
|
Reference in New Issue
Block a user