 |
Gorgon Game Engine
|
Go to the documentation of this file.
5 #include "../../Scripting.h"
8 namespace Gorgon {
namespace Scripting {
namespace Compilers {
45 else if(op.length()==2) {
60 if(op==
"<<" || op==
">>" || op==
"shl" || op==
"shr" || op==
"rol" || op==
"ror") {
63 else if(op==
"band" || op==
"bor" || op==
"bxor" || op==
"bittest") {
66 else if(op==
"bitset" || op==
"bitunset" || op==
"contains" || op==
"in" || op==
"notin" || op==
"union" || op==
"intersect") {
72 else if(op==
"and" || op==
"xor") {
@ Disabled
Component is visible when the widget is disabled.
Definition: Template.h:184
int JumpOffset
Definition: Instruction.h:175
@ Automatic
Given size is not used, object is sized to its contents.
Definition: Template.h:634
ContainerTemplate & AddIndex(int componentindex)
Adds an index to the container.
Definition: Template.h:1761
This class represents a color information.
Definition: Color.h:91
Fills a drawing with a solid color.
Definition: CGI.h:11
void Blend(const RGBA &color)
Blends the given color into this one.
Definition: Color.h:248
std::enable_if< decltype(gorgon__enum_tr_loc(T_()))::isupgradedenum, std::string >::type From(const T_ &e)
Definition: Enum.h:303
@ Even
In lists denotes the item is in even position.
Definition: Template.h:230
static EmptyImage & Instance()
Returns the instance for empty image. Only one instance is enough.
Definition: EmptyImage.h:50
VisualProvider Background
Background graphics.
Definition: Template.h:1810
void SetValueModification(ValueModification mod, ValueSource source=UseFirst, std::array< float, 4 > min={{0, 0, 0, 0}}, std::array< float, 4 > max={{1, 1, 1, 1}})
Sets the property that will be affected by the value of the widget.
Definition: Template.h:1099
@ ContentsTag
Definition: Template.h:872
@ FunctionCall
Marks instruction as a regular function call.
void SetMargin(int value, Dimension::Unit unit=Dimension::Pixel)
Changes the margin of the component.
Definition: Template.h:992
@ Icon
Data will effect the displayed graphics.
Definition: Template.h:678
const Instruction * ReadInstruction(unsigned long line)
Reads the instruction in the given line.
Definition: Scope.cpp:5
@ Absolute
Absolute positioning, coordinates will start from the container.
Definition: Template.h:619
basic_TextureAnimationProvider< Bitmap, basic_TextureAnimation, basic_AnimationFrame< Bitmap > > BitmapAnimationProvider
Definition: TextureAnimation.h:520
@ UseTransition
This channel will give the progress of a transition.
Definition: Template.h:809
void Pop()
Removes the last point from the list.
Definition: PointList.h:184
@ ModifyAlpha
Value modifies the opacity of the component.
Definition: Template.h:709
void DrawLines(Containers::Image &target, const Geometry::PointList< P_ > &p, StrokeSettings settings=1.0, F_ stroke=SolidFill<>{Graphics::Color::Black})
Draw a point list as a list of lines.
Definition: Line.h:182
@ MiddleLeft
Middle left.
Definition: Template.h:48
A new scope is created automatically when a new input source or a function like construct is created.
Definition: Scope.h:62
This class stores visual information about a widget template.
Definition: Template.h:392
@ TopCenter
Top center.
Definition: Template.h:43
GraphicsTemplate & AddGraphics(int index, ComponentCondition cond)
This will create a new drawable and return it.
Definition: Template.h:442
std::string ExtractQuotes(const std::string &input, int &ch)
Extracts a string that is in quotes.
Definition: Utils.h:44
std::enable_if<!std::is_pointer< T_ >::value, const typename std::remove_reference< T_ >::type & >::type GetValue() const
Returns the value of this data in the requested format.
Definition: Data.h:57
std::string GetEnvVar(const std::string &var)
Returns the value of an environment variable.
Definition: Linux.cpp:17
@ Ch4V1
Channel 4 value is 1, the value will be rounded to 4 decimal points before comparison.
Definition: Template.h:302
@ Hover
Mouse is over the widget, or over a particular repeat.
Definition: Template.h:193
T_ Height
Height of this size object.
Definition: Size.h:261
BitmapRectangleProvider Slice(const Bitmap &source, Geometry::Bounds center)
Slices an image to create a rectangle.
Definition: Rectangle.h:610
@ RGBA
32bit red, green, blue and alpha channel image. Red component is in the lowest byte order and
bool Reference
Definition: Instruction.h:170
void SetBorderSize(int value)
Changes the border size of the component.
Definition: Template.h:1694
@ TopLeft
Top left.
Definition: Template.h:41
bool Start(const std::string &name, const std::vector< std::string > &args=std::vector< std::string >())
Starts the given application.
Definition: Linux.cpp:116
void SetDataEffect(DataEffect effect)
Sets the data effect for this component. Default is None.
Definition: Template.h:1076
Value RHS
The value that will be assigned to the variable.
Definition: Instruction.h:165
void SetClip(bool value)
Whether to clip the contents of this container, default value is false.
Definition: Template.h:1267
virtual float GetLineGap() const =0
This is the default distance between two consecutive lines.
@ HScroll
There is space horizontally to be scrolled.
Definition: Template.h:248
Value Name
Name of the function or variable.
Definition: Instruction.h:162
void SetSize(int w, int h)
Changes the size of the template.
Definition: Template.h:508
TextholderTemplate & AddTextholder(int index, ComponentCondition cond)
This will create a new textholder and return it.
Definition: Template.h:430
@ Assignment
Marks instruction as an assignment.
std::string Join(std::string path1, const std::string &path2)
Joins two given paths or a path and filename.
Definition: Filesystem.h:154
basic_Size< int > Size
Definition: Size.h:385
int GetPrecedence(const std::string &op)
Returns the precedence of the given operator.
Definition: Language.h:12
@ Opened
This condition is triggered when the widget is opened like a combobox showing its list part.
Definition: Template.h:213
Byte A
Alpha channel.
Definition: Color.h:312
@ Pixel
Fixed pixel based dimensions.
Definition: Dimension.h:18
@ ModifyWidth
Width of this component will be affected.
Definition: Template.h:739
const Type & GetType() const
Returns the type of the data.
Definition: Data.h:173
void SetPositioning(PositionType value)
Changes the positioning method of the component.
Definition: Template.h:925
@ HScrollTag
Definition: Template.h:856
@ Text
Works only for TextholderTemplate, data will affect the text that is displayed.
Definition: Template.h:651
GlyphRenderer & GetGlyphRenderer()
Definition: Font.h:472
Root namespace for Gorgon Game Engine.
Definition: Any.h:19
This class represents a 2D geometric size.
Definition: Size.h:23
basic_Margin< int > Margin
Definition: Margin.h:289
RGBA BlendWith(const RGBA &color) const
Blends the current color with the given color and returns the result.
Definition: Color.h:279
uint32_t Char
Definition: Types.h:46
std::string Name
Used for variables and constants.
Definition: Instruction.h:84
void SetDrawable(const Graphics::Drawable &value)
Sets the content from a drawable.
Definition: Template.h:1553
std::string Disassemble(const Instruction *)
Disassembles the given instruction.
Definition: Generator.cpp:55
@ ViewPortTag
Definition: Template.h:873
@ TopRight
Top right.
Definition: Template.h:45
@ VScrollTag
Definition: Template.h:857
@ ListTag
Definition: Template.h:879
#define ASSERT(expression, message,...)
Replaces regular assert to allow messages and backtrace.
Definition: Assert.h:161
@ VScroll
There is space vertically to be scrolled.
Definition: Template.h:251
int GetWidth() const
Returns the size of the template.
Definition: Template.h:525
@ DragTag
Definition: Template.h:858
void SetRenderer(const Graphics::TextRenderer &value)
Changes the renderer.
Definition: Template.h:1440
Data Literal
Used for literal values.
Definition: Instruction.h:87
@ DragBarTag
Definition: Template.h:860
PlaceholderTemplate & AddPlaceholder(int index, ComponentCondition cond)
This will create a new placeholder and return it.
Definition: Template.h:422
std::string Trim(std::string str, const std::string &chars=" \t\n\r")
Strips whitespace around the given string both from start and end.
Definition: String.h:370
This object contains an bitmap image.
Definition: Bitmap.h:25
InstructionType Type
Type of the instruction.
Definition: Instruction.h:159
This object creates a masked object from two graphics object.
Definition: MaskedObject.h:109
std::string Extract(std::string &original, const std::string &marker, bool trim=false)
Extracts the part of the string up to the given marker.
Definition: String.h:779
@ BottomCenter
Bottom center.
Definition: Template.h:58
This class contains a parsed value.
Definition: Instruction.h:82
@ ModifyPositionAndSize
This is a combined modification of position and size.
Definition: Template.h:751
basic_Point< Float > Pointf
Definition: Point.h:601
basic_MaskedObjectProvider< RectangularAnimationProvider > MaskedObjectProvider
Definition: MaskedObject.h:342
Byte Result
Used for temporary results.
Definition: Instruction.h:93
void SetAnimation(const Graphics::AnimationProvider &value)
Sets the content from an animation provider.
Definition: Template.h:1561
@ Ch1V0
Channel 1 value is 0, the value will be rounded to 4 decimal points before comparison.
Definition: Template.h:258
Byte B
Blue channel.
Definition: Color.h:309
ContainerTemplate & AddContainer(int index, ComponentCondition cond)
This will create a new drawable and return it.
Definition: Template.h:450
This class represents a 2D point.
Definition: Point.h:32
@ Fixed
The given size is absolute, it is not affected by the contents.
Definition: Template.h:631
void SetGlyphRenderer(GlyphRenderer &renderer)
Definition: Font.h:476
void SetSizing(SizingMode value)
Changes the sizing mode of the component.
Definition: Template.h:974
basic_RectangleProvider< RectangularAnimationProvider > RectangleProvider
Definition: Rectangle.h:588
ComponentCondition
Controls the condition when the components are visible.
Definition: Template.h:174
Byte G
Green channel.
Definition: Color.h:306
@ MiddleRight
Middle right.
Definition: Template.h:53
unsigned char Byte
Represents smallest cell in memory.
Definition: Types.h:9
@ State2
Second state of the widget, first state is Always.
Definition: Template.h:201
@ MethodCall
Marks this instruction as a method call.
This class allows instancing of a rectangle like image that is made out of three parts.
Definition: Rectangle.h:185
@ Literal
This is a literal value.
std::vector< Instruction > List
The instructions that are compiled.
Definition: Compilers.h:51
int GetHeight() const
Returns the size of the template.
Definition: Template.h:530
@ ShrinkOnly
Given size is the maximum, if the contents are smaller, the object be resized.
Definition: Template.h:642
void SetSize(int w, int h, Dimension::Unit unit=Dimension::Pixel)
Changes the size of the component. The given values are ignored if the sizing mode is Automatic.
Definition: Template.h:952
void SetTag(Tag value)
Changes the tag of this component.
Definition: Template.h:1144
std::string disassemblevalue(const Value &value)
Definition: Generator.cpp:8
basic_RectangleProvider< Bitmap > BitmapRectangleProvider
Definition: Rectangle.h:590
@ Focused
Widget has the focus.
Definition: Template.h:190
@ AbsoluteSliding
Absolute positioning, coordinates will start from the container, percent based movement will move to ...
Definition: Template.h:615
@ MiddleCenter
Middle center, using this position ensures that the components will be inside each other.
Definition: Template.h:51
T_ Width
Width of this size object.
Definition: Size.h:258
@ ItemTag
Definition: Template.h:876
IgnoredTemplate & AddIgnored(int index, ComponentCondition cond)
This will create a new ignored template.
Definition: Template.h:434
@ Identifier
Marks this value as an identifier, either a constant or a variable.
Byte R
Red channel.
Definition: Color.h:303
virtual int GetHeight() const =0
Height of glyphs, actual size could be smaller but all glyphs should have the same virtual height.
Pure color blank image, default size is 0x0, but can be drawn with any size.
Definition: BlankImage.h:13
@ Variable
This is a variable.
@ UseXW
Definition: Template.h:824
Byte Store
Whether to store the result of the function.
Definition: Instruction.h:174
void AlignCenter()
Aligns the text to the center, removes justify.
Definition: Font.h:625
ValueType Type
Type of this value.
Definition: Instruction.h:90
@ Jump
Unconditionally jumps by the given offset. Offset should be in JumpOffset field.
std::vector< Value > Parameters
Parameters of the function.
Definition: Instruction.h:168
void Polyfill(Containers::Image &target, const std::vector< Geometry::PointList< P_ >> &p, F_ fill=SolidFill<>{Graphics::Color::Black})
This function fills the given point list as a polygon.
Definition: Polygon.h:164
void SetTemplate(const Template &value)
Sets the sub template for this placeholder.
Definition: Template.h:1384
@ Icon1
Definition: Template.h:679
void ForAllPixels(std::function< void(int, int)> fn) const
Loops through all pixels of the image, giving coordinates to your function.
Definition: Bitmap.h:622
@ Reversed
For widgets that can have reversed state.
Definition: Template.h:224
int CheckInputFor(const std::string &input, int &ch, P_ ...args)
Checks if the input string contains one of the given characters at current point.
Definition: Utils.h:9
VisualProvider Content
Graphical representation of the template.
Definition: Template.h:1644
A single instruction.
Definition: Instruction.h:150
void Clear()
Cleans the contents of the buffer by setting every byte it contains to 0.
Definition: Bitmap.h:730
This class allows using font files for text rendering.
Definition: FreeType.h:49
This class represents a set of points.
Definition: PointList.h:17
void SetSpacing(int value)
Sets the spacing required for this template.
Definition: Template.h:571
@ Always
Component is always active.
Definition: Template.h:176
@ Icon1IsSet
Data effect of the component is set.
Definition: Template.h:349
static basic_Point FromVector(Float magnitute, Float angle, const basic_Point< O_ > &origin={0, 0})
Creates a new point from the given vector data.
Definition: Point.h:109
virtual float GetLineThickness() const =0
Should return the average thickness of a line.
@ Readonly
Component is visible when the widget is readonly.
Definition: Template.h:187
virtual std::pair< int, int > GetLetterHeight(bool asciionly=false) const =0
Returns the offset (first) and maximum height (second) that is used by letters.
@ Percent
Dimension will be relative to the parent and given in percent.
Definition: Dimension.h:22