[pdfmod] A little more reorganization



commit 329e69b0775eb2e04ab3ceaddb088e40397f21ea
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Wed Aug 12 16:36:09 2009 -0700

    A little more reorganization

 src/Makefile.am                                    |    8 +++-----
 src/PdfMod.mdp                                     |    6 ++----
 src/PdfMod/Gui/Client.cs                           |    4 ++--
 .../Gui/{DocumentView.cs => DocumentIconView.cs}   |   20 ++++++++++----------
 src/PdfMod/Gui/PageCell.cs                         |    2 +-
 src/PdfMod/Gui/{ListStore.cs => PageListStore.cs}  |    7 ++-----
 6 files changed, 20 insertions(+), 27 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 1c0e889..d887b3d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -85,10 +85,10 @@ FILES =  \
 	PdfMod/Gui/Actions.cs \
 	PdfMod/Gui/CairoCell.cs \
 	PdfMod/Gui/Client.cs \
-	PdfMod/Gui/DocumentView.cs \
-	PdfMod/Gui/ListStore.cs \
+	PdfMod/Gui/DocumentIconView.cs \
 	PdfMod/Gui/MetadataEditorBox.cs \
 	PdfMod/Gui/PageCell.cs \
+	PdfMod/Gui/PageListStore.cs \
 	PdfMod/Gui/SelectMatchingBox.cs \
 	PdfMod/Main.cs \
 	PdfMod/Pdf/Actions/BasePageAction.cs \
@@ -112,13 +112,11 @@ REFERENCES =  \
 	Mono.Cairo \
 	Mono.Posix \
 	-pkg:gconf-sharp-2.0 \
-	-pkg:glade-sharp-2.0 \
 	-pkg:glib-sharp-2.0 \
 	-pkg:gnome-sharp-2.0 \
 	-pkg:gtk-sharp-2.0 \
 	System \
-	System.Core \
-	System.Drawing
+	System.Core
 
 DLL_REFERENCES =  \
 	../lib/Hyena.dll \
diff --git a/src/PdfMod.mdp b/src/PdfMod.mdp
index 7f16fb0..0619ef0 100644
--- a/src/PdfMod.mdp
+++ b/src/PdfMod.mdp
@@ -21,8 +21,8 @@
   <Contents>
     <File name="PdfMod/Main.cs" subtype="Code" buildaction="Compile" />
     <File name="PdfMod/Core/AssemblyInfo.cs" subtype="Code" buildaction="Compile" />
-    <File name="PdfMod/Gui/DocumentView.cs" subtype="Code" buildaction="Compile" />
-    <File name="PdfMod/Gui/ListStore.cs" subtype="Code" buildaction="Compile" />
+    <File name="PdfMod/Gui/DocumentIconView.cs" subtype="Code" buildaction="Compile" />
+    <File name="PdfMod/Gui/PageListStore.cs" subtype="Code" buildaction="Compile" />
     <File name="PdfMod/Gui/Actions.cs" subtype="Code" buildaction="Compile" />
     <File name="Resources/UIManager.xml" subtype="Code" buildaction="EmbedAsResource" />
     <File name="PdfMod/Pdf/Actions/RemoveAction.cs" subtype="Code" buildaction="Compile" />
@@ -50,9 +50,7 @@
     <ProjectReference type="Gac" localcopy="True" refto="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
     <ProjectReference type="Gac" localcopy="True" refto="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
     <ProjectReference type="Gac" localcopy="True" refto="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
-    <ProjectReference type="Gac" localcopy="True" refto="glade-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
     <ProjectReference type="Gac" localcopy="True" refto="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
-    <ProjectReference type="Gac" localcopy="True" refto="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
     <ProjectReference type="Gac" localcopy="True" refto="Mono.Cairo, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
     <ProjectReference type="Gac" localcopy="True" refto="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
     <ProjectReference type="Gac" localcopy="True" refto="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
diff --git a/src/PdfMod/Gui/Client.cs b/src/PdfMod/Gui/Client.cs
index d2078a2..d957739 100644
--- a/src/PdfMod/Gui/Client.cs
+++ b/src/PdfMod/Gui/Client.cs
@@ -31,7 +31,7 @@ namespace PdfMod.Gui
         public Actions Actions { get; private set; }
         public Gtk.Statusbar StatusBar { get; private set; }
         public Gtk.Window Window { get; private set; }
-        public DocumentView IconView { get; private set; }
+        public DocumentIconView IconView { get; private set; }
         public MetadataEditorBox EditorBox { get; private set; }
 
         static Client ()
@@ -69,7 +69,7 @@ namespace PdfMod.Gui
             };
 
             // PDF Icon View
-            IconView = new DocumentView (this);
+            IconView = new DocumentIconView (this);
             var iconview_sw = new Gtk.ScrolledWindow ();
             iconview_sw.Child = IconView;
 
diff --git a/src/PdfMod/Gui/DocumentView.cs b/src/PdfMod/Gui/DocumentIconView.cs
similarity index 96%
rename from src/PdfMod/Gui/DocumentView.cs
rename to src/PdfMod/Gui/DocumentIconView.cs
index 58ec601..921fab3 100644
--- a/src/PdfMod/Gui/DocumentView.cs
+++ b/src/PdfMod/Gui/DocumentIconView.cs
@@ -22,7 +22,7 @@ namespace PdfMod.Gui
         All
     }
 
-    public class DocumentView : Gtk.IconView, IDisposable
+    public class DocumentIconView : Gtk.IconView, IDisposable
     {
         public const int MIN_WIDTH = 128;
         public const int MAX_WIDTH = 2054;
@@ -41,12 +41,12 @@ namespace PdfMod.Gui
 
         private Client app;
         private Document document;
-        private PdfListStore store;
+        private PageListStore store;
         private PageCell page_renderer;
         private PageSelectionMode page_selection_mode = PageSelectionMode.None;
         private bool highlighted;
 
-        public PdfListStore Store { get { return store; } }
+        public PageListStore Store { get { return store; } }
         public bool CanZoomIn { get; private set; }
         public bool CanZoomOut { get; private set; }
 
@@ -56,7 +56,7 @@ namespace PdfMod.Gui
                 foreach (var path in SelectedItems) {
                     TreeIter iter;
                     store.GetIter (out iter, path);
-                    pages.Add (store.GetValue (iter, PdfListStore.PageColumn) as Page);
+                    pages.Add (store.GetValue (iter, PageListStore.PageColumn) as Page);
                 }
                 pages.Sort ((a, b) => { return a.Index < b.Index ? -1 : 1; });
                 return pages;
@@ -65,21 +65,21 @@ namespace PdfMod.Gui
 
         public event System.Action ZoomChanged;
 
-        public DocumentView (Client app) : base ()
+        public DocumentIconView (Client app) : base ()
         {
             this.app = app;
 
-            TooltipColumn = PdfListStore.TooltipColumn;
+            TooltipColumn = PageListStore.TooltipColumn;
             SelectionMode = SelectionMode.Multiple;
             ColumnSpacing = RowSpacing = Margin;
-            Model = store = new PdfListStore ();
+            Model = store = new PageListStore ();
             CanZoomIn = CanZoomOut = true;
             Reorderable = false;
             Spacing = 0;
 
             page_renderer = new PageCell (this);
             PackStart (page_renderer, true);
-            AddAttribute (page_renderer, "page", PdfListStore.PageColumn);
+            AddAttribute (page_renderer, "page", PageListStore.PageColumn);
 
             // TODO enable uri-list as drag source target for drag-out-of-pdfmod-to-extract feature
             EnableModelDragSource (Gdk.ModifierType.None, new TargetEntry [] { move_internal_target, move_external_target, uri_src_target }, Gdk.DragAction.Default | Gdk.DragAction.Move);
@@ -268,7 +268,7 @@ namespace PdfMod.Gui
             if (TreeIter.Zero.Equals (iter))
                 return -1;
 
-            var to_index = (store.GetValue (iter, PdfListStore.PageColumn) as Page).Index;
+            var to_index = (store.GetValue (iter, PageListStore.PageColumn) as Page).Index;
             if (pos == IconViewDropPosition.DropRight) {
                 to_index++;
             }
@@ -528,7 +528,7 @@ namespace PdfMod.Gui
                         select = (i % 2) == 1;
                         break;
                     case PageSelectionMode.Matching:
-                        select = matches.Contains (store.GetValue (iter, PdfListStore.PageColumn) as Page);
+                        select = matches.Contains (store.GetValue (iter, PageListStore.PageColumn) as Page);
                         break;
                     }
 
diff --git a/src/PdfMod/Gui/PageCell.cs b/src/PdfMod/Gui/PageCell.cs
index c518d0a..4601b62 100644
--- a/src/PdfMod/Gui/PageCell.cs
+++ b/src/PdfMod/Gui/PageCell.cs
@@ -72,7 +72,7 @@ namespace PdfMod.Gui
                 // Create a new thumbnail surface, but only on 200px boundaries, then we scale down if needed
                 var w = width + (width % scale_every);
                 var h = height + (height % scale_every);
-                cache_obj = Page.Document.GetSurface (Page, (int)w, (int)h, DocumentView.MIN_WIDTH);
+                cache_obj = Page.Document.GetSurface (Page, (int)w, (int)h, DocumentIconView.MIN_WIDTH);
                 if (cache_obj == null) {
                     return;
                 }
diff --git a/src/PdfMod/Gui/ListStore.cs b/src/PdfMod/Gui/PageListStore.cs
similarity index 89%
rename from src/PdfMod/Gui/ListStore.cs
rename to src/PdfMod/Gui/PageListStore.cs
index 5ad6a97..f5558eb 100644
--- a/src/PdfMod/Gui/ListStore.cs
+++ b/src/PdfMod/Gui/PageListStore.cs
@@ -1,9 +1,6 @@
 
 using System;
 using System.Collections.Generic;
-using System.Runtime.InteropServices;
-using System.Drawing;
-using System.Drawing.Drawing2D;
 using System.Linq;
 
 using Mono.Unix;
@@ -13,13 +10,13 @@ using PdfMod.Pdf;
 
 namespace PdfMod.Gui
 {
-    public class PdfListStore : ListStore
+    public class PageListStore : ListStore
     {
         public const int SortColumn = 0;
         public const int TooltipColumn = 1;
         public const int PageColumn = 2;
 
-        public PdfListStore () : base (typeof (int), typeof (string), typeof (Page))
+        public PageListStore () : base (typeof (int), typeof (string), typeof (Page))
         {
             SetSortColumnId (SortColumn, SortType.Ascending);
         }



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