private bool SetupEditor(Editor editor)
        {
            EditorState state = editor.CreateState ();

            PhotoImageView photo_view = App.Instance.Organizer.PhotoView.View;

            if (Page.InPhotoView && photo_view != null) {
                state.Selection = photo_view.Selection;
                state.PhotoImageView = photo_view;
            } else {
                state.Selection = Gdk.Rectangle.Zero;
                state.PhotoImageView = null;
            }
            if ((Page.Sidebar as Sidebar).Selection == null)
                return false;
            state.Items = (Page.Sidebar as Sidebar).Selection.Items;

            editor.Initialize (state);
            return true;
        }
Ejemplo n.º 2
0
		private bool SetupEditor (Editor editor) {
			EditorState state = editor.CreateState ();

			EditorSelection selection = new EditorSelection ();
			PhotoImageView photo_view = MainWindow.Toplevel.PhotoView.View;

			if (Page.InPhotoView && photo_view != null) {
				if (photo_view.GetSelection (out selection.x, out selection.y,
							out selection.width, out selection.height))
					state.Selection = selection;
				else
					state.Selection = null;
				state.PhotoImageView = photo_view;
			} else {
				state.Selection = null;
				state.PhotoImageView = null;
			}
			if (Page.Sidebar.Selection == null)
				return false;
			state.Items = Page.Sidebar.Selection.Items;

			editor.Initialize (state);
			return true;
		}