Merge pull request #1025 from JJones780/UpdateVisibleLayoutData
UpdateVisibility, cleanup LayoutDatapresentation
commit
fe94671528
7 changed files with 96 additions and 258 deletions
@ -1,97 +0,0 @@ |
||||
#include "LayoutData.h" |
||||
|
||||
#include <gtk/gtk.h> |
||||
|
||||
LayoutData::LayoutData() |
||||
{ |
||||
XOJ_INIT_TYPE(LayoutData); |
||||
} |
||||
|
||||
LayoutData::~LayoutData() |
||||
{ |
||||
XOJ_RELEASE_TYPE(LayoutData); |
||||
} |
||||
|
||||
int LayoutData::getX() |
||||
{ |
||||
XOJ_CHECK_TYPE(LayoutData); |
||||
|
||||
return this->x; |
||||
} |
||||
|
||||
void LayoutData::setX(int x) |
||||
{ |
||||
XOJ_CHECK_TYPE(LayoutData); |
||||
|
||||
this->x = x; |
||||
} |
||||
|
||||
int LayoutData::getY() |
||||
{ |
||||
XOJ_CHECK_TYPE(LayoutData); |
||||
|
||||
return this->y; |
||||
} |
||||
|
||||
void LayoutData::setY(int y) |
||||
{ |
||||
XOJ_CHECK_TYPE(LayoutData); |
||||
|
||||
this->y = y; |
||||
} |
||||
|
||||
int LayoutData::getPageIndex() |
||||
{ |
||||
XOJ_CHECK_TYPE(LayoutData); |
||||
|
||||
return this->pageIndex; |
||||
} |
||||
|
||||
void LayoutData::setPageIndex(int pageIndex) |
||||
{ |
||||
XOJ_CHECK_TYPE(LayoutData); |
||||
|
||||
this->pageIndex = pageIndex; |
||||
} |
||||
|
||||
int LayoutData::getLayoutAbsoluteX() const |
||||
{ |
||||
XOJ_CHECK_TYPE(LayoutData); |
||||
|
||||
return this->x + this->marginLeft; |
||||
} |
||||
|
||||
int LayoutData::getLayoutAbsoluteY() const |
||||
{ |
||||
XOJ_CHECK_TYPE(LayoutData); |
||||
|
||||
return this->y + this->marginTop; |
||||
} |
||||
|
||||
int LayoutData::getMarginLeft() |
||||
{ |
||||
XOJ_CHECK_TYPE(LayoutData); |
||||
|
||||
return this->marginLeft; |
||||
} |
||||
|
||||
void LayoutData::setMarginLeft(int left) |
||||
{ |
||||
XOJ_CHECK_TYPE(LayoutData); |
||||
|
||||
this->marginLeft = left; |
||||
} |
||||
|
||||
int LayoutData::getMarginTop() |
||||
{ |
||||
XOJ_CHECK_TYPE(LayoutData); |
||||
|
||||
return this->marginTop; |
||||
} |
||||
|
||||
void LayoutData::setMarginTop(int top) |
||||
{ |
||||
XOJ_CHECK_TYPE(LayoutData); |
||||
|
||||
this->marginTop = top; |
||||
} |
||||
@ -1,54 +0,0 @@ |
||||
/*
|
||||
* Xournal++ |
||||
* |
||||
*
|
||||
* |
||||
* @author andreas |
||||
* https://github.com/xournalpp/xournalpp
|
||||
* |
||||
* @license GNU GPLv2 or later |
||||
*/ |
||||
|
||||
#pragma once |
||||
|
||||
#include <XournalType.h> |
||||
|
||||
class LayoutData |
||||
{ |
||||
public: |
||||
LayoutData(); |
||||
~LayoutData(); |
||||
|
||||
public: |
||||
int getX(); |
||||
void setX(int x); |
||||
|
||||
int getY(); |
||||
void setY(int y); |
||||
|
||||
int getPageIndex(); |
||||
void setPageIndex(int pageIndex); |
||||
|
||||
int getLayoutAbsoluteX() const; |
||||
int getLayoutAbsoluteY() const; |
||||
|
||||
int getMarginLeft(); |
||||
void setMarginLeft(int left); |
||||
|
||||
int getMarginTop(); |
||||
void setMarginTop(int top); |
||||
|
||||
private: |
||||
XOJ_TYPE_ATTRIB; |
||||
|
||||
// page position in layout, in px to the layout contents BORDER, not ABSOLUTE
|
||||
int x = 0; |
||||
int y = 0; |
||||
|
||||
// the margin of the layout to the top
|
||||
int marginLeft = 0; |
||||
int marginTop = 0; |
||||
|
||||
// 0: left page, 1: right page, will may be extended later
|
||||
int pageIndex = 0; |
||||
}; |
||||
Loading…
Reference in new issue