Пример #1
0
        public Stage(StageOperationFactory stageOperationFactory, 
			StageOperationParametersFactory stageOperationParametersFactory,
			BitmapCoreFactory bitmapCoreFactory)
        {
            mStageQueue = new List<StageOperationParameters>();
            mStageOperationFactory = stageOperationFactory;
            mStageOperationParametersFactory = stageOperationParametersFactory;
            mBitmapCoreFactory = bitmapCoreFactory;
        }
Пример #2
0
 public ExtendedStage(StageOperationFactory stageOperationFactory,
                      StageOperationParametersFactory stageOperationParametersFactoryFromID,
                      StageOperationParametersEditorFactory SOParametersEditorFactory,
                      StageOperationHolderFactory SOHolderFactory,
                      BitmapCoreFactory imageLoader) : base(stageOperationFactory, stageOperationParametersFactoryFromID, imageLoader)
 {
     mSOParametersEditorFactory = SOParametersEditorFactory;
     mSOHolderFactory           = SOHolderFactory;
 }
Пример #3
0
 public Stage(StageOperationFactory stageOperationFactory,
              StageOperationParametersFactory stageOperationParametersFactory,
              BitmapCoreFactory bitmapCoreFactory)
 {
     mStageQueue                      = new List <StageOperationParameters>();
     mStageOperationFactory           = stageOperationFactory;
     mStageOperationParametersFactory = stageOperationParametersFactory;
     mBitmapCoreFactory               = bitmapCoreFactory;
 }
Пример #4
0
        public ExtendedStage(StageOperationFactory stageOperationFactory, 
			StageOperationParametersFactory stageOperationParametersFactoryFromID,
			StageOperationParametersEditorFactory SOParametersEditorFactory,
			StageOperationHolderFactory SOHolderFactory,
			BitmapCoreFactory imageLoader)
            : base(stageOperationFactory, stageOperationParametersFactoryFromID, imageLoader)
        {
            mSOParametersEditorFactory = SOParametersEditorFactory;
            mSOHolderFactory = SOHolderFactory;
        }
Пример #5
0
    public StageEditorWindow(Type[] stageOperationTypes,
							  StageOperationFactory stageOperationFactory, 
							  StageOperationParametersFactory stageOperationParametersFactory,
							  StageOperationParametersEditorFactory stageOperationParametersEditorFactory, 
							  StageOperationHolderFactory stageOperationHolderFactory, 
							  BitmapCoreFactory floatBitmapGtkFactory)
        : base(Gtk.WindowType.Toplevel)
    {
        mStageOperationTypes = stageOperationTypes;
        mStageOperationFactory = stageOperationFactory;
        mStageOperationParametersFactory = stageOperationParametersFactory;
        mStageOperationParametersEditorFactory = stageOperationParametersEditorFactory;
        mStageOperationHolderFactory = stageOperationHolderFactory;
        mFloatBitmapGtkFactory = floatBitmapGtkFactory;

        // ** Preparing UI **
        Build ();

        mFrozenPanel = new FrozenPanel();
        mFrozenPanel.UnfreezeButtonClicked  += delegate {
            mStage.FrozenAt = null;
        };
        stage_vbox.Add(mFrozenPanel);

        SetColorsUpdatingPending();

        Microsoft.Win32.SystemEvents.DisplaySettingsChanged += delegate {
            SetColorsUpdatingPending();
        };

        // Setting view widget events
        viewWidget.ExposeEvent += HandleViewWidgetExposeEvent;
        viewWidget.MousePositionChanged += HandleViewWidgetMousePositionChanged;
        viewWidget.MouseButtonStateChanged += HandleViewWidgetMouseButtonStateChanged;

        // Setting zoom widget events
        zoomWidget.ValueChanged += HandleZoomWidgetValueChanged;

        // ** Preparing stage and its thread **
        mStageThread = new Thread(StageThreadStart);
        mStageThread.Priority = ThreadPriority.BelowNormal;

        mStage = new ExtendedStage(
            mStageOperationFactory,
            mStageOperationParametersFactory,
            mStageOperationParametersEditorFactory,
            mStageOperationHolderFactory,
            mFloatBitmapGtkFactory);

        // Setting stage events
        mStage.OperationFrozen += HandleStageOperationFrozen;
        mStage.OperationDefrozen += HandleStageOperationDefrozen;
        mStage.ImageChanged += HandleStageImageChanged;
        mStage.ItemAdded += HandleStageOperationAddedToStage;
        mStage.ItemRemoved += HandleStageOperationRemovedFromStage;
        mStage.ItemIndexChanged += HandleStageItemIndexChanged;
        mStage.UIStateChanged += HandleStageUIStateChanged;
        mStage.ProgressMessageReport += HandleProgress;
        mStage.ImageLoadingCompleted += HandleStageImageLoadingCompleted;
        mStage.ImageUpdatingCompleted += HandleStageImageUpdatingCompleted;
        mStage.ImageLoadingCancelled += HandleStageImageLoadingCancelled;
        mStage.ImageLoadingError += HandleStageImageLoadingError;
        mStage.RawFileNameChanged += HandleStageRawFileNameChanged;
        mStage.StageFileNameChanged += HandleStageStageFileNameChanged;
        mStage.PreScaleChanged += HandleStagePrescaleChanged;
        mStage.ViewNeedsUpdate += HandleStageViewNeedsUpdate;

        mStage.ZoomAfterPrescaleValue = zoomWidget.Value * mStage.Prescale;

        mStageThread.Start();

        /*
        // Loading default stage
        string mylocation = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetCallingAssembly().Location);
        string defaultstage = mylocation + System.IO.Path.DirectorySeparatorChar.ToString() + "default.cestage";
        if (System.IO.File.Exists(defaultstage))
        {
            mStage.LoadStage(defaultstage, false);
        }
        else
        {
            Gtk.MessageDialog md = new Gtk.MessageDialog(this, DialogFlags.Modal,
                                                         MessageType.Warning, ButtonsType.Ok,
                                                         "Can not find default.cestage");

            md.Title = MainClass.APP_NAME;
            md.Run();
            md.Destroy();
        }
        */
    }
Пример #6
0
    public StageEditorWindow(Type[] stageOperationTypes,
                             StageOperationFactory stageOperationFactory,
                             StageOperationParametersFactory stageOperationParametersFactory,
                             StageOperationParametersEditorFactory stageOperationParametersEditorFactory,
                             StageOperationHolderFactory stageOperationHolderFactory,
                             BitmapCoreFactory floatBitmapGtkFactory) : base(Gtk.WindowType.Toplevel)
    {
        mStageOperationTypes                   = stageOperationTypes;
        mStageOperationFactory                 = stageOperationFactory;
        mStageOperationParametersFactory       = stageOperationParametersFactory;
        mStageOperationParametersEditorFactory = stageOperationParametersEditorFactory;
        mStageOperationHolderFactory           = stageOperationHolderFactory;
        mFloatBitmapGtkFactory                 = floatBitmapGtkFactory;

        // ** Preparing UI **
        Build();

        mFrozenPanel = new FrozenPanel();
        mFrozenPanel.UnfreezeButtonClicked += delegate {
            mStage.FrozenAt = null;
        };
        stage_vbox.Add(mFrozenPanel);

        SetColorsUpdatingPending();

        Microsoft.Win32.SystemEvents.DisplaySettingsChanged += delegate {
            SetColorsUpdatingPending();
        };

        // Setting view widget events
        viewWidget.ExposeEvent             += HandleViewWidgetExposeEvent;
        viewWidget.MousePositionChanged    += HandleViewWidgetMousePositionChanged;
        viewWidget.MouseButtonStateChanged += HandleViewWidgetMouseButtonStateChanged;

        // Setting zoom widget events
        zoomWidget.ValueChanged += HandleZoomWidgetValueChanged;

        // ** Preparing stage and its thread **
        mStageThread          = new Thread(StageThreadStart);
        mStageThread.Priority = ThreadPriority.BelowNormal;

        mStage = new ExtendedStage(
            mStageOperationFactory,
            mStageOperationParametersFactory,
            mStageOperationParametersEditorFactory,
            mStageOperationHolderFactory,
            mFloatBitmapGtkFactory);

        // Setting stage events
        mStage.OperationFrozen        += HandleStageOperationFrozen;
        mStage.OperationDefrozen      += HandleStageOperationDefrozen;
        mStage.ImageChanged           += HandleStageImageChanged;
        mStage.ItemAdded              += HandleStageOperationAddedToStage;
        mStage.ItemRemoved            += HandleStageOperationRemovedFromStage;
        mStage.ItemIndexChanged       += HandleStageItemIndexChanged;
        mStage.UIStateChanged         += HandleStageUIStateChanged;
        mStage.ProgressMessageReport  += HandleProgress;
        mStage.ImageLoadingCompleted  += HandleStageImageLoadingCompleted;
        mStage.ImageUpdatingCompleted += HandleStageImageUpdatingCompleted;
        mStage.ImageLoadingCancelled  += HandleStageImageLoadingCancelled;
        mStage.ImageLoadingError      += HandleStageImageLoadingError;
        mStage.RawFileNameChanged     += HandleStageRawFileNameChanged;
        mStage.StageFileNameChanged   += HandleStageStageFileNameChanged;
        mStage.PreScaleChanged        += HandleStagePrescaleChanged;
        mStage.ViewNeedsUpdate        += HandleStageViewNeedsUpdate;

        mStage.ZoomAfterPrescaleValue = zoomWidget.Value * mStage.Prescale;

        mStageThread.Start();

        /*
         * // Loading default stage
         * string mylocation = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetCallingAssembly().Location);
         * string defaultstage = mylocation + System.IO.Path.DirectorySeparatorChar.ToString() + "default.cestage";
         * if (System.IO.File.Exists(defaultstage))
         * {
         *      mStage.LoadStage(defaultstage, false);
         * }
         * else
         * {
         *      Gtk.MessageDialog md = new Gtk.MessageDialog(this, DialogFlags.Modal,
         *                                                   MessageType.Warning, ButtonsType.Ok,
         *                                                   "Can not find default.cestage");
         *
         *      md.Title = MainClass.APP_NAME;
         *      md.Run();
         *      md.Destroy();
         * }
         */
    }