Sha256: e8565d4d1f1776832d832a74e1a3bc871f40d613b5ae7991dda837edbe4c3367

Contents?: true

Size: 1.82 KB

Versions: 102

Compression:

Stored size: 1.82 KB

Contents

# Copyright (C) 2011-2015  Ruby-GNOME2 Project Team
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

require "tempfile"
require "fileutils"

module GtkTestUtils
  private
  def only_gtk_version(major, minor, micro=nil)
    micro ||= 0
    unless Gtk::Version.or_later?(major, minor, micro)
      omit("Require GTK+ >= #{major}.#{minor}.#{micro}")
    end
  end

  def window_system_type_name
    Gdk::Screen.default.class.gtype.name
  end

  module WindowSystemTypeNames
    X11 = "GdkX11Screen"
    WINDOWS = "GdkWin32Screen"
  end

  def x11?
    window_system_type_name == WindowSystemTypeNames::X11
  end

  def csd_supported?
    screen = Gdk::Screen.default
    case window_system_type_name
    when WindowSystemTypeNames::X11
      screen.composited? and screen.rgba_visual
    when WindowSystemTypeNames::WINDOWS
      screen.rgba_visual
    else
      true
    end
  end

  def window_have_default_title?
    # Maybe 03213b9509fc1df16c66194ea168aed6c15110e9 in GTK+
    return false if Gtk::Version.or_later?(3, 17, 0)
    return true if csd_supported?

    false
  end

  def fixture_path(*components)
    File.join(File.dirname(__FILE__), "fixture", *components)
  end
end

Version data entries

102 entries across 94 versions & 2 rubygems

Version Path
gtk3-3.3.8 test/gtk-test-utils.rb
gtk3-3.3.7 test/gtk-test-utils.rb
gtk3-3.3.6 test/gtk-test-utils.rb
gtk3-3.3.5 test/gtk-test-utils.rb
gtk3-3.3.4 test/gtk-test-utils.rb
gtk3-3.3.3 test/gtk-test-utils.rb
gtk3-3.3.2 test/gtk-test-utils.rb
gtk3-3.3.1 test/gtk-test-utils.rb
gtk3-3.3.0 test/gtk-test-utils.rb
gtk3-3.2.9-x64-mingw32 test/gtk-test-utils.rb
gtk3-3.2.9-x86-mingw32 test/gtk-test-utils.rb
gtk3-3.2.9 test/gtk-test-utils.rb
gtk3-3.2.8-x64-mingw32 test/gtk-test-utils.rb
gtk3-3.2.8-x86-mingw32 test/gtk-test-utils.rb
gtk3-3.2.8 test/gtk-test-utils.rb
gtk3-3.2.7-x86-mingw32 test/gtk-test-utils.rb
gtk3-3.2.7-x64-mingw32 test/gtk-test-utils.rb
gtk3-3.2.7 test/gtk-test-utils.rb
gtk3-3.2.6-x64-mingw32 test/gtk-test-utils.rb
gtk3-3.2.6-x86-mingw32 test/gtk-test-utils.rb