Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing .NET version of css-layout using P/Invoke #220

Closed
wants to merge 12 commits into from
38 changes: 19 additions & 19 deletions CSSLayout/CSSLayout.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,16 @@ typedef CSSSize (*CSSMeasureFunc)(void *context,
typedef void (*CSSPrintFunc)(void *context);

// CSSNode
CSSNodeRef CSSNodeNew();
void CSSNodeInit(const CSSNodeRef node);
void CSSNodeFree(const CSSNodeRef node);
WIN_EXPORT CSSNodeRef CSSNodeNew();
WIN_EXPORT void CSSNodeInit(const CSSNodeRef node);
WIN_EXPORT void CSSNodeFree(const CSSNodeRef node);

void CSSNodeInsertChild(const CSSNodeRef node, const CSSNodeRef child, const uint32_t index);
void CSSNodeRemoveChild(const CSSNodeRef node, const CSSNodeRef child);
CSSNodeRef CSSNodeGetChild(const CSSNodeRef node, const uint32_t index);
uint32_t CSSNodeChildCount(const CSSNodeRef node);
WIN_EXPORT void CSSNodeInsertChild(const CSSNodeRef node, const CSSNodeRef child, const uint32_t index);
WIN_EXPORT void CSSNodeRemoveChild(const CSSNodeRef node, const CSSNodeRef child);
WIN_EXPORT CSSNodeRef CSSNodeGetChild(const CSSNodeRef node, const uint32_t index);
WIN_EXPORT uint32_t CSSNodeChildCount(const CSSNodeRef node);

void CSSNodeCalculateLayout(const CSSNodeRef node,
WIN_EXPORT void CSSNodeCalculateLayout(const CSSNodeRef node,
const float availableWidth,
const float availableHeight,
const CSSDirection parentDirection);
Expand All @@ -142,26 +142,26 @@ void CSSNodeCalculateLayout(const CSSNodeRef node,
// measure functions
// depends on information not known to CSSLayout they must perform this dirty
// marking manually.
void CSSNodeMarkDirty(const CSSNodeRef node);
bool CSSNodeIsDirty(const CSSNodeRef node);
WIN_EXPORT void CSSNodeMarkDirty(const CSSNodeRef node);
WIN_EXPORT bool CSSNodeIsDirty(const CSSNodeRef node);

void CSSNodePrint(const CSSNodeRef node, const CSSPrintOptions options);
WIN_EXPORT void CSSNodePrint(const CSSNodeRef node, const CSSPrintOptions options);

bool CSSValueIsUndefined(const float value);
WIN_EXPORT bool CSSValueIsUndefined(const float value);

#define CSS_NODE_PROPERTY(type, name, paramName) \
void CSSNodeSet##name(const CSSNodeRef node, type paramName); \
type CSSNodeGet##name(const CSSNodeRef node);
WIN_EXPORT void CSSNodeSet##name(const CSSNodeRef node, type paramName); \
WIN_EXPORT type CSSNodeGet##name(const CSSNodeRef node);

#define CSS_NODE_STYLE_PROPERTY(type, name, paramName) \
void CSSNodeStyleSet##name(const CSSNodeRef node, const type paramName); \
type CSSNodeStyleGet##name(const CSSNodeRef node);
WIN_EXPORT void CSSNodeStyleSet##name(const CSSNodeRef node, const type paramName); \
WIN_EXPORT type CSSNodeStyleGet##name(const CSSNodeRef node);

#define CSS_NODE_STYLE_EDGE_PROPERTY(type, name, paramName) \
void CSSNodeStyleSet##name(const CSSNodeRef node, const CSSEdge edge, const type paramName); \
type CSSNodeStyleGet##name(const CSSNodeRef node, const CSSEdge edge);
WIN_EXPORT void CSSNodeStyleSet##name(const CSSNodeRef node, const CSSEdge edge, const type paramName); \
WIN_EXPORT type CSSNodeStyleGet##name(const CSSNodeRef node, const CSSEdge edge);

#define CSS_NODE_LAYOUT_PROPERTY(type, name) type CSSNodeLayoutGet##name(const CSSNodeRef node);
#define CSS_NODE_LAYOUT_PROPERTY(type, name) WIN_EXPORT type CSSNodeLayoutGet##name(const CSSNodeRef node);

CSS_NODE_PROPERTY(void *, Context, context);
CSS_NODE_PROPERTY(CSSMeasureFunc, MeasureFunc, measureFunc);
Expand Down
6 changes: 6 additions & 0 deletions CSSLayout/CSSMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
#define CSS_EXTERN_C_END
#endif

#ifdef _WINDLL
#define WIN_EXPORT __declspec(dllexport)
#else
#define WIN_EXPORT
#endif

#ifndef FB_ASSERTIONS_ENABLED
#define FB_ASSERTIONS_ENABLED 1
#endif
Expand Down
206 changes: 0 additions & 206 deletions csharp/CSSLayout/CSSLayout-win.h

This file was deleted.

3 changes: 1 addition & 2 deletions csharp/CSSLayout/CSSLayout.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<ProjectGuid>{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>CSSLayout</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.10586.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
Expand Down Expand Up @@ -149,7 +149,6 @@
<ClInclude Include="..\..\CSSLayout\CSSLayout.h" />
<ClInclude Include="..\..\CSSLayout\CSSMacros.h" />
<ClInclude Include="..\..\CSSLayout\CSSNodeList.h" />
<ClInclude Include="CSSLayout-win.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="targetver.h" />
</ItemGroup>
Expand Down
3 changes: 0 additions & 3 deletions csharp/CSSLayout/CSSLayout.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
<ClInclude Include="..\..\CSSLayout\CSSNodeList.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="CSSLayout-win.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">
Expand Down
Loading