• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

data/H06-Mar-2020-10183

docs/H06-Mar-2020-202178

libpeas/H06-Mar-2020-8,0484,529

libpeas-gtk/H06-Mar-2020-3,2642,069

loaders/H06-Mar-2020-2,3891,476

peas-demo/H06-Mar-2020-1,240769

po/H06-Mar-2020-11,7619,420

tests/H06-Mar-2020-8,6675,708

AUTHORSH A D06-Mar-2020604 2216

COPYINGH A D06-Mar-202025.9 KiB503418

NEWSH A D06-Mar-202010.6 KiB525415

READMEH A D06-Mar-20204 KiB9469

libpeas.doapH A D06-Mar-20201.7 KiB4338

license_changeH A D06-Mar-2020638 1715

meson.buildH A D06-Mar-20208.6 KiB282240

README

1Introducing libpeas
2===================
3
4libpeas is a gobject-based plugins engine, and is targetted at giving every
5application the chance to assume its own extensibility. It is currently used by
6several Gnome applications like gedit and Totem.
7
8It takes its roots in the old gedit plugins engine, and provides an extensive set
9of features mirroring the desiderata of most of the applications providing an
10extension framework.
11
12Multiple extension points
13-------------------------
14
15One of the most frustrating limitations of the Gedit plugins engine was that it
16only allows extending a single class, called GeditPlugin. With libpeas, this
17limitation vanishes, and the application writer is now able to provide a set of
18GInterfaces the plugin writer will be able to implement as his plugin requires.
19
20On-demand programming language support
21--------------------------------------
22
23libpeas comes with a set of supported languages (currently, C, Lua 5.1,
24Python 2 and Python 3). Those languages are supported through “loaders” which
25are loaded on demand. What it means is that you only pay for what you use: if
26you have no Python plugin, the Python interpreter won't be loaded in memory.
27Of course, the same goes for the C loader.
28
29Damn simple to use (or at least we try hard)
30--------------------------------------------
31
32Adding support for libpeas-enabled plugins in your own application is a matter
33of minutes. You only have to create an instance of the plugins engine, and
34call methods on the implementations of the various extension points. That's it,
35no clock harmed.
36
37A shared library for everyone
38-----------------------------
39
40As I noted earlier, the latest improvements of our beloved development platform
41made it possible to create bindings for apps very quickly. And with the Gnome 3
42announcement, this looked like the perfect timing to make the plugins engine
43and its latest improvements available to everyone, with a library. Also,
44hopefully it will reduce code duplication and allow bugs to be fixed at the
45right place, once and for all, improving the quality of our applications.
46
47As a member of the Gnome community and as an offspring of gedit, libpeas already
48shares most of the Gnome infrastructure and philosophy:
49
50    * You can download the first release tarball on the Gnome FTP server.
51    * You can browse the source and contribute using our git repository.
52    * You can come and discuss with me and others on #libpeas (GimpNet)
53    * And you can report bug or propose new features through the good old Gnome
54      Bugzilla, against the libpeas module.
55
56A few hints on using libpeas
57============================
58
59As always for the new projects, it can take some time to grasp all the
60subtleties at first.
61
62Plugins versus Extensions
63-------------------------
64
65Something that is going to puzzle most of the newcomers is the fact that the
66libpeas API talks about both plugins and extensions, two terms that are usually
67used interchangeably, but who have very different meanings in libpeas.
68
69Let's try and give a definition of both of these words in this context:
70
71- Plugin: In the context of libpeas, a plugin is a logical package. It's what
72  you will enable or disable from the UI, and at the end it is what the user
73  will see. An example of plugin for gedit would be the file browser plugin.
74
75- Extension. An extension is an object which implements an interface
76  associated to an extension point. There can be several extensions in a single
77  plugin. Examples of extensions provided by the file browser plugin would be
78  the configuration dialog, the left panel pane and a completion provider for
79  file names.
80
81Sample code
82-----------
83
84The libpeas package contains a sample application called peas-demo, and sample
85plugins written in C, Lua and Python.
86
87The global idea is this one: you create a new PeasEngine instance and give it
88the information needed for it to find your plugins. Then you load some plugins
89(you can use the PeasGtkPluginManager for that purpose) and perform actions
90through some PeasExtensions objects you can get from the engine.
91
92
93Copied from http://log.istique.net/2010/announcing-libpeas
94