# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # BUFFER_VIRTUAL_AREA = 1 # BUFFER_CLIENT_AREA = 2 # BUFFER_USES_SHARED_BUFFER = 4 # Check if the window is natively double buffered and will return a {Wx::PaintDC} if it is, a {Wx::BufferedPaintDC} otherwise. # It is the caller's responsibility to delete the {Wx::DC} pointer when finished with it. # @param window [Wx::Window] # @return [Wx::DC] def self.auto_buffered_paint_dc_factory(window) end # This class provides a simple way to avoid flicker: when drawing on it, everything is in fact first drawn on an in-memory buffer (a {Wx::Bitmap}) and then copied to the screen, using the associated {Wx::DC}, only once, when this object is destroyed. # {Wx::BufferedDC} itself is typically associated with {Wx::ClientDC}, if you want to use it in your EVT_PAINT handler, you should look at {Wx::BufferedPaintDC} instead. # When used like this, a valid DC must be specified in the constructor while the buffer bitmap doesn't have to be explicitly provided, by default this class will allocate the bitmap of required size itself. However using a dedicated bitmap can speed up the redrawing process by eliminating the repeated creation and destruction of a possibly big bitmap. Otherwise, {Wx::BufferedDC} can be used in the same way as any other device context. # Another possible use for {Wx::BufferedDC} is to use it to maintain a backing store for the window contents. In this case, the associated DC may be NULL but a valid backing store bitmap should be specified. # Finally, please note that GTK+ 2.0 as well as macOS provide double buffering themselves natively. You can either use {Wx::Window#is_double_buffered} to determine whether you need to use buffering or not, or use {Wx::AutoBufferedPaintDC} to avoid needless double buffering on the systems which already do it automatically. # === # # Category: Device Contexts # @see Wx::DC # @see Wx::MemoryDC # @see Wx::BufferedPaintDC # @see Wx::AutoBufferedPaintDC # # class BufferedDC < MemoryDC # @overload init(dc, area, style=Wx::BUFFER_CLIENT_AREA) # Initializes the object created using the default constructor. # Please see the constructors for parameter details. # @param dc [Wx::DC] # @param area [Array(Integer, Integer), Wx::Size] # @param style [Integer] # @return [void] # @overload init(dc, buffer=Wx::NULL_BITMAP, style=Wx::BUFFER_CLIENT_AREA) # Initializes the object created using the default constructor. # Please see the constructors for parameter details. # @param dc [Wx::DC] # @param buffer [Wx::Bitmap] # @param style [Integer] # @return [void] def init(*args) end # @overload initialize() # Default constructor. # You must call one of the {Wx::BufferedDC#init} methods later in order to use the device context. # @return [BufferedDC] # @overload initialize(dc, area, style=Wx::BUFFER_CLIENT_AREA) # Creates a buffer for the provided dc. # {Wx::BufferedDC#init} must not be called when using this constructor. # @param dc [Wx::DC] The underlying DC: everything drawn to this object will be flushed to this DC when this object is destroyed. You may pass NULL in order to just initialize the buffer, and not flush it. # @param area [Array(Integer, Integer), Wx::Size] The size of the bitmap to be used for buffering (this bitmap is created internally when it is not given explicitly). # @param style [Integer] {Wx::BUFFER_CLIENT_AREA} to indicate that just the client area of the window is buffered, or {Wx::BUFFER_VIRTUAL_AREA} to indicate that the buffer bitmap covers the virtual area. # @return [BufferedDC] # @overload initialize(dc, buffer=Wx::NULL_BITMAP, style=Wx::BUFFER_CLIENT_AREA) # Creates a buffer for the provided dc. # {Wx::BufferedDC#init} must not be called when using this constructor. # @param dc [Wx::DC] The underlying DC: everything drawn to this object will be flushed to this DC when this object is destroyed. You may pass NULL in order to just initialize the buffer, and not flush it. # @param buffer [Wx::Bitmap] Explicitly provided bitmap to be used for buffering: this is the most efficient solution as the bitmap doesn't have to be recreated each time but it also requires more memory as the bitmap is never freed. The bitmap should have appropriate size, anything drawn outside of its bounds is clipped. # @param style [Integer] {Wx::BUFFER_CLIENT_AREA} to indicate that just the client area of the window is buffered, or {Wx::BUFFER_VIRTUAL_AREA} to indicate that the buffer bitmap covers the virtual area. # @return [BufferedDC] def initialize(*args) end # Blits the buffer to the dc, and detaches the dc from the buffer (so it can be effectively used once only). # Usually only called in the destructor or by the destructor of derived classes if the BufferedDC must blit before the derived class (which may own the dc it's blitting to) is destroyed. # @return [void] def un_mask; end # Set the style. # @param style [Integer] # @return [void] def set_style(style) end alias_method :style=, :set_style # Get the style. # @return [Integer] def get_style; end alias_method :style, :get_style end # BufferedDC end