Debian Codegraph @

doc/sphinx/olddocs/old/ja/views.html

raw symbols SCIP
1 <HTML>
2 <HEAD>
3 <!-- Created with AOLpress/2.0 -->
4 <!-- AP: Created on: 11-Feb-2001 -->
5 <!-- AP: Last modified: 2-Mar-2004 -->
6 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
7 <LINK REL="icon" href="../../_static/fftype16.png">
8 <!--<TITLE>UI data structures for FontForge</TITLE> -->
9 <TITLE>FontForge 用の UI データ構造</TITLE>
10 <LINK REL="stylesheet" TYPE="text/css" HREF="FontForge.css">
11 </HEAD>
12 <BODY>
13 <DIV id="in">
14 <P>
15 <BLOCKQUOTE>
16 <PRE>/* Copyright (C) 2000-2003 by George Williams */
17 /*
18 * Redistribution and use in source and binary forms, with or without
19 * modification, are permitted provided that the following conditions are met:
20
21 * Redistributions of source code must retain the above copyright notice, this
22 * list of conditions and the following disclaimer.
23
24 * Redistributions in binary form must reproduce the above copyright notice,
25 * this list of conditions and the following disclaimer in the documentation
26 * and/or other materials provided with the distribution.
27
28 * The name of the author may not be used to endorse or promote products
29 * derived from this software without specific prior written permission.
30
31 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
32 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
33 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
34 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
35 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
36 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
37 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
38 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
39 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
40 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41 */
42 #ifndef _VIEWS_H
43 #define _VIEWS_H
44
45 #include "splinefont.h"
46 #include "ggadget.h"
47
48 extern struct cvshows {
49 int showfore, showback, showgrids, showhints;
50 int showpoints, showfilled;
51 } CVShows;
52
53 extern struct bvshows {
54 int showfore, showoutline, showgrid;
55 int lastpixelsize;
56 } BVShows;
57
58 typedef struct drect {
59 double x, y;
60 double width, height;
61 } DRect;
62
63 typedef struct pressedOn {
64 <!--int x,y; /* screen location of the press */ --> int x,y; /* ボタン押下時のスクリーン上の位置 */
65 <!--double cx, cy; /* Translated into character space */ --> double cx, cy; /* 文字空間に座標変換された値 */
66 SplinePoint *sp;
67 <!--unsigned int nextcp: 1; /* Is the cursor on the "next" control point of */ --> unsigned int nextcp: 1; /* "次" の制御点、または "前" の制御点 */
68 <!--unsigned int prevcp: 1; /* the spline point, or the "prev" control point */ --> unsigned int prevcp: 1; /* の上にカーソルが置かれているか */
69 <!--unsigned int anysel: 1; /* did we hit anything? */ --> unsigned int anysel: 1; /* 何か打鍵したか? */
70 <!--unsigned int width: 1; /* we're moving the width rather than a spline */ --> unsigned int width: 1; /* スプラインではなく文字幅を移動しているところである */
71 unsigned int pressed: 1;
72 unsigned int rubberbanding: 1;
73 unsigned int transany: 1;
74 unsigned int transanyrefs: 1;
75 Spline *spline;
76 <!--double t; /* location on the spline where we pressed */ --> double t; /* 押下した点のスプライン上の位置 */
77 RefChar *ref;
78 <!--SplinePointList *spl; /* containing spline or point */ --> SplinePointList *spl; /* スプラインまたは点を含む */
79 ImageList *img;
80 <!--float ex, ey; /* end of last rubber band rectangle */ --> float ex, ey; /* 最後のラバーバンド長方形の終了位置 */
81 <!--BasePoint constrain; /* Point to which we constrain movement */ --> BasePoint constrain; /* 動きが制約される起点となる位置 */
82 <!--BasePoint cp; /* Original control point position */ --> BasePoint cp; /* オリジナルの制御点の位置 */
83 } PressedOn;
84
85 <!--/* Note: These are ordered as they are displayed in the tools palette */ -->/* 注意: これらはツールパレット内での表示順に並んでいる */
86 enum cvtools { cvt_pointer, cvt_magnify,
87 cvt_curve, cvt_corner, cvt_tangent, cvt_pen,
88 cvt_knife, cvt_ruler,
89 cvt_scale, cvt_flip,
90 cvt_rotate, cvt_skew,
91 cvt_rect, cvt_poly,
92 cvt_ellipse, cvt_star,
93 cvt_minify, cvt_max=cvt_minify,
94 cvt_none = -1};
95 enum bvtools { bvt_pointer, bvt_magnify,
96 bvt_pencil, bvt_line,
97 bvt_shift, bvt_hand,
98 bvt_minify, bvt_max=bvt_minify,
99 bvt_rect, bvt_filledrect,
100 bvt_ellipse, bvt_filledellipse,
101 bvt_max2 = bvt_filledellipse,
102 bvt_none = -1,
103 bvt_fliph=0, bvt_flipv, bvt_rotate90cw, bvt_rotate90ccw, bvt_rotate180, bvt_skew };
104 enum drawmode { dm_fore, dm_back, dm_grid, dm_max };
105
106 typedef struct charview {
107 SplineChar *sc;
108 unsigned int showback:1;
109 unsigned int showfore:1;
110 unsigned int showgrids:1;
111 unsigned int showhints:1;
112 unsigned int showpoints:1;
113 unsigned int showfilled:1;
114 <!--unsigned int needsrasterize:1; /* Rasterization (of fill or fontview) needed on mouse up */ --> unsigned int needsrasterize:1; /* マウス離上時に(塗り潰しまたはフォントビューでの) ラスタ変換が必要 */
115 <!--unsigned int recentchange:1; /* a change happened in the grids or background. don't need to rasterize */ --> unsigned int recentchange:1; /* グリッドまたは背景で変更が行われた。ラスタ変換不要 */
116 unsigned int drawmode:2;
117 <!--unsigned int info_within: 1; /* cursor is within main window */ --> unsigned int info_within: 1; /* カーソルがメインウィンドウ内にあるか */
118 <!--unsigned int back_img_out_of_date: 1; /* Force redraw of back image pixmap */ --> unsigned int back_img_out_of_date: 1; /* 背景画像の pixmap を強制的に再描画 */
119 unsigned int cntrldown:1;
120 SplinePointList **heads[dm_max];
121 Undoes **uheads[dm_max];
122 Undoes **rheads[dm_max];
123 double scale;
124 GWindow gw, v;
125 int width, height;
126 int xoff, yoff;
127 int mbh, infoh;
128 GGadget *vsb, *hsb, *mb;
129 GFont *small;
130 int16 sas, sfh;
131 BasePoint info;
132 BasePoint last_c;
133 BDFChar *filled;
134 GImage gi;
135 struct charview *next;
136 struct fontview *fv;
137 GWindow icon;
138 PressedOn p;
139 GWindow tools, layers;
140 <!--int8 b1_tool, cb1_tool, b2_tool, cb2_tool; /* Button 3 does a popup */ --> int8 b1_tool, cb1_tool, b2_tool, cb2_tool; /* ボタン 3 はポップアップを起動 */
141 int8 showing_tool, pressed_tool, pressed_display, had_control, active_tool;
142 SplinePointList *active_spl;
143 SplinePoint *active_sp;
144 GWindow ruler_w;
145 uint16 rfh, ras;
146 GFont *rfont;
147 BasePoint lastknife;
148 GTimer *pressed;
149 GWindow backimgs;
150 enum expandedge { ee_none, ee_nw, ee_up, ee_ne, ee_right, ee_se, ee_down,
151 ee_sw, ee_left, ee_max } expandedge;
152 BasePoint expandorigin;
153 double expandwidth, expandheight;
154 SplinePointList *active_shape;
155 } <A NAME="CharView">CharView</A>;
156
157 typedef struct bitmapview {
158 BDFChar *bc;
159 BDFFont *bdf;
160 struct fontview *fv;
161 GWindow gw, v;
162 int xoff, yoff;
163 GGadget *vsb, *hsb, *mb;
164 int width, height;
165 int infoh, mbh;
166 int scale;
167 double scscale;
168 struct bitmapview *next;
169 unsigned int showfore:1;
170 unsigned int showoutline:1;
171 unsigned int showgrid:1;
172 unsigned int cntrldown:1;
173 unsigned int recentchange:1;
174 unsigned int clearing:1;
175 GWindow tools, layers;
176 GGadget *recalc;
177 <!--int8 b1_tool, cb1_tool, b2_tool, cb2_tool; /* Button 3 does a popup */ --> int8 b1_tool, cb1_tool, b2_tool, cb2_tool; /* ボタン 3 はポップアップを起動 */
178 int8 showing_tool, pressed_tool, pressed_display, had_control, active_tool;
179 int pressed_x, pressed_y;
180 int info_x, info_y;
181 int event_x, event_y;
182 GFont *small;
183 int16 sas, sfh;
184 } <A NAME="BitmapView">BitmapView</A>;
185
186 typedef struct metricsview {
187 struct fontview *fv;
188 int pixelsize;
189 <!--BDFFont *bdf; /* We can also see metric info on a bitmap font */ --> BDFFont *bdf; /* ビットマップもメトリックをもつ */
190 GWindow gw;
191 int16 width, height;
192 int16 mbh,sbh;
193 <!--int16 topend; /* y value of the end of the region containing the text field */ --> int16 topend; /* テキストフィールドを含む領域の終端の y 座標 */
194 <!--int16 displayend; /* y value of the end of the region showing filled characters */ --> int16 displayend; /* 塗り潰された文字を表示する領域の終端の y 座標 */
195 GFont *font;
196 int16 fh, as;
197 GGadget *hsb, *mb, *text;
198 GGadget *namelab, *widthlab, *lbearinglab, *rbearinglab, *kernlab;
199 struct metricchar {
200 SplineChar *sc;
201 BDFChar *show;
202 <!-- int16 dx, dwidth; /* position and width of the displayed char */ --> int16 dx, dwidth; /* 表示された文字の位置と幅 */
203 <!-- int16 mx, mwidth; /* position and width of the text underneath */ --> int16 mx, mwidth; /* 下にあるテキストの位置と幅 */
204 int16 kernafter;
205 unsigned int selected: 1;
206 GGadget *width, *lbearing, *rbearing, *kern, *name;
207 } *perchar;
208 int16 mwidth, mbase;
209 int16 charcnt, max;
210 int16 pressed_x;
211 int16 activeoff;
212 int xoff;
213 struct metricsview *next;
214 unsigned int right_to_left: 1;
215 unsigned int pressed: 1;
216 unsigned int pressedwidth: 1;
217 unsigned int pressedkern: 1;
218 unsigned int showgrid: 1;
219 } <A NAME="MetricsView">MetricsView</A>;
220
221
222 typedef struct fontview {
223 SplineFont *sf;
224 BDFFont *show, *filled;
225 GWindow gw, v;
226 <!--int width, height; /* of v */ --> int width, height; /* v の */
227 int mbh;
228 int colcnt, rowcnt;
229 int rowoff, rowltot;
230 <!--int cbw,cbh; /* width/height of a character box */ -->
231 int cbw,cbh; /* 文字ボックスの幅/高さ */
232 GFont *header;
233 GGadget *vsb, *mb;
234 struct fontview *next;
235 int pressed_pos, end_pos;
236 GTimer *pressed;
237 char *selected;
238 MetricsView *metrics;
239 unsigned int onlycopydisplayed: 1;
240 unsigned int antialias:1;
241 } <A NAME="FontView">FontView</A>;
242
243 typedef struct findsel {
244 GEvent *e;
245 <!--double fudge; /* One pixel fudge factor */ --> double fudge; /* 1 ピクセルの許容誤差 (fudge factor) */
246 <!--double xl,xh, yl, yh; /* One pixel fudge factor */ --> double xl,xh, yl, yh; /* 1 ピクセルの許容誤差 */
247 <!--unsigned int select_controls: 1; /* notice control points */ --> unsigned int select_controls: 1; /* 制御点を検知する */
248 <!--unsigned int seek_controls: 1; /* notice control points before base points */ --> unsigned int seek_controls: 1; /* 基点より制御点を先に検知する */
249 double scale;
250 PressedOn *p;
251 } FindSel;
252
253 enum widthtype { wt_width, wt_lbearing, wt_rbearing };
254
255 extern FontView *FontViewCreate(SplineFont *sf);
256 extern void SplineFontSetUnChanged(SplineFont *sf);
257 extern FontView *ViewPostscriptFont(char *filename);
258 extern FontView *FontNew(void);
259 extern void FontViewFree(FontView *fv);
260 extern void FVToggleCharChanged(FontView *fv,SplineChar *sc);
261 extern void FVRefreshChar(FontView *fv,BDFFont *bdf,int enc);
262 extern void FVRegenChar(FontView *fv,SplineChar *sc);
263 extern int _FVMenuSave(FontView *fv);
264 extern int _FVMenuSaveAs(FontView *fv);
265 extern int _FVMenuGenerate(FontView *fv);
266 extern char *GetPostscriptFontName(void);
267 extern void MenuPrefs(GWindow base,struct gmenuitem *mi);
268 extern void MenuExit(GWindow base,struct gmenuitem *mi);
269 extern void MenuOpen(GWindow base,struct gmenuitem *mi);
270 extern void MenuNew(GWindow gw,struct gmenuitem *mi);
271 extern int FontMenuGeneratePostscript(SplineFont *sf);
272 extern void FontMenuFontInfo(SplineFont *sf,FontView *fv);
273 extern void FontViewReformat(FontView *fv);
274 extern void FVShowFilled(FontView *fv);
275 extern void SCPreparePopup(GWindow gw,SplineChar *sc);
276 extern void FVTrans(FontView *fv,SplineChar *sc,double transform[6],char *sel);
277 extern void FVMergeFonts(FontView *fv);
278 extern void FVInterpolateFonts(FontView *fv);
279 extern void FVRevert(FontView *fv);
280 extern void FVDelay(FontView *fv,void (*func)(FontView *));
281
282 extern void FVAutoKern(FontView *fv);
283 extern void FVAutoWidth(FontView *fv);
284
285 extern void CVDrawSplineSet(CharView *cv, GWindow pixmap, SplinePointList *set,
286 Color fg, int dopoints, DRect *clip );
287
288 extern GWindow CVMakeTools(CharView *cv);
289 extern GWindow CVMakeLayers(CharView *cv);
290 extern GWindow BVMakeTools(BitmapView *bv);
291 extern GWindow BVMakeLayers(BitmapView *bv);
292 extern double CVRoundRectRadius(void);
293 extern double CVStarRatio(void);
294 extern int CVPolyStarPoints(void);
295 extern int TrueCharState(GEvent *event);
296 extern void BVToolsSetCursor(BitmapView *bv, int state);
297 extern void CVToolsSetCursor(CharView *cv, int state);
298 extern void CVToolsPopup(CharView *cv, GEvent *event);
299 extern void BVToolsPopup(BitmapView *bv, GEvent *event);
300 extern void CVTransFunc(CharView *cv,double transform[6]);
301 extern void TransformDlgCreate(void *data,void (*transfunc)(void *,double *,int),
302 int (*getorigin)(void *,BasePoint *,int));
303 extern void BitmapDlg(FontView *fv,SplineChar *sc, int isavail);
304 extern void CVReviewHints(CharView *cv);
305 extern void CVCreateHint(CharView *cv,int ishstem);
306 extern int CVExport(CharView *cv);
307 extern int BVExport(BitmapView *bv);
308
309 extern CharView *CharViewCreate(SplineChar *sc,FontView *fv);
310 extern void CharViewFree(CharView *cv);
311 extern void CVDrawRubberRect(GWindow pixmap, CharView *cv);
312 extern void CVSetCharChanged(CharView *cv,int changed);
313 extern void CVCharChangedUpdate(CharView *cv);
314 extern void SCCharChangedUpdate(SplineChar *sc,FontView *fv);
315 extern void SCSynchronizeWidth(SplineChar *sc,double newwidth, double oldwidth,FontView *fv);
316 extern void SCSynchronizeLBearing(SplineChar *sc,char *selected,double off);
317 extern int CVAnySel(CharView *cv, int *anyp, int *anyr, int *anyi);
318 extern int CVTwoForePointsSelected(CharView *cv, SplinePoint **sp1, SplinePoint **sp2);
319 extern int CVClearSel(CharView *cv);
320 extern int CVSetSel(CharView *cv);
321 extern int CVAllSelected(CharView *cv);
322 extern void SCUpdateAll(SplineChar *sc);
323 extern void SCOutOfDateBackground(SplineChar *sc);
324 extern SplinePointList *CVAnySelPointList(CharView *cv);
325 extern SplinePoint *CVAnySelPoint(CharView *cv);
326 extern int CVOneThingSel(CharView *cv, SplinePoint **sp, SplinePointList **spl,
327 RefChar **ref, ImageList **img);
328 extern void CVInfoDrawText(CharView *cv, GWindow pixmap );
329 extern void CVImport(CharView *cv);
330 extern void BVImport(BitmapView *bv);
331 extern void FVImport(FontView *bv);
332 extern int FVImportBDF(FontView *fv, char *filename);
333 extern void CVFindCenter(CharView *cv, BasePoint *bp, int nosel);
334 extern void CVStroke(CharView *cv);
335 extern void FVStroke(FontView *fv);
336 extern void SCGetInfo(SplineChar *sc,int nextprev);
337 extern void CVGetInfo(CharView *cv);
338 extern void FVSetWidth(FontView *fv,enum widthtype wtype);
339 extern void CVSetWidth(CharView *cv,enum widthtype wtype);
340 extern void CVChangeSC(CharView *cv, SplineChar *sc );
341
342 extern void CVAdjustPoint(CharView *cv, SplinePoint *sp);
343 extern void CVMergeSplineSets(CharView *cv, SplinePoint *active, SplineSet *activess,
344 SplinePoint *merge, SplineSet *mergess);
345 extern void CVChar(CharView *cv, GEvent *event );
346 extern void CVMoveSelection(CharView *cv, double dx, double dy);
347 extern void CVMouseDownPoint(CharView *cv);
348 extern void CVMouseMovePoint(CharView *cv,PressedOn *);
349 extern void CVMouseMovePen(CharView *cv, PressedOn *p);
350 extern void CVMouseUpPoint(CharView *cv);
351 extern void CVMouseUpPointer(CharView *cv );
352 extern void CVMouseMovePointer(CharView *cv );
353 extern void CVMouseDownPointer(CharView *cv, FindSel *fs, GEvent *event);
354 extern void CVCheckResizeCursors(CharView *cv);
355 extern void CVMouseDownRuler(CharView *cv, GEvent *event);
356 extern void CVMouseMoveRuler(CharView *cv, GEvent *event);
357 extern void CVMouseUpRuler(CharView *cv, GEvent *event);
358 extern void CVMouseDownTransform(CharView *cv);
359 extern void CVMouseMoveTransform(CharView *cv);
360 extern void CVMouseUpTransform(CharView *cv);
361 extern void CVMouseDownKnife(CharView *cv);
362 extern void CVMouseMoveKnife(CharView *cv,PressedOn *);
363 extern void CVMouseUpKnife(CharView *cv);
364 extern void CVMouseDownShape(CharView *cv);
365 extern void CVMouseMoveShape(CharView *cv);
366 extern void CVMouseUpShape(CharView *cv);
367
368 extern int GotoChar(SplineFont *sf);
369
370 extern Undoes *CVPreserveState(CharView *cv);
371 extern Undoes *CVPreserveTState(CharView *cv);
372 extern Undoes *CVPreserveWidth(CharView *cv,int width);
373 extern void CVDoRedo(CharView *cv);
374 extern void CVDoUndo(CharView *cv);
375 extern void CVRestoreTOriginalState(CharView *cv);
376 extern void CVUndoCleanup(CharView *cv);
377 extern void CVRemoveTopUndo(CharView *cv);
378 extern int CopyContainsSomething(void);
379 extern int CopyContainsBitmap(void);
380 extern void CopyReference(SplineChar *sc);
381 extern void CopySelected(CharView *cv);
382 extern void CopyWidth(CharView *cv);
383 extern void PasteToCV(CharView *cv);
384 extern void BCCopySelected(BDFChar *bc,int pixelsize);
385 extern void PasteToBC(BDFChar *bc,int pixelsize,FontView *fv);
386 extern void FVCopyWidth(FontView *fv);
387 extern void FVCopy(FontView *fv, int fullcopy);
388 extern void PasteIntoFV(FontView *fv);
389
390 extern void WindowMenuBuild(GWindow base,struct gmenuitem *mi);
391
392 extern GImage GIcon_sel2ptr, GIcon_rightpointer, GIcon_angle, GIcon_distance,
393 GIcon_selectedpoint;
394
395 extern BitmapView *BitmapViewCreate(BDFChar *bc, BDFFont *bdf, FontView *fv);
396 extern BitmapView *BitmapViewCreatePick(int enc, FontView *fv);
397 extern void BitmapViewFree(BitmapView *bv);
398 extern void BCCharChangedUpdate(BDFChar *bc,FontView *fv);
399 extern void BCFlattenFloat(BDFChar *bc);
400 extern BDFFloat *BDFFloatCreate(BDFChar *bc,int xmin,int xmax,int ymin,int ymax, int clear);
401 extern BDFFloat *BDFFloatCopy(BDFFloat *sel);
402 extern void BDFFloatFree(BDFFloat *sel);
403 extern void BVMenuRotateInvoked(GWindow gw,struct gmenuitem *mi);
404 extern void BVRotateBitmap(BitmapView *bv,enum bvtools type );
405 extern void BCSetPoint(BDFChar *bc, int x, int y, int clear);
406 extern void BCGeneralFunction(BitmapView *bv,
407 void (*SetPoint)(BitmapView *,int x, int y, void *data),void *data);
408 extern unichar_t *BVFlipNames[];
409 extern void BVChangeBC(BitmapView *bv, BDFChar *bc, int fitit );
410 extern void BVChar(BitmapView *cv, GEvent *event );
411
412 extern void MVRefreshChar(MetricsView *mv, SplineChar *sc);
413 extern void MVRegenChar(MetricsView *mv, SplineChar *sc);
414 extern void MVReKern(MetricsView *mv);
415 extern MetricsView *MetricsViewCreate(FontView *fv,SplineChar *sc,BDFFont *bdf);
416 extern void MetricsViewFree(MetricsView *mv);
417
418 extern void LoadPrefs(void);
419 extern void SavePrefs(void);
420 extern void DoPrefs(void);
421 #endif
422 </PRE>
423 </BLOCKQUOTE>
424 </DIV>
425 </BODY></HTML>