File: rbgtk22.c

package info (click to toggle)
ruby-gnome2 0.15.0-1.1
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 7,692 kB
  • ctags: 8,558
  • sloc: ansic: 69,912; ruby: 19,511; makefile: 97; xml: 35; sql: 13
file content (77 lines) | stat: -rw-r--r-- 1,813 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/************************************************

  rbgtk22.c -

  $Author: mutoh $
  $Date: 2005/01/29 11:44:15 $

  Copyright (C) 2003 KUBO Takehiro

************************************************/
#include "global.h"
#include "rbgtk.h"
#include <gtk/gtk.h>

#ifndef GTK_TYPE_CLIPBOARD
#define GTK_TYPE_CLIPBOARD            (gtk_clipboard_get_type ())
extern GtkType gtk_clipboard_get_type(void);
#endif

#ifndef GTK_CLIPBOARD
#define GTK_CLIPBOARD(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CLIPBOARD, GtkClipboard))
#endif

#ifndef GTK_TYPE_TREE_ROW_REFERENCE
#define GTK_TYPE_TREE_ROW_REFERENCE    (gtk_tree_row_reference_get_type ())
extern GtkType gtk_tree_row_reference_get_type(void);
#endif

static GType
clipboard_get_type()
{
    static GType our_type = 0;
    if(our_type == 0)
        our_type = GTK_TYPE_CLIPBOARD;
    return our_type;
}

static GtkClipboard* 
get_clipboard(obj)
    VALUE obj;
{
    return GTK_CLIPBOARD(RVAL2GOBJ(obj));
}

static VALUE
make_clipboard(gobj)
    GtkClipboard* gobj;
{
    return GOBJ2RVAL(gobj);
}

static GType
tree_row_reference_get_type(void)
{ 
  static GType our_type = 0;
  if (our_type == 0)
      our_type = GTK_TYPE_TREE_ROW_REFERENCE;
  return our_type;
}

static GtkTreeRowReference *
get_tree_row_reference(obj)
    VALUE obj;
{
    return (GtkTreeRowReference*)RVAL2BOXED(obj, GTK_TYPE_TREE_ROW_REFERENCE);
}

void
Init_gtk22()
{
    rbgtk_clipboard_get_type = clipboard_get_type;
    rbgtk_get_clipboard = (RBGtkClipboardGetFunc)get_clipboard;
    rbgtk_make_clipboard = (RBGtkClipboardMakeFunc)make_clipboard;
    rbgtk_tree_row_reference_get_type = tree_row_reference_get_type;
    rbgtk_get_tree_row_reference = (RBGtkTreeRowReferenceGetFunc)get_tree_row_reference;
}