Esempio n. 1
0
            /*! \brief Open nested window. */
            public void OpenNested(OS.Rect visible,
                                   OS.Coord scroll,
                                   uint behindWindow,
                                   uint parentWindow,
                                   uint nestedFlags,
                                   uint windowFlags)
            {
                // Make sure bit 0 of nested flags is set correctly depending on whether
                // window flags are supplied.
                if (windowFlags == 0xffffffff)
                {
                    nestedFlags &= (~1U);
                    windowFlags  = 0;
                }
                else
                {
                    nestedFlags |= 1;
                }

                var block = new NativeWimp.WindowStateBlock(WimpWindow.Handle,
                                                            visible,
                                                            scroll,
                                                            behindWindow,
                                                            windowFlags);

                Wimp.OpenWindowNested(ref block, parentWindow, nestedFlags);
            }
Esempio n. 2
0
 /*! \brief Convert a rectangle from screen to window when the window's origin
  * is already known.
  * \param [in] rect The rectangle to convert in screen coordinates.
  * \param [in] origin The origin of the window in screen coordinates.
  * \return The converted rectangle in window coordinates.
  * \note The original rectangle is left unchanged. */
 public OS.Rect RectangleToWorkArea(OS.Rect rect, OS.Coord origin)
 {
     return(new OS.Rect(rect.MinX - origin.X,
                        rect.MinY - origin.Y,
                        rect.MaxX - origin.X,
                        rect.MaxY - origin.Y));
 }
Esempio n. 3
0
 /*! \brief Create a ScanCoordBlock with default values. */
 public ScanCoordBlock()
 {
     Space       = new OS.Coord();
     Letter      = new OS.Coord();
     SplitChar   = -1;
     BoundingBox = new OS.Rect();
 }
Esempio n. 4
0
 public Rect(OS.Rect rect)
 {
     MinX = rect.MinX;
     MinY = rect.MinY;
     MaxX = rect.MaxX;
     MaxY = rect.MaxY;
 }
Esempio n. 5
0
 /*! \brief Convert a rectangle from window to screen when the window's origin
  * is already known.
  * \param [in] rect The rectangle to convert in window coordinates.
  * \param [in] origin The origin of the window in screen coordinates.
  * \return The converted rectangle in screen coordinates.
  * \note The original rectangle is left unchanged. */
 public OS.Rect RectangleToScreen(OS.Rect rect, OS.Coord origin)
 {
     return(new OS.Rect(rect.MinX + origin.X,
                        rect.MinY + origin.Y,
                        rect.MaxX + origin.X,
                        rect.MaxY + origin.Y));
 }
Esempio n. 6
0
 /*! \brief Create a PaintCoordBlock */
 public PaintCoordBlock(OS.Coord space,
                        OS.Coord letter,
                        OS.Rect rubOut)
 {
     Space  = space;
     Letter = letter;
     RubOut = rubOut;
 }
Esempio n. 7
0
            /*! \brief Force a redraw on the area of the window given.
             * \param [in] area The rectangular area of the window to redraw.
             * \return Nothing.  */
            public void ForceRedraw(OS.Rect area)
            {
                var rect = new NativeOS.Rect(area);

                OS.ThrowOnError(NativeMethods.Window_ForceRedraw(0,
                                                                 ID,
                                                                 Method.ForceRedraw,
                                                                 ref rect));
            }
Esempio n. 8
0
            // Drag types 8-11 not supported.

            public DragStartBlock(uint handle,
                                  Wimp.DragType type,
                                  OS.Rect initial,
                                  OS.Rect parent)
            {
                WindowHandle = handle;
                DragType     = type;
                InitialBox   = new NativeOS.Rect(initial);
                ParentBox    = new NativeOS.Rect(parent);
            }
Esempio n. 9
0
 /*! \brief Create a full show object specification from the details given.
  *
  * Assumes that window nesting is not required, and so assumes default values for
  * nesting parameters.  */
 public ShowObjectFull(OS.Rect visible,
                       OS.Coord scroll) : base(ShowObjectType.FullSpec)
 {
     Visible            = visible;
     Scroll             = scroll;
     StackPosition      = Wimp.WindowStackPosition.Top;
     WindowFlags        = 0;
     ParentWindowHandle = 0;
     AlignmentFlags     = 0;
 }
Esempio n. 10
0
 /*! \brief Create a ScanCoordBlock */
 public ScanCoordBlock(OS.Coord space,
                       OS.Coord letter,
                       int splitChar,
                       OS.Rect boundingBox)
 {
     Space       = space;
     Letter      = letter;
     SplitChar   = splitChar;
     BoundingBox = boundingBox;
 }
Esempio n. 11
0
            /*! \brief Open a normal window (no nesting) */
            public void Open(OS.Rect visible,
                             OS.Coord scroll,
                             uint behind)
            {
                var block = new NativeWimp.WindowStateBlock(WimpWindow.Handle,
                                                            visible,
                                                            scroll,
                                                            behind,
                                                            0);                  // Flags are ignored on a normal window open

                Wimp.OpenWindow(ref block);
            }
Esempio n. 12
0
 /*! \brief Open nested window using the window flags it already has. */
 public void OpenNested(OS.Rect visible,
                        OS.Coord scroll,
                        uint behindWindow,
                        uint parentWindow,
                        uint nestedFlags)
 {
     OpenNested(visible,
                scroll,
                behindWindow,
                parentWindow,
                nestedFlags,
                0xffffffff);                  // Use the window's existing flags.
 }
Esempio n. 13
0
        /*! \brief Call RISC OS Drawfile module to find the coordinates of the bounding box
         * that encloses the draw file.
         * \param [in] flags Currently unused and should be 0.
         * \param [in] drawfile A byte array holding the draw file.
         * \param [in] matrix A standard RISC OS matrix, that allows the draw file to
         * be translated, rotated, scaled, etc before the bounding box is returned.
         * \return A rectangle giving the bounding box coordinates.
         * \note The RISC OS call requires the size in bytes of the draw file. This is
         * assumed to be the length of the byte array that contains it.  */
        public static OS.Rect GetBounds(int flags,
                                        byte [] drawfile,
                                        OS.Matrix matrix)
        {
            var bounding_box = new OS.Rect();

            OS.ThrowOnError(NativeMethods.Drawfile_GetBBox(flags,
                                                           drawfile,
                                                           drawfile.Length,
                                                           matrix,
                                                           bounding_box));
            return(bounding_box);
        }
Esempio n. 14
0
 /*! \brief Create a full show object specification from the details given.
  *
  * Allows access to full window nesting parameters.  */
 public ShowObjectFull(OS.Rect visible,
                       OS.Coord scroll,
                       uint stackPosition,
                       uint windowFlags,
                       uint parentWindowHandle,
                       uint alignmentFlags) : base(ShowObjectType.FullSpec)
 {
     Visible            = visible;
     Scroll             = scroll;
     StackPosition      = stackPosition;
     WindowFlags        = windowFlags;
     ParentWindowHandle = parentWindowHandle;
     AlignmentFlags     = alignmentFlags;
 }
Esempio n. 15
0
            /*! \brief Get the font bounding box.
             * \param[out] bbox Bounding box of font in OS units
             * \returns Nothing.
             * \deprecated You should use CharBBox in preference. */
            public void ReadInfo(OS.Rect bbox)
            {
                int min_x, min_y, max_x, max_y;

                OS.ThrowOnError(NativeMethods.Font_ReadInfo(Handle,
                                                            out min_x,
                                                            out min_y,
                                                            out max_x,
                                                            out max_y));
                bbox.MinX = min_x;
                bbox.MinY = min_y;
                bbox.MaxX = max_x;
                bbox.MaxY = max_y;
            }
Esempio n. 16
0
            public uint           Flags;   // Used for nested windows

//			public WindowStateBlock (uint handle)
//			{
//				WindowHandle = handle;
//			}

            public WindowStateBlock(uint handle,
                                    OS.Rect rect,
                                    OS.Coord scroll,
                                    uint behind_window,
                                    uint window_flags)
            {
                WindowHandle = handle;
                Visible.MinX = rect.MinX;
                Visible.MinY = rect.MinY;
                Visible.MaxX = rect.MaxX;
                Visible.MaxY = rect.MaxY;

                Scroll.X = scroll.Y;
                Scroll.Y = scroll.Y;

                BehindWindow = behind_window;
                Flags        = window_flags;
            }
Esempio n. 17
0
 /*! \brief Convert a rectangle from window to screen when the window's origin
  * is unknown.
  * \param [in] rect The rectangle to convert in window coordinates.
  * \return The converted rectangle in screen coordinates.
  * \note The original rectangle is left unchanged. */
 public OS.Rect RectangleToScreen(OS.Rect rect)
 {
     return(RectangleToScreen(rect, GetOrigin()));
 }
Esempio n. 18
0
 /*! \brief Convert a rectangle from window to screen when the window's origin
  * is unknown.
  * \param [in] rect The rectangle to convert in window coordinates.
  * \return The converted rectangle in screen coordinates.
  * \note The original rectangle is left unchanged. */
 public OS.Rect RectangleToScreen(OS.Rect rect)
 {
     return(WimpWindow.RectangleToScreen(rect));
 }
Esempio n. 19
0
 /*! \brief Convert a rectangle from window to screen when the window's origin
  * is already known.
  * \param [in] rect The rectangle to convert in window coordinates.
  * \param [in] origin The origin of the window in screen coordinates.
  * \return The converted rectangle in screen coordinates.
  * \note The original rectangle is left unchanged. */
 public OS.Rect RectangleToScreen(OS.Rect rect, OS.Coord origin)
 {
     return(WimpWindow.RectangleToScreen(rect, origin));
 }
Esempio n. 20
0
 /*! \brief Convert a rectangle from screen to window when the window's origin
  * is unknown.
  * \param [in] rect The rectangle to convert in screen coordinates.
  * \return The converted rectangle in window coordinates.
  * \note The original rectangle is left unchanged. */
 public OS.Rect RectangleToWorkArea(OS.Rect rect)
 {
     return(WimpWindow.RectangleToWorkArea(rect));
 }
Esempio n. 21
0
 /*! \brief Convert a rectangle from screen to window when the window's origin
  * is already known.
  * \param [in] rect The rectangle to convert in screen coordinates.
  * \param [in] origin The origin of the window in screen coordinates.
  * \return The converted rectangle in window coordinates.
  * \note The original rectangle is left unchanged. */
 public OS.Rect RectangleToWorkArea(OS.Rect rect, OS.Coord origin)
 {
     return(WimpWindow.RectangleToWorkArea(rect, origin));
 }
Esempio n. 22
0
 internal static extern IntPtr Drawfile_GetBBox(int flags,
                                                [In] byte [] drawfile,
                                                int size,
                                                [In] OS.Matrix matrix,
                                                [Out] OS.Rect bbox_out);
Esempio n. 23
0
            /*! \brief Set the work area size of the window.  */
            public void SetExtent(OS.Rect extent)
            {
                var native_extent = new NativeOS.Rect(extent);

                Wimp.SetExtent(WimpWindow.Handle, ref native_extent);
            }
Esempio n. 24
0
 internal static extern IntPtr Window_GetExtent(uint flags,
                                                uint WindowID,
                                                int method,
                                                OS.Rect extent);
Esempio n. 25
0
 /*! \brief Convert a rectangle from screen to window when the window's origin
  * is unknown.
  * \param [in] rect The rectangle to convert in screen coordinates.
  * \return The converted rectangle in window coordinates.
  * \note The original rectangle is left unchanged. */
 public OS.Rect RectangleToWorkArea(OS.Rect rect)
 {
     return(RectangleToWorkArea(rect, GetOrigin()));
 }
Esempio n. 26
0
 /*! \brief Forces an area of this window to be redrawn later.
  * \param [in] redrawArea A rectangle defining the area of the window to redraw.
  * \return Nothing.  */
 public void ForceRedraw(OS.Rect redrawArea)
 {
     Wimp.ForceRedraw(Handle, redrawArea.MinX, redrawArea.MinY,
                      redrawArea.MaxX, redrawArea.MaxY);
 }
Esempio n. 27
0
 /*! \brief Forces an area of this window to be redrawn later.
  * \param [in] redrawArea A rectangle defining the area of the window to redraw.
  * \return Nothing.  */
 public void ForceRedraw(OS.Rect redrawArea)
 {
     WimpWindow.ForceRedraw(redrawArea);
 }