63 Commits

Author SHA1 Message Date
Elizabeth M Smith 806a8657de Add little hack to make sure user classes get
their constructor's run when used with libglade or
gtkbuilder and that constructors ar never double
constructed

Also added signal example for using TYPE_PHP_VALUE
2012-08-15 11:39:11 -04:00
Elizabeth M Smith ba6ed42850 Fixed more tsrmls stuff
Compiles now in ZTS mode
2012-07-18 12:58:11 -04:00
Elizabeth M Smith d972807a2e Beginning removal of tsrmls_fetch calls (ugh) 2012-07-18 11:40:53 -04:00
Elizabeth M Smith 71f565cf86 TSRMLS_FETCH is the most evil thing in the world
remove where I can, also make 5.4 do class property
defaults correctly
2012-07-16 14:19:47 -04:00
Mark Skilbeck 7da0ddc280 Updated function_entry's to zend_function_entry's - see http://news.php.net/php.pecl.dev/7123 2010-05-25 16:51:49 +00:00
Elizabeth Marie Smith 7fdb88137b Fix for build && crash (e.g. foreach (new gtklistitem as $x) { })
Patch by Felipe Pena (you're the best)
2009-10-08 00:56:55 +00:00
Derick Rethans 5b959e0da2 - Fixed compilation with latest PHP 5.2 and PHP 5.3, due to the change
in the PHP API that added "static" as part of the ZEND_ARG_INFO_BEGIN macro.
2009-03-31 18:21:24 +00:00
Elizabeth Marie Smith e3e8953959 Deprecation fixes - use new E_DEPRECATED for 5.3+, allow deprecating previously def'd stuff from overrides, fix constructors to display deprecated messages 2008-03-12 15:46:45 +00:00
Andrei Zmievski 2546ce52ae Update Copyright year. 2008-02-29 19:05:53 +00:00
Andrei Zmievski 482a962b03 - Do not register 'gtype' class constants for interfaces.
- When creating classes dynamically, unset the abstract flag from
  methods inherited from interfaces and from the class itself.
- Use explicit function entry instead of ZEND_ABSTRACT_ME() to point to
  default interface method implementation.
2007-03-03 19:23:02 +00:00
Andrei Zmievski be8a794110 Some clipboard support. 2006-09-17 20:56:27 +00:00
Steph Fox 6fc9ed83f2 Give GPointer types something to hold onto... 2006-06-25 10:48:07 +00:00
Andrei Zmievski 9a4af2eb69 Rework Steph's pointer generation patch so that it works like boxed
type.
2006-06-23 04:11:49 +00:00
Andrei Zmievski 34600d000b Commit Steph's PHP_5_2 compat patch. 2006-06-03 18:07:41 +00:00
Andrei Zmievski 6ca129cece Use proper original handlers when creating custom ones. 2006-02-19 21:53:44 +00:00
Christian Weiske 688dab4b5b Telling Zend engine that NULL values are allowed 2005-08-01 17:23:38 +00:00
Christian Weiske 59bda20e89 I forgot to commit the templates... thanks Markus 2005-05-15 08:22:23 +00:00
Andrei Zmievski 7626db91fd Static constructors should unref the created object after calling
phpg_gobject_new() since the refcount will be 2 after the call.
2005-04-12 05:57:50 +00:00
Andrei Zmievski fb2838ba73 - Fix phpg_parse_ctor_props() return value check.
- Fix phpg_gvalue_from_zval() to check the proper variable in some
  cases.
2005-04-04 04:09:41 +00:00
Andrei Zmievski 8f792480d4 Make most of GObject-derived classes use property constructors. This
allows for widget subclassing in the future.
2005-03-27 22:39:33 +00:00
Andrei Zmievski 9fd13d6266 Whew. It all started with because I had to
- Implement GtkFileChooserDialog

But then I reliazed that it implemented GtkFileChooser interface so I had
to:

- Put in support for interfaces and access to object's interface
  implementations.

The rest was easy:

- Register stock item constants (Gtk::STOCK_OK, etc)
2005-03-22 00:13:47 +00:00
Andrei Zmievski abdacfc035 - Make generator output '#line' references in the generated file, so
that we can much more easily pinpoint which line in overrides caused
  the compilation error or warning.
- Get rid of large chunks of old/unused generator code.
2005-03-19 09:09:48 +00:00
Andrei Zmievski 7f6de8daec Fix boxed type access. 2005-03-04 04:59:39 +00:00
Andrei Zmievski e8caaff1d8 Implement support for GError type. This allows us to do something like:
try {
	$pixbuf = GdkPixbuf::new_from_file($image_file);
} catch (PhpGtkGErrorException $e) {
	echo $e->message, $e->code,"\n";
}
2005-03-01 08:09:24 +00:00
Andrei Zmievski 3c108424b2 Implement infrastructure for overriding object handlers per-class. This
allows us to do things like custom read/write handler for all of
GdkEvent properties, and making objects behave like arrays when
necessary.
2005-02-27 03:39:06 +00:00
Andrei Zmievski 2670152aee Too much to describe. 2005-02-26 22:24:21 +00:00
Andrei Zmievski b72c56ba1c Rename PHPG_GET() to PHPG_GOBJECT() to better reflect its function. 2005-02-26 04:20:05 +00:00
Andrei Zmievski 56f5f20a8c We cannot simply mark classes without constructors as abstract, because
we may need to instantiate them internally. We just need to forbid the
users to use them directly.
2005-02-06 00:34:08 +00:00
Andrei Zmievski b148aa5140 This started as an attempt to implement property access for boxed types,
but turned out supporting regular properties as well. Writing to
properties is not yet implemented. Testing is appreciated. Now I damn
well deserve a beer.
2005-01-27 07:40:40 +00:00
Andrei Zmievski c98e73cf4f Initial support for boxed types. Things will compile, but there is still
work to be done.
2005-01-24 06:18:48 +00:00
Andrei Zmievski f54c0e1207 Implement deprecation warnings. 2005-01-18 01:24:16 +00:00
Andrei Zmievski d90583d4c8 Support static constructors better. 2005-01-17 21:27:51 +00:00
Andrei Zmievski ec4f2bdfee - Sort method definitions alphabetically, but put constructors at the
top.
- Allow specification of function entry flags via overrides.
- Allow more than one constructor per class. The first constructor in
  the .defs file will be considered the 'default' one and will be
  generated or overriden as __construct. The rest become static methods
  and are named the same as the C function without the class name at the
  beginning, i.e. gtk_button_new_with_mnemonic become new_with_mnemonic.
2005-01-17 04:19:26 +00:00
Andrei Zmievski 649d7df0b8 Throw the PhpGtkConstructException in constructors. 2005-01-17 04:11:19 +00:00
Andrei Zmievski bbd0f0b1bf This commit implements.. eh.. what does it implement. Hmm, I just had it
a second ago.. Screw it, I'm too tired to explain it. It's just closer
to the goal, that's all. I need a drink.
2004-11-13 07:34:34 +00:00
Andrei Zmievski cb2047dff4 More work on generator. We can now generate some methods - only those
that work with strings and integers, basically.
2004-11-06 08:48:34 +00:00
Andrei Zmievski 9f0e368baa More work on the generator. 2004-10-21 02:46:31 +00:00
Andrei Zmievski 7a24769b4e * Modified generator.php to take -f option that specifies the output
file. If -f is not specified, the output goes to stdout.
* Move object sorting code into defs parser.
* Implement enum/flags registration. They now live inside top-level
  classes, e.g. Gtk::, Atk::, etc.
2004-08-14 21:09:52 +00:00
Andrei Zmievski 454572e904 * Fix "underquoted definition" warnings in php_gtk.m4.
* Add atk*.defs to the mix.
* Simplify building even more via implicit rules: gen_*.h is now
  generated right after gen_*.c. Thus, adding 'atk' definitions was a
  snap.

# Damn, it pays to learn GNU make rules.
2004-08-14 05:28:51 +00:00
Andrei Zmievski cf94978755 Commit #n out of 1..infinity to come. 2004-08-13 06:33:43 +00:00
Andrei Zmievski c640ea65dc A whole bunch of stuff that I'm too tired right now to talk about. New
GTK/GDK defs are in and parsing works. So does object registration, but
that's about it for now. If this compiles for you, you can do
var_dump(get_declared_classes()) and see all the Gtk classes there.
2004-08-12 07:26:16 +00:00
Andrei Zmievski 95215d70bf Finished definitions, except for Pointer_Def. 2004-08-05 02:57:05 +00:00
Andrei Zmievski f9cf33ecdd Merged ZE2_PORT branch to HEAD. All PHP4 specific work needs to be done
on PHP_GTK_1 branch now.
2003-10-10 03:41:47 +00:00
Andrei Zmievski 9b1cd4cac7 This mega-patch adjusts the build system so that it can work automatically
with either old or new PHP build system. It also updates copyright years
and fixes loading of rc files by test/gtk.php.

Extension writers should take notice of the changes in the build system.
2002-04-11 02:19:50 +00:00
Andrei Zmievski ef096eafe4 Modified generator to have better support for objects that are not GtkObject
descendants. Made it use typed enums only when generating ext/gtk+, enums
in other extensions are handled as simple integers. Added -c option to
generator that allows specifying what class the non-method functions should
go into (this allows merging some of them into a defined class). And a few
optimizations of course.
2001-11-30 04:37:36 +00:00
Andrei Zmievski c1045fab91 Invalidate object if construction failed. 2001-08-29 16:15:20 +00:00
Andrei Zmievski 838eab8d74 - Implemented a workaround for registering classes with proper name
capitalization.
- Removed the unnecessary wrap_ prefix from internal function names.
2001-08-11 03:28:20 +00:00
Frank M. Kromann 2183e1bc82 More TSRMLS_FETCH() 2001-08-07 04:54:33 +00:00
Andrei Zmievski 8ae066e3fb - Fix config.h.in generation.
- Changed GtkWidget::state() method to GtkWidget->state property.
- Removed GtkWidget::get_allocation(), it is redundant with GtkWidget->allocation
  property present.
- Implemented support for struct based classes (GdkRectable, GtkAllocation,
  GtkRequisition, etc).

0.1 is on the horizon.
2001-07-31 05:27:01 +00:00
Frank M. Kromann dde5564c98 Fixing ZTS compilation 2001-07-31 00:38:58 +00:00