Author: mkrueger
Date: 2008-02-03 08:31:47 -0500 (Sun, 03 Feb 2008)
New Revision: 94683

Modified:
   trunk/monodevelop/main/src/core/MonoDevelop.Ide/ChangeLog
   
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs
   
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IPrintable.cs
   
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/ISplittable.cs
   
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewCommandHandlers.cs
   trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.addin.xml
Log:
* MonoDevelop.Ide.Gui.Content/ISplittable.cs,
  MonoDevelop.Ide.Gui.Content/IPrintable.cs,
  MonoDevelop.Ide.Commands/FileCommands.cs,
  MonoDevelop.Ide.addin.xml,
  MonoDevelop.Ide.Gui/ViewCommandHandlers.cs: Moved print
  infrastructure to MonoDevelop.Ide.

Modified: trunk/monodevelop/main/src/core/MonoDevelop.Ide/ChangeLog
===================================================================
--- trunk/monodevelop/main/src/core/MonoDevelop.Ide/ChangeLog   2008-02-03 
13:21:12 UTC (rev 94682)
+++ trunk/monodevelop/main/src/core/MonoDevelop.Ide/ChangeLog   2008-02-03 
13:31:47 UTC (rev 94683)
@@ -1,6 +1,14 @@
 2008-02-03  Mike Krüger <[EMAIL PROTECTED]> 
 
        * MonoDevelop.Ide.Gui.Content/ISplittable.cs,
+         MonoDevelop.Ide.Gui.Content/IPrintable.cs,
+         MonoDevelop.Ide.Commands/FileCommands.cs, MonoDevelop.Ide.addin.xml,
+         MonoDevelop.Ide.Gui/ViewCommandHandlers.cs: Moved print infrastructure
+         to MonoDevelop.Ide.
+
+2008-02-03  Mike Krüger <[EMAIL PROTECTED]> 
+
+       * MonoDevelop.Ide.Gui.Content/ISplittable.cs,
          MonoDevelop.Ide.Commands/WindowCommands.cs, MonoDevelop.Ide.addin.xml,
          MonoDevelop.Ide.Gui/ViewCommandHandlers.cs: Added splitting
          infrastructure.

Modified: 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs
===================================================================
--- 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs
    2008-02-03 13:21:12 UTC (rev 94682)
+++ 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs
    2008-02-03 13:31:47 UTC (rev 94683)
@@ -56,7 +56,9 @@
                OpenFileInSolution,
                OpenInTerminal,
                OpenFolder,
-               OpenContainingFolder
+               OpenContainingFolder,
+               PrintDocument,
+               PrintPreviewDocument
        }
        
        internal class NewProjectHandler : CommandHandler

Modified: 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewCommandHandlers.cs
===================================================================
--- 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewCommandHandlers.cs
  2008-02-03 13:21:12 UTC (rev 94682)
+++ 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewCommandHandlers.cs
  2008-02-03 13:31:47 UTC (rev 94683)
@@ -665,6 +665,24 @@
                        split.Unsplit ();
                }
 #endregion
+#region Printing
+               [CommandUpdateHandler (FileCommands.PrintDocument)]
+               [CommandUpdateHandler (FileCommands.PrintPreviewDocument)]
+               protected void UpdatePrintCommands (CommandInfo info)
+               {
+                       info.Enabled = GetContent <IPrintable> () != null;
+               }
+               [CommandHandler (FileCommands.PrintDocument)]
+               public void PrintDocument ()
+               {
+                       GetContent <IPrintable> ().PrintDocument ();
+               }
+               [CommandHandler (FileCommands.PrintPreviewDocument)]
+               public void PrintPreviewDocument ()
+               {
+                       GetContent <IPrintable> ().PrintPreviewDocument ();
+               }
+#endregion
                
        }
 }

Modified: 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IPrintable.cs
===================================================================
--- 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IPrintable.cs
   2008-02-03 13:21:12 UTC (rev 94682)
+++ 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IPrintable.cs
   2008-02-03 13:31:47 UTC (rev 94683)
@@ -1,40 +1,38 @@
-//  IPrintable.cs
 //
-//  This file was derived from a file from #Develop. 
+// IPrintable.cs
 //
-//  Copyright (C) 2001-2007 Mike Krüger <[EMAIL PROTECTED]>
+// Author:
+//   Mike Krüger <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
 // 
-//  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 of the License, or
-//  (at your option) any later version.
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
 // 
-//  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
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
 
 using System;
-using System.Drawing.Printing;
 
 namespace MonoDevelop.Ide.Gui.Content
 {
-       /// <summary>
-       /// If a IViewContent object is from the type IPrintable it signals
-       /// that it's contents could be printed to a printer, fax etc.
-       /// </summary>
        public interface IPrintable
        {
-               /// <summary>
-               /// Returns the PrintDocument for this object, see the .NET 
reference
-               /// for more information about printing.
-               /// </summary>
-               PrintDocument PrintDocument {
-                       get;
-               }
+               void PrintDocument ();
+               void PrintPreviewDocument ();
        }
 }

Modified: 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/ISplittable.cs
===================================================================
--- 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/ISplittable.cs
  2008-02-03 13:21:12 UTC (rev 94682)
+++ 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/ISplittable.cs
  2008-02-03 13:31:47 UTC (rev 94683)
@@ -28,7 +28,7 @@
 
 using System;
 
-namespace MonoDevelop.Ide
+namespace MonoDevelop.Ide.Gui.Content
 {
        public interface ISplittable
        {

Modified: 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.addin.xml
===================================================================
--- trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.addin.xml   
2008-02-03 13:21:12 UTC (rev 94682)
+++ trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.addin.xml   
2008-02-03 13:31:47 UTC (rev 94683)
@@ -21,7 +21,7 @@
                <Addin id="Components" version="0.19.0"/>
        </Dependencies>
 
-       <!-- Extension points -->
+       <!-- Extension ponts -->
        
        <ConditionType id="combineopen" 
type="MonoDevelop.Ide.Codons.CombineOpenCondition" />
        <ConditionType id="activeproject" 
type="MonoDevelop.Ide.Codons.ProjectActiveCondition" />
@@ -510,6 +510,16 @@
                                icon = "gtk-save-as"
                                shortcut = "Control|Shift|S" 
                                description = "Save file as" />
+               <Command id = 
"MonoDevelop.Ide.Commands.FileCommands.PrintDocument"
+                               _label = "_Print..." 
+                               _description = "Print current document" 
+                               icon  = "gtk-print"
+                               shortcut = "Control|P" />
+               <Command id = 
"MonoDevelop.Ide.Commands.FileCommands.PrintPreviewDocument"
+                               _label = "Print Previe_w" 
+                               description = "Show print preview" 
+                               icon  = "gtk-print-preview"
+                               shortcut = "Shift|Control|P" />
                <Command id = 
"MonoDevelop.Ide.Commands.FileCommands.RecentFileList"
                                defaultHandler = 
"MonoDevelop.Ide.Commands.RecentFileListHandler"
                                type="array"
@@ -1161,6 +1171,7 @@
                        <CommandItem id = 
"MonoDevelop.Ide.Commands.FileCommands.OpenFile" />
                        <CommandItem id = 
"MonoDevelop.Ide.Commands.FileCommands.Save" />
                        <CommandItem id = 
"MonoDevelop.Ide.Commands.FileCommands.SaveAll" />
+                       <CommandItem id = 
"MonoDevelop.Ide.Commands.FileCommands.PrintDocument" />
                        <SeparatorItem id = "Separator1" />
                        <CommandItem id = 
"MonoDevelop.Ide.Commands.EditCommands.Undo" />
                        <CommandItem id = 
"MonoDevelop.Ide.Commands.EditCommands.Redo" />
@@ -1214,6 +1225,9 @@
                        <CommandItem id = 
"MonoDevelop.Ide.Commands.FileCommands.SaveAs" />
                        <CommandItem id = 
"MonoDevelop.Ide.Commands.FileCommands.SaveAll" />
                        <SeparatorItem id = "SaveSeparator" />
+                       <CommandItem id = 
"MonoDevelop.Ide.Commands.FileCommands.PrintPreviewDocument" />
+                       <CommandItem id = 
"MonoDevelop.Ide.Commands.FileCommands.PrintDocument" />
+                       <SeparatorItem id = "PrintSeparator" />
                        <CommandItem id = 
"MonoDevelop.Ide.Commands.FileCommands.CloseFile" />
                        <CommandItem id = 
"MonoDevelop.Ide.Commands.FileCommands.CloseAllFiles" />
                        <CommandItem id = 
"MonoDevelop.Ide.Commands.FileCommands.CloseCombine" />

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to