22#ifndef GTKMM_KAGE_STAGE_H
23 #define GTKMM_KAGE_STAGE_H
25 #include <gtkmm/drawingarea.h>
28 #include "../data/anchor.h"
29 #include "../data/color.h"
30 #include "../data/strokecolor.h"
31 #include "../data/vectordata.h"
32 #include "../vectordatamanager.h"
33 #include <cairomm/context.h>
34 #include <gdkmm/general.h>
35 #include "../../util/cairo/cairo_kage.h"
39 class KageStage :
public Gtk::DrawingArea {
104 void renderFrame(Cairo::RefPtr<Cairo::Context> p_context,
bool p_force =
false);
105 void renderOnionFrame(Cairo::RefPtr<Cairo::Context> p_context, vector<VectorData> p_vectorData,
double p_alpha);
106 void renderFrame(Cairo::RefPtr<Cairo::Context> p_context, vector<VectorData> p_vectorData,
double p_alpha = 1.0);
107 void renderFrameOffset(Cairo::RefPtr<Cairo::Context> p_context,
bool p_force =
false,
double p_offsetX = 0.0,
double p_offsetY = 0.0);
108 void renderFrameOffset(Cairo::RefPtr<Cairo::Context> p_context, vector<VectorData> p_vectorData,
double p_alpha = 1.0,
double p_offsetX = 0.0,
double p_offsetY = 0.0);
109 unsigned int addImage(
unsigned int p_ID);
147 Glib::RefPtr<Gdk::Pixbuf>
_bg;
148 Cairo::RefPtr<Cairo::Surface>
_bgcr;
169 unsigned int getShape(
unsigned int p_index, vector<VectorData> p_v);
186 bool renderToPNGOffset(
string p_path,
bool p_transparent,
double p_offsetX = 0.0,
double p_offsetY = 0.0);
190 Cairo::RefPtr<Cairo::Context>
cr;
215 vector<Cairo::RefPtr<Cairo::ImageSurface>>
cairoPNG;
231 Glib::RefPtr<Gdk::Window>
window;
244 bool on_draw(
const Cairo::RefPtr<Cairo::Context>&
cr)
override;
258 void renderNode(
double p_x,
double p_y,
unsigned int p_state = 5);
type
Definition: anchor.h:30
Kage * _kage
Definition: stage.h:219
AnchorData anchor_lowerRight
Definition: stage.h:275
void setSelectedShapes(vector< unsigned int > p_selectedShapes)
void renderOnionFrame(Cairo::RefPtr< Cairo::Context > p_context, vector< VectorData > p_vectorData, double p_alpha)
bool on_draw(const Cairo::RefPtr< Cairo::Context > &cr) override
bool isSelectedShape(unsigned int p_index)
virtual bool on_key_press_event(GdkEventKey *e) override
double polyXhead
Definition: stage.h:226
unsigned int mouseOnNode
Definition: stage.h:245
unsigned int drawCtr
Definition: stage.h:235
double polyYhead
Definition: stage.h:226
AnchorData anchor_center
Definition: stage.h:274
bool isMouseOnNode(double p_x, double p_y, unsigned int p_buffer=5)
static Glib::RefPtr< Gdk::Pixbuf > imageSHAPE_045
Definition: stage.h:42
void handleShapes_scaleNorth()
double polyXtail
Definition: stage.h:227
GdkPoint _mouseLocation
Definition: stage.h:231
bool deleteSelectedNodes()
double nodeX
Definition: stage.h:87
PointData draw1
Definition: stage.h:218
bool renderToPNG(string p_path, bool p_transparent)
void clearScreen(Cairo::RefPtr< Cairo::Context > p_context)
for use with zoom; default value is _kage->_document.Project._width; can be changed as preferred
double propHeight
Definition: stage.h:86
static Glib::RefPtr< Gdk::Pixbuf > imageSHAPE_NW
Definition: stage.h:47
static Glib::RefPtr< Gdk::Pixbuf > imageSHAPE_135
Definition: stage.h:44
PointData drawFree2
Definition: stage.h:221
unsigned int getSelectedShapeViaNode(unsigned int p_index, vector< VectorData > p_v)
unsigned int selectedNode
Definition: stage.h:249
double propY
Definition: stage.h:82
Cairo::RefPtr< Cairo::Context > cr
Definition: stage.h:191
vector< unsigned int > selectedNodes
Definition: stage.h:252
void handleStrokeMouseUp()
void renderFrameOffset(Cairo::RefPtr< Cairo::Context > p_context, bool p_force=false, double p_offsetX=0.0, double p_offsetY=0.0)
unsigned int mouseOnNodeIndex
Definition: stage.h:248
PointData applyZoomRatio(PointData p_value)
vector< Cairo::RefPtr< Cairo::ImageSurface > > cairoPNG
Definition: stage.h:215
bool keyDownDown
Definition: stage.h:282
static Cairo::RefPtr< Cairo::ImageSurface > cairoImageSurface
Definition: stage.h:216
VectorDataManager _polyVectors
Definition: stage.h:228
PointData drawFree1
Definition: stage.h:220
vector< unsigned int > selectedShapes
Definition: stage.h:253
Glib::RefPtr< Gdk::Pixbuf > _bg
Definition: stage.h:148
void updateNodeY(double p_value, bool p_stackDo=true)
AnchorData anchor_rotate
Definition: stage.h:277
PointData _rotateReference
Definition: stage.h:202
bool pasteSelectedShapes()
bool toggleLineSelectedNodes()
void invalidateToRender()
PointData selectionBox2
Definition: stage.h:261
Cairo::RefPtr< Cairo::Surface > _bgcr
Definition: stage.h:149
bool keyUpDown
Definition: stage.h:281
void handleShapes_modifyingShape()
double fpsElapse
Definition: stage.h:78
PointData _zoomReference
Definition: stage.h:198
const unsigned int _NO_SELECTION
Definition: stage.h:71
bool deleteSelectedShapes()
bool keyLeftDown
Definition: stage.h:283
bool keyShiftDown
Definition: stage.h:279
short int drawFreeCtr
Definition: stage.h:224
PointData origin
Definition: stage.h:192
void handleDrawOvalMouseUp()
static Glib::RefPtr< Gdk::Pixbuf > imageSHAPE_090
Definition: stage.h:43
void normalizeSelectionBox()
int propXindex1
Definition: stage.h:80
bool _isModifyingShape
Definition: stage.h:194
static Glib::RefPtr< Gdk::Pixbuf > imageSHAPE_000
Definition: stage.h:41
void updateShapeColor(bool p_doFill=true, bool p_doStroke=true)
unsigned int nodeIndexX
Definition: stage.h:89
PointData drawFree4
Definition: stage.h:223
PointData draw2
Definition: stage.h:219
bool isSelectedNode(unsigned int p_index)
void handleDrawPolyMouseUp()
double propX
Definition: stage.h:79
void handleShapes_scaleEast()
void renderNodeControl(double p_x, double p_y, bool p_selected)
void handleNodes_rendering()
double propWidth
Definition: stage.h:85
PointData selectionBox1
Definition: stage.h:260
void handleDrawPencilMouseUp()
void handleDrawRectMouseUp()
static Glib::RefPtr< Gdk::Pixbuf > imageSHAPE_MOVE
Definition: stage.h:45
int _registerWidth
Definition: stage.h:286
bool draw
Definition: stage.h:234
bool _rotateMode
Definition: stage.h:208
GdkPoint _copyBufferMouse
Definition: stage.h:233
void updateShapeWidth(double p_value)
virtual bool on_event(GdkEvent *e) override
void handleDrawPencilMouseMove(PointData p_point)
void renderFrameOffset(Cairo::RefPtr< Cairo::Context > p_context, vector< VectorData > p_vectorData, double p_alpha=1.0, double p_offsetX=0.0, double p_offsetY=0.0)
void trySingleSelectShape()
double nodeY
Definition: stage.h:88
int propXindex2
Definition: stage.h:81
int propYindex2
Definition: stage.h:84
void handleShapesMouseDown()
void handleNodes_selection()
static Glib::RefPtr< Gdk::Pixbuf > imageSHAPE_NE
Definition: stage.h:46
unsigned int selectedShape
Definition: stage.h:251
double currentScale
Definition: stage.h:104
PointData drawFree3
Definition: stage.h:222
GdkPoint drawConstraint
Definition: stage.h:225
void updateShapeHeight(double p_value)
void renderFrame(Cairo::RefPtr< Cairo::Context > p_context, bool p_force=false)
void renderNode(double p_x, double p_y, unsigned int p_state=5)
static GdkPoint moveStageXY
Definition: stage.h:76
bool isSelectionBoxNormalized()
bool keyRightDown
Definition: stage.h:284
void handleNodes_relocation()
void handleShapes_modifyingShapeRotate()
static Glib::RefPtr< Gdk::Pixbuf > imageSHAPE_SE
Definition: stage.h:49
PointData __stageArea
Definition: stage.h:200
void tryMultiSelectShapes_populateShapes()
void handleShapes_updateAnchors(double p_x, double p_y)
void addSelectedShape(unsigned int p_index)
void setStroke(Gdk::Color p_Color)
void handleShapesMouseUp()
double polyYtail
Definition: stage.h:227
bool keyControlDown
Definition: stage.h:280
unsigned int mouseOnShape
Definition: stage.h:250
static ToolMode toolMode
direct use for get only
Definition: stage.h:75
vector< unsigned int > getSelectedShapes()
int propYindex1
Definition: stage.h:83
unsigned int mouseOnNodeHover
Definition: stage.h:247
bool handleNodes_getNearestShape(double p_x, double p_y, unsigned int p_index, vector< VectorData > p_v)
void handleNodesMouseUp()
double _zoomValue
Definition: stage.h:197
vector< VectorData > _vectorDataZOrderBufferA
Definition: stage.h:182
double _nodeToMouseDistance
Definition: stage.h:271
bool _stackDo
Definition: stage.h:180
bool renderToPNGOffset(string p_path, bool p_transparent, double p_offsetX=0.0, double p_offsetY=0.0)
void handleShapes_scaleSouth()
void setFill(Gdk::Color p_Color)
double _zoomRatio
Definition: stage.h:196
void handleEyedropMouseUp()
vector< VectorData > applyZoom(vector< VectorData > p_v)
AnchorData::type mouseOnAnchor
Definition: stage.h:255
void handleShapes_scaleWest()
bool deleteSelectedNode(unsigned int p_index)
void addSelectedNode(unsigned int p_index)
int _registerHeight
Definition: stage.h:287
bool copySelectedShapes()
virtual bool on_expose_event(GdkEventExpose *e)
void renderFrameToPNG(Cairo::RefPtr< Cairo::Context > p_context)
void updateShapeX(double p_value, bool p_stackDo=true)
bool _rotateApply
Definition: stage.h:209
unsigned int getShape(unsigned int p_index, vector< VectorData > p_v)
void handleEyedropMouseMove()
AnchorData anchor_upperLeft
Definition: stage.h:273
void handleShapes_moveShape(double p_diffX, double p_diffY)
unsigned int _mouseLocationShapeIndex
Definition: stage.h:232
static ColorData pencilFillColor
direct use for get only
Definition: stage.h:75
unsigned int addImage(unsigned int p_ID)
This will return an Cairo::ImageSurface array-index to be used as ID for rendering on Stage or Librar...
Definition: stage.cpp:1363
PointData mouseOnNodeOffset
Definition: stage.h:246
static Glib::RefPtr< Gdk::Pixbuf > imageSHAPE_SW
Definition: stage.h:48
void tryMultiSelectShapes()
vector< VectorData > _vectorDataCopyBuffer
Definition: stage.h:181
Glib::RefPtr< Gdk::Window > window
Definition: stage.h:229
void handleNodesMouseDown()
void updateNodeX(double p_value, bool p_stackDo=true)
bool _invalidated
Definition: stage.h:96
unsigned int nodeIndexY
Definition: stage.h:90
vector< VectorData > _vectorDataZOrderBufferB
Definition: stage.h:183
PointData __origin
Definition: stage.h:199
ToolMode
Definition: stage.h:55
@ MODE_SELECT
Definition: stage.h:57
@ MODE_MOVE_STAGE
Definition: stage.h:63
@ MODE_NONE
Definition: stage.h:56
@ MODE_ZOOM
Definition: stage.h:62
@ MODE_DRAW_TEXT
Definition: stage.h:65
@ MODE_FILL
Definition: stage.h:60
@ MODE_DRAW_POLY
Definition: stage.h:66
@ MODE_DRAW_RECT
Definition: stage.h:64
@ MODE_STROKE
Definition: stage.h:59
@ MODE_NODE
Definition: stage.h:58
@ MODE_DRAW_OVAL
Definition: stage.h:67
@ MODE_DRAW_PENCIL
Definition: stage.h:69
@ MODE_EYEDROP
Definition: stage.h:61
@ MODE_DRAW_LINE
Definition: stage.h:68
vector< VectorData > _vectorDataZOrderBufferC
Definition: stage.h:184
bool mouseDown
Definition: stage.h:230
bool deselectSelectedShapes()
void updateShapeY(double p_value, bool p_stackDo=true)
static StrokeColorData stroke
direct use for get only
Definition: stage.h:74
static Glib::RefPtr< Gdk::Pixbuf > imageSHAPE_ROTATE
Definition: stage.h:50
ToolMode prevTool
Definition: stage.h:216
static ColorData fillColor
direct use for get only
Definition: stage.h:73
void handleDrawPencilMouseDown(PointData p_point)
bool deselectSelectedNodes()
virtual bool on_key_release_event(GdkEventKey *e) override
void renderFrameToPNGOffset(Cairo::RefPtr< Cairo::Context > p_context, double p_offsetX=0.0, double p_offsetY=0.0)
static StrokeColorData pencilStroke
direct use for get only
Definition: stage.h:76
bool isNodeOnSelectionBox(double p_nodeX, double p_nodeY)
void handleStrokeMouseMove()
void renderFrame(Cairo::RefPtr< Cairo::Context > p_context, vector< VectorData > p_vectorData, double p_alpha=1.0)
Definition: strokecolor.h:27
Definition: vectordatamanager.h:37