f-spot r3562 - in trunk: . src src/Imaging



Author: sdelcroix
Date: Thu Jan 17 12:47:58 2008
New Revision: 3562
URL: http://svn.gnome.org/viewvc/f-spot?rev=3562&view=rev

Log:
2008-01-17  Stephane Delcroix  <sdelcroix novell com>

	* src/: ns changes to allow fresh LogicalTerm implementation in 
	Fspot.Query


Modified:
   trunk/ChangeLog
   trunk/src/Imaging/IptcFile.cs
   trunk/src/Imaging/PngFile.cs
   trunk/src/Imaging/Tiff.cs
   trunk/src/InfoBox.cs
   trunk/src/InfoDisplay.cs
   trunk/src/MainWindow.cs
   trunk/src/MetadataStore.cs
   trunk/src/TagCommands.cs
   trunk/src/TagPopup.cs
   trunk/src/TagQueryWidget.cs
   trunk/src/Term.cs
   trunk/src/XmpTagsImporter.cs

Modified: trunk/src/Imaging/IptcFile.cs
==============================================================================
--- trunk/src/Imaging/IptcFile.cs	(original)
+++ trunk/src/Imaging/IptcFile.cs	Thu Jan 17 12:47:58 2008
@@ -364,16 +364,16 @@
 			foreach (DataSet data in sets) {
 				switch (data.ID) {
 				case DataSetID.CopyrightNotice:
-					MetadataStore.AddLiteral (sink, "dc:rights", "rdf:Alt", new Literal (data.XmpObject, "x-default", null));
+					MetadataStore.AddLiteral (sink, "dc:rights", "rdf:Alt", new SemWeb.Literal (data.XmpObject, "x-default", null));
 					break;
 				case DataSetID.ByLine:
-					MetadataStore.AddLiteral (sink, "dc:creator", "rdf:Seq", new Literal (data.XmpObject, "x-default", null));
+					MetadataStore.AddLiteral (sink, "dc:creator", "rdf:Seq", new SemWeb.Literal (data.XmpObject, "x-default", null));
 					break;
 				case DataSetID.CaptionAbstract:
-					MetadataStore.AddLiteral (sink, "dc:description", "rdf:Alt", new Literal (data.XmpObject, "x-default", null));
+					MetadataStore.AddLiteral (sink, "dc:description", "rdf:Alt", new SemWeb.Literal (data.XmpObject, "x-default", null));
 					break;
 				case DataSetID.ObjectName:
-					MetadataStore.AddLiteral (sink, "dc:title", "rdf:Alt", new Literal (data.XmpObject, "x-default", null));
+					MetadataStore.AddLiteral (sink, "dc:title", "rdf:Alt", new SemWeb.Literal (data.XmpObject, "x-default", null));
 					break;
 				case DataSetID.Keywords:
 					if (keywords == null) {
@@ -387,13 +387,13 @@
 					}
 					sink.Add (new Statement (keywords, 
 								 MetadataStore.Namespaces.Resolve ("rdf:li"), 
-								 new Literal (data.XmpObject, "x-default", null)));
+								 new SemWeb.Literal (data.XmpObject, "x-default", null)));
 					break;
 				default:
 					if (data.XmpPredicate != null) {
 						sink.Add (new Statement (MetadataStore.FSpotXMPBase, 
 									 (Entity)data.XmpPredicate, 
-									 new Literal (data.XmpObject)));
+									 new SemWeb.Literal (data.XmpObject)));
 					}
 					break;
 				}

Modified: trunk/src/Imaging/PngFile.cs
==============================================================================
--- trunk/src/Imaging/PngFile.cs	(original)
+++ trunk/src/Imaging/PngFile.cs	Thu Jan 17 12:47:58 2008
@@ -89,16 +89,16 @@
 						MetadataStore.AddLiteral (sink, "xmp:CreatorTool", text.Text);
 						break;
 					case "Title":
-						MetadataStore.AddLiteral (sink, "dc:title", "rdf:Alt", new Literal (text.Text, "x-default", null));
+						MetadataStore.AddLiteral (sink, "dc:title", "rdf:Alt", new SemWeb.Literal (text.Text, "x-default", null));
 						break;
 					case "Author":
-						MetadataStore.AddLiteral (sink, "dc:creator", "rdf:Seq", new Literal (text.Text));
+						MetadataStore.AddLiteral (sink, "dc:creator", "rdf:Seq", new SemWeb.Literal (text.Text));
 						break;
 					case "Copyright":
-						MetadataStore.AddLiteral (sink, "dc:rights", "rdf:Alt", new Literal (text.Text, "x-default", null));
+						MetadataStore.AddLiteral (sink, "dc:rights", "rdf:Alt", new SemWeb.Literal (text.Text, "x-default", null));
 						break;
 					case "Description":
-						MetadataStore.AddLiteral (sink, "dc:description", "rdf:Alt", new Literal (text.Text, "x-default", null));
+						MetadataStore.AddLiteral (sink, "dc:description", "rdf:Alt", new SemWeb.Literal (text.Text, "x-default", null));
 						break;
 					case "Creation Time":
 						try {

Modified: trunk/src/Imaging/Tiff.cs
==============================================================================
--- trunk/src/Imaging/Tiff.cs	(original)
+++ trunk/src/Imaging/Tiff.cs	Thu Jan 17 12:47:58 2008
@@ -950,15 +950,15 @@
 					break;
 				case TagId.ImageDescription:
 					MetadataStore.AddLiteral (sink, "dc:description", "rdf:Alt", 
-								  new Literal (e.ValueAsString [0], "x-default", null));
+								  new SemWeb.Literal (e.ValueAsString [0], "x-default", null));
 					break;
 				case TagId.UserComment:
 					MetadataStore.AddLiteral (sink, "exif:UserComment", "rdf:Alt", 
-								  new Literal (e.ValueAsString [0], "x-default", null));
+								  new SemWeb.Literal (e.ValueAsString [0], "x-default", null));
 					break;
 				case TagId.Copyright:
 					MetadataStore.AddLiteral (sink, "dc:rights", "rdf:Alt", 
-								  new Literal (e.ValueAsString [0], "x-default", null));
+								  new SemWeb.Literal (e.ValueAsString [0], "x-default", null));
 					break;
 				case TagId.Artist:
 					MetadataStore.Add (sink, "dc:creator", "rdf:Seq", e.ValueAsString);
@@ -1005,11 +1005,11 @@
 					
 					Statement cols = new Statement (empty, 
 									(Entity) MetadataStore.Namespaces.Resolve ("exif:Columns"),
-									new Literal (pattern.Columns.ToString (), null, null));
+									new SemWeb.Literal (pattern.Columns.ToString (), null, null));
 					sink.Add (cols);
 					Statement rows = new Statement (empty, 
 									(Entity) MetadataStore.Namespaces.Resolve ("exif:Rows"),
-									new Literal (pattern.Rows.ToString (), null, null));
+									new SemWeb.Literal (pattern.Rows.ToString (), null, null));
 					sink.Add (rows);
 					string [] vals = e.ArrayToString (pattern.Values);
 					MetadataStore.Add (sink, empty, "exif:Values", "rdf:Seq", vals);

Modified: trunk/src/InfoBox.cs
==============================================================================
--- trunk/src/InfoBox.cs	(original)
+++ trunk/src/InfoBox.cs	Thu Jan 17 12:47:58 2008
@@ -182,24 +182,24 @@
 		{
 			if (stmt.Predicate == MetadataStore.Namespaces.Resolve ("tiff:ImageWidth")) {
 				if (width == null)
-					width = ((Literal)stmt.Object).Value;
+					width = ((SemWeb.Literal)stmt.Object).Value;
 				} else if (stmt.Predicate == MetadataStore.Namespaces.Resolve ("tiff:ImageLength")) {
 				if (height == null)
-					height = ((Literal)stmt.Object).Value;
+					height = ((SemWeb.Literal)stmt.Object).Value;
 			} else if (stmt.Predicate == MetadataStore.Namespaces.Resolve ("exif:PixelXDimension"))
-				width = ((Literal)stmt.Object).Value;						      
+				width = ((SemWeb.Literal)stmt.Object).Value;						      
 			else if (stmt.Predicate == MetadataStore.Namespaces.Resolve ("exif:PixelYDimension"))
-				height = ((Literal)stmt.Object).Value;
+				height = ((SemWeb.Literal)stmt.Object).Value;
 			else if (stmt.Predicate == MetadataStore.Namespaces.Resolve ("exif:ExposureTime"))
-				exposure = ((Literal)stmt.Object).Value;
+				exposure = ((SemWeb.Literal)stmt.Object).Value;
 			else if (stmt.Predicate == MetadataStore.Namespaces.Resolve ("exif:ApertureValue"))
-				aperture = ((Literal)stmt.Object).Value;
+				aperture = ((SemWeb.Literal)stmt.Object).Value;
 			else if (stmt.Predicate == MetadataStore.Namespaces.Resolve ("exif:FNumber"))
-				fnumber = ((Literal)stmt.Object).Value;
+				fnumber = ((SemWeb.Literal)stmt.Object).Value;
 			else if (stmt.Predicate == MetadataStore.Namespaces.Resolve ("exif:ISOSpeedRatings"))
 				iso_anon = stmt.Object;
 			else if (stmt.Subject == iso_anon && stmt.Predicate == MetadataStore.Namespaces.Resolve ("rdf:li"))
-				iso_speed = ((Literal)stmt.Object).Value;
+				iso_speed = ((SemWeb.Literal)stmt.Object).Value;
 			else if (add && stmt.Subject.Uri == null)
 				store.Add (stmt);
 

Modified: trunk/src/InfoDisplay.cs
==============================================================================
--- trunk/src/InfoDisplay.cs	(original)
+++ trunk/src/InfoDisplay.cs	Thu Jan 17 12:47:58 2008
@@ -321,9 +321,9 @@
 			
 			stream.Write ("<table cellpadding=5 cellspacing=0 width=100%>");
 			foreach (Statement sub in substore) {
-				if (sub.Object is Literal) {
+				if (sub.Object is SemWeb.Literal) {
 					string title;
-					string value = ((Literal)(sub.Object)).Value;
+					string value = ((SemWeb.Literal)(sub.Object)).Value;
 					string vc = String.Empty;
 					
 					Description.GetDescription (substore, sub, out title, out value);

Modified: trunk/src/MainWindow.cs
==============================================================================
--- trunk/src/MainWindow.cs	(original)
+++ trunk/src/MainWindow.cs	Thu Jan 17 12:47:58 2008
@@ -2456,7 +2456,7 @@
 		//How many pictures are associated to these tags?
 		Db db = MainWindow.Toplevel.Database;
 		FSpot.PhotoQuery count_query = new FSpot.PhotoQuery(db.Photos);
-		count_query.Terms = FSpot.Query.OrTerm.FromTags(tags);
+		count_query.Terms = FSpot.OrTerm.FromTags(tags);
 		int associated_photos = count_query.Photos.Length;
 
 		string header;
@@ -2820,7 +2820,7 @@
 		if (find_add_tag_with.Submenu != null)
 			find_add_tag_with.Submenu.Dispose ();
 		
-		Gtk.Menu submenu = FSpot.Query.TermMenuItem.GetSubmenu (tag_selection_widget.TagHighlight);
+		Gtk.Menu submenu = FSpot.TermMenuItem.GetSubmenu (tag_selection_widget.TagHighlight);
 		find_add_tag_with.Sensitive = (submenu != null);
 		if (submenu != null) 
 			find_add_tag_with.Submenu = submenu;	
@@ -2841,11 +2841,11 @@
 		// account for All and separator menu items
 		item_pos -= 2;
 		
-		FSpot.Query.Term parent_term = (FSpot.Query.Term) FSpot.Query.LogicWidget.Root.SubTerms [item_pos];
+		FSpot.Term parent_term = (FSpot.Term) FSpot.LogicWidget.Root.SubTerms [item_pos];
 		
-		if (FSpot.Query.LogicWidget.Box != null) {
-			FSpot.Query.Literal after = parent_term.Last as FSpot.Query.Literal;
-			FSpot.Query.LogicWidget.Box.InsertTerm (tag_selection_widget.TagHighlight, parent_term, after);
+		if (FSpot.LogicWidget.Box != null) {
+			FSpot.Literal after = parent_term.Last as FSpot.Literal;
+			FSpot.LogicWidget.Box.InsertTerm (tag_selection_widget.TagHighlight, parent_term, after);
 		}
 	}
 	

Modified: trunk/src/MetadataStore.cs
==============================================================================
--- trunk/src/MetadataStore.cs	(original)
+++ trunk/src/MetadataStore.cs	Thu Jan 17 12:47:58 2008
@@ -100,13 +100,13 @@
 			label = System.IO.Path.GetFileName (predicate);
 			value = null;
 
-			if (stmt.Object is Literal)
-			        value = ((Literal)(stmt.Object)).Value;
+			if (stmt.Object is SemWeb.Literal)
+			        value = ((SemWeb.Literal)(stmt.Object)).Value;
 
 			if (d != null) {
 				label = d.title;
 				if (d.formater != null && stmt.Object is Literal)
-					value = d.formater.GetValue (store, (Literal)stmt.Object);
+					value = d.formater.GetValue (store, (SemWeb.Literal)stmt.Object);
 
 			} else {
 				Statement sstmt = new Statement (stmt.Predicate,
@@ -114,8 +114,8 @@
 								 null);
 				
 				foreach (Statement tstmt in MetadataStore.Descriptions.Select (sstmt))
-					if (tstmt.Object is Literal)
-						label = ((Literal)(tstmt.Object)).Value;
+					if (tstmt.Object is SemWeb.Literal)
+						label = ((SemWeb.Literal)(tstmt.Object)).Value;
 			}
 			return;
 		}
@@ -130,7 +130,7 @@
 			this.type = type;
 		}
 
-		public virtual string GetValue (MemoryStore store, Literal obj)
+		public virtual string GetValue (MemoryStore store, SemWeb.Literal obj)
 		{
 			string result = obj.Value;
 
@@ -218,7 +218,7 @@
 #endif
 		}
 
-		public static void AddLiteral (StatementSink sink, string predicate, string type, Literal value)
+		public static void AddLiteral (StatementSink sink, string predicate, string type, SemWeb.Literal value)
 		{
 			Entity empty = new BNode ();
 			Statement top = new Statement (FSpotXMPBase, (Entity)MetadataStore.Namespaces.Resolve (predicate), empty);
@@ -237,7 +237,7 @@
 		{
 			Statement stmt = new Statement (FSpotXMPBase,
 							(Entity)MetadataStore.Namespaces.Resolve (predicate), 
-							new Literal (value));
+							new SemWeb.Literal (value));
 			sink.Add (stmt);
 		}
 
@@ -314,7 +314,7 @@
 			foreach (string value in values) {
 				Statement literal = new Statement (empty,
 								   (Entity)MetadataStore.Namespaces.Resolve ("rdf:li"),
-								   new Literal (value, null, null));
+								   new SemWeb.Literal (value, null, null));
 				sink.Add (literal);
 			}
 			sink.Add (top);

Modified: trunk/src/TagCommands.cs
==============================================================================
--- trunk/src/TagCommands.cs	(original)
+++ trunk/src/TagCommands.cs	Thu Jan 17 12:47:58 2008
@@ -444,9 +444,9 @@
 			query = new FSpot.PhotoQuery (db.Photos);
 			
 			if (db.Tags.Hidden != null)
-				query.Terms = FSpot.Query.OrTerm.FromTags (new Tag []{ t, db.Tags.Hidden });
+				query.Terms = FSpot.OrTerm.FromTags (new Tag []{ t, db.Tags.Hidden });
 			else 
-				query.Terms = new FSpot.Query.Literal (t);
+				query.Terms = new FSpot.Literal (t);
 
 			image_view = new FSpot.PhotoImageView (query);
 			image_view.SelectionXyRatio = 1.0;

Modified: trunk/src/TagPopup.cs
==============================================================================
--- trunk/src/TagPopup.cs	(original)
+++ trunk/src/TagPopup.cs	Thu Jan 17 12:47:58 2008
@@ -27,7 +27,7 @@
                 true
         );
 
-        FSpot.Query.TermMenuItem.Create (tags, popup_menu);
+        FSpot.TermMenuItem.Create (tags, popup_menu);
 
 		GtkUtil.MakeMenuSeparator (popup_menu);
 		

Modified: trunk/src/TagQueryWidget.cs
==============================================================================
--- trunk/src/TagQueryWidget.cs	(original)
+++ trunk/src/TagQueryWidget.cs	Thu Jan 17 12:47:58 2008
@@ -5,7 +5,7 @@
 using Gtk;
 using Gdk;
 
-namespace FSpot.Query
+namespace FSpot
 {
 	public class LiteralPopup
 	{

Modified: trunk/src/Term.cs
==============================================================================
--- trunk/src/Term.cs	(original)
+++ trunk/src/Term.cs	Thu Jan 17 12:47:58 2008
@@ -11,7 +11,7 @@
 using Gtk;
 using Gdk;
 
-namespace FSpot.Query {
+namespace FSpot {
 	public abstract class Term {
 		private ArrayList sub_terms = new ArrayList ();
 		private Term parent = null;

Modified: trunk/src/XmpTagsImporter.cs
==============================================================================
--- trunk/src/XmpTagsImporter.cs	(original)
+++ trunk/src/XmpTagsImporter.cs	Thu Jan 17 12:47:58 2008
@@ -114,7 +114,7 @@
 		private static string GetTextField (Resource value)
 		{
 			string text_field = null;
-			Literal l = value as Literal;
+			SemWeb.Literal l = value as SemWeb.Literal;
 			if (l != null && l.Value != null && l.Value.Length > 0) {
 				text_field = l.Value;
 				if (Char.IsControl (l.Value [l.Value.Length - 1]))
@@ -163,7 +163,7 @@
 				case Caption:
 				case Headline:
 					if (!descriptions.Contains (stmt.Predicate.Uri)) {
-						string caption = GetTextField (stmt.Object as Literal);
+						string caption = GetTextField (stmt.Object as SemWeb.Literal);
 						if (caption != null)
 							caption = caption.Trim ();
 
@@ -181,7 +181,7 @@
 						if ( (tag.Predicate != RdfType) && (!descriptions.Contains (stmt.Predicate.Uri)) ) {
 							string title = null;
 							try {
-								title = (GetTextField ((Literal) tag.Object)).Trim ();
+								title = (GetTextField ((SemWeb.Literal) tag.Object)).Trim ();
 							} catch {
 							}
 							if ( (title != null) && (title.Length > 0) )
@@ -192,7 +192,7 @@
 
 				case Urgency: // Used if Rating was not found
 				case Rating:
-					Literal l = stmt.Object as Literal;
+					SemWeb.Literal l = stmt.Object as SemWeb.Literal;
 					if (l != null && l.Value != null && l.Value.Length > 0) {
 						uint tmp_ui;
 						try {
@@ -217,7 +217,7 @@
 				case Country:
 				case Location:
 				case Source:
-					AddTagToPhoto (photo, stmt.Object as Literal, taginfo_table [stmt.Predicate] as TagInfo);
+					AddTagToPhoto (photo, stmt.Object as SemWeb.Literal, taginfo_table [stmt.Predicate] as TagInfo);
 					break;
 					
 				case Subject:
@@ -229,7 +229,7 @@
 					foreach (Statement tag in store.Select (new Statement (stmt.Object as Entity, null, null))) {
 						
 						if (tag.Predicate != RdfType)
-							AddTagToPhoto (photo, tag.Object as Literal, null);
+							AddTagToPhoto (photo, tag.Object as SemWeb.Literal, null);
 
 					}
 					break;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]