summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt8
-rw-r--r--src/ld-document.h2
-rw-r--r--src/ld-library.c (renamed from src/ld-symbol-library.c)64
-rw-r--r--src/ld-library.h70
-rw-r--r--src/ld-lua.c2
-rw-r--r--src/ld-symbol-category.c6
-rw-r--r--src/ld-symbol-category.h4
-rw-r--r--src/ld-symbol-library.h70
-rw-r--r--src/ld-symbol.c8
-rw-r--r--src/ld-symbol.h2
-rw-r--r--src/ld-window-main.c8
11 files changed, 122 insertions, 122 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bfb41f2..d5c2af7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -88,9 +88,9 @@ set (logdiag_SOURCES
src/ld-window-main.c
src/ld-document.c
src/ld-canvas.c
- src/ld-symbol.c
+ src/ld-library.c
src/ld-symbol-category.c
- src/ld-symbol-library.c
+ src/ld-symbol.c
src/ld-lua.c)
set (logdiag_HEADERS
${CMAKE_CURRENT_BINARY_DIR}/config.h
@@ -98,9 +98,9 @@ set (logdiag_HEADERS
src/ld-window-main.h
src/ld-document.h
src/ld-canvas.h
- src/ld-symbol.h
+ src/ld-library.h
src/ld-symbol-category.h
- src/ld-symbol-library.h
+ src/ld-symbol.h
src/ld-lua.h)
# Generate a configure file
diff --git a/src/ld-document.h b/src/ld-document.h
index cc7266b..471b3ce 100644
--- a/src/ld-document.h
+++ b/src/ld-document.h
@@ -14,7 +14,7 @@
G_BEGIN_DECLS
-#define LD_TYPE_DOCUMENT (ld_symbol_library_get_type ())
+#define LD_TYPE_DOCUMENT (ld_library_get_type ())
#define LD_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST \
((obj), LD_TYPE_DOCUMENT, LdDocument))
#define LD_DOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST \
diff --git a/src/ld-symbol-library.c b/src/ld-library.c
index 2f5f9d3..d035644 100644
--- a/src/ld-symbol-library.c
+++ b/src/ld-library.c
@@ -1,5 +1,5 @@
/*
- * ld-symbol-library.c
+ * ld-library.c
*
* This file is a part of logdiag.
* Copyright Přemysl Janouch 2010. All rights reserved.
@@ -12,44 +12,44 @@
#include "config.h"
-#include "ld-symbol-library.h"
+#include "ld-library.h"
#include "ld-symbol-category.h"
#include "ld-symbol.h"
/**
- * SECTION:ld-symbol-library
+ * SECTION:ld-library
* @short_description: A symbol library.
* @see_also: #LdSymbol, #LdSymbolCategory
*
- * #LdSymbolLibrary is used for loading symbols from their files.
+ * #LdLibrary is used for loading symbols from their files.
*/
/*
- * LdSymbolLibraryPrivate:
+ * LdLibraryPrivate:
* @script_state: State of the scripting language.
*/
-struct _LdSymbolLibraryPrivate
+struct _LdLibraryPrivate
{
gpointer script_state;
};
-G_DEFINE_TYPE (LdSymbolLibrary, ld_symbol_library, G_TYPE_OBJECT);
+G_DEFINE_TYPE (LdLibrary, ld_library, G_TYPE_OBJECT);
static void
-ld_symbol_library_finalize (GObject *gobject);
+ld_library_finalize (GObject *gobject);
static void
-ld_symbol_library_class_init (LdSymbolLibraryClass *klass)
+ld_library_class_init (LdLibraryClass *klass)
{
GObjectClass *object_class;
object_class = G_OBJECT_CLASS (klass);
- object_class->finalize = ld_symbol_library_finalize;
+ object_class->finalize = ld_library_finalize;
/**
- * LdSymbolLibrary::changed:
+ * LdLibrary::changed:
* @library: The library object.
*
* Contents of the library have changed.
@@ -59,14 +59,14 @@ ld_symbol_library_class_init (LdSymbolLibraryClass *klass)
G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS,
0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
- g_type_class_add_private (klass, sizeof (LdSymbolLibraryPrivate));
+ g_type_class_add_private (klass, sizeof (LdLibraryPrivate));
}
static void
-ld_symbol_library_init (LdSymbolLibrary *self)
+ld_library_init (LdLibrary *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE
- (self, LD_TYPE_SYMBOL_LIBRARY, LdSymbolLibraryPrivate);
+ (self, LD_TYPE_LIBRARY, LdLibraryPrivate);
/* TODO */
self->priv->script_state = NULL;
@@ -76,27 +76,27 @@ ld_symbol_library_init (LdSymbolLibrary *self)
}
static void
-ld_symbol_library_finalize (GObject *gobject)
+ld_library_finalize (GObject *gobject)
{
- LdSymbolLibrary *self;
+ LdLibrary *self;
- self = LD_SYMBOL_LIBRARY (gobject);
+ self = LD_LIBRARY (gobject);
g_hash_table_destroy (self->categories);
/* Chain up to the parent class. */
- G_OBJECT_CLASS (ld_symbol_library_parent_class)->finalize (gobject);
+ G_OBJECT_CLASS (ld_library_parent_class)->finalize (gobject);
}
/**
- * ld_symbol_library_new:
+ * ld_library_new:
*
* Create an instance.
*/
-LdSymbolLibrary *
-ld_symbol_library_new (void)
+LdLibrary *
+ld_library_new (void)
{
- return g_object_new (LD_TYPE_SYMBOL_LIBRARY, NULL);
+ return g_object_new (LD_TYPE_LIBRARY, NULL);
}
/*
@@ -108,12 +108,12 @@ ld_symbol_library_new (void)
* Loads a category into the library.
*/
static LdSymbolCategory *
-load_category (LdSymbolLibrary *self, const char *path, const char *name)
+load_category (LdLibrary *self, const char *path, const char *name)
{
LdSymbolCategory *cat;
gchar *icon_file;
- g_return_val_if_fail (LD_IS_SYMBOL_LIBRARY (self), NULL);
+ g_return_val_if_fail (LD_IS_LIBRARY (self), NULL);
g_return_val_if_fail (path != NULL, NULL);
g_return_val_if_fail (name != NULL, NULL);
@@ -138,20 +138,20 @@ load_category (LdSymbolLibrary *self, const char *path, const char *name)
}
/**
- * ld_symbol_library_load:
+ * ld_library_load:
* @self: A symbol library object.
* @directory: A directory to be loaded.
*
* Load the contents of a directory into the library.
*/
gboolean
-ld_symbol_library_load (LdSymbolLibrary *self, const char *path)
+ld_library_load (LdLibrary *self, const char *path)
{
GDir *dir;
const gchar *item;
gboolean changed = FALSE;
- g_return_val_if_fail (LD_IS_SYMBOL_LIBRARY (self), FALSE);
+ g_return_val_if_fail (LD_IS_LIBRARY (self), FALSE);
g_return_val_if_fail (path != NULL, FALSE);
dir = g_dir_open (path, 0, NULL);
@@ -175,25 +175,25 @@ ld_symbol_library_load (LdSymbolLibrary *self, const char *path)
if (changed)
g_signal_emit (self,
- LD_SYMBOL_LIBRARY_GET_CLASS (self)->changed_signal, 0);
+ LD_LIBRARY_GET_CLASS (self)->changed_signal, 0);
return TRUE;
}
/**
- * ld_symbol_library_clear:
+ * ld_library_clear:
* @self: A symbol library object.
*
* Clears all the contents.
*/
void
-ld_symbol_library_clear (LdSymbolLibrary *self)
+ld_library_clear (LdLibrary *self)
{
- g_return_if_fail (LD_IS_SYMBOL_LIBRARY (self));
+ g_return_if_fail (LD_IS_LIBRARY (self));
g_hash_table_remove_all (self->categories);
g_signal_emit (self,
- LD_SYMBOL_LIBRARY_GET_CLASS (self)->changed_signal, 0);
+ LD_LIBRARY_GET_CLASS (self)->changed_signal, 0);
}
diff --git a/src/ld-library.h b/src/ld-library.h
new file mode 100644
index 0000000..3dd052f
--- /dev/null
+++ b/src/ld-library.h
@@ -0,0 +1,70 @@
+/*
+ * ld-library.h
+ *
+ * This file is a part of logdiag.
+ * Copyright Přemysl Janouch 2010. All rights reserved.
+ *
+ * See the file LICENSE for licensing information.
+ *
+ */
+
+#ifndef __LD_LIBRARY_H__
+#define __LD_LIBRARY_H__
+
+G_BEGIN_DECLS
+
+
+#define LD_TYPE_LIBRARY (ld_library_get_type ())
+#define LD_LIBRARY(obj) (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), LD_TYPE_LIBRARY, LdLibrary))
+#define LD_LIBRARY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST \
+ ((klass), LD_TYPE_LIBRARY, LdLibraryClass))
+#define LD_IS_LIBRARY(obj) (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), LD_TYPE_LIBRARY))
+#define LD_IS_LIBRARY_CLASS(klass) (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((klass), LD_TYPE_LIBRARY))
+#define LD_LIBRARY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), LD_LIBRARY, LdLibraryClass))
+
+typedef struct _LdLibrary LdLibrary;
+typedef struct _LdLibraryPrivate LdLibraryPrivate;
+typedef struct _LdLibraryClass LdLibraryClass;
+
+
+/**
+ * LdLibrary:
+ * @categories: Lists all the categories (#LdSymbolCategory).
+ *
+ * Object structure.
+ */
+struct _LdLibrary
+{
+/*< private >*/
+ GObject parent_instance;
+ LdLibraryPrivate *priv;
+
+/*< public >*/
+ GHashTable *categories;
+};
+
+struct _LdLibraryClass
+{
+/*< private >*/
+ GObjectClass parent_class;
+
+ guint changed_signal;
+};
+
+
+GType ld_library_get_type (void) G_GNUC_CONST;
+
+LdLibrary *ld_library_new (void);
+gboolean ld_library_load (LdLibrary *self,
+ const gchar *directory);
+void ld_library_clear (LdLibrary *self);
+
+
+G_END_DECLS
+
+#endif /* ! __LD_LIBRARY_H__ */
+
diff --git a/src/ld-lua.c b/src/ld-lua.c
index 02ff7ac..9bf0e76 100644
--- a/src/ld-lua.c
+++ b/src/ld-lua.c
@@ -15,7 +15,7 @@
#include "config.h"
-#include "ld-symbol-library.h"
+#include "ld-library.h"
#include "ld-lua.h"
diff --git a/src/ld-symbol-category.c b/src/ld-symbol-category.c
index 8bfe419..96e6bd1 100644
--- a/src/ld-symbol-category.c
+++ b/src/ld-symbol-category.c
@@ -12,7 +12,7 @@
#include "config.h"
-#include "ld-symbol-library.h"
+#include "ld-library.h"
#include "ld-symbol-category.h"
#include "ld-symbol.h"
@@ -20,7 +20,7 @@
/**
* SECTION:ld-symbol-category
* @short_description: A category of symbols.
- * @see_also: #LdSymbol, #LdSymbolLibrary
+ * @see_also: #LdSymbol, #LdLibrary
*
* #LdSymbolCategory represents a category of #LdSymbol objects.
*/
@@ -76,7 +76,7 @@ ld_symbol_category_finalize (GObject *gobject)
* Create an instance.
*/
LdSymbolCategory *
-ld_symbol_category_new (LdSymbolLibrary *parent)
+ld_symbol_category_new (LdLibrary *parent)
{
LdSymbolCategory *cat;
diff --git a/src/ld-symbol-category.h b/src/ld-symbol-category.h
index c06f46a..6f48606 100644
--- a/src/ld-symbol-category.h
+++ b/src/ld-symbol-category.h
@@ -32,7 +32,7 @@ typedef struct _LdSymbolCategoryClass LdSymbolCategoryClass;
/**
* LdSymbolCategory:
- * @parent: The parent object, may be #LdSymbolLibrary
+ * @parent: The parent object, may be #LdLibrary
* or another #LdSymbolCategory.
* @name: The name of the category.
* @image_path: Path to the image for this category.
@@ -63,7 +63,7 @@ struct _LdSymbolCategoryClass
GType ld_symbol_category_get_type (void) G_GNUC_CONST;
LdSymbolCategory *
-ld_symbol_category_new (LdSymbolLibrary *parent);
+ld_symbol_category_new (LdLibrary *parent);
G_END_DECLS
diff --git a/src/ld-symbol-library.h b/src/ld-symbol-library.h
deleted file mode 100644
index 8678201..0000000
--- a/src/ld-symbol-library.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * ld-symbol-library.h
- *
- * This file is a part of logdiag.
- * Copyright Přemysl Janouch 2010. All rights reserved.
- *
- * See the file LICENSE for licensing information.
- *
- */
-
-#ifndef __LD_SYMBOL_LIBRARY_H__
-#define __LD_SYMBOL_LIBRARY_H__
-
-G_BEGIN_DECLS
-
-
-#define LD_TYPE_SYMBOL_LIBRARY (ld_symbol_library_get_type ())
-#define LD_SYMBOL_LIBRARY(obj) (G_TYPE_CHECK_INSTANCE_CAST \
- ((obj), LD_TYPE_SYMBOL_LIBRARY, LdSymbolLibrary))
-#define LD_SYMBOL_LIBRARY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST \
- ((klass), LD_TYPE_SYMBOL_LIBRARY, LdSymbolLibraryClass))
-#define LD_IS_SYMBOL_LIBRARY(obj) (G_TYPE_CHECK_INSTANCE_TYPE \
- ((obj), LD_TYPE_SYMBOL_LIBRARY))
-#define LD_IS_SYMBOL_LIBRARY_CLASS(klass) (G_TYPE_CHECK_INSTANCE_TYPE \
- ((klass), LD_TYPE_SYMBOL_LIBRARY))
-#define LD_SYMBOL_LIBRARY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS \
- ((obj), LD_SYMBOL_LIBRARY, LdSymbolLibraryClass))
-
-typedef struct _LdSymbolLibrary LdSymbolLibrary;
-typedef struct _LdSymbolLibraryPrivate LdSymbolLibraryPrivate;
-typedef struct _LdSymbolLibraryClass LdSymbolLibraryClass;
-
-
-/**
- * LdSymbolLibrary:
- * @categories: Lists all the categories (#LdSymbolCategory).
- *
- * Object structure.
- */
-struct _LdSymbolLibrary
-{
-/*< private >*/
- GObject parent_instance;
- LdSymbolLibraryPrivate *priv;
-
-/*< public >*/
- GHashTable *categories;
-};
-
-struct _LdSymbolLibraryClass
-{
-/*< private >*/
- GObjectClass parent_class;
-
- guint changed_signal;
-};
-
-
-GType ld_symbol_library_get_type (void) G_GNUC_CONST;
-
-LdSymbolLibrary *ld_symbol_library_new (void);
-gboolean ld_symbol_library_load (LdSymbolLibrary *self,
- const gchar *directory);
-void ld_symbol_library_clear (LdSymbolLibrary *self);
-
-
-G_END_DECLS
-
-#endif /* ! __LD_SYMBOL_LIBRARY_H__ */
-
diff --git a/src/ld-symbol.c b/src/ld-symbol.c
index deab3f5..4bfe6a2 100644
--- a/src/ld-symbol.c
+++ b/src/ld-symbol.c
@@ -12,7 +12,7 @@
#include "config.h"
-#include "ld-symbol-library.h"
+#include "ld-library.h"
#include "ld-symbol-category.h"
#include "ld-symbol.h"
@@ -28,12 +28,12 @@
/*
* LdSymbolPrivate:
- * @library: The parent LdSymbolLibrary.
+ * @library: The parent LdLibrary.
* The library contains the real function for rendering.
*/
struct _LdSymbolPrivate
{
- LdSymbolLibrary *library;
+ LdLibrary *library;
};
G_DEFINE_TYPE (LdSymbol, ld_symbol, G_TYPE_OBJECT);
@@ -79,7 +79,7 @@ ld_symbol_finalize (GObject *gobject)
*
* Load a symbol from a file into the library.
*/
-LdSymbol *ld_symbol_new (LdSymbolLibrary *library)
+LdSymbol *ld_symbol_new (LdLibrary *library)
{
LdSymbol *symbol;
diff --git a/src/ld-symbol.h b/src/ld-symbol.h
index 882bde7..f3a2d35 100644
--- a/src/ld-symbol.h
+++ b/src/ld-symbol.h
@@ -53,7 +53,7 @@ struct _LdSymbolClass
GType ld_symbol_get_type (void) G_GNUC_CONST;
-LdSymbol *ld_symbol_new (LdSymbolLibrary *library);
+LdSymbol *ld_symbol_new (LdLibrary *library);
gchar *ld_symbol_build_identifier (LdSymbol *self);
void ld_symbol_draw (LdSymbol *self, cairo_t *cr, GHashTable *param);
diff --git a/src/ld-window-main.c b/src/ld-window-main.c
index 3713cc9..d37488f 100644
--- a/src/ld-window-main.c
+++ b/src/ld-window-main.c
@@ -15,7 +15,7 @@
#include "ld-window-main.h"
#include "ld-document.h"
#include "ld-canvas.h"
-#include "ld-symbol-library.h"
+#include "ld-library.h"
#include "ld-symbol-category.h"
#include "ld-symbol.h"
@@ -41,7 +41,7 @@ struct _LdWindowMainPrivate
GtkWidget *menu;
GtkWidget *toolbar;
- LdSymbolLibrary *library;
+ LdLibrary *library;
LdCanvas *canvas;
GtkWidget *statusbar;
@@ -215,8 +215,8 @@ ld_window_main_init (LdWindowMain *self)
gtk_box_pack_start (GTK_BOX (priv->hbox), priv->toolbar, FALSE, FALSE, 0);
/* Symbol library. */
- priv->library = ld_symbol_library_new ();
- ld_symbol_library_load (priv->library, PROJECT_SHARE_DIR "library");
+ priv->library = ld_library_new ();
+ ld_library_load (priv->library, PROJECT_SHARE_DIR "library");
load_toolbar (self);