GeocvpfLibrarySelector

GeocvpfLibrarySelector — Select the best libraries based on canvas viewport location and dimensions.

Synopsis




                    GeocvpfLibrarySelectorPrivate;
                    GeocvpfLibrarySelector;
                    GeocvpfLibrarySelectorClass;
GeocvpfLibrarySelector* geocvpf_library_selector_get_system
                                                        ();

Object Hierarchy


  GObject
   +----GeocvpfLibrarySelector

Properties


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

Signals


  "select-event"                                   : Run Last

Description

The GeocvpfLibrarySelector can be used with the GeocvpfCanvasView 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.

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

The GeocvpfLibrarySelector can be used with the GeocvpfCanvasView 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 GeocvpfLibrarySelector you must call g_thread_init() and gdk_threads_init() from you main program.

Details

GeocvpfLibrarySelectorPrivate

typedef struct _GeocvpfLibrarySelectorPrivate GeocvpfLibrarySelectorPrivate;


GeocvpfLibrarySelector

typedef struct _GeocvpfLibrarySelector GeocvpfLibrarySelector;


GeocvpfLibrarySelectorClass

typedef struct {
        GObjectClass parent_class;
        int (* rating_function) (gpointer library, double distance);
        /**
         * GeocvpfLibrarySelector::select_event:
         * @selector:
         * @library_name: name of an available library.
         *
         * Each time the just prior to the @available_libraries property notify,
         * the #GeocvpfLibrarySelector 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 #GeocvpfLibrarySelector that this library should be
         * selected.
         */
        gboolean (* select_event) (GeocvpfLibrarySelector *selector, const char
              *library_name);
} GeocvpfLibrarySelectorClass;


geocvpf_library_selector_get_system ()

GeocvpfLibrarySelector* geocvpf_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.

Property Details

The "available-libraries" property

  "available-libraries"      gpointer              : Read

GSList of libraries that fit into the current viewport.


The "geocanvas" property

  "geocanvas"                GeocCanvas            : Write

Reference to the associated Geo Canvas.


The "lock" property

  "lock"                     gboolean              : Read / Write

Causes the presently selected library to be locked.

Default value: FALSE


The "selected-library" property

  "selected-library"         gchararray            : Read / Write

The VPF Library that is currently the best fit.

Default value: ""

Signal Details

The "select-event" signal

gboolean            user_function                      (GeocvpfLibrarySelector *geocvpflibraryselector,
                                                        gchar                  *arg1,
                                                        gpointer                user_data)                   : Run Last

Each time the just prior to the available_libraries property notify, the GeocvpfLibrarySelector 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 GeocvpfLibrarySelector that this library should be selected.

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

See Also

GeocvpfCanvasView