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

ShellAnything API in C #103

Closed
17 tasks done
end2endzone opened this issue Jan 2, 2022 · 0 comments
Closed
17 tasks done

ShellAnything API in C #103

end2endzone opened this issue Jan 2, 2022 · 0 comments
Labels
code cleanup The code needs optimization enhancement New feature or request
Milestone

Comments

@end2endzone
Copy link
Owner

end2endzone commented Jan 2, 2022

Is your feature request related to a problem? Please describe.
An C API should be created over ShellAnything core to allow safe access to ShellAnything features.
This API could also be used as the entry point for plugins or similar features.

Describe the solution you'd like
The following code changes must be implemented:

  • Convert libeval to a DLL with a C interface.
  • Convert shellanything library to a shared library.
  • Rename shellanything library to sa.core.dll.
  • Renamed "shellanything_unittest.exe" to "sa.tests.exe". This is not requied for the API but it is for consistency.
  • Move include files from include\shellanything back to src since they are not expected to be published and used.
  • Create sa.api.dll.
    • Create file sa_action.h which provides features to the Action class.
    • Create file sa_config_manager.h which provide features to the ConfigManager class.
    • Create file sa_configuration.h which provide features to the Configuration class.
    • Create file sa_context.h which provide features to the Context class.
    • Create file sa_icon.h which provide features to the Icon class.
    • Create file sa_menu.h which provide features to the Menu class.
    • Create file sa_validator.h which provide features to the Validator class.
    • Move all sa_*.h files to include\shellanything to publish then with the installer.
  • Rename shellext library to shellextension.dll or sa.shellextension.dll. Careful to also update the scripts and the installation packages to make sure that files are now using the new filename.
  • Create a directory structure under /src. For example, /src/core, /src/api, /src/shared
  • Move shared source files a.k.a SHELLANYTHING_PRIVATE_FILES to /src/shared. Rename source_group() to "ShellAnything Shared Files".

Describe alternatives you've considered
A possible alternative is to remove all std classes from the public header files. This would allow the library to be used by other compilers. It was first tried in #102 but it was cancelled since it was to complicated and created way too much overhead. See #102 for details.

Additional context
N/A

@end2endzone end2endzone added enhancement New feature or request code cleanup The code needs optimization labels Jan 2, 2022
@end2endzone end2endzone added this to the 0.8.0 milestone Jan 2, 2022
end2endzone added a commit that referenced this issue Jan 3, 2022
… to introduce another string evaluation library. Issue #103
end2endzone added a commit that referenced this issue Jan 7, 2022
Renamed shellanything library to sa.core.dll.
For issue #103
end2endzone added a commit that referenced this issue Jan 9, 2022
…static library.

This means that unit tests, sa.core.dll and the shellextension (shellext.dll) uses the same shared logging configuration.
Implemented GlogUtils::IsTestingEnvironment() to be able to distinguish between when running unit tests and when the shell extension is used by Windows File Explorer.
Modified unit tests to delete all previous logs when starting tests.
Modified the shell extension to not initialize and shutdown GLOG library when in testing mode. This is done by the main application.
Modified unit test application to use the same initialization code as the shell extension. Both shellanything_unittest.exe and shellext.dll are now initializing the GLOG library through GlogUtils::InitLogger().
For #103.
end2endzone added a commit that referenced this issue Jan 14, 2022
…exprtk, /src/shared, /src/shellextension. The /include directory is left as-is since it will be for the public API.

For issue #103.
end2endzone added a commit that referenced this issue Jan 29, 2022
end2endzone added a commit that referenced this issue Feb 4, 2022
* feature-issue103:
  Implemented logging support in the API.
  Renamed the shell extension library `shellext.dll` to `sa.shellextension.dll`. For issue #103.
  Implemented shellanything::Validator api in sa_validator.h. For issue #103.
  Implemented ShellAnything API in C. For issue #103
  Updated Menu::GetValidityCount() and Menu::GetVisibilityCount() as const methods.
  Moved tests source files from /test to /src/tests.
  Moved source files and non-public header files in /src/core, /src/libexprtk, /src/shared, /src/shellextension. The /include directory is left as-is since it will be for the public API. For issue #103.
  Updated CHANGES for changes introduced in 94e871f
  Renamed "shellanything_unittest.exe" to "sa.tests.exe". This is not required for the API but it is better for consistency.
  Modified TestActionExecute unit test to properly kill Calculator.exe process on Windows 10.
  Now using GLOG (Google Logging Library) as a shared DLL instead of a static library. This means that unit tests, sa.core.dll and the shellextension (shellext.dll) uses the same shared logging configuration. Implemented GlogUtils::IsTestingEnvironment() to be able to distinguish between when running unit tests and when the shell extension is used by Windows File Explorer. Modified unit tests to delete all previous logs when starting tests. Modified the shell extension to not initialize and shutdown GLOG library when in testing mode. This is done by the main application. Modified unit test application to use the same initialization code as the shell extension. Both shellanything_unittest.exe and shellext.dll are now initializing the GLOG library through GlogUtils::InitLogger(). For #103.
  Converted shellanything library to a shared library. Renamed shellanything library to sa.core.dll. For issue #103
  Modified project to also build branch `feature-issue103` on appveyor.
  Added new configuration files to the project.
  Renamed libEval to libexprtk. This change is required if we ever want to introduce another string evaluation library. Issue #103
  Converted libeval to a DLL with a C interface. Issue #103.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code cleanup The code needs optimization enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant