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 19-May-2015

607 views

Category:

Technology


4 download

DESCRIPTION

Presentation at Foss.in/2010 on Writing Kate plugin.

TRANSCRIPT

  • 1. Writing Kate plugins and enhancing Kate

2. About me

  • Abhishek Patil (http://thezeroth.net)

3. Software Engineer 4. Vcreate Logic Pvt. Ltd (http://vcreatelogic.com) 5. @abhishekworld 6. Why me?

  • A Qt/KDE developer

7. Mainly contributes to Kate 8. Tabify Plugin for kate (KDE 4.5) 9. And other features from kate's wishlist (KDE 4.5) 10. Aim of this talk!

  • Understand how kate plugins are written

11. Create Tabify Plugin 12. Kate Application base

  • Plugin Architecture

13. Based on KParts 14. Important classes in KATE

  • Kate::Application

15. Kate::MainWindow 16. Kate::DocumentManager 17. Kate::PluginManager 18. Kate::Plugin 19. Kate::PluginView 20. Kate::PluginConfigPageInterface 21. Bacis of Kate Plugin

  • 3 Important Files in Kate Plugin
  • A desktop file with some information about the plugin

22. An XmlGui rc file named ui.rc 23. A library containing the plugin 24. Desktop File [Desktop Entry] Encoding=UTF-8 X-Kate-Version=2.8 X-KDE-Library=katetabifyplugin ServiceTypes=Kate/Plugin Type=Service Icon=korganizer Name=Tabify X-Kate-MajorProfiles=Kate X-Kate-MinorProfiles=* Name of the files has to be inkate yourpluginname.desktopformat. katetabify.desktop IMPORTANT 25. XmlGUI file Tabify Plugin The name of this file has to be ui.rc 26.

    • The Library

class MyPlugin : public Kate::Plugin { Q_OBJECT public: // other methods etc... PluginView *createView(MainWindow *mainWindow) { return new MyPluginView(mainWindow); } }; 27.

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() }; 28. Code http://websvn.kde.org/trunk/KDE/kdesdk/kate/plugins/tabify/ 29. 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 katetabifypluginDESTINATION ${PLUGIN_INSTALL_DIR}) install(FILES ui.rcDESTINATION ${DATA_INSTALL_DIR}/kate/plugins/katetabify) install(FILESkatetabifyplugin.desktopDESTINATION ${SERVICES_INSTALL_DIR}) 30. Referances

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

31. http://kate-editor.org/2004/01/06/writing-a-kate-plugin/ 32. http://kate-editor.org/featured-articles/ 33. Thank You.... Questions??? [email_address] @abhishekworld http://thezeroth.net