diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2010-10-27 15:52:36 +0200 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2010-10-27 16:52:00 +0200 |
commit | 9156953cc95cd4d814ea0ad0e9407efc9a6a0a7d (patch) | |
tree | 9bb740c24230eb0d4c5d79fa6ad684ca1f328eb3 /src/ld-symbol.h | |
parent | aa33db342b4fc194cdb4966381ac1e5f44b73465 (diff) | |
download | logdiag-9156953cc95cd4d814ea0ad0e9407efc9a6a0a7d.tar.gz logdiag-9156953cc95cd4d814ea0ad0e9407efc9a6a0a7d.tar.xz logdiag-9156953cc95cd4d814ea0ad0e9407efc9a6a0a7d.zip |
Add more properties to LdSymbol.
Also move the actual storage of symbol properties to implementations
of the abstract LdSymbol class. All the properties are read only.
Diffstat (limited to 'src/ld-symbol.h')
-rw-r--r-- | src/ld-symbol.h | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/src/ld-symbol.h b/src/ld-symbol.h index 4010107..92d7d82 100644 --- a/src/ld-symbol.h +++ b/src/ld-symbol.h @@ -30,6 +30,8 @@ typedef struct _LdSymbol LdSymbol; typedef struct _LdSymbolPrivate LdSymbolPrivate; typedef struct _LdSymbolClass LdSymbolClass; +typedef struct _LdSymbolArea LdSymbolArea; + /** * LdSymbol: @@ -43,26 +45,50 @@ struct _LdSymbol }; /** + * LdSymbolArea: + * @x1: Left-top X coordinate. + * @y1: Left-top Y coordinate. + * @x2: Right-bottom X coordinate. + * @y2: Right-bottom Y coordinate. + * + * Defines the area of the symbol relative to the center of the symbol, + * which is at the (0, 0) coordinates. + */ +struct _LdSymbolArea +{ + gdouble x1, y1; + gdouble x2, y2; +}; + +/** * LdSymbolClass: * @parent_class: The parent class. + * @get_name: Get the name of the symbol. + * @get_human_name: Get the localized human name of the symbol. + * @get_area: Get the area of the symbol. * @draw: Draw the symbol on a Cairo surface. */ struct _LdSymbolClass { GObjectClass parent_class; + const gchar *(*get_name) (LdSymbol *self); + const gchar *(*get_human_name) (LdSymbol *self); + void (*get_area) (LdSymbol *self, LdSymbolArea *area); void (*draw) (LdSymbol *self, cairo_t *cr); }; GType ld_symbol_get_type (void) G_GNUC_CONST; -void ld_symbol_set_name (LdSymbol *self, const gchar *name); const gchar *ld_symbol_get_name (LdSymbol *self); - +const gchar *ld_symbol_get_human_name (LdSymbol *self); +void ld_symbol_get_area (LdSymbol *self, LdSymbolArea *area); void ld_symbol_draw (LdSymbol *self, cairo_t *cr); -/* TODO: Interface for symbol terminals. */ +/* TODO: Interface for terminals. + * Something like a list of gdouble pairs (-> a new structure). + */ G_END_DECLS |