Branch: Tag:

2006-01-02

2006-01-02 21:44:59 by Marcus Comstedt <marcus@mc.pp.se>

Implemented mixins and multiple inheritance.

Rev: src/post_modules/GTK2/build_pgtk.pike:1.6
Rev: src/post_modules/GTK2/output/few.pike:1.7
Rev: src/post_modules/GTK2/output/split.pike:1.6
Rev: src/post_modules/GTK2/output/util.pike:1.2
Rev: src/post_modules/GTK2/pgtk.h:1.12
Rev: src/post_modules/GTK2/pgtk2_symbol_remap.h:1.4
Rev: src/post_modules/GTK2/source/support.c:1.8

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: support.c,v 1.7 2005/12/30 21:56:53 nilsson Exp $ + || $Id: support.c,v 1.8 2006/01/02 21:44:59 marcus Exp $   */      #include <version.h>
27:    Pike_error("You must call Gnome2.init( app,version,argv ) first\n");   }    - void pgtk_verify_inited() { + void pgtk_verify_obj_inited() {    if (!THIS->obj)    Pike_error("Calling function in unitialized object\n");   }    - void pgtk_verify_not_inited() { + void pgtk_verify_obj_not_inited() {    if (THIS->obj)    Pike_error("Tried to initialize object twice\n");   }    -  + void pgtk_verify_mixin_inited() { +  if (!MIXIN_THIS->obj) +  Pike_error("Calling function in unitialized object\n"); + } +  + void pgtk_verify_mixin_not_inited() { +  if (MIXIN_THIS->obj) +  Pike_error("Tried to initialize object twice\n"); + } +    void my_pop_n_elems(int n) /* anti-inline */   {    pop_n_elems(n);
754:    MEMSET(Pike_fp->current_storage,0,sizeof(struct object_wrapper));   }    + void pgtk_setup_mixin(struct object *o, struct program *p) { +  ptrdiff_t offset; +  offset = low_get_storage(o->prog, p); +  if(offset == -1) +  Pike_error("This class can not be instantiated on its own.\n"); +  ((struct mixin_wrapper *)Pike_fp->current_storage)->offset = offset; + }      LONGEST pgtk_get_int(struct svalue *s) {    if (s->type==PIKE_T_INT)