forked from parro-it/libui-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
195 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,98 @@ | ||
#include "../libui/ui.h" | ||
#include "ui-node.h" | ||
#include "../../libui/ui.h" | ||
#include "../ui-node.h" | ||
#include "nbind/nbind.h" | ||
|
||
|
||
struct uiDrawStrokeParams { | ||
int Cap; | ||
int Join; | ||
// TODO what if this is 0? on windows there will be a crash with dashing | ||
double Thickness; | ||
double MiterLimit; | ||
double *Dashes; | ||
// TOOD what if this is 1 on Direct2D? | ||
// TODO what if a dash is 0 on Cairo or Quartz? | ||
int NumDashes; | ||
double DashPhase; | ||
}; | ||
|
||
class DrawStrokeParams { | ||
private: | ||
int Cap; | ||
int Join; | ||
double Thickness; | ||
double MiterLimit; | ||
std::vector<double> Dashes; | ||
int NumDashes; | ||
double DashPhase; | ||
public: | ||
DrawStrokeParams(int cap, int join, double thickness, double miterLimit,std::vector<double> dashes,int numDashes,double DashPhase); | ||
int getCap(); | ||
int getJoin(); | ||
double getThickness(); | ||
double getMiterLimit(); | ||
std::vector<double> getDashes(); | ||
int getNumDashes(); | ||
double getDashPhase(); | ||
|
||
void setCap(int value); | ||
void setJoin(int value); | ||
void setThickness(double value); | ||
void setMiterLimit(double value); | ||
void setDashes(std::vector<double> value); | ||
void setNumDashes(int value); | ||
void setDashPhase(double value); | ||
|
||
uiDrawStrokeParams *toStruct(); | ||
|
||
void toJS(nbind::cbOutput output); | ||
|
||
DrawStrokeParams::DrawStrokeParams(int cap, int join, double thickness, double miterLimit,std::vector<double> dashes,int numDashes,double DashPhase) { | ||
|
||
} | ||
|
||
int DrawStrokeParams::getCap() { | ||
return Cap; | ||
} | ||
|
||
int DrawStrokeParams::getJoin() { | ||
return Join; | ||
} | ||
|
||
double DrawStrokeParams::getThickness() { | ||
return Thickness; | ||
} | ||
|
||
double DrawStrokeParams::getMiterLimit() { | ||
return MiterLimit; | ||
|
||
} | ||
|
||
std::vector<double> DrawStrokeParams::getDashes() { | ||
return Dashes; | ||
} | ||
|
||
int DrawStrokeParams::getNumDashes() { | ||
return NumDashes; | ||
|
||
} | ||
|
||
double DrawStrokeParams::getDashPhase() { | ||
return DashPhase; | ||
|
||
} | ||
|
||
void DrawStrokeParams::setCap(int value) { | ||
|
||
} | ||
|
||
void DrawStrokeParams::setJoin(int value) { | ||
|
||
} | ||
|
||
void DrawStrokeParams::setThickness(double value) { | ||
|
||
} | ||
|
||
void DrawStrokeParams::setMiterLimit(double value) { | ||
|
||
} | ||
|
||
void DrawStrokeParams::setDashes(std::vector<double> value) { | ||
|
||
} | ||
|
||
void DrawStrokeParams::setNumDashes(int value) { | ||
|
||
} | ||
|
||
void DrawStrokeParams::setDashPhase(double value) { | ||
|
||
} | ||
|
||
|
||
uiDrawStrokeParams * DrawStrokeParams::toStruct() { | ||
return NULL; | ||
} | ||
|
||
|
||
void DrawStrokeParams::toJS(nbind::cbOutput output) { | ||
|
||
} | ||
|
||
|
||
NBIND_CLASS(DrawStrokeParams) { | ||
construct<double, Color>(); | ||
method(getColor); | ||
method(setColor); | ||
method(getPos); | ||
method(setPos); | ||
method(toJS); | ||
getset(getColor, setColor); | ||
getset(getPos, setPos); | ||
method(getCap); | ||
method(getJoin); | ||
method(getThickness); | ||
method(getMiterLimit); | ||
method(getDashes); | ||
method(getNumDashes); | ||
method(getDashPhase); | ||
method(setCap); | ||
method(setJoin); | ||
method(setThickness); | ||
method(setMiterLimit); | ||
method(setDashes); | ||
method(setNumDashes); | ||
method(setDashPhase); | ||
method(toStruct); | ||
method(toJS); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters