writing plugins for kate and enhancing kate

Download Writing plugins for Kate and enhancing Kate

If you can't read please download the document

Upload: abhishek-patil

Post on 16-Apr-2017

3.525 views

Category:

Technology


2 download

TRANSCRIPT

Writing Kate plugins and enhancing Kate

About me

Abhishek Patil (http://thezeroth.net)

Software Engineer

Vcreate Logic Pvt. Ltd (http://vcreatelogic.com)

@abhishekworld

Why me?

A Qt/KDE developer

Mainly contributes to Kate

Tabify Plugin for kate (KDE 4.5)

And other features from kate's wishlist (KDE 4.5)

Aim of this talk!

Understand how kate plugins are written

Create Tabify Plugin

Kate Application base

Plugin Architecture

Based on KParts

Important classes in KATE

Kate::Application

Kate::MainWindow

Kate::DocumentManager

Kate::PluginManager

Kate::Plugin

Kate::PluginView

Kate::PluginConfigPageInterface

Bacis of Kate Plugin

3 Important Files in Kate PluginA desktop file with some information about the plugin

An XmlGui rc file named ui.rc

A library containing the plugin

Desktop File

[Desktop Entry]Encoding=UTF-8X-Kate-Version=2.8X-KDE-Library=katetabifypluginServiceTypes=Kate/PluginType=ServiceIcon=korganizerName=TabifyX-Kate-MajorProfiles=KateX-Kate-MinorProfiles=*

IMPORTANT

Name of the files has to be in kateyourpluginname.desktop format.

katetabify.desktop

XmlGUI file

Tabify Plugin

The name of this file has to be ui.rc

The Library

class MyPlugin : public Kate::Plugin { Q_OBJECT

public: // other methods etc... PluginView *createView(MainWindow *mainWindow) { return new MyPluginView(mainWindow); } };

class MyPluginView : public Kate::PluginView { Q_OBJECT public: MyPluginView(MainWindow *mainWindow);

// possibilities of gui: // - hook into the menus with KXMLGUIClient // - create a toolView and put a widget into it // with MainWindow::createToolView() };

Code

http://websvn.kde.org/trunk/KDE/kdesdk/kate/plugins/tabify/

Compile your plugin

CMakeList.txt

find_package(KDE4 REQUIRED)include (KDE4Defaults)include_directories(${KDE4_INCLUDES})

kde4_add_plugin(katetabifyplugin tabify.cpp)

target_link_libraries(katetabifyplugin ${KDE4_KDEUI_LIBS} ${KDE4_KPARTS_LIBS} kateinterfaces)install(TARGETS katetabifyplugin DESTINATION ${PLUGIN_INSTALL_DIR})install(FILES ui.rc DESTINATION ${DATA_INSTALL_DIR}/kate/plugins/katetabify)install(FILES katetabifyplugin.desktop DESTINATION ${SERVICES_INSTALL_DIR})

Referances

http://api.kde.org/4.x-api/kdesdk-apidocs/kate/interfaces/kate/html/index.html

http://kate-editor.org/2004/01/06/writing-a-kate-plugin/

http://kate-editor.org/featured-articles/

Thank You....

Questions???

[email protected]

@abhishekworld

http://thezeroth.net

Muokkaa otsikon tekstimuotoa napsauttamalla

Muokkaa jsennyksen tekstimuotoa napsauttamallaToinen jsennystasoKolmas jsennystasoNeljs jsennystasoViides jsennystasoKuudes jsennystasoSeitsems jsennystasoKahdeksas jsennystasoYhdekss jsennystaso