cvs: php-gtk /ext/gtkhtml gtkhtml.defs gtkhtml.overrides
| From: | Alan Knowles | Date: | Thu, 03 Jan 2002 08:48:25 +0000 |
| Subject: | cvs: php-gtk /ext/gtkhtml gtkhtml.defs gtkhtml.overrides | ||
| Groups: | php.gtk.cvs | ||
| Request: | Send a blank email to php-gtk-cvs+get-423@lists.php.net to get a copy of this message | ||
alan_k Thu Jan 3 03:48:25 2002 EDT
Modified files:
/php-gtk/ext/gtkhtml gtkhtml.overrides gtkhtml.defs
Log:
Fixed GtkHTML parentage, added gtkhtml->set_cursor_xy
Index: php-gtk/ext/gtkhtml/gtkhtml.overrides
diff -u php-gtk/ext/gtkhtml/gtkhtml.overrides:1.3 php-gtk/ext/gtkhtml/gtkhtml.overrides:1.4
--- php-gtk/ext/gtkhtml/gtkhtml.overrides:1.3 Thu Nov 29 11:43:15 2001
+++ php-gtk/ext/gtkhtml/gtkhtml.overrides Thu Jan 3 03:48:25 2002
@@ -10,6 +10,9 @@
#include <gtkhtml/htmlengine-edit-cut-and-paste.h>
#include <gtkhtml/htmlcolor.h>
#include <gtkhtml/htmltypes.h>
+#include <gtkhtml/htmlobject.h>
+#include <gtkhtml/htmlcursor.h>
+#include <gtkhtml/htmlengine-edit-movement.h>
#include "ext/gtk+/php_gtk+.h"
#include "ext/gtkhtml/php_gtkhtml.h"
@@ -407,12 +410,6 @@
TSRMLS_FETCH();
zend_hash_index_find(Z_ARRVAL_P(callback_data), 0, (void **)&cb_check_word);
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 1, (void **)&cb_suggestion_request);
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 2, (void **)&cb_add_to_session);
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 3, (void **)&cb_add_to_personal);
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 4, (void **)&cb_command);
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 5, (void **)&cb_event);
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 6, (void **)&cb_create_input_line);
zend_hash_index_find(Z_ARRVAL_P(callback_data), 7, (void **)&extra);
zend_hash_index_find(Z_ARRVAL_P(callback_data), 8, (void **)&callback_filename);
zend_hash_index_find(Z_ARRVAL_P(callback_data), 9, (void **)&callback_lineno);
@@ -465,13 +462,7 @@
TSRMLS_FETCH();
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 0, (void **)&cb_check_word);
zend_hash_index_find(Z_ARRVAL_P(callback_data), 1, (void **)&cb_suggestion_request);
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 2, (void **)&cb_add_to_session);
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 3, (void **)&cb_add_to_personal);
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 4, (void **)&cb_command);
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 5, (void **)&cb_event);
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 6, (void **)&cb_create_input_line);
zend_hash_index_find(Z_ARRVAL_P(callback_data), 7, (void **)&extra);
zend_hash_index_find(Z_ARRVAL_P(callback_data), 8, (void **)&callback_filename);
zend_hash_index_find(Z_ARRVAL_P(callback_data), 9, (void **)&callback_lineno);
@@ -520,13 +511,7 @@
TSRMLS_FETCH();
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 0, (void **)&cb_check_word);
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 1, (void **)&cb_suggestion_request);
zend_hash_index_find(Z_ARRVAL_P(callback_data), 2, (void **)&cb_add_to_session);
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 3, (void **)&cb_add_to_personal);
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 4, (void **)&cb_command);
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 5, (void **)&cb_event);
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 6, (void **)&cb_create_input_line);
zend_hash_index_find(Z_ARRVAL_P(callback_data), 7, (void **)&extra);
zend_hash_index_find(Z_ARRVAL_P(callback_data), 8, (void **)&callback_filename);
zend_hash_index_find(Z_ARRVAL_P(callback_data), 9, (void **)&callback_lineno);
@@ -577,13 +562,7 @@
TSRMLS_FETCH();
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 0, (void **)&cb_check_word);
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 1, (void **)&cb_suggestion_request);
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 2, (void **)&cb_add_to_session);
zend_hash_index_find(Z_ARRVAL_P(callback_data), 3, (void **)&cb_add_to_personal);
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 4, (void **)&cb_command);
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 5, (void **)&cb_event);
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 6, (void **)&cb_create_input_line);
zend_hash_index_find(Z_ARRVAL_P(callback_data), 7, (void **)&extra);
zend_hash_index_find(Z_ARRVAL_P(callback_data), 8, (void **)&callback_filename);
zend_hash_index_find(Z_ARRVAL_P(callback_data), 9, (void **)&callback_lineno);
@@ -635,13 +614,8 @@
TSRMLS_FETCH();
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 0, (void **)&cb_check_word);
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 1, (void **)&cb_suggestion_request);
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 2, (void **)&cb_add_to_session);
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 3, (void **)&cb_add_to_personal);
+
zend_hash_index_find(Z_ARRVAL_P(callback_data), 4, (void **)&cb_command);
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 5, (void **)&cb_event);
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 6, (void **)&cb_create_input_line);
zend_hash_index_find(Z_ARRVAL_P(callback_data), 7, (void **)&extra);
zend_hash_index_find(Z_ARRVAL_P(callback_data), 8, (void **)&callback_filename);
zend_hash_index_find(Z_ARRVAL_P(callback_data), 9, (void **)&callback_lineno);
@@ -697,13 +671,9 @@
TSRMLS_FETCH();
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 0, (void **)&cb_check_word);
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 1, (void **)&cb_suggestion_request);
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 2, (void **)&cb_add_to_session);
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 3, (void **)&cb_add_to_personal);
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 4, (void **)&cb_command);
+
zend_hash_index_find(Z_ARRVAL_P(callback_data), 5, (void **)&cb_event);
- zend_hash_index_find(Z_ARRVAL_P(callback_data), 6, (void **)&cb_create_input_line);
+
zend_hash_index_find(Z_ARRVAL_P(callback_data), 7, (void **)&extra);
zend_hash_index_find(Z_ARRVAL_P(callback_data), 8, (void **)&callback_filename);
zend_hash_index_find(Z_ARRVAL_P(callback_data), 9, (void **)&callback_lineno);
@@ -1063,6 +1033,45 @@
RETURN_NULL();
}
}
+%%override gtk_html_set_cursor_xy
+/* direct copy from gtkhtml.c */
+static GtkWidget *
+php_gtk_shift_to_iframe_parent (GtkWidget *widget, gint *x, gint *y)
+{
+ while (GTK_HTML (widget)->iframe_parent) {
+ if (x)
+ *x += widget->allocation.x;
+ if (y)
+ *y += widget->allocation.y;
+ widget = GTK_HTML (widget)->iframe_parent;
+ }
+
+ return widget;
+}
+
+PHP_FUNCTION(gtk_html_set_cursor_xy)
+{
+ GtkWidget *widget;
+ HTMLEngine *engine;
+ gint x, y;
+
+ NOT_STATIC_METHOD();
+
+ if (!php_gtk_parse_args(ZEND_NUM_ARGS(), "ii", &x,&y))
+ return;
+
+ /* from shift_to_iframe_parent - not exposed by headers */
+ widget = GTK_WIDGET(PHP_GTK_GET(this_ptr));
+ widget = php_gtk_shift_to_iframe_parent (widget, &x, &y);
+
+ engine = GTK_HTML (widget)->engine;
+ if (GTK_HTML (widget)->button1_pressed && html_engine_get_editable (engine))
+ html_engine_jump_at (engine,
+ x + engine->x_offset,
+ y + engine->y_offset);
+
+ RETURN_NULL();
+}
Index: php-gtk/ext/gtkhtml/gtkhtml.defs
diff -u php-gtk/ext/gtkhtml/gtkhtml.defs:1.1 php-gtk/ext/gtkhtml/gtkhtml.defs:1.2
--- php-gtk/ext/gtkhtml/gtkhtml.defs:1.1 Tue Nov 27 20:28:33 2001
+++ php-gtk/ext/gtkhtml/gtkhtml.defs Thu Jan 3 03:48:25 2002
@@ -7,7 +7,7 @@
(object HTML
(in-module Gtk)
- (parent Widget (Gtk))
+ (parent Layout (Gtk))
(c-name GtkHTML)
)
@@ -689,6 +689,15 @@
(c-name gtk_html_get_font_color)
(return-type GdkColor)
)
+
+(method set_cursor_xy
+ (of-object HTML (Gtk))
+ (c-name gtk_html_set_cursor_xy)
+ (return-type none)
+ (parameter (type-and-name gint x))
+ (parameter (type-and-name gint y))
+)
+
; links !