Giter Site home page Giter Site logo

plugins's Introduction

C++/Qt plugins

Native plugins are based on Qt Plugins.

Getting started

In your CMakeLists.txt define a project. PROJECT_NAME and PROJECT_VERSION define your plugin id and version. Use the Albert package CMake macro albert_plugin. These macros do a lot of necessary Qt boilerplate for you. See the table below for parameters you can pass. If you are keen on seeing the details check the cmake dir in the project root.

Parameter Type Notes
NAME value MANDATORY Human readable name
DESCRIPTION value MANDATORY Brief, imperative description
LICENSE value MANDATORY Short form e.g. BSD-2-Clause or GPL-3.0
URL value MANDATORY Browsable source, issues etc
FRONTEND option Optional Indicates that this plugin realizes the frontend interface
MAINTAINERS list Optional Active maintainers. Preferrably using mentionable GitHub usernames
QT_DEPENDENCIES list Optional Qt::Core is exported from albert, auto import and link
LIB_DEPENDENCIES list Optional Required libraries
EXEC_DEPENDENCIES list Optional Required executables

A CMakeLists.txt of an example plugin could look like this:

project(some_plugin_id VERSION 1.0)
albert_plugin(
    NAME "Some pretty name"
    DESCRIPTION "Brief description"
    LICENSE GPL
    URL https://mydomain.com/myurl
    MAINTAINERS @yourname
)

A minimal working example of an albert Plugin looks like:

#pragma once
#include "albert.h"

class Plugin : public albert::Plugin
{
    Q_OBJECT ALBERT_PLUGIN
};

Subclass classes deriving albert::Extension to extend the application by loading this plugin. The most common use case is probably albert::QueryHandler or one of its subclasses.

Check the library interface classes as they are documented and always up to date. Also see the existing plugins to get a basic understanding. Join our community chats if you need help.

plugins's People

Contributors

caseof avatar elcste avatar hnboy avatar idkcpp avatar johanhelsing avatar manuelschneid3r avatar mateuszradomski avatar mschrupp avatar snuggle avatar tim3z avatar tyilo avatar vesim987 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.