[gnome-builder/wip/libide] libide: use mkenums for IdeBufferLineFlags
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/libide] libide: use mkenums for IdeBufferLineFlags
- Date: Wed, 11 Mar 2015 21:14:57 +0000 (UTC)
commit 56cc488ae2c055df74770b6a5486e1c85ef6ca11
Author: Christian Hergert <christian hergert me>
Date: Wed Mar 11 14:14:52 2015 -0700
libide: use mkenums for IdeBufferLineFlags
libide/Makefile.am | 1 +
libide/ide-buffer.c | 25 -------------------------
libide/ide-buffer.h | 8 +++-----
3 files changed, 4 insertions(+), 30 deletions(-)
---
diff --git a/libide/Makefile.am b/libide/Makefile.am
index 542b2e5..16693c1 100644
--- a/libide/Makefile.am
+++ b/libide/Makefile.am
@@ -311,6 +311,7 @@ AM_CPPFLAGS += -DIDE_DISABLE_DEBUG
endif
libide_1_0_la_type_headers = \
+ libide/ide-buffer.h \
libide/ide-source-view.h \
$(NULL)
diff --git a/libide/ide-buffer.c b/libide/ide-buffer.c
index c435d25..a9ce6ff 100644
--- a/libide/ide-buffer.c
+++ b/libide/ide-buffer.c
@@ -706,31 +706,6 @@ ide_buffer_init (IdeBuffer *self)
self->diagnostics_line_cache = g_hash_table_new (g_direct_hash, g_direct_equal);
}
-GType
-ide_buffer_line_flags_get_type (void)
-{
- static gsize type_id;
-
- if (g_once_init_enter (&type_id))
- {
- GType _type_id;
- const static GFlagsValue values[] = {
- { IDE_BUFFER_LINE_FLAGS_NONE, "IDE_BUFFER_LINE_FLAGS_NONE", "NONE" },
- { IDE_BUFFER_LINE_FLAGS_ADDED, "IDE_BUFFER_LINE_FLAGS_ADDED", "ADDED" },
- { IDE_BUFFER_LINE_FLAGS_CHANGED, "IDE_BUFFER_LINE_FLAGS_CHANGED", "CHANGED" },
- { IDE_BUFFER_LINE_FLAGS_ERROR, "IDE_BUFFER_LINE_FLAGS_ERROR", "ERROR" },
- { IDE_BUFFER_LINE_FLAGS_WARNING, "IDE_BUFFER_LINE_FLAGS_WARNING", "WARNING" },
- { IDE_BUFFER_LINE_FLAGS_NOTE, "IDE_BUFFER_LINE_FLAGS_NOTE", "NOTE" },
- { 0 }
- };
-
- _type_id = g_flags_register_static ("IdeBufferLineFlags", values);
- g_once_init_leave (&type_id, _type_id);
- }
-
- return type_id;
-}
-
static void
ide_buffer_update_title (IdeBuffer *self)
{
diff --git a/libide/ide-buffer.h b/libide/ide-buffer.h
index 9edc2e5..e063257 100644
--- a/libide/ide-buffer.h
+++ b/libide/ide-buffer.h
@@ -33,6 +33,9 @@ G_BEGIN_DECLS
#define IDE_IS_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), IDE_TYPE_BUFFER))
#define IDE_BUFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), IDE_TYPE_BUFFER, IdeBufferClass))
+#define IDE_BUFFER_LINE_FLAGS_DIAGNOSTICS_MASK \
+ ((IDE_BUFFER_LINE_FLAGS_ERROR | IDE_BUFFER_LINE_FLAGS_WARNING | IDE_BUFFER_LINE_FLAGS_NOTE))
+
typedef enum
{
IDE_BUFFER_LINE_FLAGS_NONE = 0,
@@ -41,10 +44,6 @@ typedef enum
IDE_BUFFER_LINE_FLAGS_ERROR = 1 << 2,
IDE_BUFFER_LINE_FLAGS_WARNING = 1 << 3,
IDE_BUFFER_LINE_FLAGS_NOTE = 1 << 4,
-
- IDE_BUFFER_LINE_FLAGS_DIAGNOSTICS_MASK = (IDE_BUFFER_LINE_FLAGS_ERROR |
- IDE_BUFFER_LINE_FLAGS_WARNING |
- IDE_BUFFER_LINE_FLAGS_NOTE),
} IdeBufferLineFlags;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (IdeBuffer, g_object_unref)
@@ -60,7 +59,6 @@ gboolean ide_buffer_get_highlight_diagnostics (IdeBuffer *sel
const gchar *ide_buffer_get_style_scheme_name (IdeBuffer *self);
const gchar *ide_buffer_get_title (IdeBuffer *self);
GType ide_buffer_get_type (void);
-GType ide_buffer_line_flags_get_type (void);
void ide_buffer_set_file (IdeBuffer *self,
IdeFile *file);
void ide_buffer_set_highlight_diagnostics (IdeBuffer *self,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]