File: KstDataSources

package info (click to toggle)
kst 2.0.8-6
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 30,748 kB
  • sloc: cpp: 97,086; ansic: 13,364; python: 2,970; sh: 761; yacc: 184; lex: 143; makefile: 141; javascript: 122; perl: 30; xml: 30
file content (40 lines) | stat: -rw-r--r-- 1,257 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
KstDataSource Plugins
---------------------

The purpose of a KstDataSource plugin is to provide an implementation of the
virtual class "KstDataSource".  By default this class does nothing, which means
that there is no direct way to load external data into Kst.  Such a plugin
provides three symbols:

extern "C" {
// Create a data source.
KstDataSource *create_<libname>(const QString& filename, const QString& type);

// Does this plugin understand the file indicated by the argument?
bool understands_<libname>(const QString& filename);

// Which types of data does this plugin provide a data source for?
QStringList provides_<libname>();
}

Generally you will have to create one or more derived classes of KstDataSource
which implement your I/O system.

Along with the shared object, you must also create a desktop file:

=> kstdata_myplugin.desktop

[Desktop Entry]
Encoding=UTF-8
Type=Service
ServiceTypes=Kst Data Source
X-KDE-ModuleType=Plugin
X-KDE-Library=myplugin
X-Kst-Plugin-Author=Your Name
X-Kst-Plugin-Version=0.1
Name=My Plugin
Comment=A long description of what this thing actually does.


You can find a template datasource plugin in kst/datasources/template/.  It
includes a proper Makefile.am, source files, and a desktop service file.