Started the uiOpenTypeFeatures implementationss, filling in holes in the API.

This commit is contained in:
Pietro Gagliardi 2017-05-11 10:27:34 -04:00
parent a0454a6b43
commit 676dfb87f2
4 changed files with 165 additions and 2 deletions

52
darwin/opentype.m Normal file
View File

@ -0,0 +1,52 @@
// 11 may 2017
#include "uipriv_windows.hpp"
struct uiOpenTypeFeatures {
xxxx;
};
uiOpenTypeFeatures *uiNewOpenTypeFeatures(void)
{
uiOpenTypeFeatures *otf;
otf = uiNew(uiOpenTypeFeatures);
xxxx;
return otf;
}
void uiFreeOpenTypeFeatures(uiOpenTypeFeatures *otf)
{
xxxxxx;
uiFree(otf);
}
uiOpenTypeFeatures *uiOpenTypeFeaturesClone(uiOpenTypeFeatures *otf)
{
uiOpenTypeFeatures *out;
out = uiNew(uiOpenTypeFeatures);
xxxxxx;
return out;
}
void uiOpenTypeFeaturesAdd(uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t value)
{
}
void uiOpenTypeFeaturesRemove(uiOpenTypeFeatures *otf, char a, char b, char c, char d)
{
}
int uiOpenTypeFeaturesGet(uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t *value)
{
}
void uiOpenTypeFeaturesForEach(uiOpenTypeFeatures *otf, uiOpenTypeFeaturesForEachFunc f, void *data)
{
}
int uiOpenTypeFeaturesEqual(uiOpenTypeFeatures *a, uiOpenTypeFeatures *b)
{
}
// TODO put the internal function to produce a backend object from one here

View File

@ -220,13 +220,19 @@ _UI_ENUM(uiAttributeCapForm) {
// TODO rename? // TODO rename?
typedef struct uiOpenTypeFeatures uiOpenTypeFeatures; typedef struct uiOpenTypeFeatures uiOpenTypeFeatures;
// TODO pass the feature set?
typedef int (*uiOpenTypeFeaturesForEachFunc)(char a, char b, char c, char d, uint32_t value, void *data);
// TODO detailed constructor? // TODO detailed constructor?
_UI_EXTERN uiOpenTypeFeatures *uiNewOpenTypeFeatures(void); _UI_EXTERN uiOpenTypeFeatures *uiNewOpenTypeFeatures(void);
_UI_EXTERN void uiFreeOpenTypeFeatures(uiOpenTypeFeatures *otf); _UI_EXTERN void uiFreeOpenTypeFeatures(uiOpenTypeFeatures *otf);
// TODO put above Free?
// TODO Copy instead of Clone?
_UI_EXTERN uiOpenTypeFeatures *uiOpenTypeFeaturesClone(uiOpenTypeFeatures *otf); _UI_EXTERN uiOpenTypeFeatures *uiOpenTypeFeaturesClone(uiOpenTypeFeatures *otf);
_UI_EXTERN void uiOpenTypeFeaturesAdd(uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t value); _UI_EXTERN void uiOpenTypeFeaturesAdd(uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t value);
// TODO remove, query, enumerate _UI_EXTERN void uiOpenTypeFeaturesRemove(uiOpenTypeFeatures *otf, char a, char b, char c, char d);
// TODO make the compare function public? _UI_EXTERN int uiOpenTypeFeaturesGet(uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t *value);
_UI_EXTERN void uiOpenTypeFeaturesForEach(uiOpenTypeFeatures *otf, uiOpenTypeFeaturesForEachFunc f, void *data);
_UI_EXTERN int uiOpenTypeFeaturesEqual(uiOpenTypeFeatures *a, uiOpenTypeFeatures *b);
typedef struct uiAttributeSpec uiAttributeSpec; typedef struct uiAttributeSpec uiAttributeSpec;
@ -240,6 +246,7 @@ struct uiAttributeSpec {
double A; double A;
}; };
// TODO name the foreach return values
typedef int (*uiAttributedStringForEachAttributeFunc)(uiAttributedString *s, uiAttributeSpec *spec, size_t start, size_t end, void *data); typedef int (*uiAttributedStringForEachAttributeFunc)(uiAttributedString *s, uiAttributeSpec *spec, size_t start, size_t end, void *data);
// @role uiAttributedString constructor // @role uiAttributedString constructor

52
unix/opentype.c Normal file
View File

@ -0,0 +1,52 @@
// 11 may 2017
#include "uipriv_windows.hpp"
struct uiOpenTypeFeatures {
xxxx;
};
uiOpenTypeFeatures *uiNewOpenTypeFeatures(void)
{
uiOpenTypeFeatures *otf;
otf = uiNew(uiOpenTypeFeatures);
xxxx;
return otf;
}
void uiFreeOpenTypeFeatures(uiOpenTypeFeatures *otf)
{
xxxxxx;
uiFree(otf);
}
uiOpenTypeFeatures *uiOpenTypeFeaturesClone(uiOpenTypeFeatures *otf)
{
uiOpenTypeFeatures *out;
out = uiNew(uiOpenTypeFeatures);
xxxxxx;
return out;
}
void uiOpenTypeFeaturesAdd(uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t value)
{
}
void uiOpenTypeFeaturesRemove(uiOpenTypeFeatures *otf, char a, char b, char c, char d)
{
}
int uiOpenTypeFeaturesGet(uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t *value)
{
}
void uiOpenTypeFeaturesForEach(uiOpenTypeFeatures *otf, uiOpenTypeFeaturesForEachFunc f, void *data)
{
}
int uiOpenTypeFeaturesEqual(uiOpenTypeFeatures *a, uiOpenTypeFeatures *b)
{
}
// TODO put the internal function to produce a backend object from one here

52
windows/opentype.cpp Normal file
View File

@ -0,0 +1,52 @@
// 11 may 2017
#include "uipriv_windows.hpp"
struct uiOpenTypeFeatures {
xxxx;
};
uiOpenTypeFeatures *uiNewOpenTypeFeatures(void)
{
uiOpenTypeFeatures *otf;
otf = uiNew(uiOpenTypeFeatures);
xxxx;
return otf;
}
void uiFreeOpenTypeFeatures(uiOpenTypeFeatures *otf)
{
xxxxxx;
uiFree(otf);
}
uiOpenTypeFeatures *uiOpenTypeFeaturesClone(uiOpenTypeFeatures *otf)
{
uiOpenTypeFeatures *out;
out = uiNew(uiOpenTypeFeatures);
xxxxxx;
return out;
}
void uiOpenTypeFeaturesAdd(uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t value)
{
}
void uiOpenTypeFeaturesRemove(uiOpenTypeFeatures *otf, char a, char b, char c, char d)
{
}
int uiOpenTypeFeaturesGet(uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t *value)
{
}
void uiOpenTypeFeaturesForEach(uiOpenTypeFeatures *otf, uiOpenTypeFeaturesForEachFunc f, void *data)
{
}
int uiOpenTypeFeaturesEqual(uiOpenTypeFeatures *a, uiOpenTypeFeatures *b)
{
}
// TODO put the internal function to produce a backend object from one here