123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- deferred class CD_CANVAS_CONTROL
- inherit
- CANVAS_DRAW
- feature {ANY}
- clear
- -- Cleans the active canvas using the current background color. This
- -- action is interpreted very differently by each driver. Many drivers
- -- simply draw a rectangle with the current background color. It is NOT
- -- necessary to call "clear" when the canvas has just been created, as at
- -- this moment it is already clean. Most file-based drivers do not
- -- implement this function.
- do
- int_canvas_clear (cnvs);
- end
- flush
- -- Has a different meaning for each driver. It is useful to send
- -- information to buffered devices and to move to a new page or layer. In
- -- all cases, the current canvas attributes are preserved.
- do
- int_canvas_flush (cnvs);
- end
- save_state: POINTER
- -- Saves the state of attributes of the active canvas. It does not save
- -- play callbacks, polygon creation states (begin/vertex/vertex/...), the
- -- palette, complex clipping regions and driver internal attributes.
- do
- Result := int_canvas_save_state (cnvs);
- end
- restore_state (state: POINTER)
- -- Restores the attribute state of the active canvas. It can be used
- -- between canvases of different contexts. It can be used several times
- -- for the same state.
- do
- int_canvas_restore_state (cnvs, state);
- end
- release_state (state: POINTER)
- -- Releases the memory allocated by the "save_state" function.
- do
- int_canvas_release_state (state);
- end
- feature {}
- -- Internals
- int_canvas_clear (data: POINTER)
- external "plug_in"
- alias "{
- location: "${sys}/plugins"
- module_name: "iup"
- feature_name: "cdCanvasClear"
- }"
- end
- int_canvas_flush (data: POINTER)
- external "plug_in"
- alias "{
- location: "${sys}/plugins"
- module_name: "iup"
- feature_name: "cdCanvasFlush"
- }"
- end
- int_canvas_save_state (data: POINTER): POINTER
- external "plug_in"
- alias "{
- location: "${sys}/plugins"
- module_name: "iup"
- feature_name: "cdCanvasSaveState"
- }"
- end
- int_canvas_restore_state (data, state: POINTER)
- external "plug_in"
- alias "{
- location: "${sys}/plugins"
- module_name: "iup"
- feature_name: "cdCanvasRestoreState"
- }"
- end
- int_canvas_release_state (state: POINTER)
- external "plug_in"
- alias "{
- location: "${sys}/plugins"
- module_name: "iup"
- feature_name: "cdReleaseState"
- }"
- end
- end
- -- The MIT License (MIT)
- -- Copyright (c) 2016 by German A. Arias
- -- 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:
- --
- -- The above copyright notice and this permission notice shall be included in
- -- all copies or substantial portions of the Software.
- --
- -- 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.
|