GeovpfCanvasView

GeovpfCanvasView — A canvas group that represents a set of GeovpfCanvasThemes to be applied to a VPF library.

Synopsis




struct      GeovpfCanvasViewPrivate;
struct      GeovpfCanvasView;
struct      GeovpfCanvasViewClass;

Object Hierarchy


  GObject
   +----GtkObject
         +----FooCanvasItem
               +----FooCanvasGroup
                     +----GeovpfCanvasView

Properties


  "library-pattern"      gchararray           : Read / Write
  "library-selector"     GObject              : Read / Write
  "sticky-deselect"      gboolean             : Read / Write

Description

The GeovpfCanvasView object is a simple canvas group that connects to the GeovpfCanvasSelector. It has special logic to select an appropriate library based on its library_pattern property and pass the library_name into is child GeovpfCanvasTheme objects. A GeovpfCanvasView can be thought of as a set of themes that should be applied to specific type of library.

Here is an example:


        /* The library selector needs to be told which canvas to connect to.
        * After that, all views will look for a singleton instance unless the
        * view "library-selector" property is set explicitly.
        */
        selector = g_object_new(GEOVPF_TYPE_LIBRARY_SELECTOR, "geocanvas",
                        FOO_CANVAS_ITEM(group)->canvas, NULL);
                        
        /* This view will activate select any library that begins with "g".
         * DNC, this is a "general" library.
         */
        general = FOO_CANVAS_GROUP(
                foo_canvas_item_new(group, GEOVPF_TYPE_CANVAS_VIEW,
                        "library_pattern", "g*", 
                        NULL));

        /* This item will draw water */
        foo_canvas_item_new(general, GEOVPF_TYPE_CANVAS_THEME, 
                "coverage", "ecr", 
                "feature_class", "ecrarea",
                "expression", "F_CODE=BA040",
                "fill_color_rgba", 0xD1F4FFFF,
                NULL);
        /* This item will draw mainland and islands */
        foo_canvas_item_new(general, GEOVPF_TYPE_CANVAS_THEME, 
                "coverage", "ecr", 
                "feature_class", "ecrarea",
                "expression", "F_CODE=BA030 or F_CODE=DA010",
                "fill_color_rgba", 0xBDAF1Bff,
                NULL);
        /* This item will draw text features. */
        foo_canvas_item_new(general, GEOVPF_TYPE_CANVAS_THEME,
                "coverage", "ecr",
                "feature_class", "ecrtext",
                "fill_color_rgba", 0x000000FF,
                NULL);

Details

struct GeovpfCanvasViewPrivate

struct GeovpfCanvasViewPrivate;


struct GeovpfCanvasView

struct GeovpfCanvasView;


struct GeovpfCanvasViewClass

struct GeovpfCanvasViewClass {

        FooCanvasGroupClass parent_class;
};

Properties

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

This is the name subject to a 'glob' style pattern match of the library or libraries to be associated with this GeovpfCanvasView. For example, a name of "g*" would match any libraries "gen17a", "gen17b", and more.

"library-selector" (GObject : Read / Write)

This property points to an instance of any GObject that is capable of notifying on a selected_library property. Usual it will connect to an instance of the GeovpfLibrarySelector. It defaults to NULL.

"sticky-deselect" (gboolean : Read / Write)

This property when set will cause this instance to stay activated when a non-matching library is selected by the library_selector after it has been activated once.

See Also

GeovpfLibrarySelector, GeovpfCanvasTheme