00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00023 #ifndef SCBSTROKE_H_
00024 #define SCBSTROKE_H_
00025 #include "scbcolor.h"
00026 #include "scbpoints.h"
00027 #include "scbtype.h"
00028 #include "scbxml.h"
00029 #include <glib.h>
00030
00031 #ifdef __cplusplus
00032 extern "C"
00033 {
00034 #endif
00035
00036 typedef struct _ScbStrokeStyle
00037 {
00038 int penSize;
00039 int layer;
00040 ScbDevColor color;
00041 ScbLineStyle lineStyle;
00042 int attributes;
00043 double zoom;
00044 }ScbStrokeStyle;
00045 typedef ScbStrokeStyle * ScbStrokeStylePtr;
00046
00047 typedef struct _ScbStroke
00048 {
00049 ScbRect rect;
00050 ScbStrokeStyle style;
00051 ScbPoints points;
00052 }ScbStroke;
00053 typedef ScbStroke * ScbStrokePtr;
00054
00055 typedef struct _ScbHitTestCtx
00056 {
00057 int size;
00058 double zoom;
00059 }ScbHitTestCtx;
00060 typedef ScbHitTestCtx * ScbHitTestCtxPtr;
00061
00062
00063 ScbStrokePtr scb_stroke_new();
00064
00065
00066 ScbStrokePtr scb_stroke_new_with_style(ScbStrokeStylePtr ptr);
00067
00068
00069 void scb_stroke_free(ScbStrokePtr stroke);
00070
00071
00072 int scb_stroke_get_point_count(ScbStrokePtr stroke);
00073
00074
00075 ScbPointPtr scb_stroke_get_point_data(ScbStrokePtr stroke);
00076
00077
00078
00079 int scb_stroke_add_point(ScbStrokePtr stroke,
00080 ScbDevPointPtr point);
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100 void scb_stroke_fast_draw_point(ScbStrokePtr stroke,
00101 ScbDevPointPtr point);
00102
00103
00104 void scb_stroke_fast_draw_point_done(ScbStrokePtr stroke,
00105 ScbDevPointPtr point);
00106
00107
00108
00109 void scb_stroke_fast_draw(ScbStrokePtr stroke);
00110
00111
00112 gboolean scb_stroke_point_hit_test(ScbStrokePtr stroke,
00113 ScbDevPointPtr point,
00114 const ScbHitTestCtxPtr ctx);
00115
00116
00117 gboolean scb_stroke_line_hit_test(ScbStrokePtr stroke,
00118 ScbDevPointPtr point1,
00119 ScbDevPointPtr point2,
00120 const ScbHitTestCtxPtr ctx);
00121
00122
00123 void scb_stroke_set_color(ScbStrokePtr stroke, const ScbDevColor color);
00124 ScbDevColor scb_stroke_get_color(ScbStrokePtr stroke);
00125
00126
00127 gboolean scb_stroke_save(ScbStrokePtr stroke, ScbXmlPtr);
00128 gboolean scb_stroke_load(ScbStrokePtr stroke, ScbXmlPtr);
00129
00130
00131 void scb_stroke_dump(ScbStrokePtr ptr);
00132
00133 #ifdef __cplusplus
00134 }
00135 #endif
00136
00137 #endif