projects
/
ruby-ecore.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Build system fixes.
[ruby-ecore.git]
/
src
/
ecore_x
/
rb_window.c
diff --git
a/src/ecore_x/rb_window.c
b/src/ecore_x/rb_window.c
index 2d7e3c0d7b4f666218a8329c669ae22cccfc7b91..e046b6f37f67d1bc81ba511cea111a5beb6910f1 100644
(file)
--- a/
src/ecore_x/rb_window.c
+++ b/
src/ecore_x/rb_window.c
@@
-1,5
+1,5
@@
/*
/*
- * $Id: rb_window.c
39 2004-07-25 13:13:57
Z tilman $
+ * $Id: rb_window.c
50 2004-08-01 10:18:39
Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
@@
-23,39
+23,31
@@
#include <Ecore.h>
#include <Ecore_X.h>
#include <Ecore.h>
#include <Ecore_X.h>
+#define __RB_WINDOW_C
+#include "../ecore/rb_ecore.h"
#include "rb_ecore_x.h"
#include "rb_ecore_x.h"
+#include "rb_window.h"
-
static VALUE cWindow, parents
;
+
VALUE cWindow
;
-static void c_mark (
Ecore_X_
Window *w)
+static void c_mark (
Rb
Window *w)
{
{
- VALUE parent;
-
- parent = rb_hash_aref (parents, INT2NUM ((long) (w)));
- if (parent != Qnil)
- rb_gc_mark (parent);
-}
-
-static void c_free (Ecore_X_Window *w)
-{
- rb_hash_aset (parents, INT2NUM ((long) w), Qnil);
-
- free (w);
+ if (!NIL_P (w->parent))
+ rb_gc_mark (w->parent);
}
VALUE TO_ECORE_X_WINDOW (VALUE parent, Ecore_X_Window w)
{
VALUE self;
}
VALUE TO_ECORE_X_WINDOW (VALUE parent, Ecore_X_Window w)
{
VALUE self;
-
Ecore_X_Window *my_
w = NULL;
+
RbWindow *windo
w = NULL;
- if (
NIL_P (parent) ||
!w)
+ if (!w)
return Qnil;
return Qnil;
- self = Data_Make_Struct (cWindow, Ecore_X_Window,
- c_mark, c_free, my_w);
- *my_w = w;
+ self = Data_Make_Struct (cWindow, RbWindow, c_mark, free, window);
- rb_hash_aset (parents, INT2NUM ((long) my_w), parent);
+ window->real = w;
+ window->parent = parent;
rb_obj_call_init (self, 0, NULL);
rb_obj_call_init (self, 0, NULL);
@@
-69,7
+61,4
@@
void Init_Window (void)
/* not publically instantiable yet */
rb_define_private_method (rb_singleton_class (cWindow),
"new", NULL, 0);
/* not publically instantiable yet */
rb_define_private_method (rb_singleton_class (cWindow),
"new", NULL, 0);
-
- parents = rb_hash_new ();
- rb_global_variable (&parents);
}
}