Sha256: 29ef89c2b2491730faf0877616f2428975b8521b6038b4088b2eccd1fee90755

Contents?: true

Size: 1.5 KB

Versions: 6

Compression:

Stored size: 1.5 KB

Contents

/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/************************************************

  rbgtkinvisible.c -

  $Author: sakai $
  $Date: 2003/11/20 18:27:54 $

  Copyright (C) 2002,2003 OGASAWARA, Takeshi
************************************************/
#include "global.h"

#define _SELF(s) GTK_INVISIBLE(RVAL2GOBJ(s))

static VALUE
invisible_initialize(int argc, VALUE *argv, VALUE self)
{
    VALUE screen;

    rb_scan_args(argc, argv, "01", &screen);

    if (argc == 0){
        RBGTK_INITIALIZE(self, gtk_invisible_new());
    } else {
#if GTK_CHECK_VERSION(2,2,0)
        RBGTK_INITIALIZE(self, gtk_invisible_new_for_screen(
                             GDK_SCREEN(RVAL2GOBJ(screen))));
#else
        rb_raise(rb_eArgError, "GTK+-2.2 feature. GTK+-2.0.x doesn't support this.");
#endif
    }
    return Qnil;
}

#if GTK_CHECK_VERSION(2,2,0)
static VALUE
invisible_set_screen(VALUE self, VALUE screen)
{
    gtk_invisible_set_screen(_SELF(self), GDK_SCREEN(RVAL2GOBJ(screen)));
    return self;
}

static VALUE
invisible_get_screen(VALUE self)
{
    return GOBJ2RVAL(gtk_invisible_get_screen(_SELF(self)));
}
#endif

void
Init_invisible()
{
    VALUE gInvisible = G_DEF_CLASS(GTK_TYPE_INVISIBLE, "Invisible", mGtk);

    rb_define_method(gInvisible, "initialize", invisible_initialize, -1);

#if GTK_CHECK_VERSION(2,2,0)
    rb_define_method(gInvisible, "set_screen", invisible_set_screen, 1);
    rb_define_method(gInvisible, "screen", invisible_get_screen, 0);
#endif

    G_DEF_SETTERS(gInvisible);
}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gtk2-1.0.0-x86-mingw32 ext/gtk2/rbgtkinvisible.c
gtk2-1.0.0 ext/gtk2/rbgtkinvisible.c
gtk2-0.90.9 ext/gtk2/rbgtkinvisible.c
gtk2-0.90.9-x86-mingw32 ext/gtk2/rbgtkinvisible.c
gtk2-0.90.8-x86-mingw32 ext/gtk2/rbgtkinvisible.c
gtk2-0.90.8 ext/gtk2/rbgtkinvisible.c