X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=kagecgi%2Fkagetool.c;h=77a21475e2099412e3f876759587130ada4b37db;hb=21f38342930d8a535a5804f42bae19b8e6c8d983;hp=5c5a96e87888938b05dd3adc69f0fceb0e9adf31;hpb=b755cadf536858496296e43b30baec2cd9ec8c13;p=chise%2Fkage.git diff --git a/kagecgi/kagetool.c b/kagecgi/kagetool.c index 5c5a96e..77a2147 100755 --- a/kagecgi/kagetool.c +++ b/kagecgi/kagetool.c @@ -3,8 +3,7 @@ #include "kage.h" #include "kagecgi.h" -#include -#include +#include "sysdep.h" void DotsWidth(int *dlx, int *drx){ int i, j; @@ -54,7 +53,7 @@ void DotsHeight(int *dly, int *dry){ } } -void PartsWidth(const GString *in, int *lx, int *rx){ +void PartsWidth(const KGString *in, int *lx, int *rx){ int i; int *buf, strokes; @@ -81,7 +80,7 @@ void PartsWidth(const GString *in, int *lx, int *rx){ free(buf); } -void PartsHeight(const GString *in, int *ly, int *ry){ +void PartsHeight(const KGString *in, int *ly, int *ry){ int i; int *buf, strokes; @@ -108,7 +107,7 @@ void PartsHeight(const GString *in, int *ly, int *ry){ free(buf); } -GString * CalcSizes(const GString *in, int mode){ +KGString * CalcSizes(const KGString *in, int mode){ int i, j, k, basewidth, one_lineX, one_lineY; int dlx1, drx1, dly1, dry1; int px1, py1; @@ -120,9 +119,9 @@ GString * CalcSizes(const GString *in, int mode){ int *buf, strokes; int tf[12]; - GString *out; + KGString *out; - out = g_string_new(""); + out = kg_string_new(""); basewidth = pngWidth * 0.9; if(mode == 0){ @@ -181,12 +180,12 @@ GString * CalcSizes(const GString *in, int mode){ cuty++; } - //especially get small the 'mouse' + //especially get small the 'mouth' if(mode == 2 && flg_boxT % 16 == 15){ widthT = widthT - kWidth * (max(0, 16 - (int)yokoT * 4)); heightT = heightT - kWidth * (max(0, 16 - (int)tateT * 4)); } - //'dot' as same as 'mouse' + //'dot' as same as 'mouth' if(mode == 2 && tateT == 1 && yokoT == 1){ widthT = pngWidth * 0.9 * 0.5; heightT = pngWidth * 0.9 * 0.5; @@ -233,7 +232,7 @@ GString * CalcSizes(const GString *in, int mode){ tf[2] = px1 + pr1 * 200; tf[3] = py1 + pry1 * 200; addStrokeWithTransform(in, 1, tf, out, 0); - return g_string_new(out->str); + return kg_string_new(out->str); } void DrawBox(){ @@ -246,7 +245,7 @@ void DrawBox(){ } } -void CalcOptions(const GString *in, int *mitsudo, int *flag, double *yoko, double *tate){ +void CalcOptions(const KGString *in, int *mitsudo, int *flag, double *yoko, double *tate){ int i, j, k, l, flg; int dlx1, drx1, dly1, dry1; int kari, mode; @@ -387,7 +386,7 @@ void CalcOptions(const GString *in, int *mitsudo, int *flag, double *yoko, doubl buf = convertStroke(in->str, buf, &strokes); for(i = 0; i < strokes; i++){ if(buf[i * 11 + 0] % 10 == 0){ - if(buf[i * 11 + 1] != 0){ *yoko = (double)(buf[i * 11 + 1]) * 0.1;fprintf(stderr,"@@@@@\r\n");} + if(buf[i * 11 + 1] != 0) *yoko = (double)(buf[i * 11 + 1]) * 0.1; if(buf[i * 11 + 2] != 0) *tate = (double)(buf[i * 11 + 2]) * 0.1; if(buf[i * 11 + 3] != 0) *flag = *flag + buf[i * 11 + 3] * 16; } @@ -395,7 +394,7 @@ void CalcOptions(const GString *in, int *mitsudo, int *flag, double *yoko, doubl free(buf); } -void DoDrawParts(const GString *in, const int lx1, const double rf1, const int ly1, const double rfy1){ +void DoDrawParts(const KGString *in, const int lx1, const double rf1, const int ly1, const double rfy1){ int i; int *buf, strokes; @@ -417,10 +416,10 @@ void DoDrawParts(const GString *in, const int lx1, const double rf1, const int l free(buf); } -void DoDrawMixFont(const GString *in1, +void DoDrawMixFont(const KGString *in1, const int lx1, const double rf1, - const GString *in2, + const KGString *in2, const int lx2, const double rf2, const int ly1,