If you can't read please download the document
Upload
abhishek-patil
View
607
Download
4
Embed Size (px)
DESCRIPTION
Presentation at Foss.in/2010 on Writing Kate plugin.
Citation preview
2. About me
3. Software Engineer 4. Vcreate Logic Pvt. Ltd (http://vcreatelogic.com) 5. @abhishekworld 6. Why me?
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!
11. Create Tabify Plugin 12. Kate Application base
13. Based on KParts 14. Important classes in KATE
15. Kate::MainWindow 16. Kate::DocumentManager 17. Kate::PluginManager 18. Kate::Plugin 19. Kate::PluginView 20. Kate::PluginConfigPageInterface 21. Bacis of Kate 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.
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
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