GeovpfLibrarySelector

GeovpfLibrarySelector — Selects best libraries based on canvas viewport location and dimensions.

Synopsis




struct      GeovpfLibrarySelectorPrivate;
struct      GeovpfLibrarySelector;
struct      GeovpfLibrarySelectorClass;
GeovpfLibrarySelector* geovpf_library_selector_get_system
                                            ();

Object Hierarchy


  GObject
   +----GeovpfLibrarySelector

Properties


  "available-libraries"  gpointer             : Read
  "geocanvas"            GeoCanvas            : Write
  "lock"                 gboolean             : Read / Write
  "selected-library"     gchararray           : Read / Write

Signal Prototypes


"select-event"
            gboolean    user_function      (GeovpfLibrarySelector *geovpflibraryselector,
                                            gchar *arg1,
                                            gpointer user_data);

Description

The GeovpfLibrarySelector can be used with the GeovpfCanvasView object to partially automated the selection of libraries based on canvas viewport. Whenever the viewport of the GeoCanvas changes, three signals are emitted. The first signal, the select-event, indicates that a library is available for selection. This event is emitted oncefor each of the available libraries until a listener returns a TRUE value. If a TRUE value is returned, that library is marked to be selected, otherwise the library at the head of the list is marked. The second signal is a notify on the available_libraries property. The available_libraries is a linked list of all libraries that fit the current viewport. Finally, a notify is issued on the selected_library property if it is different than the proeviously selected library.

Note

In order to use GeovpfLibrarySelector you must call g_thread_init() and gdk_threads_init() from you main program.

Details

struct GeovpfLibrarySelectorPrivate

struct GeovpfLibrarySelectorPrivate;


struct GeovpfLibrarySelector

struct GeovpfLibrarySelector;


struct GeovpfLibrarySelectorClass

struct GeovpfLibrarySelectorClass {

        GObjectClass parent_class;
        int (* rating_function) (gpointer library, double distance);
        gboolean (* select_event) (GeovpfLibrarySelector *selector, const char
              *library_name);
};


geovpf_library_selector_get_system ()

GeovpfLibrarySelector* geovpf_library_selector_get_system
                                            ();

Creates a singleton instance if none exists, else will increase the reference count on the singleton by one. Use g_object_unref when finished. Note also that the first g_object_new for this object type will create the singleton instance. The first library selector object created is the system object.

Returns : A singleton instance of the library selector.

Properties

"available-libraries" (gpointer : Read)

GSList of libraries that fit into the current viewport.

"geocanvas" (GeoCanvas : Write)

Reference to the associated Geo Canvas.

"lock" (gboolean : Read / Write)

Causes the presently selected library to be locked.

"selected-library" (gchararray : Read / Write)

The VPF Library that is currently the best fit.

Signals

The "select-event" signal

gboolean    user_function                  (GeovpfLibrarySelector *geovpflibraryselector,
                                            gchar *arg1,
                                            gpointer user_data);

Each time the just prior to the available_libraries property notify, the GeovpfLibrarySelector will issues a series of select-event signals. It will signal once for each library to be put into the available_libraries list. Until a listening object returns a TRUE indicating to the GeovpfLibrarySelector that this library should be selected.

geovpflibraryselector :the object which received the signal.
arg1 :
user_data :user data set when the signal handler was connected.
Returns :

See Also

GeovpfCanvasView