Changed the object prefix from "logdiag" to "ld".

It was just too long to type and read. My mistake.
This commit is contained in:
Přemysl Eric Janouch 2010-09-17 19:16:53 +02:00
parent 341f51eb41
commit 354e54826f
10 changed files with 284 additions and 283 deletions

View File

@ -20,39 +20,39 @@
/** /**
* SECTION:ld-canvas * SECTION:ld-canvas
* @short_description: A canvas. * @short_description: A canvas.
* @see_also: #LogdiagDocument * @see_also: #LdDocument
* *
* #LogdiagCanvas is used for displaying #LogdiagDocument objects. * #LdCanvas is used for displaying #LdDocument objects.
*/ */
/* /*
* LogdiagCanvasPrivate: * LdCanvasPrivate:
* @document: A document object assigned to this canvas as a model. * @document: A document object assigned to this canvas as a model.
*/ */
struct _LogdiagCanvasPrivate struct _LdCanvasPrivate
{ {
LogdiagDocument *document; LdDocument *document;
}; };
G_DEFINE_TYPE (LogdiagCanvas, logdiag_canvas, GTK_TYPE_DRAWING_AREA); G_DEFINE_TYPE (LdCanvas, ld_canvas, GTK_TYPE_DRAWING_AREA);
static void static void
logdiag_canvas_finalize (GObject *gobject); ld_canvas_finalize (GObject *gobject);
static void static void
logdiag_canvas_class_init (LogdiagCanvasClass *klass) ld_canvas_class_init (LdCanvasClass *klass)
{ {
GObjectClass *object_class; GObjectClass *object_class;
GtkWidgetClass *widget_class; GtkWidgetClass *widget_class;
object_class = G_OBJECT_CLASS (klass); object_class = G_OBJECT_CLASS (klass);
object_class->finalize = logdiag_canvas_finalize; object_class->finalize = ld_canvas_finalize;
widget_class = GTK_WIDGET_CLASS (klass); widget_class = GTK_WIDGET_CLASS (klass);
/** /**
* LogdiagCanvas::set-scroll-adjustments: * LdCanvas::set-scroll-adjustments:
* @canvas: The canvas object. * @canvas: The canvas object.
* *
* Contents of the library have changed. * Contents of the library have changed.
@ -61,39 +61,39 @@ logdiag_canvas_class_init (LogdiagCanvasClass *klass)
widget_class->set_scroll_adjustments_signal = g_signal_new widget_class->set_scroll_adjustments_signal = g_signal_new
("set-scroll-adjustments", G_TYPE_FROM_CLASS (widget_class), ("set-scroll-adjustments", G_TYPE_FROM_CLASS (widget_class),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
0, // G_STRUCT_OFFSET (LogdiagCanvasClass, ...) 0, // G_STRUCT_OFFSET (LdCanvasClass, ...)
NULL, NULL, NULL, NULL,
gtk_marshal_NONE__POINTER_POINTER, gtk_marshal_NONE__POINTER_POINTER,
G_TYPE_NONE, 2, GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT); G_TYPE_NONE, 2, GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT);
*/ */
g_type_class_add_private (klass, sizeof (LogdiagCanvasPrivate)); g_type_class_add_private (klass, sizeof (LdCanvasPrivate));
} }
static void static void
logdiag_canvas_init (LogdiagCanvas *self) ld_canvas_init (LdCanvas *self)
{ {
self->priv = G_TYPE_INSTANCE_GET_PRIVATE self->priv = G_TYPE_INSTANCE_GET_PRIVATE
(self, LOGDIAG_TYPE_CANVAS, LogdiagCanvasPrivate); (self, LD_TYPE_CANVAS, LdCanvasPrivate);
} }
static void static void
logdiag_canvas_finalize (GObject *gobject) ld_canvas_finalize (GObject *gobject)
{ {
LogdiagCanvas *self; LdCanvas *self;
self = LOGDIAG_CANVAS (gobject); self = LD_CANVAS (gobject);
/* Chain up to the parent class. */ /* Chain up to the parent class. */
G_OBJECT_CLASS (logdiag_canvas_parent_class)->finalize (gobject); G_OBJECT_CLASS (ld_canvas_parent_class)->finalize (gobject);
} }
/** /**
* logdiag_canvas_new: * ld_canvas_new:
* *
* Create an instance. * Create an instance.
*/ */
LogdiagCanvas * LdCanvas *
logdiag_canvas_new (void) ld_canvas_new (void)
{ {
return g_object_new (LOGDIAG_TYPE_CANVAS, NULL); return g_object_new (LD_TYPE_CANVAS, NULL);
} }

View File

@ -8,52 +8,52 @@
* *
*/ */
#ifndef __CANVAS_H__ #ifndef __LD_CANVAS_H__
#define __CANVAS_H__ #define __LD_CANVAS_H__
G_BEGIN_DECLS G_BEGIN_DECLS
#define LOGDIAG_TYPE_CANVAS (logdiag_canvas_get_type ()) #define LD_TYPE_CANVAS (ld_canvas_get_type ())
#define LOGDIAG_CANVAS(obj) (G_TYPE_CHECK_INSTANCE_CAST \ #define LD_CANVAS(obj) (G_TYPE_CHECK_INSTANCE_CAST \
((obj), LOGDIAG_TYPE_CANVAS, LogdiagCanvas)) ((obj), LD_TYPE_CANVAS, LdCanvas))
#define LOGDIAG_CANVAS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST \ #define LD_CANVAS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST \
((klass), LOGDIAG_TYPE_CANVAS, LogdiagCanvasClass)) ((klass), LD_TYPE_CANVAS, LdCanvasClass))
#define LOGDIAG_IS_CANVAS(obj) (G_TYPE_CHECK_INSTANCE_TYPE \ #define LD_IS_CANVAS(obj) (G_TYPE_CHECK_INSTANCE_TYPE \
((obj), LOGDIAG_TYPE_CANVAS)) ((obj), LD_TYPE_CANVAS))
#define LOGDIAG_IS_CANVAS_CLASS(klass) (G_TYPE_CHECK_INSTANCE_TYPE \ #define LD_IS_CANVAS_CLASS(klass) (G_TYPE_CHECK_INSTANCE_TYPE \
((klass), LOGDIAG_TYPE_CANVAS)) ((klass), LD_TYPE_CANVAS))
#define LOGDIAG_CANVAS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS \ #define LD_CANVAS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS \
((obj), LOGDIAG_CANVAS, LogdiagCanvasClass)) ((obj), LD_CANVAS, LdCanvasClass))
typedef struct _LogdiagCanvas LogdiagCanvas; typedef struct _LdCanvas LdCanvas;
typedef struct _LogdiagCanvasPrivate LogdiagCanvasPrivate; typedef struct _LdCanvasPrivate LdCanvasPrivate;
typedef struct _LogdiagCanvasClass LogdiagCanvasClass; typedef struct _LdCanvasClass LdCanvasClass;
/** /**
* LogdiagCanvas: * LdCanvas:
*/ */
struct _LogdiagCanvas struct _LdCanvas
{ {
/*< private >*/ /*< private >*/
GtkDrawingArea parent_instance; GtkDrawingArea parent_instance;
LogdiagCanvasPrivate *priv; LdCanvasPrivate *priv;
/*< public >*/ /*< public >*/
}; };
struct _LogdiagCanvasClass struct _LdCanvasClass
{ {
GtkDrawingAreaClass parent_class; GtkDrawingAreaClass parent_class;
}; };
GType logdiag_canvas_get_type (void) G_GNUC_CONST; GType ld_canvas_get_type (void) G_GNUC_CONST;
LogdiagCanvas *logdiag_canvas_new (void); LdCanvas *ld_canvas_new (void);
G_END_DECLS G_END_DECLS
#endif /* ! __CANVAS_H__ */ #endif /* ! __LD_CANVAS_H__ */

View File

@ -8,33 +8,33 @@
* *
*/ */
#ifndef __DOCUMENT_H__ #ifndef __LD_DOCUMENT_H__
#define __DOCUMENT_H__ #define __LD_DOCUMENT_H__
G_BEGIN_DECLS G_BEGIN_DECLS
#define LOGDIAG_TYPE_DOCUMENT (logdiag_symbol_library_get_type ()) #define LD_TYPE_DOCUMENT (ld_symbol_library_get_type ())
#define LOGDIAG_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST \ #define LD_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST \
((obj), LOGDIAG_TYPE_DOCUMENT, LogdiagDocument)) ((obj), LD_TYPE_DOCUMENT, LdDocument))
#define LOGDIAG_DOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST \ #define LD_DOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST \
((klass), LOGDIAG_TYPE_DOCUMENT, LogdiagDocumentClass)) ((klass), LD_TYPE_DOCUMENT, LdDocumentClass))
#define LOGDIAG_IS_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE \ #define LD_IS_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE \
((obj), LOGDIAG_TYPE_DOCUMENT)) ((obj), LD_TYPE_DOCUMENT))
#define LOGDIAG_IS_DOCUMENT_CLASS(klass) (G_TYPE_CHECK_INSTANCE_TYPE \ #define LD_IS_DOCUMENT_CLASS(klass) (G_TYPE_CHECK_INSTANCE_TYPE \
((klass), LOGDIAG_TYPE_DOCUMENT)) ((klass), LD_TYPE_DOCUMENT))
#define LOGDIAG_DOCUMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS \ #define LD_DOCUMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS \
((obj), LOGDIAG_DOCUMENT, LogdiagDocumentClass)) ((obj), LD_DOCUMENT, LdDocumentClass))
typedef struct _LogdiagDocument LogdiagDocument; typedef struct _LdDocument LdDocument;
/*typedef struct _LogdiagDocumentPrivate LogdiagDocumentPrivate;*/ /*typedef struct _LdDocumentPrivate LdDocumentPrivate;*/
typedef struct _LogdiagDocumentClass LogdiagDocumentClass; typedef struct _LdDocumentClass LdDocumentClass;
/** /**
* LogdiagDocument: * LdDocument:
*/ */
struct _LogdiagDocument struct _LdDocument
{ {
/*< private >*/ /*< private >*/
GObject parent_instance; GObject parent_instance;
@ -42,24 +42,24 @@ struct _LogdiagDocument
/*< public >*/ /*< public >*/
}; };
struct _LogdiagDocumentClass struct _LdDocumentClass
{ {
GObjectClass parent_class; GObjectClass parent_class;
}; };
GType logdiag_document_get_type (void) G_GNUC_CONST; GType ld_document_get_type (void) G_GNUC_CONST;
LogdiagDocument *logdiag_document_new (void); LdDocument *ld_document_new (void);
gboolean logdiag_document_new_from_file (const char *file_name, GError *error); gboolean ld_document_new_from_file (const char *file_name, GError *error);
gboolean logdiag_document_save_to_file (const char *file_name, GError *error); gboolean ld_document_save_to_file (const char *file_name, GError *error);
#if 0 #if 0
/* /*
* LogdiagDocumentPrivate: * LdDocumentPrivate:
* @objects: All the objects in the document. * @objects: All the objects in the document.
*/ */
struct _LogdiagDocumentPrivate struct _LdDocumentPrivate
{ {
GSList *objects; GSList *objects;
}; };
@ -68,24 +68,25 @@ struct _LogdiagDocumentPrivate
signal documentChanged (...); signal documentChanged (...);
/* TODO: A list of objects: */ /* TODO: A list of objects: */
LogdiagDocumentSymbol LdDocumentSymbol
LogdiagDocumentLabel LdDocumentLabel
logdiag_document_add_symbol (LogdiagSymbol *symbol, x, y); ld_document_add_symbol (LdSymbol *symbol, x, y);
/* XXX: Separated lists of objects /* XXX: Separated lists of objects
* or a single list for all objects? * or a single list for all objects?
*/ */
/* TODO: Wires. */ /* TODO: Wires. */
logdiag_document_selection_... ld_document_selection_...
logdiag_document_selection_get_json (LogdiagDocument *self); ld_document_selection_get_json (LdDocument *self);
logdiag_document_insert_json (LogdiagDocument *self); ld_document_insert_json (LdDocument *self);
/** Go back or forward in the history of changes. */ /** Go back or forward in the history of changes. */
/* TODO: An interface that informs about the history. */ /* TODO: An interface that informs about the history. */
logdiag_document_history_go (LogdiagDocument *self); ld_document_history_go (LdDocument *self);
#endif /* 0 */ #endif /* 0 */
G_END_DECLS G_END_DECLS
#endif /* ! __DOCUMENT_H__ */ #endif /* ! __LD_DOCUMENT_H__ */

View File

@ -8,37 +8,37 @@
* *
*/ */
#ifndef __SYMBOL_CATEGORY_H__ #ifndef __LD_SYMBOL_CATEGORY_H__
#define __SYMBOL_CATEGORY_H__ #define __LD_SYMBOL_CATEGORY_H__
G_BEGIN_DECLS G_BEGIN_DECLS
#define LOGDIAG_TYPE_SYMBOL_CATEGORY (logdiag_symbol_category_get_type ()) #define LD_TYPE_SYMBOL_CATEGORY (ld_symbol_category_get_type ())
#define LOGDIAG_SYMBOL_CATEGORY(obj) (G_TYPE_CHECK_INSTANCE_CAST \ #define LD_SYMBOL_CATEGORY(obj) (G_TYPE_CHECK_INSTANCE_CAST \
((obj), LOGDIAG_TYPE_SYMBOL_CATEGORY, LogdiagSymbolCategory)) ((obj), LD_TYPE_SYMBOL_CATEGORY, LdSymbolCategory))
#define LOGDIAG_SYMBOL_CATEGORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST \ #define LD_SYMBOL_CATEGORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST \
((klass), LOGDIAG_TYPE_SYMBOL_CATEGORY, LogdiagSymbolCategoryClass)) ((klass), LD_TYPE_SYMBOL_CATEGORY, LdSymbolCategoryClass))
#define LOGDIAG_IS_SYMBOL_CATEGORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE \ #define LD_IS_SYMBOL_CATEGORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE \
((obj), LOGDIAG_TYPE_SYMBOL_CATEGORY)) ((obj), LD_TYPE_SYMBOL_CATEGORY))
#define LOGDIAG_IS_SYMBOL_CATEGORY_CLASS(klass) (G_TYPE_CHECK_INSTANCE_TYPE \ #define LD_IS_SYMBOL_CATEGORY_CLASS(klass) (G_TYPE_CHECK_INSTANCE_TYPE \
((klass), LOGDIAG_TYPE_SYMBOL_CATEGORY)) ((klass), LD_TYPE_SYMBOL_CATEGORY))
#define LOGDIAG_SYMBOL_CATEGORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS \ #define LD_SYMBOL_CATEGORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS \
((obj), LOGDIAG_SYMBOL_CATEGORY, LogdiagSymbolCategoryClass)) ((obj), LD_SYMBOL_CATEGORY, LdSymbolCategoryClass))
typedef struct _LogdiagSymbolCategory LogdiagSymbolCategory; typedef struct _LdSymbolCategory LdSymbolCategory;
typedef struct _LogdiagSymbolCategoryClass LogdiagSymbolCategoryClass; typedef struct _LdSymbolCategoryClass LdSymbolCategoryClass;
/** /**
* LogdiagSymbolCategory: * LdSymbolCategory:
* @parent: The parent object, may be LogdiagSymbolLibrary * @parent: The parent object, may be LdSymbolLibrary
* or another LogdiagSymbolCategory. * or another LdSymbolCategory.
* @name: The name of the category. * @name: The name of the category.
* @image_path: Path to the image for this category. * @image_path: Path to the image for this category.
* @children: Children of this category. * @children: Children of this category.
*/ */
struct _LogdiagSymbolCategory struct _LdSymbolCategory
{ {
/*< private >*/ /*< private >*/
GObject parent_instance; GObject parent_instance;
@ -50,19 +50,19 @@ struct _LogdiagSymbolCategory
GHashTable *children; GHashTable *children;
}; };
struct _LogdiagSymbolCategoryClass struct _LdSymbolCategoryClass
{ {
GObjectClass parent_class; GObjectClass parent_class;
}; };
GType logdiag_symbol_category_get_type (void) G_GNUC_CONST; GType ld_symbol_category_get_type (void) G_GNUC_CONST;
LogdiagSymbolCategory * LdSymbolCategory *
logdiag_symbol_category_new (LogdiagSymbolLibrary *parent); ld_symbol_category_new (LdSymbolLibrary *parent);
G_END_DECLS G_END_DECLS
#endif /* ! __SYMBOL_CATEGORY_H__ */ #endif /* ! __LD_SYMBOL_CATEGORY_H__ */

View File

@ -23,36 +23,36 @@
/** /**
* SECTION:ld-symbol-library * SECTION:ld-symbol-library
* @short_description: A symbol library. * @short_description: A symbol library.
* @see_also: #LogdiagSymbol, #LogdiagSymbolCategory * @see_also: #LdSymbol, #LdSymbolCategory
* *
* #LogdiagSymbolLibrary is used for loading symbols from their files. * #LdSymbolLibrary is used for loading symbols from their files.
*/ */
/* /*
* LogdiagSymbolLibraryPrivate: * LdSymbolLibraryPrivate:
* @lua_state: Lua state. * @lua_state: Lua state.
*/ */
struct _LogdiagSymbolLibraryPrivate struct _LdSymbolLibraryPrivate
{ {
lua_State *lua_state; lua_State *lua_state;
}; };
G_DEFINE_TYPE (LogdiagSymbolLibrary, logdiag_symbol_library, G_TYPE_OBJECT); G_DEFINE_TYPE (LdSymbolLibrary, ld_symbol_library, G_TYPE_OBJECT);
static void static void
logdiag_symbol_library_finalize (GObject *gobject); ld_symbol_library_finalize (GObject *gobject);
static void static void
logdiag_symbol_library_class_init (LogdiagSymbolLibraryClass *klass) ld_symbol_library_class_init (LdSymbolLibraryClass *klass)
{ {
GObjectClass *object_class; GObjectClass *object_class;
object_class = G_OBJECT_CLASS (klass); object_class = G_OBJECT_CLASS (klass);
object_class->finalize = logdiag_symbol_library_finalize; object_class->finalize = ld_symbol_library_finalize;
/** /**
* LogdiagSymbolLibrary::changed: * LdSymbolLibrary::changed:
* @library: The library object. * @library: The library object.
* *
* Contents of the library have changed. * Contents of the library have changed.
@ -62,14 +62,14 @@ logdiag_symbol_library_class_init (LogdiagSymbolLibraryClass *klass)
G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS,
0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
g_type_class_add_private (klass, sizeof (LogdiagSymbolLibraryPrivate)); g_type_class_add_private (klass, sizeof (LdSymbolLibraryPrivate));
} }
static void static void
logdiag_symbol_library_init (LogdiagSymbolLibrary *self) ld_symbol_library_init (LdSymbolLibrary *self)
{ {
self->priv = G_TYPE_INSTANCE_GET_PRIVATE self->priv = G_TYPE_INSTANCE_GET_PRIVATE
(self, LOGDIAG_TYPE_SYMBOL_LIBRARY, LogdiagSymbolLibraryPrivate); (self, LD_TYPE_SYMBOL_LIBRARY, LdSymbolLibraryPrivate);
/* TODO: lua */ /* TODO: lua */
self->priv->lua_state = NULL; self->priv->lua_state = NULL;
@ -79,27 +79,27 @@ logdiag_symbol_library_init (LogdiagSymbolLibrary *self)
} }
static void static void
logdiag_symbol_library_finalize (GObject *gobject) ld_symbol_library_finalize (GObject *gobject)
{ {
LogdiagSymbolLibrary *self; LdSymbolLibrary *self;
self = LOGDIAG_SYMBOL_LIBRARY (gobject); self = LD_SYMBOL_LIBRARY (gobject);
g_hash_table_destroy (self->categories); g_hash_table_destroy (self->categories);
/* Chain up to the parent class. */ /* Chain up to the parent class. */
G_OBJECT_CLASS (logdiag_symbol_library_parent_class)->finalize (gobject); G_OBJECT_CLASS (ld_symbol_library_parent_class)->finalize (gobject);
} }
/** /**
* logdiag_symbol_library_new: * ld_symbol_library_new:
* *
* Create an instance. * Create an instance.
*/ */
LogdiagSymbolLibrary * LdSymbolLibrary *
logdiag_symbol_library_new (void) ld_symbol_library_new (void)
{ {
return g_object_new (LOGDIAG_TYPE_SYMBOL_LIBRARY, NULL); return g_object_new (LD_TYPE_SYMBOL_LIBRARY, NULL);
} }
/* /*
@ -110,13 +110,13 @@ logdiag_symbol_library_new (void)
* *
* Loads a category into the library. * Loads a category into the library.
*/ */
static LogdiagSymbolCategory * static LdSymbolCategory *
load_category (LogdiagSymbolLibrary *self, const char *path, const char *name) load_category (LdSymbolLibrary *self, const char *path, const char *name)
{ {
LogdiagSymbolCategory *cat; LdSymbolCategory *cat;
gchar *icon_file; gchar *icon_file;
g_return_val_if_fail (LOGDIAG_IS_SYMBOL_LIBRARY (self), NULL); g_return_val_if_fail (LD_IS_SYMBOL_LIBRARY (self), NULL);
g_return_val_if_fail (path != NULL, NULL); g_return_val_if_fail (path != NULL, NULL);
g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (name != NULL, NULL);
@ -134,26 +134,26 @@ load_category (LogdiagSymbolLibrary *self, const char *path, const char *name)
/* TODO: Search for category.json and read the category name from it. */ /* TODO: Search for category.json and read the category name from it. */
/* TODO: Search for xyz.lua and load the objects into the category. */ /* TODO: Search for xyz.lua and load the objects into the category. */
cat = logdiag_symbol_category_new (self); cat = ld_symbol_category_new (self);
cat->name = g_strdup (name); cat->name = g_strdup (name);
cat->image_path = icon_file; cat->image_path = icon_file;
return cat; return cat;
} }
/** /**
* logdiag_symbol_library_load: * ld_symbol_library_load:
* @self: A symbol library object. * @self: A symbol library object.
* @directory: A directory to be loaded. * @directory: A directory to be loaded.
* *
* Load the contents of a directory into the library. * Load the contents of a directory into the library.
*/ */
gboolean gboolean
logdiag_symbol_library_load (LogdiagSymbolLibrary *self, const char *path) ld_symbol_library_load (LdSymbolLibrary *self, const char *path)
{ {
GDir *dir; GDir *dir;
const gchar *item; const gchar *item;
g_return_val_if_fail (LOGDIAG_IS_SYMBOL_LIBRARY (self), FALSE); g_return_val_if_fail (LD_IS_SYMBOL_LIBRARY (self), FALSE);
g_return_val_if_fail (path != NULL, FALSE); g_return_val_if_fail (path != NULL, FALSE);
dir = g_dir_open (path, 0, NULL); dir = g_dir_open (path, 0, NULL);
@ -162,7 +162,7 @@ logdiag_symbol_library_load (LogdiagSymbolLibrary *self, const char *path)
while ((item = g_dir_read_name (dir))) while ((item = g_dir_read_name (dir)))
{ {
LogdiagSymbolCategory *cat; LdSymbolCategory *cat;
gchar *categ_path; gchar *categ_path;
categ_path = g_build_filename (path, item, NULL); categ_path = g_build_filename (path, item, NULL);
@ -176,15 +176,15 @@ logdiag_symbol_library_load (LogdiagSymbolLibrary *self, const char *path)
} }
/** /**
* logdiag_symbol_library_clear: * ld_symbol_library_clear:
* @self: A symbol library object. * @self: A symbol library object.
* *
* Clears all the contents. * Clears all the contents.
*/ */
void void
logdiag_symbol_library_clear (LogdiagSymbolLibrary *self) ld_symbol_library_clear (LdSymbolLibrary *self)
{ {
g_return_if_fail (LOGDIAG_IS_SYMBOL_LIBRARY (self)); g_return_if_fail (LD_IS_SYMBOL_LIBRARY (self));
g_hash_table_remove_all (self->categories); g_hash_table_remove_all (self->categories);
return; return;
@ -196,28 +196,28 @@ logdiag_symbol_library_clear (LogdiagSymbolLibrary *self)
/** /**
* SECTION:ld-symbol-category * SECTION:ld-symbol-category
* @short_description: A category of symbols. * @short_description: A category of symbols.
* @see_also: #LogdiagSymbol, #LogdiagSymbolLibrary * @see_also: #LdSymbol, #LdSymbolLibrary
* *
* #LogdiagSymbolCategory represents a category of #LogdiagSymbol objects. * #LdSymbolCategory represents a category of #LdSymbol objects.
*/ */
G_DEFINE_TYPE (LogdiagSymbolCategory, logdiag_symbol_category, G_TYPE_OBJECT); G_DEFINE_TYPE (LdSymbolCategory, ld_symbol_category, G_TYPE_OBJECT);
static void static void
logdiag_symbol_category_finalize (GObject *gobject); ld_symbol_category_finalize (GObject *gobject);
static void static void
logdiag_symbol_category_class_init (LogdiagSymbolCategoryClass *klass) ld_symbol_category_class_init (LdSymbolCategoryClass *klass)
{ {
GObjectClass *object_class; GObjectClass *object_class;
object_class = G_OBJECT_CLASS (klass); object_class = G_OBJECT_CLASS (klass);
object_class->finalize = logdiag_symbol_category_finalize; object_class->finalize = ld_symbol_category_finalize;
} }
static void static void
logdiag_symbol_category_init (LogdiagSymbolCategory *self) ld_symbol_category_init (LdSymbolCategory *self)
{ {
/* TODO: use _new_full, correct equal and specify destroy functions. */ /* TODO: use _new_full, correct equal and specify destroy functions. */
/* XXX: How's the situation with subcategory names and symbol names /* XXX: How's the situation with subcategory names and symbol names
@ -227,11 +227,11 @@ logdiag_symbol_category_init (LogdiagSymbolCategory *self)
} }
static void static void
logdiag_symbol_category_finalize (GObject *gobject) ld_symbol_category_finalize (GObject *gobject)
{ {
LogdiagSymbolCategory *self; LdSymbolCategory *self;
self = LOGDIAG_SYMBOL_CATEGORY (gobject); self = LD_SYMBOL_CATEGORY (gobject);
if (self->name) if (self->name)
g_free (self->name); g_free (self->name);
@ -242,21 +242,21 @@ logdiag_symbol_category_finalize (GObject *gobject)
g_hash_table_destroy (self->children); g_hash_table_destroy (self->children);
/* Chain up to the parent class. */ /* Chain up to the parent class. */
G_OBJECT_CLASS (logdiag_symbol_category_parent_class)->finalize (gobject); G_OBJECT_CLASS (ld_symbol_category_parent_class)->finalize (gobject);
} }
/** /**
* logdiag_symbol_category_new: * ld_symbol_category_new:
* @parent: The parent library for this category. * @parent: The parent library for this category.
* *
* Create an instance. * Create an instance.
*/ */
LogdiagSymbolCategory * LdSymbolCategory *
logdiag_symbol_category_new (LogdiagSymbolLibrary *parent) ld_symbol_category_new (LdSymbolLibrary *parent)
{ {
LogdiagSymbolCategory *cat; LdSymbolCategory *cat;
cat = g_object_new (LOGDIAG_TYPE_SYMBOL_CATEGORY, NULL); cat = g_object_new (LD_TYPE_SYMBOL_CATEGORY, NULL);
cat->parent = parent; cat->parent = parent;
g_object_ref (parent); g_object_ref (parent);
@ -270,71 +270,71 @@ logdiag_symbol_category_new (LogdiagSymbolLibrary *parent)
/** /**
* SECTION:ld-symbol * SECTION:ld-symbol
* @short_description: A symbol. * @short_description: A symbol.
* @see_also: #LogdiagDocument, #LogdiagCanvas * @see_also: #LdDocument, #LdCanvas
* *
* #LogdiagSymbol represents a symbol in the #LogdiagDocument that is in turn * #LdSymbol represents a symbol in the #LdDocument that is in turn
* drawn onto the #LogdiagCanvas. * drawn onto the #LdCanvas.
*/ */
/* /*
* LogdiagSymbolPrivate: * LdSymbolPrivate:
* @library: The parent LogdiagSymbolLibrary. * @library: The parent LdSymbolLibrary.
* The library contains the real function for rendering. * The library contains the real function for rendering.
*/ */
struct _LogdiagSymbolPrivate struct _LdSymbolPrivate
{ {
LogdiagSymbolLibrary *library; LdSymbolLibrary *library;
}; };
G_DEFINE_TYPE (LogdiagSymbol, logdiag_symbol, G_TYPE_OBJECT); G_DEFINE_TYPE (LdSymbol, ld_symbol, G_TYPE_OBJECT);
static void static void
logdiag_symbol_finalize (GObject *gobject); ld_symbol_finalize (GObject *gobject);
static void static void
logdiag_symbol_class_init (LogdiagSymbolClass *klass) ld_symbol_class_init (LdSymbolClass *klass)
{ {
GObjectClass *object_class; GObjectClass *object_class;
object_class = G_OBJECT_CLASS (klass); object_class = G_OBJECT_CLASS (klass);
object_class->finalize = logdiag_symbol_finalize; object_class->finalize = ld_symbol_finalize;
g_type_class_add_private (klass, sizeof (LogdiagSymbolPrivate)); g_type_class_add_private (klass, sizeof (LdSymbolPrivate));
} }
static void static void
logdiag_symbol_init (LogdiagSymbol *self) ld_symbol_init (LdSymbol *self)
{ {
self->priv = G_TYPE_INSTANCE_GET_PRIVATE self->priv = G_TYPE_INSTANCE_GET_PRIVATE
(self, LOGDIAG_TYPE_SYMBOL_LIBRARY, LogdiagSymbolPrivate); (self, LD_TYPE_SYMBOL_LIBRARY, LdSymbolPrivate);
} }
static void static void
logdiag_symbol_finalize (GObject *gobject) ld_symbol_finalize (GObject *gobject)
{ {
LogdiagSymbol *self; LdSymbol *self;
self = LOGDIAG_SYMBOL (gobject); self = LD_SYMBOL (gobject);
g_object_unref (self->priv->library); g_object_unref (self->priv->library);
/* Chain up to the parent class. */ /* Chain up to the parent class. */
G_OBJECT_CLASS (logdiag_symbol_parent_class)->finalize (gobject); G_OBJECT_CLASS (ld_symbol_parent_class)->finalize (gobject);
} }
/** /**
* logdiag_symbol_new: * ld_symbol_new:
* @library: A library object. * @library: A library object.
* @filename: The file from which the symbol will be loaded. * @filename: The file from which the symbol will be loaded.
* *
* Load a symbol from a file into the library. * Load a symbol from a file into the library.
*/ */
LogdiagSymbol *logdiag_symbol_new (LogdiagSymbolLibrary *library, LdSymbol *ld_symbol_new (LdSymbolLibrary *library,
const gchar *filename) const gchar *filename)
{ {
LogdiagSymbol *symbol; LdSymbol *symbol;
symbol = g_object_new (LOGDIAG_TYPE_SYMBOL, NULL); symbol = g_object_new (LD_TYPE_SYMBOL, NULL);
/* TODO: Use the filename, Luke. */ /* TODO: Use the filename, Luke. */
symbol->priv->library = library; symbol->priv->library = library;
@ -342,20 +342,20 @@ LogdiagSymbol *logdiag_symbol_new (LogdiagSymbolLibrary *library,
} }
/** /**
* logdiag_symbol_build_identifier: * ld_symbol_build_identifier:
* @self: A symbol object. * @self: A symbol object.
* *
* Build an identifier for the symbol. * Build an identifier for the symbol.
* The identifier is in the format "Category/Category/Symbol". * The identifier is in the format "Category/Category/Symbol".
*/ */
char * char *
logdiag_symbol_build_identifier (LogdiagSymbol *self) ld_symbol_build_identifier (LdSymbol *self)
{ {
return NULL; return NULL;
} }
/** /**
* logdiag_symbol_draw: * ld_symbol_draw:
* @self: A symbol object. * @self: A symbol object.
* @surface: A cairo surface to be drawn on. * @surface: A cairo surface to be drawn on.
* @param: Parameters for the symbol in a table. * @param: Parameters for the symbol in a table.
@ -366,7 +366,7 @@ logdiag_symbol_build_identifier (LogdiagSymbol *self)
* Draw the symbol onto a Cairo surface. * Draw the symbol onto a Cairo surface.
*/ */
void void
logdiag_symbol_draw (LogdiagSymbol *self, cairo_t *surface, ld_symbol_draw (LdSymbol *self, cairo_t *surface,
GHashTable *param, gint x, gint y, gdouble zoom) GHashTable *param, gint x, gint y, gdouble zoom)
{ {
return; return;

View File

@ -8,46 +8,46 @@
* *
*/ */
#ifndef __SYMBOL_LIBRARY_H__ #ifndef __LD_SYMBOL_LIBRARY_H__
#define __SYMBOL_LIBRARY_H__ #define __LD_SYMBOL_LIBRARY_H__
G_BEGIN_DECLS G_BEGIN_DECLS
#define LOGDIAG_TYPE_SYMBOL_LIBRARY (logdiag_symbol_library_get_type ()) #define LD_TYPE_SYMBOL_LIBRARY (ld_symbol_library_get_type ())
#define LOGDIAG_SYMBOL_LIBRARY(obj) (G_TYPE_CHECK_INSTANCE_CAST \ #define LD_SYMBOL_LIBRARY(obj) (G_TYPE_CHECK_INSTANCE_CAST \
((obj), LOGDIAG_TYPE_SYMBOL_LIBRARY, LogdiagSymbolLibrary)) ((obj), LD_TYPE_SYMBOL_LIBRARY, LdSymbolLibrary))
#define LOGDIAG_SYMBOL_LIBRARY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST \ #define LD_SYMBOL_LIBRARY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST \
((klass), LOGDIAG_TYPE_SYMBOL_LIBRARY, LogdiagSymbolLibraryClass)) ((klass), LD_TYPE_SYMBOL_LIBRARY, LdSymbolLibraryClass))
#define LOGDIAG_IS_SYMBOL_LIBRARY(obj) (G_TYPE_CHECK_INSTANCE_TYPE \ #define LD_IS_SYMBOL_LIBRARY(obj) (G_TYPE_CHECK_INSTANCE_TYPE \
((obj), LOGDIAG_TYPE_SYMBOL_LIBRARY)) ((obj), LD_TYPE_SYMBOL_LIBRARY))
#define LOGDIAG_IS_SYMBOL_LIBRARY_CLASS(klass) (G_TYPE_CHECK_INSTANCE_TYPE \ #define LD_IS_SYMBOL_LIBRARY_CLASS(klass) (G_TYPE_CHECK_INSTANCE_TYPE \
((klass), LOGDIAG_TYPE_SYMBOL_LIBRARY)) ((klass), LD_TYPE_SYMBOL_LIBRARY))
#define LOGDIAG_SYMBOL_LIBRARY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS \ #define LD_SYMBOL_LIBRARY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS \
((obj), LOGDIAG_SYMBOL_LIBRARY, LogdiagSymbolLibraryClass)) ((obj), LD_SYMBOL_LIBRARY, LdSymbolLibraryClass))
typedef struct _LogdiagSymbolLibrary LogdiagSymbolLibrary; typedef struct _LdSymbolLibrary LdSymbolLibrary;
typedef struct _LogdiagSymbolLibraryPrivate LogdiagSymbolLibraryPrivate; typedef struct _LdSymbolLibraryPrivate LdSymbolLibraryPrivate;
typedef struct _LogdiagSymbolLibraryClass LogdiagSymbolLibraryClass; typedef struct _LdSymbolLibraryClass LdSymbolLibraryClass;
/** /**
* LogdiagSymbolLibrary: * LdSymbolLibrary:
* @categories: Lists all the categories (#LogdiagSymbolCategory). * @categories: Lists all the categories (#LdSymbolCategory).
* *
* Object structure. * Object structure.
*/ */
struct _LogdiagSymbolLibrary struct _LdSymbolLibrary
{ {
/*< private >*/ /*< private >*/
GObject parent_instance; GObject parent_instance;
LogdiagSymbolLibraryPrivate *priv; LdSymbolLibraryPrivate *priv;
/*< public >*/ /*< public >*/
GHashTable *categories; GHashTable *categories;
}; };
struct _LogdiagSymbolLibraryClass struct _LdSymbolLibraryClass
{ {
/*< private >*/ /*< private >*/
GObjectClass parent_class; GObjectClass parent_class;
@ -55,15 +55,15 @@ struct _LogdiagSymbolLibraryClass
}; };
GType logdiag_symbol_library_get_type (void) G_GNUC_CONST; GType ld_symbol_library_get_type (void) G_GNUC_CONST;
LogdiagSymbolLibrary *logdiag_symbol_library_new (void); LdSymbolLibrary *ld_symbol_library_new (void);
gboolean logdiag_symbol_library_load (LogdiagSymbolLibrary *self, gboolean ld_symbol_library_load (LdSymbolLibrary *self,
const char *directory); const char *directory);
void logdiag_symbol_library_clear (LogdiagSymbolLibrary *self); void ld_symbol_library_clear (LdSymbolLibrary *self);
G_END_DECLS G_END_DECLS
#endif /* ! __SYMBOL_LIBRARY_H__ */ #endif /* ! __LD_SYMBOL_LIBRARY_H__ */

View File

@ -8,55 +8,55 @@
* *
*/ */
#ifndef __SYMBOL_H__ #ifndef __LD_SYMBOL_H__
#define __SYMBOL_H__ #define __LD_SYMBOL_H__
G_BEGIN_DECLS G_BEGIN_DECLS
#define LOGDIAG_TYPE_SYMBOL (logdiag_symbol_get_type ()) #define LD_TYPE_SYMBOL (ld_symbol_get_type ())
#define LOGDIAG_SYMBOL(obj) (G_TYPE_CHECK_INSTANCE_CAST \ #define LD_SYMBOL(obj) (G_TYPE_CHECK_INSTANCE_CAST \
((obj), LOGDIAG_TYPE_SYMBOL, LogdiagSymbol)) ((obj), LD_TYPE_SYMBOL, LdSymbol))
#define LOGDIAG_SYMBOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST \ #define LD_SYMBOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST \
((klass), LOGDIAG_TYPE_SYMBOL, LogdiagSymbolClass)) ((klass), LD_TYPE_SYMBOL, LdSymbolClass))
#define LOGDIAG_IS_SYMBOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE \ #define LD_IS_SYMBOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE \
((obj), LOGDIAG_TYPE_SYMBOL)) ((obj), LD_TYPE_SYMBOL))
#define LOGDIAG_IS_SYMBOL_CLASS(klass) (G_TYPE_CHECK_INSTANCE_TYPE \ #define LD_IS_SYMBOL_CLASS(klass) (G_TYPE_CHECK_INSTANCE_TYPE \
((klass), LOGDIAG_TYPE_SYMBOL)) ((klass), LD_TYPE_SYMBOL))
#define LOGDIAG_SYMBOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS \ #define LD_SYMBOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS \
((obj), LOGDIAG_SYMBOL, LogdiagSymbolClass)) ((obj), LD_SYMBOL, LdSymbolClass))
typedef struct _LogdiagSymbol LogdiagSymbol; typedef struct _LdSymbol LdSymbol;
typedef struct _LogdiagSymbolPrivate LogdiagSymbolPrivate; typedef struct _LdSymbolPrivate LdSymbolPrivate;
typedef struct _LogdiagSymbolClass LogdiagSymbolClass; typedef struct _LdSymbolClass LdSymbolClass;
/** /**
* LogdiagSymbol: * LdSymbol:
* @name: The name of this symbol. * @name: The name of this symbol.
*/ */
struct _LogdiagSymbol struct _LdSymbol
{ {
/*< private >*/ /*< private >*/
GObject parent_instance; GObject parent_instance;
LogdiagSymbolPrivate *priv; LdSymbolPrivate *priv;
/*< public >*/ /*< public >*/
gchar *name; gchar *name;
}; };
struct _LogdiagSymbolClass struct _LdSymbolClass
{ {
GObjectClass parent_class; GObjectClass parent_class;
}; };
GType logdiag_symbol_get_type (void) G_GNUC_CONST; GType ld_symbol_get_type (void) G_GNUC_CONST;
LogdiagSymbol *logdiag_symbol_new (LogdiagSymbolLibrary *library, LdSymbol *ld_symbol_new (LdSymbolLibrary *library,
const gchar *filename); const gchar *filename);
char *logdiag_symbol_build_identifier (LogdiagSymbol *self); char *ld_symbol_build_identifier (LdSymbol *self);
void logdiag_symbol_draw (LogdiagSymbol *self, cairo_t *surface, void ld_symbol_draw (LdSymbol *self, cairo_t *surface,
GHashTable *param, gint x, gint y, gdouble zoom); GHashTable *param, gint x, gint y, gdouble zoom);
/* TODO: Funkce pro získání terminálů. */ /* TODO: Funkce pro získání terminálů. */
@ -65,5 +65,5 @@ void logdiag_symbol_draw (LogdiagSymbol *self, cairo_t *surface,
G_END_DECLS G_END_DECLS
#endif /* ! __SYMBOL_H__ */ #endif /* ! __LD_SYMBOL_H__ */

View File

@ -24,7 +24,7 @@
* SECTION:ld-window-main * SECTION:ld-window-main
* @short_description: The main application window. * @short_description: The main application window.
* *
* #LogdiagWindowMain is the main window of the application. * #LdWindowMain is the main window of the application.
*/ */
/* NOTE: The main window should not maybe be included in either /* NOTE: The main window should not maybe be included in either
* the documentation or the static library. * the documentation or the static library.
@ -32,15 +32,15 @@
/* Private members of the window. */ /* Private members of the window. */
struct _LogdiagWindowMainPrivate struct _LdWindowMainPrivate
{ {
GtkWidget *vbox; GtkWidget *vbox;
GtkWidget *hbox; GtkWidget *hbox;
GtkWidget *menu; GtkWidget *menu;
GtkWidget *toolbar; GtkWidget *toolbar;
LogdiagSymbolLibrary *library; LdSymbolLibrary *library;
LogdiagCanvas *canvas; LdCanvas *canvas;
GtkWidget *statusbar; GtkWidget *statusbar;
guint statusbar_menu_context_id; guint statusbar_menu_context_id;
@ -48,13 +48,13 @@ struct _LogdiagWindowMainPrivate
struct DocumentData struct DocumentData
{ {
LogdiagDocument *document; LdDocument *document;
const gchar *file_name; const gchar *file_name;
/* Canvas viewport settings (for multitabbed) */ /* Canvas viewport settings (for multitabbed) */
}; };
/* Define the type. */ /* Define the type. */
G_DEFINE_TYPE (LogdiagWindowMain, logdiag_window_main, GTK_TYPE_WINDOW); G_DEFINE_TYPE (LdWindowMain, ld_window_main, GTK_TYPE_WINDOW);
/* ===== Local functions =================================================== */ /* ===== Local functions =================================================== */
@ -73,7 +73,7 @@ cb_load_category (gpointer key, gpointer value, gpointer user_data);
* Load symbols from the library into the toolbar. * Load symbols from the library into the toolbar.
*/ */
static void static void
load_toolbar (LogdiagWindowMain *self); load_toolbar (LdWindowMain *self);
/* /*
* cb_ui_proxy_connected: * cb_ui_proxy_connected:
@ -82,7 +82,7 @@ load_toolbar (LogdiagWindowMain *self);
*/ */
static void static void
cb_ui_proxy_connected (GtkUIManager *ui, GtkAction *action, cb_ui_proxy_connected (GtkUIManager *ui, GtkAction *action,
GtkWidget *proxy, LogdiagWindowMain *window); GtkWidget *proxy, LdWindowMain *window);
/* /*
* cb_ui_proxy_disconnected: * cb_ui_proxy_disconnected:
@ -91,19 +91,19 @@ cb_ui_proxy_connected (GtkUIManager *ui, GtkAction *action,
*/ */
static void static void
cb_ui_proxy_disconnected (GtkUIManager *ui, GtkAction *action, cb_ui_proxy_disconnected (GtkUIManager *ui, GtkAction *action,
GtkWidget *proxy, LogdiagWindowMain *window); GtkWidget *proxy, LdWindowMain *window);
/* A menu item was selected. */ /* A menu item was selected. */
static void static void
cb_menu_item_selected (GtkWidget *item, LogdiagWindowMain *window); cb_menu_item_selected (GtkWidget *item, LdWindowMain *window);
/* A menu item was deselected. */ /* A menu item was deselected. */
static void static void
cb_menu_item_deselected (GtkItem *item, LogdiagWindowMain *window); cb_menu_item_deselected (GtkItem *item, LdWindowMain *window);
/* Show the about dialog. */ /* Show the about dialog. */
static void static void
cb_show_about_dialog (GtkAction *action, LogdiagWindowMain *window); cb_show_about_dialog (GtkAction *action, LdWindowMain *window);
/* ===== Local variables =================================================== */ /* ===== Local variables =================================================== */
@ -140,18 +140,18 @@ static GtkActionEntry mw_actionEntries[] =
/** /**
* logdiag_window_main_new: * ld_window_main_new:
* *
* Create an instance. * Create an instance.
*/ */
GtkWidget * GtkWidget *
logdiag_window_main_new (void) ld_window_main_new (void)
{ {
return g_object_new (LOGDIAG_TYPE_WINDOW_MAIN, NULL); return g_object_new (LD_TYPE_WINDOW_MAIN, NULL);
} }
static void static void
logdiag_window_main_class_init (LogdiagWindowMainClass *klass) ld_window_main_class_init (LdWindowMainClass *klass)
{ {
GObjectClass *object_class; GObjectClass *object_class;
GtkWidgetClass *widget_class; GtkWidgetClass *widget_class;
@ -159,19 +159,19 @@ logdiag_window_main_class_init (LogdiagWindowMainClass *klass)
object_class = G_OBJECT_CLASS (klass); object_class = G_OBJECT_CLASS (klass);
widget_class = GTK_WIDGET_CLASS (klass); widget_class = GTK_WIDGET_CLASS (klass);
g_type_class_add_private (klass, sizeof (LogdiagWindowMainPrivate)); g_type_class_add_private (klass, sizeof (LdWindowMainPrivate));
} }
static void static void
logdiag_window_main_init (LogdiagWindowMain *self) ld_window_main_init (LdWindowMain *self)
{ {
LogdiagWindowMainPrivate *priv; LdWindowMainPrivate *priv;
GtkActionGroup *action_group; GtkActionGroup *action_group;
GtkUIManager *ui_manager; GtkUIManager *ui_manager;
GError *error; GError *error;
self->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE self->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE
(self, LOGDIAG_TYPE_WINDOW_MAIN, LogdiagWindowMainPrivate); (self, LD_TYPE_WINDOW_MAIN, LdWindowMainPrivate);
priv->vbox = gtk_vbox_new (FALSE, 0); priv->vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (self), priv->vbox); gtk_container_add (GTK_CONTAINER (self), priv->vbox);
@ -225,13 +225,13 @@ logdiag_window_main_init (LogdiagWindowMain *self)
gtk_box_pack_start (GTK_BOX (priv->hbox), priv->toolbar, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (priv->hbox), priv->toolbar, FALSE, FALSE, 0);
/* Symbol library. */ /* Symbol library. */
priv->library = logdiag_symbol_library_new (); priv->library = ld_symbol_library_new ();
logdiag_symbol_library_load (priv->library, PROJECT_SHARE_DIR "library"); ld_symbol_library_load (priv->library, PROJECT_SHARE_DIR "library");
load_toolbar (self); load_toolbar (self);
/* Canvas. */ /* Canvas. */
priv->canvas = logdiag_canvas_new (); priv->canvas = ld_canvas_new ();
gtk_box_pack_start (GTK_BOX (priv->hbox), GTK_WIDGET (priv->canvas), gtk_box_pack_start (GTK_BOX (priv->hbox), GTK_WIDGET (priv->canvas),
FALSE, FALSE, 0); FALSE, FALSE, 0);
@ -256,8 +256,8 @@ static void
cb_load_category (gpointer key, gpointer value, gpointer user_data) cb_load_category (gpointer key, gpointer value, gpointer user_data)
{ {
const gchar *name; const gchar *name;
LogdiagSymbolCategory *cat; LdSymbolCategory *cat;
LogdiagWindowMain *self; LdWindowMain *self;
GdkPixbuf *pbuf; GdkPixbuf *pbuf;
GtkWidget *img; GtkWidget *img;
GtkToolItem *item; GtkToolItem *item;
@ -267,7 +267,7 @@ cb_load_category (gpointer key, gpointer value, gpointer user_data)
self = user_data; self = user_data;
g_return_if_fail (key != NULL); g_return_if_fail (key != NULL);
g_return_if_fail (LOGDIAG_IS_SYMBOL_CATEGORY (cat)); g_return_if_fail (LD_IS_SYMBOL_CATEGORY (cat));
/* XXX: Hardcoded icon width, unref? */ /* XXX: Hardcoded icon width, unref? */
pbuf = gdk_pixbuf_new_from_file_at_size (cat->image_path, 32, -1, NULL); pbuf = gdk_pixbuf_new_from_file_at_size (cat->image_path, 32, -1, NULL);
@ -282,7 +282,7 @@ cb_load_category (gpointer key, gpointer value, gpointer user_data)
} }
static void static void
load_toolbar (LogdiagWindowMain *self) load_toolbar (LdWindowMain *self)
{ {
/* TODO: Clear the toolbar first, if there was already something in it. */ /* TODO: Clear the toolbar first, if there was already something in it. */
@ -292,7 +292,7 @@ load_toolbar (LogdiagWindowMain *self)
static void static void
cb_ui_proxy_connected (GtkUIManager *ui, GtkAction *action, cb_ui_proxy_connected (GtkUIManager *ui, GtkAction *action,
GtkWidget *proxy, LogdiagWindowMain *window) GtkWidget *proxy, LdWindowMain *window)
{ {
if (GTK_IS_MENU_ITEM (proxy)) if (GTK_IS_MENU_ITEM (proxy))
{ {
@ -305,7 +305,7 @@ cb_ui_proxy_connected (GtkUIManager *ui, GtkAction *action,
static void static void
cb_ui_proxy_disconnected (GtkUIManager *ui, GtkAction *action, cb_ui_proxy_disconnected (GtkUIManager *ui, GtkAction *action,
GtkWidget *proxy, LogdiagWindowMain *window) GtkWidget *proxy, LdWindowMain *window)
{ {
if (GTK_IS_MENU_ITEM (proxy)) if (GTK_IS_MENU_ITEM (proxy))
{ {
@ -317,7 +317,7 @@ cb_ui_proxy_disconnected (GtkUIManager *ui, GtkAction *action,
} }
static void static void
cb_menu_item_selected (GtkWidget *item, LogdiagWindowMain *window) cb_menu_item_selected (GtkWidget *item, LdWindowMain *window)
{ {
GtkAction *action; GtkAction *action;
gchar *tooltip; gchar *tooltip;
@ -333,14 +333,14 @@ cb_menu_item_selected (GtkWidget *item, LogdiagWindowMain *window)
} }
static void static void
cb_menu_item_deselected (GtkItem *item, LogdiagWindowMain *window) cb_menu_item_deselected (GtkItem *item, LdWindowMain *window)
{ {
gtk_statusbar_pop (GTK_STATUSBAR (window->priv->statusbar), gtk_statusbar_pop (GTK_STATUSBAR (window->priv->statusbar),
window->priv->statusbar_menu_context_id); window->priv->statusbar_menu_context_id);
} }
static void static void
cb_show_about_dialog (GtkAction *action, LogdiagWindowMain *window) cb_show_about_dialog (GtkAction *action, LdWindowMain *window)
{ {
gtk_show_about_dialog (GTK_WINDOW (window), gtk_show_about_dialog (GTK_WINDOW (window),
"program-name", PROJECT_NAME, "program-name", PROJECT_NAME,

View File

@ -8,53 +8,53 @@
* *
*/ */
#ifndef __WINDOW_MAIN_H__ #ifndef __LD_WINDOW_MAIN_H__
#define __WINDOW_MAIN_H__ #define __LD_WINDOW_MAIN_H__
G_BEGIN_DECLS G_BEGIN_DECLS
#define LOGDIAG_TYPE_WINDOW_MAIN (logdiag_window_main_get_type ()) #define LD_TYPE_WINDOW_MAIN (ld_window_main_get_type ())
#define LOGDIAG_WINDOW_MAIN(obj) (G_TYPE_CHECK_INSTANCE_CAST \ #define LD_WINDOW_MAIN(obj) (G_TYPE_CHECK_INSTANCE_CAST \
((obj), LOGDIAG_TYPE_WINDOW_MAIN, LogdiagWindowMain)) ((obj), LD_TYPE_WINDOW_MAIN, LdWindowMain))
#define LOGDIAG_WINDOW_MAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST \ #define LD_WINDOW_MAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST \
((klass), LOGDIAG_TYPE_WINDOW_MAIN, LogdiagWindowMainClass)) ((klass), LD_TYPE_WINDOW_MAIN, LdWindowMainClass))
#define LOGDIAG_IS_WINDOW_MAIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE \ #define LD_IS_WINDOW_MAIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE \
((obj), LOGDIAG_TYPE_WINDOW_MAIN)) ((obj), LD_TYPE_WINDOW_MAIN))
#define LOGDIAG_IS_WINDOW_MAIN_CLASS(klass) (G_TYPE_CHECK_INSTANCE_TYPE \ #define LD_IS_WINDOW_MAIN_CLASS(klass) (G_TYPE_CHECK_INSTANCE_TYPE \
((klass), LOGDIAG_TYPE_WINDOW_MAIN)) ((klass), LD_TYPE_WINDOW_MAIN))
#define LOGDIAG_WINDOW_MAIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS \ #define LD_WINDOW_MAIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS \
((obj), LOGDIAG_WINDOW_MAIN, LogdiagWindowMainClass)) ((obj), LD_WINDOW_MAIN, LdWindowMainClass))
typedef struct _LogdiagWindowMain LogdiagWindowMain; typedef struct _LdWindowMain LdWindowMain;
typedef struct _LogdiagWindowMainPrivate LogdiagWindowMainPrivate; typedef struct _LdWindowMainPrivate LdWindowMainPrivate;
typedef struct _LogdiagWindowMainClass LogdiagWindowMainClass; typedef struct _LdWindowMainClass LdWindowMainClass;
/** /**
* LogdiagWindowMain: * LdWindowMain:
* *
* Object structure. * Object structure.
*/ */
struct _LogdiagWindowMain struct _LdWindowMain
{ {
/*< private >*/ /*< private >*/
GtkWindow parent_instance; GtkWindow parent_instance;
LogdiagWindowMainPrivate *priv; LdWindowMainPrivate *priv;
}; };
struct _LogdiagWindowMainClass struct _LdWindowMainClass
{ {
GtkWindowClass parent_class; GtkWindowClass parent_class;
}; };
GType logdiag_window_main_get_type (void) G_GNUC_CONST; GType ld_window_main_get_type (void) G_GNUC_CONST;
GtkWidget *logdiag_window_main_new (void); GtkWidget *ld_window_main_new (void);
G_END_DECLS G_END_DECLS
#endif /* ! __WINDOW_MAIN_H__ */ #endif /* ! __LD_WINDOW_MAIN_H__ */

View File

@ -31,7 +31,7 @@ int main (int argc, char *argv[])
*/ */
gtk_init (&argc, &argv); gtk_init (&argc, &argv);
wnd = logdiag_window_main_new (); wnd = ld_window_main_new ();
gtk_main (); gtk_main ();
return 0; return 0;