Skip to content

Commit

Permalink
Move to spiro.h all the prototypes of non-static spiro.c functions
Browse files Browse the repository at this point in the history
  • Loading branch information
gioele committed Jan 2, 2017
1 parent 8e7a782 commit 67cc1be
Show file tree
Hide file tree
Showing 21 changed files with 43 additions and 14 deletions.
1 change: 1 addition & 0 deletions fontforge/Makefile.am
Expand Up @@ -76,6 +76,7 @@ noinst_HEADERS = \
savefont.h \
scstyles.h \
sfd.h \
spiro.h \
fontforgeui.h sftextfieldP.h configure-fontforge.h views.h \
flaglist.h strlist.h charview_private.h cvundoes.h tables.h

Expand Down
1 change: 1 addition & 0 deletions fontforge/cvexport.c
Expand Up @@ -31,6 +31,7 @@
#include "bvedit.h"
#include "dumppfa.h"
#include "fontforgevw.h"
#include "spiro.h"
#include <math.h>
#include <locale.h>
#include <string.h>
Expand Down
1 change: 1 addition & 0 deletions fontforge/cvimages.c
Expand Up @@ -32,6 +32,7 @@
#include "fvfonts.h"
#include "parsepdf.h"
#include "psread.h"
#include "spiro.h"
#include <math.h>
#include <sys/types.h>
#include <dirent.h>
Expand Down
1 change: 1 addition & 0 deletions fontforge/cvundoes.c
Expand Up @@ -37,6 +37,7 @@
#include "fvfonts.h"
#include "namelist.h"
#include "sfd.h"
#include "spiro.h"
#include "views.h"
#include <math.h>
#include <ustring.h>
Expand Down
1 change: 1 addition & 0 deletions fontforge/fontviewbase.c
Expand Up @@ -40,6 +40,7 @@
#include "psfont.h"
#include "scripting.h"
#include "sfd.h"
#include "spiro.h"
#include <gfile.h>
#include <gio.h>
#include <ustring.h>
Expand Down
1 change: 1 addition & 0 deletions fontforge/python.c
Expand Up @@ -82,6 +82,7 @@ extern int old_sfnt_flags;
#include "scstyles.h"
#include "search.h"
#include "sfd.h"
#include "spiro.h"
#include "ffpython.h"

#include <math.h>
Expand Down
1 change: 1 addition & 0 deletions fontforge/scripting.c
Expand Up @@ -63,6 +63,7 @@
#include "scstyles.h"
#include "search.h"
#include "sfd.h"
#include "spiro.h"
#include <gfile.h>
#include <utype.h>
#include <ustring.h>
Expand Down
4 changes: 4 additions & 0 deletions fontforge/spiro.c
Expand Up @@ -26,6 +26,10 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <fontforge-config.h>

#include "spiro.h"

#include "fontforgevw.h"

/* Access to Raph Levien's spiro splines */
Expand Down
21 changes: 21 additions & 0 deletions fontforge/spiro.h
@@ -0,0 +1,21 @@
#ifndef FONTFORGE_SPIRO_H

This comment has been minimized.

Copy link
@khaledhosny

khaledhosny Jan 4, 2017

Contributor

All these new files should have license headers AFAIK.

This comment has been minimized.

Copy link
@gioele

gioele Jan 5, 2017

Author Contributor

Hi @khaledhosny, yes, they should have a proper license header. I tried my best to avoid that discussion before getting the ball rolling with this series of PR. Licensing discussions tend to turn into bike shedding fast. ;)

My plan is to send a mass-licensing pull request at the end of this series of PR. Would that be OK?

This comment has been minimized.

Copy link
@frank-trampe

frank-trampe Jan 6, 2017

Contributor

It's not a big deal. We just take the header from spiro.c.

This comment has been minimized.

Copy link
@JoesCat

JoesCat Jan 30, 2017

Contributor

@gioele, we have some scripts in m4/fontforge_arg_with.m4 that test for the existence of spiro.h and I believe this file can cause some confusion due to the same filename being used. There was a large number of changes made shortly after 20120731, so you might want to preview tag-point 20120731 for ideas on a possible direction, plus you may want to check the libspiro/spiro.h for comparisons/additions if you feel inspired.
references:
https://github.com/fontforge/fontforge/releases/tag/v20120731-b
https://github.com/fontforge/libspiro

At the moment, the easiest solution (I think) may be to rename spiro.* to something different, like maybe spiro_ff.* but pointing-out the info (above) if you have other ideas.

#define FONTFORGE_SPIRO_H

#include "splinefont.h"

#define SPIRO_SELECTED(cp) ((cp)->ty&0x80)
#define SPIRO_DESELECT(cp) ((cp)->ty&=~0x80)
#define SPIRO_SELECT(cp) ((cp)->ty|=0x80)
#define SPIRO_SPL_OPEN(spl) ((spl)->spiro_cnt>1 && ((spl)->spiros[0].ty&0x7f)==SPIRO_OPEN_CONTOUR)

#define SPIRO_NEXT_CONSTRAINT SPIRO_RIGHT /* The curve is on the next side of the constraint point */
#define SPIRO_PREV_CONSTRAINT SPIRO_LEFT /* The curve is on the prev side of the constraint point */

extern char *libspiro_version(void);
extern int hasspiro(void);
extern spiro_cp *SpiroCPCopy(spiro_cp *spiros, uint16 *_cnt);
extern spiro_cp *SplineSet2SpiroCP(SplineSet *ss, uint16 *cnt);
extern SplineSet *SpiroCP2SplineSet(spiro_cp *spiros);
extern void SSRegenerateFromSpiros(SplineSet *spl);

#endif /* FONTFORGE_SPIRO_H */
1 change: 1 addition & 0 deletions fontforge/splinechar.c
Expand Up @@ -33,6 +33,7 @@
#include "lookups.h"
#include "mem.h"
#include "parsettf.h"
#include "spiro.h"
#include <math.h>
#include <locale.h>
# include <ustring.h>
Expand Down
14 changes: 0 additions & 14 deletions fontforge/splinefont.h
Expand Up @@ -1161,13 +1161,6 @@ typedef struct { /* Taken from spiro.h because I want */
char ty;
} spiro_cp;
#endif
#define SPIRO_SELECTED(cp) ((cp)->ty&0x80)
#define SPIRO_DESELECT(cp) ((cp)->ty&=~0x80)
#define SPIRO_SELECT(cp) ((cp)->ty|=0x80)
#define SPIRO_SPL_OPEN(spl) ((spl)->spiro_cnt>1 && ((spl)->spiros[0].ty&0x7f)==SPIRO_OPEN_CONTOUR)

#define SPIRO_NEXT_CONSTRAINT SPIRO_RIGHT /* The curve is on the next side of the constraint point */
#define SPIRO_PREV_CONSTRAINT SPIRO_LEFT /* The curve is on the prev side of the constraint point */

typedef struct splinepointlist {
SplinePoint *first, *last;
Expand Down Expand Up @@ -2905,13 +2898,6 @@ extern int ValidatePrivate(SplineFont *sf);
extern int SFValidate(SplineFont *sf, int layer, int force);
extern int VSMaskFromFormat(SplineFont *sf, int layer, enum fontformat format);

extern int hasspiro(void);
extern char *libspiro_version(void);
extern SplineSet *SpiroCP2SplineSet(spiro_cp *spiros);
extern spiro_cp *SplineSet2SpiroCP(SplineSet *ss,uint16 *_cnt);
extern spiro_cp *SpiroCPCopy(spiro_cp *spiros,uint16 *_cnt);
extern void SSRegenerateFromSpiros(SplineSet *spl);

extern char *RandomParaFromScript(uint32 script, uint32 *lang, SplineFont *sf);

extern int SSHasClip(SplineSet *ss);
Expand Down
1 change: 1 addition & 0 deletions fontforge/splineutil.c
Expand Up @@ -37,6 +37,7 @@
#include "psread.h"
#include <math.h>
#include "psfont.h"
#include "spiro.h"
#include "ustring.h"
#include "utype.h"
#include "views.h" /* for FindSel structure */
Expand Down
1 change: 1 addition & 0 deletions fontforge/splineutil2.c
Expand Up @@ -30,6 +30,7 @@
#include "fontforge.h"
#include "namelist.h"
#include "psread.h"
#include "spiro.h"
#include <math.h>
#include "ustring.h"
#include "chardata.h"
Expand Down
1 change: 1 addition & 0 deletions fontforgeexe/charview.c
Expand Up @@ -41,6 +41,7 @@
#include "mm.h"
#include "namelist.h"
#include "sfd.h"
#include "spiro.h"
#include <math.h>
#include <locale.h>
#include <ustring.h>
Expand Down
1 change: 1 addition & 0 deletions fontforgeexe/cvaddpoints.c
Expand Up @@ -27,6 +27,7 @@
#include "cvundoes.h"
#include "fontforgeui.h"
#include <math.h>
#include "spiro.h"
#include "splinefont.h"
#include "ustring.h"

Expand Down
1 change: 1 addition & 0 deletions fontforgeexe/cvgetinfo.c
Expand Up @@ -28,6 +28,7 @@
#include "fontforgeui.h"
#include "lookups.h"
#include "parsettf.h"
#include "spiro.h"
#include <ustring.h>
#include <math.h>
#include <utype.h>
Expand Down
1 change: 1 addition & 0 deletions fontforgeexe/cvimportdlg.c
Expand Up @@ -29,6 +29,7 @@
#include "cvundoes.h"
#include "fontforgeui.h"
#include "fvimportbdf.h"
#include "spiro.h"
#include <math.h>
#include <sys/types.h>
#include <dirent.h>
Expand Down
1 change: 1 addition & 0 deletions fontforgeexe/cvknife.c
Expand Up @@ -26,6 +26,7 @@
*/
#include "cvundoes.h"
#include "fontforgeui.h"
#include "spiro.h"
#include "collabclientui.h"
#include <math.h>

Expand Down
1 change: 1 addition & 0 deletions fontforgeexe/cvpalettes.c
Expand Up @@ -26,6 +26,7 @@
*/
#include "cvundoes.h"
#include "fontforgeui.h"
#include "spiro.h"
#include "collabclientui.h"

int palettes_docked=1;
Expand Down
1 change: 1 addition & 0 deletions fontforgeexe/cvpointer.c
Expand Up @@ -27,6 +27,7 @@

#include "cvundoes.h"
#include "fontforgeui.h"
#include "spiro.h"
#include <utype.h>
#include <math.h>
#include "collabclient.h"
Expand Down
1 change: 1 addition & 0 deletions fontforgeexe/cvshapes.c
Expand Up @@ -26,6 +26,7 @@
*/
#include "cvundoes.h"
#include "fontforgeui.h"
#include "spiro.h"
#include <math.h>

static struct shapedescrip {
Expand Down

0 comments on commit 67cc1be

Please sign in to comment.