Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
225 changes: 225 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,225 @@
---
Language: Cpp
# BasedOnStyle: Google
AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignArrayOfStructures: None
AlignConsecutiveMacros: None
AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: None
AlignEscapedNewlines: Left
AlignOperands: Align
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortEnumsOnASingleLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
AttributeMacros:
- __capability
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: true
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
QualifierAlignment: Leave
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: true
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
PackConstructorInitializers: NextLine
BasedOnStyle: ''
ConstructorInitializerAllOnOneLineOrOnePerLine: false
AllowAllConstructorInitializersOnNextLine: true
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IfMacros:
- KJ_IF_MAYBE
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<ext/.*\.h>'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '^<.*\.h>'
Priority: 1
SortPriority: 0
CaseSensitive: false
- Regex: '^<.*'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '.*'
Priority: 3
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: '([-_](test|unittest))?$'
IncludeIsMainSourceRegex: ''
IndentAccessModifiers: false
IndentCaseLabels: true
IndentCaseBlocks: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentExternBlock: AfterExternBlock
IndentRequires: false
IndentWidth: 2
IndentWrappedFunctionNames: false
InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
LambdaBodyIndentation: Signature
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Never
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakOpenParenthesis: 0
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PenaltyIndentedWhitespace: 0
PointerAlignment: Left
PPIndentWidth: -1
RawStringFormats:
- Language: Cpp
Delimiters:
- cc
- CC
- cpp
- Cpp
- CPP
- 'c++'
- 'C++'
CanonicalDelimiter: ''
BasedOnStyle: google
- Language: TextProto
Delimiters:
- pb
- PB
- proto
- PROTO
EnclosingFunctions:
- EqualsProto
- EquivToProto
- PARSE_PARTIAL_TEXT_PROTO
- PARSE_TEST_PROTO
- PARSE_TEXT_PROTO
- ParseTextOrDie
- ParseTextProtoOrDie
- ParseTestProto
- ParsePartialTestProto
CanonicalDelimiter: pb
BasedOnStyle: google
ReferenceAlignment: Pointer
ReflowComments: true
RemoveBracesLLVM: false
SeparateDefinitionBlocks: Leave
ShortNamespaceLines: 1
SortIncludes: CaseSensitive
SortJavaStaticImport: Before
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterForeachMacros: true
AfterFunctionDefinitionName: false
AfterFunctionDeclarationName: false
AfterIfMacros: true
AfterOverloadedOperator: false
BeforeNonEmptyParentheses: false
SpaceAroundPointerQualifiers: Default
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: Never
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
BitFieldColonSpacing: Both
Standard: Auto
StatementAttributeLikeMacros:
- Q_EMIT
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 8
UseCRLF: false
UseTab: Never
WhitespaceSensitiveMacros:
- STRINGIZE
- PP_STRINGIZE
- BOOST_PP_STRINGIZE
- NS_SWIFT_NAME
- CF_SWIFT_NAME
...
100 changes: 100 additions & 0 deletions .github/workflows/bindings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
on:
release:
types:
- published
name: Publish bindings
jobs:
build-binaries:
if: startsWith(github.ref_name, 'accesskit_c-v')
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macOS-latest
target: aarch64-apple-darwin
path: macos-arm64
- os: macOS-latest
target: x86_64-apple-darwin
path: macos-x86_64
- os: windows-2019
target: aarch64-pc-windows-msvc
path: win-arm64-msvc
- os: windows-2019
target: i686-pc-windows-msvc
path: win-x86-msvc
- os: windows-2019
target: x86_64-pc-windows-msvc
path: win-x86_64-msvc
- os: ubuntu-latest
target: i686-pc-windows-gnu
use-cross: true
path: win-x86-mingw
- os: ubuntu-latest
target: x86_64-pc-windows-gnu
use-cross: true
path: win-x86_64-mingw
- os: ubuntu-latest
target: i686-unknown-linux-gnu
use-cross: true
path: linux-x86
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
path: linux-x86_64
name: cargo build
steps:
- uses: actions/checkout@v3

- name: install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
profile: minimal
override: true

- name: cargo build
uses: actions-rs/cargo@v1
with:
command: build
use-cross: ${{ matrix.use-cross || false }}
args: --package accesskit_c --release --target ${{ matrix.target }}

- name: Upload binaries
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.path }}
path: |
target/${{ matrix.target }}/release/*.a
target/${{ matrix.target }}/release/*.dll
target/${{ matrix.target }}/release/*.dylib
target/${{ matrix.target }}/release/*.lib
target/${{ matrix.target }}/release/*.pdb
target/${{ matrix.target }}/release/*.so

generate-headers:
if: startsWith(github.ref_name, 'accesskit_c-v')
uses: AccessKit/accesskit/.github/workflows/generate-headers.yml@main

publish:
needs: [build-binaries, generate-headers]
runs-on: ubuntu-latest
name: Publish
steps:
- uses: actions/checkout@v3

- uses: actions/download-artifact@v3
with:
path: accesskit_c/lib

- run: mv accesskit_c/lib/headers accesskit_c/include
- run: cp -r bindings/c/examples accesskit_c/
- run: cp bindings/c/*.md accesskit_c/
- run: cp LICENSE* accesskit_c/
- run: mv accesskit_c ${{ github.ref_name }}
- run: zip -r ${{ github.ref_name }}.zip ${{ github.ref_name }}

- uses: AButler/upload-release-assets@v2.0
with:
files: ${{ github.ref_name }}.zip
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: ${{ github.ref_name }}
13 changes: 11 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ on:
name: CI

jobs:
rustfmt:
fmt:
runs-on: ubuntu-latest
name: cargo fmt
name: Check formatting
steps:
- uses: actions/checkout@v2

Expand All @@ -27,6 +27,12 @@ jobs:
command: fmt
args: --all -- --check

- name: clang-format
uses: jidicula/clang-format-action@v4.11.0
with:
clang-format-version: 15
check-path: bindings/c

test:
runs-on: ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -57,3 +63,6 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: test

generate-headers:
uses: AccessKit/accesskit/.github/workflows/generate-headers.yml@main
27 changes: 27 additions & 0 deletions .github/workflows/generate-headers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
on:
workflow_call:

jobs:
generate-headers:
runs-on: ubuntu-latest
name: Generate headers
steps:
- uses: actions/checkout@v3

- name: install nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true

- uses: dtolnay/install@master
with:
crate: cbindgen
- run: make -C bindings/c include/accesskit.h

- name: Upload header file
uses: actions/upload-artifact@v3
with:
name: headers
path: bindings/c/include/accesskit.h
1 change: 1 addition & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ jobs:
- uses: GoogleCloudPlatform/release-please-action@v3
with:
command: manifest
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ target

#KDE
.directory

Loading