[kazehakase-svn] [3565] Added KzBookmarkSeparator object.

Zurück zum Archiv-Index

svnno****@sourc***** svnno****@sourc*****
Sun Jan 25 10:07:23 JST 2009


Revision: 3565
          http://svn.sourceforge.jp/view?root=kazehakase&view=rev&rev=3565
Author:   ikezoe
Date:     2009-01-25 10:07:23 +0900 (Sun, 25 Jan 2009)

Log Message:
-----------
Added KzBookmarkSeparator object.

Modified Paths:
--------------
    kazehakase/trunk/ChangeLog
    kazehakase/trunk/src/bookmarks/Makefile.am
    kazehakase/trunk/src/bookmarks/kz-actions-bookmark.c
    kazehakase/trunk/src/bookmarks/kz-bookmark-bar.c
    kazehakase/trunk/src/bookmarks/kz-bookmark-edit.c
    kazehakase/trunk/src/bookmarks/kz-bookmark-editor.c
    kazehakase/trunk/src/bookmarks/kz-bookmark-file.c
    kazehakase/trunk/src/bookmarks/kz-bookmark-file.h
    kazehakase/trunk/src/bookmarks/kz-bookmark-menu-item-list.c
    kazehakase/trunk/src/bookmarks/kz-bookmark-menu.c
    kazehakase/trunk/src/bookmarks/kz-bookmark-separator-menu-item.c
    kazehakase/trunk/src/bookmarks/kz-bookmark.c
    kazehakase/trunk/src/bookmarks/kz-bookmark.h
    kazehakase/trunk/src/bookmarks/kz-bookmarks-view.c
    kazehakase/trunk/src/bookmarks/kz-nsbookmark.c
    kazehakase/trunk/src/bookmarks/kz-xbel.c
    kazehakase/trunk/src/sidebar/kz-bookmarks-sidebar.c
    kazehakase/trunk/test/test-bookmark-separator.c

Added Paths:
-----------
    kazehakase/trunk/src/bookmarks/kz-bookmark-separator.c
    kazehakase/trunk/src/bookmarks/kz-bookmark-separator.h

Modified: kazehakase/trunk/ChangeLog
===================================================================
--- kazehakase/trunk/ChangeLog	2009-01-25 00:12:10 UTC (rev 3564)
+++ kazehakase/trunk/ChangeLog	2009-01-25 01:07:23 UTC (rev 3565)
@@ -1,3 +1,7 @@
+2009-01-25  Hiroyuki Ikezoe  <poinc****@ikezo*****>
+
+	* src/bookmarks/kz-bookmark-separator.[ch]: Added.
+
 2009-01-24  Hiroyuki Ikezoe  <poinc****@ikezo*****>
 
 	* test: added.

Modified: kazehakase/trunk/src/bookmarks/Makefile.am
===================================================================
--- kazehakase/trunk/src/bookmarks/Makefile.am	2009-01-25 00:12:10 UTC (rev 3564)
+++ kazehakase/trunk/src/bookmarks/Makefile.am	2009-01-25 01:07:23 UTC (rev 3565)
@@ -36,6 +36,7 @@
 	kz-root-bookmark.h \
 	kz-smart-bookmark.h \
 	kz-bookmark-file.h \
+	kz-bookmark-separator.h \
 	kz-bookmark-filter.h \
 	kz-bookmark-bar.h \
 	kz-bookmark-item.h \
@@ -75,6 +76,7 @@
 	kz-root-bookmark.c \
 	kz-smart-bookmark.c \
 	kz-bookmark-file.c \
+	kz-bookmark-separator.c \
 	kz-bookmark-filter.c \
 	kz-bookmark-bar.c \
 	kz-bookmark-item.c \

Modified: kazehakase/trunk/src/bookmarks/kz-actions-bookmark.c
===================================================================
--- kazehakase/trunk/src/bookmarks/kz-actions-bookmark.c	2009-01-25 00:12:10 UTC (rev 3564)
+++ kazehakase/trunk/src/bookmarks/kz-actions-bookmark.c	2009-01-25 01:07:23 UTC (rev 3565)
@@ -27,6 +27,7 @@
 #include "kz-bookmark-edit-win.h"
 #include "kz-smart-bookmark.h"
 #include "kz-bookmark-file.h"
+#include "kz-bookmark-separator.h"
 #include "utils.h"
 
 

Modified: kazehakase/trunk/src/bookmarks/kz-bookmark-bar.c
===================================================================
--- kazehakase/trunk/src/bookmarks/kz-bookmark-bar.c	2009-01-25 00:12:10 UTC (rev 3564)
+++ kazehakase/trunk/src/bookmarks/kz-bookmark-bar.c	2009-01-25 01:07:23 UTC (rev 3565)
@@ -35,6 +35,7 @@
 #include "kz-bookmark-item.h"
 #include "kz-bookmark.h"
 #include "kz-bookmark-file.h"
+#include "kz-bookmark-separator.h"
 #include "kz-bookmark-utils.h"
 #include "kz-actions.h"
 #include "kz-notebook.h"

Modified: kazehakase/trunk/src/bookmarks/kz-bookmark-edit.c
===================================================================
--- kazehakase/trunk/src/bookmarks/kz-bookmark-edit.c	2009-01-25 00:12:10 UTC (rev 3564)
+++ kazehakase/trunk/src/bookmarks/kz-bookmark-edit.c	2009-01-25 01:07:23 UTC (rev 3565)
@@ -23,6 +23,7 @@
 
 #include <glib/gi18n.h>
 #include "kz-bookmark-edit.h"
+#include "kz-bookmark-separator.h"
 #include "kz-smart-bookmark.h"
 #include "gtk-utils.h"
 #include "kz-thumbnail.h"

Modified: kazehakase/trunk/src/bookmarks/kz-bookmark-editor.c
===================================================================
--- kazehakase/trunk/src/bookmarks/kz-bookmark-editor.c	2009-01-25 00:12:10 UTC (rev 3564)
+++ kazehakase/trunk/src/bookmarks/kz-bookmark-editor.c	2009-01-25 01:07:23 UTC (rev 3565)
@@ -32,6 +32,7 @@
 #include "kz-icons.h"
 #include "kz-bookmarks-view.h"
 #include "kz-bookmark-file.h"
+#include "kz-bookmark-separator.h"
 
 
 enum {

Modified: kazehakase/trunk/src/bookmarks/kz-bookmark-file.c
===================================================================
--- kazehakase/trunk/src/bookmarks/kz-bookmark-file.c	2009-01-25 00:12:10 UTC (rev 3564)
+++ kazehakase/trunk/src/bookmarks/kz-bookmark-file.c	2009-01-25 01:07:23 UTC (rev 3565)
@@ -32,6 +32,7 @@
 #include "kz-io.h"
 #include "kz-xmlrpc.h"
 
+#include "kz-bookmark-separator.h"
 /* bookmark_file file types */
 #include "kz-xbel.h"
 #include "kz-rss.h"

Modified: kazehakase/trunk/src/bookmarks/kz-bookmark-file.h
===================================================================
--- kazehakase/trunk/src/bookmarks/kz-bookmark-file.h	2009-01-25 00:12:10 UTC (rev 3564)
+++ kazehakase/trunk/src/bookmarks/kz-bookmark-file.h	2009-01-25 01:07:23 UTC (rev 3565)
@@ -54,7 +54,7 @@
 
 struct _KzBookmarkFile
 {
-	KzBookmark         parent;
+	KzBookmark          parent;
 	KzBookmarkFileFlag  flags;
 };
 

Modified: kazehakase/trunk/src/bookmarks/kz-bookmark-menu-item-list.c
===================================================================
--- kazehakase/trunk/src/bookmarks/kz-bookmark-menu-item-list.c	2009-01-25 00:12:10 UTC (rev 3564)
+++ kazehakase/trunk/src/bookmarks/kz-bookmark-menu-item-list.c	2009-01-25 01:07:23 UTC (rev 3565)
@@ -28,6 +28,7 @@
 
 #include "kazehakase.h"
 #include "kz-icons.h"
+#include "kz-bookmark-separator.h"
 #include "kz-bookmark-menu-item.h"
 #include "kz-bookmark-separator-menu-item.h"
 #include "kz-bookmark-folder-menu-item.h"

Modified: kazehakase/trunk/src/bookmarks/kz-bookmark-menu.c
===================================================================
--- kazehakase/trunk/src/bookmarks/kz-bookmark-menu.c	2009-01-25 00:12:10 UTC (rev 3564)
+++ kazehakase/trunk/src/bookmarks/kz-bookmark-menu.c	2009-01-25 01:07:23 UTC (rev 3565)
@@ -27,6 +27,7 @@
 
 #include "kazehakase.h"
 #include "utils.h"
+#include "kz-bookmark-separator.h"
 #include "kz-bookmark-menu-item-list.h"
 #include "kz-bookmark-menu-item.h"
 #include "kz-bookmark-folder-menu-item.h"

Modified: kazehakase/trunk/src/bookmarks/kz-bookmark-separator-menu-item.c
===================================================================
--- kazehakase/trunk/src/bookmarks/kz-bookmark-separator-menu-item.c	2009-01-25 00:12:10 UTC (rev 3564)
+++ kazehakase/trunk/src/bookmarks/kz-bookmark-separator-menu-item.c	2009-01-25 01:07:23 UTC (rev 3565)
@@ -27,6 +27,7 @@
 #include <glib/gi18n.h>
 
 #include "kazehakase.h"
+#include "kz-bookmark-separator.h"
 #include "gtk-utils.h"
 #include "utils.h"
 

Added: kazehakase/trunk/src/bookmarks/kz-bookmark-separator.c
===================================================================
--- kazehakase/trunk/src/bookmarks/kz-bookmark-separator.c	                        (rev 0)
+++ kazehakase/trunk/src/bookmarks/kz-bookmark-separator.c	2009-01-25 01:07:23 UTC (rev 3565)
@@ -0,0 +1,44 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ *  Copyright (C) 2003 Hiroyuki Ikezoe
+ *  Copyright (C) 2003 Takuro Ashie
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include "kz-bookmark-separator.h"
+
+G_DEFINE_TYPE(KzBookmarkSeparator, kz_bookmark_separator, KZ_TYPE_BOOKMARK)
+
+static void
+kz_bookmark_separator_class_init (KzBookmarkSeparatorClass *klass)
+{
+}
+
+static void
+kz_bookmark_separator_init (KzBookmarkSeparator *separator)
+{
+}
+
+KzBookmark *
+kz_bookmark_separator_new (void)
+{
+	return g_object_new(KZ_TYPE_BOOKMARK_SEPARATOR,
+			    "title", "-----",
+			    NULL);
+}
+

Added: kazehakase/trunk/src/bookmarks/kz-bookmark-separator.h
===================================================================
--- kazehakase/trunk/src/bookmarks/kz-bookmark-separator.h	                        (rev 0)
+++ kazehakase/trunk/src/bookmarks/kz-bookmark-separator.h	2009-01-25 01:07:23 UTC (rev 3565)
@@ -0,0 +1,57 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ *  Copyright (C) 2003 Hiroyuki Ikezoe
+ *  Copyright (C) 2003 Takuro Ashie
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef __KZ_BOOKMARK_SEPARATOR_H__
+#define __KZ_BOOKMARK_SEPARATOR_H__
+
+#include "kz-bookmark.h"
+
+G_BEGIN_DECLS
+
+#define KZ_TYPE_BOOKMARK_SEPARATOR		(kz_bookmark_separator_get_type ())
+#define KZ_BOOKMARK_SEPARATOR(obj)		(G_TYPE_CHECK_INSTANCE_CAST ((obj), KZ_TYPE_BOOKMARK_SEPARATOR, KzBookmarkSeparator))
+#define KZ_BOOKMARK_SEPARATOR_CLASS(klass)	(G_TYPE_CHECK_CLASS_CAST ((klass),  KZ_TYPE_BOOKMARK_SEPARATOR, KzBookmarkSeparatorClass))
+#define KZ_IS_BOOKMARK_SEPARATOR(obj)		(G_TYPE_CHECK_INSTANCE_TYPE ((obj), KZ_TYPE_BOOKMARK_SEPARATOR))
+#define KZ_IS_BOOKMARK_SEPARATOR_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE ((klass),  KZ_TYPE_BOOKMARK_SEPARATOR))
+#define KZ_BOOKMARK_SEPARATOR_GET_CLASS(obj)	(G_TYPE_INSTANCE_GET_CLASS ((obj),  KZ_TYPE_BOOKMARK_SEPARATOR, KzBookmarkSeparatorClass))
+
+typedef struct _KzBookmarkSeparator         KzBookmarkSeparator;
+typedef struct _KzBookmarkSeparatorClass    KzBookmarkSeparatorClass;
+
+struct _KzBookmarkSeparator
+{
+	KzBookmark parent;
+};
+
+struct _KzBookmarkSeparatorClass
+{
+	KzBookmarkClass parent_class;
+};
+
+
+GType		kz_bookmark_separator_get_type		(void) G_GNUC_CONST; 
+
+KzBookmark     *kz_bookmark_separator_new		(void);
+
+G_END_DECLS
+
+#endif /* __KZ_BOOKMARK_SEPARATOR_H__ */

Modified: kazehakase/trunk/src/bookmarks/kz-bookmark.c
===================================================================
--- kazehakase/trunk/src/bookmarks/kz-bookmark.c	2009-01-25 00:12:10 UTC (rev 3564)
+++ kazehakase/trunk/src/bookmarks/kz-bookmark.c	2009-01-25 01:07:23 UTC (rev 3565)
@@ -30,6 +30,7 @@
 #include "kz-marshalers.h"
 #include "utils.h"
 #include "kz-bookmark-file.h"
+#include "kz-bookmark-separator.h"
 #include "kz-bookmarks-enum-types.h"
 
 enum {
@@ -377,7 +378,6 @@
 		kz_bookmark_set_id(bookmark, g_value_get_string(value));
 		break;
 	case PROP_TITLE:
-		g_return_if_fail(!kz_bookmark_is_separator(bookmark));
 		kz_bookmark_set_title(bookmark, g_value_get_string(value));
 		break;
 	case PROP_DOC_TITLE:
@@ -528,19 +528,6 @@
 
 
 KzBookmark *
-kz_bookmark_separator_new (void)
-{
-	KzBookmark *bookmark;
-
-	bookmark = g_object_new(KZ_TYPE_BOOKMARK,
-			        "title", "-----",
-			        "type",  KZ_BOOKMARK_SEPARATOR,
-				NULL);
-	return bookmark;
-}
-
-
-KzBookmark *
 kz_bookmark_new_with_attrs (const gchar *title,
 			    const gchar *uri,
 			    const gchar *description)
@@ -725,15 +712,6 @@
 }
 
 gboolean
-kz_bookmark_is_separator (KzBookmark *bookmark)
-{
-	g_return_val_if_fail(KZ_IS_BOOKMARK(bookmark), FALSE);
-
-	return (bookmark->type == KZ_BOOKMARK_SEPARATOR);
-}
-
-
-gboolean
 kz_bookmark_is_folder(KzBookmark *bookmark)
 {
 	g_return_val_if_fail(KZ_IS_BOOKMARK(bookmark), FALSE);

Modified: kazehakase/trunk/src/bookmarks/kz-bookmark.h
===================================================================
--- kazehakase/trunk/src/bookmarks/kz-bookmark.h	2009-01-25 00:12:10 UTC (rev 3564)
+++ kazehakase/trunk/src/bookmarks/kz-bookmark.h	2009-01-25 01:07:23 UTC (rev 3565)
@@ -42,7 +42,6 @@
 	KZ_BOOKMARK_NORMAL,
 	KZ_BOOKMARK_FOLDER,
 	KZ_BOOKMARK_PURE_FOLDER,
-	KZ_BOOKMARK_SEPARATOR,
 	KZ_BOOKMARK_N_TYPES
 } KzBookmarkType;
 
@@ -88,7 +87,6 @@
 						 const gchar *uri,
 						 const gchar *description);
 KzBookmark     *kz_bookmark_pure_folder_new	(void);
-KzBookmark     *kz_bookmark_separator_new	(void);
 /* set/get properties */
 /*
  * "ID" is md5sum of URI of the parent bookmark file + ":" + ID
@@ -122,7 +120,7 @@
 void		kz_bookmark_set_added_time	(KzBookmark  *bookmark,
 						 guint        time);
 /* separator interface */
-gboolean	kz_bookmark_is_separator	(KzBookmark  *bookmark);
+#define kz_bookmark_is_separator        KZ_IS_BOOKMARK_SEPARATOR
 
 /* folder interface */
 gboolean	kz_bookmark_is_folder		(KzBookmark  *bookmark);

Modified: kazehakase/trunk/src/bookmarks/kz-bookmarks-view.c
===================================================================
--- kazehakase/trunk/src/bookmarks/kz-bookmarks-view.c	2009-01-25 00:12:10 UTC (rev 3564)
+++ kazehakase/trunk/src/bookmarks/kz-bookmarks-view.c	2009-01-25 01:07:23 UTC (rev 3565)
@@ -26,6 +26,7 @@
 
 #include "kazehakase.h"
 #include "kz-bookmark-file.h"
+#include "kz-bookmark-separator.h"
 #include "kz-smart-bookmark.h"
 #include "kz-favicon.h"
 #include "kz-icons.h"

Modified: kazehakase/trunk/src/bookmarks/kz-nsbookmark.c
===================================================================
--- kazehakase/trunk/src/bookmarks/kz-nsbookmark.c	2009-01-25 00:12:10 UTC (rev 3564)
+++ kazehakase/trunk/src/bookmarks/kz-nsbookmark.c	2009-01-25 01:07:23 UTC (rev 3565)
@@ -21,6 +21,7 @@
  */
 
 #include "kz-nsbookmark.h"
+#include "kz-bookmark-separator.h"
 
 #include <string.h>
 #include <utils.h>

Modified: kazehakase/trunk/src/bookmarks/kz-xbel.c
===================================================================
--- kazehakase/trunk/src/bookmarks/kz-xbel.c	2009-01-25 00:12:10 UTC (rev 3564)
+++ kazehakase/trunk/src/bookmarks/kz-xbel.c	2009-01-25 01:07:23 UTC (rev 3565)
@@ -25,6 +25,7 @@
 #include "kz-xml.h"
 #include "utils.h"
 #include "kz-smart-bookmark.h"
+#include "kz-bookmark-separator.h"
 
 #include <string.h>
 #include <stdlib.h>

Modified: kazehakase/trunk/src/sidebar/kz-bookmarks-sidebar.c
===================================================================
--- kazehakase/trunk/src/sidebar/kz-bookmarks-sidebar.c	2009-01-25 00:12:10 UTC (rev 3564)
+++ kazehakase/trunk/src/sidebar/kz-bookmarks-sidebar.c	2009-01-25 01:07:23 UTC (rev 3565)
@@ -26,6 +26,7 @@
 #include "kazehakase.h"
 #include "kz-actions.h"
 #include "kz-bookmarks-view.h"
+#include "kz-bookmark-separator.h"
 
 
 enum {

Modified: kazehakase/trunk/test/test-bookmark-separator.c
===================================================================
--- kazehakase/trunk/test/test-bookmark-separator.c	2009-01-25 00:12:10 UTC (rev 3564)
+++ kazehakase/trunk/test/test-bookmark-separator.c	2009-01-25 01:07:23 UTC (rev 3565)
@@ -1,4 +1,4 @@
-#include "src/bookmarks/kz-bookmark.h"
+#include "src/bookmarks/kz-bookmark-separator.h"
 
 #include <gcutter.h>
 



More information about the Kazehakase-cvs mailing list
Zurück zum Archiv-Index