GNOME Clipboard Manager - Documentation
Introduction
Index
About
GNOME Clipboard Manager is an application to manage your selections a.k.a. clipboards.
Short: GNOME Clipboard Manager for Gnome 2.0 desktops (Gcm-2) is an application for managing
selections a.k.a. clipboards and their available targets. It auto- collects selections and their
targets on a shelf and has the option to choose which selection is to be pasted when an applications
sends a request for the selection (a.k.a. the clipboard) in a specific target. Selections can be edited,
manually created, merged, deleted, saved to files, loaded from files, copied, and pasted. The available
selection types are clipboard, primary, secondary or a custom atom.
Details
(This information might or might not be correct, please send corrections
to me if you think something is wrong here. I am not an X-specialist :)
Because the clipboard in X uses a few names and words that are
not the same in the Microsoft Windows world, I've made a small
data dictionary. Not all of these words are used on this webpage
but its good to understand a few basics about X before starting
to use the GNOME Clipboard Manager :
- A widget: A widget is a (graphical) object (in X). For example
a textbox, button and label are all .. widgets. But also your
entire screen is a widget. A window (as in, a window that is managed
by your windowmanager) is also a widget and will most likely contain other
widgets. Generally spoken, you can say that
most X-applications are a collection of widgets. Each of those
widgets have a few properties, signals and possible methods that you
can use on them. You can compare them with objects in Object Oriented Programming.
Signals occur for example on an event like "clicked" or "mouse over". But also on
less obvious things like "selection received" or "I got a request from a widget
to give the selection that I am owning" and "I have lost the selectionownership".
When such a Signal occurs then a function (a block of code) in your application
will be executed. We, programmers, call this a callback function.
If you ever saw the name GtkWidget, then now you know that this is the Gtk-abstraction
of a widget. A GtkWidget is an undefined widget, most of the times it must be casted
to a real widget like a GtkButton or a GtkLabel. These widgets can be anything, like
custom GtkWidgets that are coded by the programmer. A widget in X is sometimes also
called a Window. A Window in X is a very abstract definition of an object
in X, a Window that is managed by your WindowManager will become draggable on your
screen using the mice and can function as a container for other Windows. Generally
spoken you can say that a Window is a Widget.
- A selection: A selection is "what you selected" in your session. So, in case you
selected some text in application "e" then the selection is the text
that you selected.
- The selectionowner: The selectionowner is the widget (Window) that
holds the selection. For example if a textbox holds the selected
text then this textbox is the selection owner. Note that there are a few
selections available in X : The CLIPBOARD, PRIMARY and SECONDARY selection.
The CLIPBOARD is the property used when typing CTRL+C after selecting something,
the PRIMARY is the selection that is used when only selecting something and the
SECONDARY is the selection that got lost last time (the gray selected text).
- The parent of a widget: Most widgets have a parent. That is
the container widget that holds the widget. A parent can also have
a parent of course. So it is like a tree of Widgets.
- Some of you guys probably already noticed that the "clipboard"
in X works with owners and requests. Microsoft Windows has a
seperated mecanism for the clipboard. They hold the last selection
for you in some allocated memory and claim selectionownership on an
object that never dies and that is part of the Operating System.
That is not how X works with clipboards. In X a Widget must claim the ownership of
the selection. This means that from that point on, that widget decides
what it will give when another widgets requests the selection data.
So, actually, your application is more in control when another applications
requests the clipboard (a.k.a the selection). That is also the reason why you cannot
keep your clipboard when you closed the application of which are copying from.
(Some windowmanagers like have tried solved this by passing the selection to
an object that does exist). When using Gnome Clipboard Manager, you will never
loose your selections if you don't quit Gnome Clipboard Manager as Gnome
Clipboard Manager automagically takes over the selection once it has been
set by another application.
(*) One problem with the way X handles the clipboard is that you cannot
know when something {an application, a widget or an object} claimed ownership of the selection. You
can only know when you "lost" ownership. GNOME Clipboard Manager will
claim ownership, and when it loses that ownership.. it gets the
(new) selection from the new selectionowner and reclaims selection ownership. I don't know if that is
the "best" solution but it's "a" solution, and it currently works perfectly.
Required
- (CVS only) Autoconf, Automake etc
- A C compiler (like gcc), GNU's make tools, etc
- A complete Gnome 2.0 development environment
- libgnomeui-2 and GTK+-2
- LibGnomeUi-2 -and gtk+-2 development libs
- GConf-2 and GConf-2 development libs
Help programming and other contributions
- Yes, you can help me :). I am looking for people who want to help developping GCM.
Also documentation contributions, packages and suggestions are more then welcome.
CVS
Reference