Kage Studio 0.7.240121
A Simple Free and Open Source 2D Animation Software
Loading...
Searching...
No Matches
stage.h
Go to the documentation of this file.
1/*
2 * Kage Studio - a simple free and open source vector-based 2D animation software
3 * Copyright (C) 2011~2024 Mj Mendoza IV
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 * MA 02110-1301, USA. Or, see <https://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef GTKMM_KAGE_STAGE_H
23 #define GTKMM_KAGE_STAGE_H
24
25 #include <gtkmm/drawingarea.h>
26 #include <iostream>
27
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> // set_source_pixbuf()
36
37 class Kage; //forward declaration
38
39 class KageStage : public Gtk::DrawingArea {
40 public:
41 static Glib::RefPtr<Gdk::Pixbuf> imageSHAPE_000;
42 static Glib::RefPtr<Gdk::Pixbuf> imageSHAPE_045;
43 static Glib::RefPtr<Gdk::Pixbuf> imageSHAPE_090;
44 static Glib::RefPtr<Gdk::Pixbuf> imageSHAPE_135;
45 static Glib::RefPtr<Gdk::Pixbuf> imageSHAPE_MOVE;
46 static Glib::RefPtr<Gdk::Pixbuf> imageSHAPE_NE;
47 static Glib::RefPtr<Gdk::Pixbuf> imageSHAPE_NW;
48 static Glib::RefPtr<Gdk::Pixbuf> imageSHAPE_SW;
49 static Glib::RefPtr<Gdk::Pixbuf> imageSHAPE_SE;
50 static Glib::RefPtr<Gdk::Pixbuf> imageSHAPE_ROTATE;
51
52 KageStage(Kage *p_kage);
53 virtual ~KageStage();
54
71 const unsigned int _NO_SELECTION = -1;
74 //any changes on color/stroke during use of Pencil will be stored on Pencil only
78 static GdkPoint moveStageXY;
79 double fpsElapse;
80 double propX = 0;
83 double propY = 0;
86 double propWidth = 0;
87 double propHeight = 0;
88 double propRotation = 0;
89 double nodeX = 0;
90 double nodeY = 0;
91 unsigned int nodeIndexX = 0;
92 unsigned int nodeIndexY = 0;
93 static float propAlpha; //= 1.0f;
94
95 #define IMAGE_ID_BUFF 0 //p1 x/y == ID / imageBuff
96 #define IMAGE_X_Y 1 //p2 x/y == x / y
97 #define IMAGE_WIDTH_HEIGHT 2 //p3 x/y == width / height
98 #define IMAGE_SCALEX_SCALEY 3 //p4 x/y == scaleX / scaleY
99 #define IMAGE_ROTATE_ALPHA 4 //p5 x/y == rotate / alpha
100
101 void printVectors(std::vector<VectorData> p_vectorData);
102 void cleanSlate();
103 void invalidateToRender();
105
106 void setFill(Gdk::Color p_Color);
107 Gdk::Color getFill();
108 void setStroke(Gdk::Color p_Color);
109 Gdk::Color getStroke();
110 static double currentScale;
111 void clearScreen(Cairo::RefPtr<Cairo::Context> p_context);
112 void renderFrame(Cairo::RefPtr<Cairo::Context> p_context, bool p_force = false);
113 void renderOnionFrame(Cairo::RefPtr<Cairo::Context> p_context, std::vector<VectorData> p_vectorData, double p_alpha);
114 void renderFrame(Cairo::RefPtr<Cairo::Context> p_context, std::vector<VectorData> p_vectorData, double p_alpha = 1.0);
115 void renderFrameOffset(Cairo::RefPtr<Cairo::Context> p_context, bool p_force = false, double p_offsetX = 0.0, double p_offsetY = 0.0);
116 void renderFrameOffset(Cairo::RefPtr<Cairo::Context> p_context, std::vector<VectorData> p_vectorData, double p_alpha = 1.0, double p_offsetX = 0.0, double p_offsetY = 0.0);
117 unsigned int addImage(unsigned int p_ID, double p_x, double p_y);
118 unsigned int addImage(unsigned int p_ID);
119 void initNodeTool();
120 void handleShapes();
127 void handleShapes_moveShape(double p_diffX, double p_diffY);
128 void handleShapes_updateAnchors(double p_x, double p_y);
130 void handleShapesMouseUp();
131 void handleNodes();
136 void handleNodesMouseUp();
137 bool handleNodes_getNearestShape(double p_x, double p_y, unsigned int p_index, std::vector<VectorData> p_v);
144 void handleOval();
145 void handleRect();
146 void handlePoly();
147 void handlePencil();
148 void handleStroke(); //needed?
150 void handleStrokeMouseUp();
151 void handleFill(); //needed?
152 void handleFillMouseUp();
153 void handleEyedrop();
156 Glib::RefPtr<Gdk::Pixbuf> _bg;
157 Cairo::RefPtr<Cairo::Surface> _bgcr;
158
159 void updateShapeRotation(float l_rotation);
160 void updateImageAlpha(float l_alpha);
161
162 bool selectAllShapes();
165 bool cancelDrawingPoly();
166 bool cutSelectedShapes();
167 bool copySelectedShapes();
168 bool pasteSelectedShapes();
170 bool deleteSelectedNodes();
172
173 void updateNodeXY();
174 bool isSelectedNode(unsigned int p_index);
175 void addSelectedNode(unsigned int p_index);
176 bool isSelectedShape(unsigned int p_index);
177 void addSelectedShape(unsigned int p_index);
181 unsigned int getShape(unsigned int p_index, std::vector<VectorData> p_v);
182
183 void updateShapeColor(bool p_doFill = true, bool p_doStroke = true);
184 void updateShapeX(double p_value, bool p_stackDo = true);
185 void updateShapeY(double p_value, bool p_stackDo = true);
186 void updateShapeWidth(double p_value);
187 void updateShapeHeight(double p_value);
188 void updateNodeX(double p_value, bool p_stackDo = true);
189 void updateNodeY(double p_value, bool p_stackDo = true);
190 bool _stackDo = false;
191 std::vector<VectorData> _vectorDataCopyBuffer;
192 std::vector<VectorData> _vectorDataZOrderBufferA;
193 std::vector<VectorData> _vectorDataZOrderBufferB;
194 std::vector<VectorData> _vectorDataZOrderBufferC;
195
196 bool renderToPNG(std::string p_path, bool p_transparent);
197 bool renderToPNGOffset(std::string p_path, bool p_transparent, double p_offsetX = 0.0, double p_offsetY = 0.0);
198 void renderFrameToPNG(Cairo::RefPtr<Cairo::Context> p_context);
199 void renderFrameToPNGOffset(Cairo::RefPtr<Cairo::Context> p_context, double p_offsetX = 0.0, double p_offsetY = 0.0);
200
201 Cairo::RefPtr<Cairo::Context> cr;
203
205
207 static double _zoomValue;
211
213
215
218
219 void setSelectedShapes(std::vector<unsigned int> p_selectedShapes);
220 std::vector<unsigned int> getSelectedShapes();
221
222 void unpressKeys();
223
224 static std::vector<Cairo::RefPtr<Cairo::ImageSurface>> cairoPNG;
225 static Cairo::RefPtr<Cairo::ImageSurface> cairoImageSurface;
226 protected:
227 ToolMode prevTool; //used by Hand-tool shortcut [spacebar]
235 short int drawFreeCtr;
240 Glib::RefPtr<Gdk::Window> window;
245 bool draw;
246 unsigned int drawCtr;
247 //Override default signal handler:
248 virtual bool on_expose_event(GdkEventExpose *e);
249 virtual bool on_key_press_event(GdkEventKey *e) override;
250 virtual bool on_key_release_event(GdkEventKey *e) override;
251 virtual bool on_event(GdkEvent *e) override;
252
253 bool on_draw(const Cairo::RefPtr<Cairo::Context>& cr) override;
254
256 unsigned int mouseOnNode;
258 unsigned int mouseOnNodeHover;
259 unsigned int mouseOnNodeIndex;
260 unsigned int selectedNode;
261 unsigned int mouseOnShape;
262 unsigned int selectedShape;
263 public:
264 std::vector<unsigned int> selectedNodes;
265 std::vector<unsigned int> selectedShapes;
266 protected:
268 void renderNode(double p_x, double p_y, unsigned int p_state = 5);
269 void renderNodeControl(double p_x, double p_y, bool p_selected);
270 bool isMouseOnNode(double p_x, double p_y, unsigned int p_buffer = 5);
271
276 bool isNodeOnSelectionBox(double p_nodeX, double p_nodeY);
277
278 void drawSelectionArea();
279
280 bool deleteSelectedNode(unsigned int p_index);
281
282 unsigned int getSelectedShapeViaNode(unsigned int p_index, std::vector<VectorData> p_v);
284
288
289 AnchorData anchor_rotate; //for global use rotation-anchor
290
297
300
301 void updateShapeXY();
302 };
303#endif // GTKMM_KAGE_STAGE_H
Definition anchor.h:28
type
Definition anchor.h:30
Definition color.h:28
Definition kage.h:74
Kage * _kage
Definition stage.h:228
AnchorData anchor_lowerRight
Definition stage.h:287
bool on_draw(const Cairo::RefPtr< Cairo::Context > &cr) override
Called by Gtkmm when DrawingArea's display is invalidated.
Definition stage.cpp:921
bool isSelectedShape(unsigned int p_index)
Definition shape.cpp:36
Glib::RefPtr< Gdk::Window > window
Definition stage.h:240
static std::vector< Cairo::RefPtr< Cairo::ImageSurface > > cairoPNG
Definition stage.h:224
double polyXhead
Definition stage.h:237
unsigned int mouseOnNode
Definition stage.h:256
unsigned int drawCtr
Definition stage.h:246
void renderOnionFrame(Cairo::RefPtr< Cairo::Context > p_context, std::vector< VectorData > p_vectorData, double p_alpha)
Definition stage.cpp:1137
double polyYhead
Definition stage.h:237
AnchorData anchor_center
Definition stage.h:286
bool isMouseOnNode(double p_x, double p_y, unsigned int p_buffer=5)
Definition node.cpp:1017
void handleShapes_scaleNorth()
Definition shape.cpp:57
double polyXtail
Definition stage.h:238
GdkPoint _mouseLocation
Definition stage.h:242
bool deleteSelectedNodes()
Definition node.cpp:1041
double nodeX
Definition stage.h:89
PointData draw1
Definition stage.h:229
void clearScreen(Cairo::RefPtr< Cairo::Context > p_context)
for use with zoom; default value is _kage->_document._width; can be changed as preferred
Definition stage.cpp:982
double propHeight
Definition stage.h:87
static Glib::RefPtr< Gdk::Pixbuf > imageSHAPE_NE
Definition stage.h:46
PointData drawFree2
Definition stage.h:232
void updateNodeXY()
Definition node.cpp:1205
unsigned int selectedNode
Definition stage.h:260
double propY
Definition stage.h:83
void handleFill()
Definition stage.cpp:1475
void handleStrokeMouseUp()
Definition stage.cpp:1468
void renderFrameOffset(Cairo::RefPtr< Cairo::Context > p_context, bool p_force=false, double p_offsetX=0.0, double p_offsetY=0.0)
Definition stage.cpp:1120
unsigned int mouseOnNodeIndex
Definition stage.h:259
PointData applyZoomRatio(PointData p_value)
Definition stage.cpp:669
static Glib::RefPtr< Gdk::Pixbuf > imageSHAPE_SW
Definition stage.h:48
static Glib::RefPtr< Gdk::Pixbuf > imageSHAPE_000
Definition stage.h:41
Gdk::Color getStroke()
Definition stage.cpp:730
bool keyDownDown
Definition stage.h:294
static Cairo::RefPtr< Cairo::ImageSurface > cairoImageSurface
Definition stage.h:225
VectorDataManager _polyVectors
Definition stage.h:239
std::vector< unsigned int > selectedNodes
Definition stage.h:264
PointData drawFree1
Definition stage.h:231
std::vector< VectorData > _vectorDataZOrderBufferC
Definition stage.h:194
Cairo::RefPtr< Cairo::Surface > _bgcr
Definition stage.h:157
void updateNodeY(double p_value, bool p_stackDo=true)
Definition node.cpp:121
AnchorData anchor_rotate
Definition stage.h:289
PointData _rotateReference
Definition stage.h:212
bool pasteSelectedShapes()
Definition shape.cpp:1396
bool toggleLineSelectedNodes()
Definition node.cpp:1151
void invalidateToRender()
Definition stage.cpp:899
PointData selectionBox2
Definition stage.h:273
bool handleNodes_getNearestShape(double p_x, double p_y, unsigned int p_index, std::vector< VectorData > p_v)
Definition node.cpp:740
bool keyUpDown
Definition stage.h:293
void handleShapes_modifyingShape()
Definition shape.cpp:757
double fpsElapse
Definition stage.h:79
PointData _zoomReference
Definition stage.h:208
const unsigned int _NO_SELECTION
Definition stage.h:71
static float propAlpha
Definition stage.h:93
bool deleteSelectedShapes()
Definition shape.cpp:1430
bool keyLeftDown
Definition stage.h:295
bool keyShiftDown
Definition stage.h:291
static Glib::RefPtr< Gdk::Pixbuf > imageSHAPE_SE
Definition stage.h:49
virtual bool on_key_press_event(GdkEventKey *e) override
Definition stage.cpp:77
short int drawFreeCtr
Definition stage.h:235
static PointData origin
Definition stage.h:202
void handleDrawOvalMouseUp()
Definition oval.cpp:28
void normalizeSelectionBox()
Definition node.cpp:980
int propXindex1
Definition stage.h:81
bool _isModifyingShape
Definition stage.h:204
static Glib::RefPtr< Gdk::Pixbuf > imageSHAPE_135
Definition stage.h:44
void updateShapeColor(bool p_doFill=true, bool p_doStroke=true)
Definition shape.cpp:362
void handlePoly()
Definition poly.cpp:88
unsigned int nodeIndexX
Definition stage.h:91
PointData drawFree4
Definition stage.h:234
PointData draw2
Definition stage.h:230
bool isSelectedNode(unsigned int p_index)
Definition node.cpp:38
void handleDrawPolyMouseUp()
Definition poly.cpp:28
static ToolMode toolMode
direct use for get only
Definition stage.h:77
double propX
Definition stage.h:80
void handleShapes_scaleEast()
Definition shape.cpp:120
virtual bool on_key_release_event(GdkEventKey *e) override
Definition stage.cpp:176
void renderNodeControl(double p_x, double p_y, bool p_selected)
Definition node.cpp:958
void handleNodes_rendering()
Definition node.cpp:498
double propWidth
Definition stage.h:86
unsigned int getSelectedShapeViaNode(unsigned int p_index, std::vector< VectorData > p_v)
Definition node.cpp:773
void updateShapeXY()
Definition shape.cpp:1478
std::vector< VectorData > _vectorDataZOrderBufferB
Definition stage.h:193
PointData selectionBox1
Definition stage.h:272
void handleDrawPencilMouseUp()
Definition pencil.cpp:78
void handleDrawRectMouseUp()
Definition rect.cpp:28
int _registerWidth
Definition stage.h:298
virtual bool on_event(GdkEvent *e) override
Definition stage.cpp:305
static Glib::RefPtr< Gdk::Pixbuf > imageSHAPE_045
Definition stage.h:42
static StrokeColorData stroke
direct use for get only
Definition stage.h:73
bool on_timeout()
bool draw
Definition stage.h:245
bool _rotateMode
Definition stage.h:216
GdkPoint _copyBufferMouse
Definition stage.h:244
void updateShapeWidth(double p_value)
Definition shape.cpp:544
void handleEyedrop()
Definition stage.cpp:1486
void initNodeTool()
Definition node.cpp:28
void handleDrawPencilMouseMove(PointData p_point)
Definition pencil.cpp:47
Glib::RefPtr< Gdk::Pixbuf > _bg
Definition stage.h:156
void trySingleSelectShape()
Definition shape.cpp:1163
double nodeY
Definition stage.h:90
bool renderToPNG(std::string p_path, bool p_transparent)
Definition stage.cpp:1020
int propXindex2
Definition stage.h:82
int propYindex2
Definition stage.h:85
void handleShapesMouseDown()
void handleNodes_selection()
Definition node.cpp:182
unsigned int addImage(unsigned int p_ID, double p_x, double p_y)
Definition stage.cpp:1153
unsigned int selectedShape
Definition stage.h:262
static double currentScale
Definition stage.h:110
unsigned int getShape(unsigned int p_index, std::vector< VectorData > p_v)
Definition shape.cpp:1272
static Glib::RefPtr< Gdk::Pixbuf > imageSHAPE_MOVE
Definition stage.h:45
PointData drawFree3
Definition stage.h:233
GdkPoint drawConstraint
Definition stage.h:236
void unpressKeys()
Definition stage.cpp:293
void handleStroke()
void updateShapeHeight(double p_value)
Definition shape.cpp:611
Gdk::Color getFill()
Definition stage.cpp:704
void renderFrame(Cairo::RefPtr< Cairo::Context > p_context, bool p_force=false)
Definition stage.cpp:1065
void renderNode(double p_x, double p_y, unsigned int p_state=5)
Definition node.cpp:937
std::vector< VectorData > _vectorDataCopyBuffer
Definition stage.h:191
double propRotation
Definition stage.h:88
void drawSelectionArea()
Definition stage.cpp:1445
Cairo::RefPtr< Cairo::Context > cr
Definition stage.h:201
bool isSelectionBoxNormalized()
Definition node.cpp:974
void handleFillMouseUp()
Definition stage.cpp:1479
bool keyRightDown
Definition stage.h:296
void handleNodes_relocation()
Definition node.cpp:307
void handleShapes_modifyingShapeRotate()
Definition shape.cpp:681
PointData __stageArea
Definition stage.h:210
void tryMultiSelectShapes_populateShapes()
Definition shape.cpp:1195
void handleShapes_updateAnchors(double p_x, double p_y)
Definition shape.cpp:347
void addSelectedShape(unsigned int p_index)
Definition shape.cpp:48
void setStroke(Gdk::Color p_Color)
Definition stage.cpp:718
void handleShapesMouseUp()
Definition shape.cpp:1285
static GdkPoint moveStageXY
Definition stage.h:78
double polyYtail
Definition stage.h:238
void handlePencil()
Definition pencil.cpp:115
KageStage(Kage *p_kage)
Definition stage.cpp:46
bool keyControlDown
Definition stage.h:292
unsigned int mouseOnShape
Definition stage.h:261
int propYindex1
Definition stage.h:84
static Glib::RefPtr< Gdk::Pixbuf > imageSHAPE_ROTATE
Definition stage.h:50
unsigned int mouseOnNodeHover
Definition stage.h:258
void handleNodesMouseUp()
Definition node.cpp:662
void updateShapeRotation(float l_rotation)
updates selected Shapes's Rotation
Definition stage.cpp:1572
static double _zoomValue
Definition stage.h:207
std::vector< unsigned int > getSelectedShapes()
Definition shape.cpp:32
void setSelectedShapes(std::vector< unsigned int > p_selectedShapes)
Definition shape.cpp:28
double _nodeToMouseDistance
Definition stage.h:283
bool _stackDo
Definition stage.h:190
void handleOval()
Definition oval.cpp:75
bool cutSelectedShapes()
Definition shape.cpp:1294
static Glib::RefPtr< Gdk::Pixbuf > imageSHAPE_090
Definition stage.h:43
bool renderToPNGOffset(std::string p_path, bool p_transparent, double p_offsetX=0.0, double p_offsetY=0.0)
Definition stage.cpp:1074
std::vector< unsigned int > selectedShapes
Definition stage.h:265
void handleShapes_scaleSouth()
Definition shape.cpp:243
void setFill(Gdk::Color p_Color)
Definition stage.cpp:692
double _zoomRatio
Definition stage.h:206
void handleEyedropMouseUp()
Definition stage.cpp:1562
static ColorData fillColor
Definition stage.h:72
AnchorData::type mouseOnAnchor
Definition stage.h:267
void handleShapes_scaleWest()
Definition shape.cpp:180
bool deleteSelectedNode(unsigned int p_index)
Definition node.cpp:1073
void addSelectedNode(unsigned int p_index)
Definition node.cpp:53
int _registerHeight
Definition stage.h:299
bool copySelectedShapes()
Definition shape.cpp:1316
void renderFrameToPNG(Cairo::RefPtr< Cairo::Context > p_context)
Definition stage.cpp:1062
void updateShapeX(double p_value, bool p_stackDo=true)
Definition shape.cpp:403
bool _rotateApply
Definition stage.h:217
void handleEyedropMouseMove()
Definition stage.cpp:1554
AnchorData anchor_upperLeft
Definition stage.h:285
void handleShapes_moveShape(double p_diffX, double p_diffY)
Definition shape.cpp:303
void handleRect()
Definition rect.cpp:58
unsigned int _mouseLocationShapeIndex
Definition stage.h:243
static ColorData pencilFillColor
direct use for get only
Definition stage.h:75
PointData mouseOnNodeOffset
Definition stage.h:257
void tryMultiSelectShapes()
Definition shape.cpp:1205
void handleNodesMouseDown()
Definition node.cpp:659
void updateNodeX(double p_value, bool p_stackDo=true)
Definition node.cpp:63
bool _invalidated
Definition stage.h:104
bool cancelDrawingPoly()
Definition poly.cpp:132
unsigned int nodeIndexY
Definition stage.h:92
PointData __origin
Definition stage.h:209
ToolMode
Definition stage.h:55
@ MODE_FILL
Definition stage.h:60
@ MODE_NODE
Definition stage.h:58
@ MODE_ZOOM
Definition stage.h:62
@ MODE_DRAW_TEXT
Definition stage.h:65
@ MODE_DRAW_RECT
Definition stage.h:64
@ MODE_MOVE_STAGE
Definition stage.h:63
@ MODE_DRAW_LINE
Definition stage.h:68
@ MODE_DRAW_POLY
Definition stage.h:66
@ MODE_DRAW_PENCIL
Definition stage.h:69
@ MODE_DRAW_OVAL
Definition stage.h:67
@ MODE_STROKE
Definition stage.h:59
@ MODE_EYEDROP
Definition stage.h:61
@ MODE_NONE
Definition stage.h:56
@ MODE_SELECT
Definition stage.h:57
void handleShapes()
Definition shape.cpp:985
std::vector< VectorData > _vectorDataZOrderBufferA
Definition stage.h:192
void updateImageAlpha(float l_alpha)
updates selected Image's Alpha
Definition stage.cpp:1584
bool mouseDown
Definition stage.h:241
bool deselectSelectedShapes()
Definition shape.cpp:1374
void updateShapeY(double p_value, bool p_stackDo=true)
Definition shape.cpp:473
void handleNodes()
Definition node.cpp:177
bool selectAllShapes()
Definition shape.cpp:1351
virtual bool on_expose_event(GdkEventExpose *e)
Definition stage.cpp:287
ToolMode prevTool
Definition stage.h:227
void cleanSlate()
Definition stage.cpp:858
void handleDrawPencilMouseDown(PointData p_point)
Definition pencil.cpp:28
bool deselectSelectedNodes()
Definition node.cpp:1025
void renderFrameToPNGOffset(Cairo::RefPtr< Cairo::Context > p_context, double p_offsetX=0.0, double p_offsetY=0.0)
Definition stage.cpp:1116
static StrokeColorData pencilStroke
direct use for get only
Definition stage.h:76
bool isNodeOnSelectionBox(double p_nodeX, double p_nodeY)
Definition node.cpp:1008
void printVectors(std::vector< VectorData > p_vectorData)
Definition stage.cpp:744
void handleStrokeMouseMove()
Definition stage.cpp:1464
static Glib::RefPtr< Gdk::Pixbuf > imageSHAPE_NW
Definition stage.h:47
virtual ~KageStage()
Definition stage.cpp:73
Definition point.h:27
Definition strokecolor.h:27
Definition vectordatamanager.h:35