Skip to content

Posts 

Kate: Fast backtrace navigation

Tuesday, 12 August 2008  | Dominik Haumann
I’ve added a new plugin to kdesdk/kate/plugin: a backtrace browser. It’s meant for developers and probably of no use for users. What does it do? It shows a backtrace delivered by gdb in a listview in a Kate toolview. Clicking on an item opens the selected file and jumps to the correct line number. It works for backtraces generated on your own machine, but it will also work for backtraces from other people, i.e. with /home/dummy/qt-copy/…/qwidget.cpp will still be found on other machines. For that to work, you have to index the directories where the source code is located.
Sometimes there are several files with the same name, e.g. Read More

Do you understand the word HTML?

Wednesday, 16 April 2008  | Dominik Haumann

During the Kate developer meeting we also thought about simplifying KWrite and how to make the decision whether KWrite should be launched in full featured mode or in a stripped version. …well, and we found a really funny idea:


Note, that this would even work, the question would be rather annoying, though :) The solution right now is to always start KWrite in a simple mode. Mostly only actions are hidden in the menus (@distributors: kdelibs/kate/data/katepartsimpleui.rc), but you can also change c++ code at Kate part level, as there are some functions:

Read More

Kate Meeting: Day 1 and 2

Tuesday, 15 April 2008  | Dominik Haumann
The Kate Developer Meeting was a productive weekend and once more shows how important the developer sprints are. The summary will be on the dot shortly. Work already started on several topics. As everyone want screenshots, here we go: The new annotation interface available now in KTextEditor can be use to e.g. show svn annotations directly in kate:
basysKom’s coffee maching is simply the best: It can do everything, you just have to press the right key combos: Read More

Kate Developer Sprint 2008 Results

Tuesday, 15 April 2008  | Christoph Cullmann

The below notes is what was decided at the development sprint in Darmstadt on April 11-13, 2008

Short term goals

  1. Scripting, part level QtScript
  2. API for indentation scripts
  3. Sessions handling
  4. make text completion work!
  5. VI-Modes (GSoC-project)

Long term goals

  1. Scripting at application level (Kate): Kross
  2. Combination of highlightings & indentations

Table of Contents

  • Scripting
  • Indentation
  • Kate Sessions
  • Extending the highlighting system (Highlighting combination)
  • Collaborative editing
  • Text input modes (vi mode)
  • Minor topics: Search & Replace, text completion
  • Interface Review
  • Simplifying KWrite

Scripting

  • Use cases
    • indentation
    • helper scripts + assign shortcut
    • useful for vi-mode scripting
  • right now: kjs (barely documented, future uncertain)
  • choices: Kross, QtScript
    • Kross: language independent, depends on available bindings/plugins at runtime
    • QtScript, Kross: simply wrap QObjects (signals/slots, Q_SCRIPTABLE automatically exported)

Kate Part: QtScript

  • flexible integration possible
  • make it fast for specific use cases (e.g. indentation)
  • script header
    • meta information: key/value pairs (type, name, mimetype, wildcard, …)
    • contact i18n people: how to do translation
    • translation possible outside KDE?

Kate App

  • Kross

Indentation

  • allow multiple indenters for documents with mixed languages (e.g. php and html)
    • document variables: e.g. indent-mode [ ];
    • document variables: allow different settings (indent-width, …)
  • remove option “Default Indenter”, it does not make sense (really?)
  • the script header should state which hl-modes it can indent (instead of mimetype/wildcard in the header)

Auto-completion:

  • build word completion plugin into kate part by default
  • fix implementation to actually complete stuff
  • simplfy the popupmenu (!), just as in KDE3
  • remove code completion config dialog, this must be implemented in the code completion model, as this is not applicable to any other than the cpp model. Better have something tiny working instead of a broken monster

Kate Sessions (profiles)

  • data stored:
    • application plugin config
    • file list (opened files)
    • window configuration
    • editor component config
    • ktexteditor plugin config (maybe kpluginselector problems)
  • session level configuration / document variables
  • kill default.katesession file, always use katerc
  • do not show the session chooser at startup, instead, make a good default (katerc)
  • clone session: “save as” opens a small dialog with line edit and options like window config, file list
  • remove option “restore view config” -> simply always do it
  • make sure kate part plugins can save data to sessions: fork kpluginselector, if necessary :)

Highlighting

  • extend highlighting system to allow combined highlighting
    • add e.g. “entercontext” rules
    • separate highlighting loader from hightlight class

Explanation: The purpose of this is to combine template languages such as PHP, EmbPerl, Mason etc with any other syntax highlighting on the fly, as opposed to the current practice which requires a combined set of files to be generated at build time. This is only done for the HTML + PHP combination, so with the new way a multitude of combination becomes available. In addition to that, nothing needs to be regenerated when a highlight is updated, makeing it much easier for users to keep their highlightings updated.

Read More

Kate Meeting: Day 0

Friday, 11 April 2008  | Dominik Haumann
Finally it all begins: Anders and Joseph arrived at basysKom and we’ve started to discuss some things we want to do for KDE 4.1. Later, we are going to meet with the rest of the attendees in a restaurant to get to know each other. The official start of the meeting is tomorrow morning. If you are interested in contributing to Kate, just join #kate on irc.libera.chat. I’m looking forward to the next two days :) Read More

Kate Developer Sprint 2008

Tuesday, 25 March 2008  | Christoph Cullmann
In April there will be a Kate Developer Sprint, similar to previous sprints for Decibel, Akonadi, KDevelop and others. This is a great opportunity as developers interested in development of KDE’s text editor will discuss what to do to make Kate the best text editor on earth. This also means lots of polishing so that Kate in KDE 4.1 will shine even more! The meeting will take place from 2008-04-11 till 2008-04-13. The location is hosted by basysKom in Darmstadt, Germany. Many thanks goes especially to the KDE e.V. for their financial support. If you are interested in Kate development, join our mailing list. More to come, stay tuned! Read More

Encapsulation is not Information Hiding

Friday, 21 December 2007  | Dominik Haumann
As food for thought and in reply to Why Encapsulation is a Good Thing it’s interesting to take a closer look. What does encapsulation mean exactly, and what can you do with it? Maybe what you really want is Information Hiding? …and encapsulation is just a way of possibly achieving it? If you are interested in the details/differences, read the article Encapsulation is not Information Hiding.

Memory Leak Continued

Thursday, 22 November 2007  | Dominik Haumann

There was some confusion with regard to my last blog about leaking memory. Suppose the ui_mywidget.h files looks like this:

class Ui_Widget
{
public:
   QGridLayout *gridLayout;
   QGroupBox *groupBox;
   QGridLayout *gridLayout1;
   QListWidget *listWidget;
   QSpacerItem *spacerItem;
   QPushButton *pushButton;

void setupUi(QWidget *Widget); void retranslateUi(QWidget *Widget); };</pr

Read More

Memory leak: Ui files and direct approach

Wednesday, 21 November 2007  | Dominik Haumann

The KDE codebase often uses a forward declaration in the .h-file to speedup compilation. The code often looks like this:

// header file
namespace Ui { class MyWidget; }
class MyDialog : public KDialog {
  // ...
  private:
    Ui::MyWidget *ui;
};

The impl looks like this:

// source file
#include "mydialog.h"
#include "ui_mywidget.h"
MyDialog::MyDialog() : KDialog()
{
  QWidget *w = new QWidget(this);
  setMainWidget(w);
  ui = new Ui::MyWidget(); // allocation
  ui->setupUi(w);
  // ui->...
}Read More
                
              

Kate Highlighting Power

Wednesday, 12 September 2007  | Dominik Haumann

Kate’s highlighting capabilities are amazing. If you want you can highlight really complex syntax, without having to hardcode rules in C++. As an example, we’ll take a look at how Lua comments can be realized:

  • –[=[ starts a multiline comment (the ‘=’ chars are optional)
  • ]=] ends the multiline comment
  • the number of ‘=’ chars in ]=] must match the number of –[=[

That means: When the highlighting processor matches the end of a multiline comment, it has to know how many ‘=’ chars started the comment. Thanks to the concept of dynamic rules and contexts Kate is able to do that. The highlighting file looks like this. First comes the header

Read More