forked from albertlauncher/albert
-
Notifications
You must be signed in to change notification settings - Fork 0
Coding guide
idkCpp edited this page May 19, 2016
·
2 revisions
Albert comes with the convienient feature to extend it with plugins. Everyone is free and welcome to issue their own plugin to me to ship it with every new version of albert. However it has to pass specific checks. These checks are necessary to guarantee the functionality and maintainability of this application and are therefore vital.
So you want to create an extension. When creating a new extension, make sure that:
- you create it with the script. This ensures that the code will be according to the basic template.
- you modify all copyright notices accordingly
- you modify the values in the
metadata.json
andCMakeLists.txt
file - you add an
add_subdirectory
line to theCMakeLists.txt
file in theplugins
folder
When adding header files to your extension make sure that:
- they have the copyright notice on the first lines
- you have updated the copyright notice accordingly
- there are not header guards. Instead use
#pragma once
When adding source files make sure that:
- you don't use a namespace declaration. Instead prefix every member with the according namespace
- the function members are seperated by 3 newlines and a javadoc-comment looking like
/** ****[...]****/
- also the source files are fitted with appropriate copyright notices
Albert provides an icon lookup class. It's called XdgIconLookup
. To use it you have to:
- include the
xdgiconlookup.h
- add
iconlookup
to thetarget_link_libraries
directive in yourCMakeLists.txt