[gtkhtml/gtk3-rebased: 2/11] Drop backward-compatibility cruft.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkhtml/gtk3-rebased: 2/11] Drop backward-compatibility cruft.
- Date: Wed, 26 Jan 2011 16:49:06 +0000 (UTC)
commit d99bbea2d99484cc9cbd0baab7782a58a00686c5
Author: Matthew Barnes <mbarnes redhat com>
Date: Sun Jan 9 10:52:38 2011 -0500
Drop backward-compatibility cruft.
components/editor/gtkhtml-color-combo.c | 7 +--
components/editor/gtkhtml-color-swatch.c | 3 -
components/editor/gtkhtml-face-tool-button.c | 7 +--
components/editor/gtkhtml-spell-dialog.c | 3 -
components/editor/main.c | 4 --
gtkhtml/Makefile.am | 1 -
gtkhtml/gtk-compat.h | 53 --------------------------
gtkhtml/gtkhtml-embedded.c | 3 -
gtkhtml/gtkhtml-search.c | 3 -
gtkhtml/gtkhtml.c | 5 +--
gtkhtml/htmldrawqueue.c | 3 -
gtkhtml/htmlembedded.c | 3 -
gtkhtml/htmlengine.c | 23 ++++++-----
gtkhtml/htmlselect.c | 14 +------
gtkhtml/htmltextinput.c | 3 -
gtkhtml/test.c | 3 -
gtkhtml/testgtkhtml.c | 3 -
17 files changed, 18 insertions(+), 123 deletions(-)
---
diff --git a/components/editor/gtkhtml-color-combo.c b/components/editor/gtkhtml-color-combo.c
index 18cc6ac..abadcd9 100644
--- a/components/editor/gtkhtml-color-combo.c
+++ b/components/editor/gtkhtml-color-combo.c
@@ -28,9 +28,6 @@
#include <gdk/gdkkeysyms.h>
#include "gtkhtml-color-swatch.h"
-/* backward-compatibility cruft */
-#include "gtkhtml/gtk-compat.h"
-
#define NUM_CUSTOM_COLORS 8
#define GTKHTML_COLOR_COMBO_GET_PRIVATE(obj) \
@@ -259,8 +256,8 @@ color_combo_child_key_press_event_cb (GtkhtmlColorCombo *combo,
{
GtkWidget *window = combo->priv->window;
- if (!gtk_bindings_activate_event (COMPAT_BINDING_TYPE (window), event))
- gtk_bindings_activate_event (COMPAT_BINDING_TYPE (combo), event);
+ if (!gtk_bindings_activate_event (G_OBJECT (window), event))
+ gtk_bindings_activate_event (G_OBJECT (combo), event);
return TRUE;
}
diff --git a/components/editor/gtkhtml-color-swatch.c b/components/editor/gtkhtml-color-swatch.c
index 523e229..df820ac 100644
--- a/components/editor/gtkhtml-color-swatch.c
+++ b/components/editor/gtkhtml-color-swatch.c
@@ -22,9 +22,6 @@
#include <glib/gi18n-lib.h>
-/* backward-compatibility cruft */
-#include "gtkhtml/gtk-compat.h"
-
#define GTKHTML_COLOR_SWATCH_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE \
((obj), GTKHTML_TYPE_COLOR_SWATCH, GtkhtmlColorSwatchPrivate))
diff --git a/components/editor/gtkhtml-face-tool-button.c b/components/editor/gtkhtml-face-tool-button.c
index fd5e195..05a7149 100644
--- a/components/editor/gtkhtml-face-tool-button.c
+++ b/components/editor/gtkhtml-face-tool-button.c
@@ -30,9 +30,6 @@
#include "gtkhtml-face-chooser.h"
-/* backward-compatibility cruft */
-#include "gtkhtml/gtk-compat.h"
-
#define GTKHTML_FACE_TOOL_BUTTON_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE \
((obj), GTKHTML_TYPE_FACE_TOOL_BUTTON, GtkhtmlFaceToolButtonPrivate))
@@ -213,8 +210,8 @@ face_tool_button_child_key_press_event_cb (GtkhtmlFaceToolButton *button,
{
GtkWidget *window = button->priv->window;
- if (!gtk_bindings_activate_event (COMPAT_BINDING_TYPE (window), event))
- gtk_bindings_activate_event (COMPAT_BINDING_TYPE (button), event);
+ if (!gtk_bindings_activate_event (G_OBJECT (window), event))
+ gtk_bindings_activate_event (G_OBJECT (button), event);
return TRUE;
}
diff --git a/components/editor/gtkhtml-spell-dialog.c b/components/editor/gtkhtml-spell-dialog.c
index c1735a0..b923d7f 100644
--- a/components/editor/gtkhtml-spell-dialog.c
+++ b/components/editor/gtkhtml-spell-dialog.c
@@ -443,9 +443,6 @@ spell_dialog_init (GtkhtmlSpellDialog *dialog)
gtk_dialog_add_button (
GTK_DIALOG (dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
-#if !GTK_CHECK_VERSION(2,90,7)
- g_object_set (dialog, "has-separator", FALSE, NULL);
-#endif
gtk_window_set_title (GTK_WINDOW (dialog), _("Spell Checker"));
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
diff --git a/components/editor/main.c b/components/editor/main.c
index 3445229..a10d12e 100644
--- a/components/editor/main.c
+++ b/components/editor/main.c
@@ -157,10 +157,6 @@ view_source_dialog (GtkhtmlEditor *editor,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
NULL);
-#if !GTK_CHECK_VERSION(2,90,7)
- g_object_set (dialog, "has-separator", FALSE, NULL);
-#endif
-
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
diff --git a/gtkhtml/Makefile.am b/gtkhtml/Makefile.am
index e9ff602..3adb590 100644
--- a/gtkhtml/Makefile.am
+++ b/gtkhtml/Makefile.am
@@ -200,7 +200,6 @@ libgtkhtml_4_0_la_SOURCES = \
htmliframe.h \
htmlframe.h \
htmlframeset.h \
- gtk-compat.h \
$(PLATFORM_DEP_SOURCES) \
$(NULL)
diff --git a/gtkhtml/gtkhtml-embedded.c b/gtkhtml/gtkhtml-embedded.c
index 31719e0..fb8f3e8 100644
--- a/gtkhtml/gtkhtml-embedded.c
+++ b/gtkhtml/gtkhtml-embedded.c
@@ -26,9 +26,6 @@
#include "gtkhtml-embedded.h"
#include "htmlengine.h"
-/* backward-compatibility cruft */
-#include "gtk-compat.h"
-
static void gtk_html_embedded_class_init (GtkHTMLEmbeddedClass *class);
static void gtk_html_embedded_init (GtkHTMLEmbedded *gspaper);
diff --git a/gtkhtml/gtkhtml-search.c b/gtkhtml/gtkhtml-search.c
index e16de06..0cfa278 100644
--- a/gtkhtml/gtkhtml-search.c
+++ b/gtkhtml/gtkhtml-search.c
@@ -30,9 +30,6 @@
#include "htmlsearch.h"
#include "htmlselection.h"
-/* backward-compatibility cruft */
-#include "gtk-compat.h"
-
struct _GtkHTMLISearch {
GtkHTML *html;
gboolean forward;
diff --git a/gtkhtml/gtkhtml.c b/gtkhtml/gtkhtml.c
index 0ce2d42..1038e2e 100644
--- a/gtkhtml/gtkhtml.c
+++ b/gtkhtml/gtkhtml.c
@@ -69,9 +69,6 @@
#include "gtkhtml-properties.h"
#include "math.h"
-/* backward-compatibility cruft */
-#include "gtk-compat.h"
-
enum DndTargetType {
DND_TARGET_TYPE_TEXT_URI_LIST,
DND_TARGET_TYPE_MOZILLA_URL,
@@ -1068,7 +1065,7 @@ key_press_event (GtkWidget *widget, GdkEventKey *event)
}
if (html_class->use_emacs_bindings && html_class->emacs_bindings && !html->binding_handled)
- gtk_binding_set_activate (html_class->emacs_bindings, event->keyval, event->state, COMPAT_BINDING_TYPE (widget));
+ gtk_binding_set_activate (html_class->emacs_bindings, event->keyval, event->state, G_OBJECT (widget));
if (!html->binding_handled) {
html->priv->in_key_binding = TRUE;
diff --git a/gtkhtml/htmldrawqueue.c b/gtkhtml/htmldrawqueue.c
index f014100..85f5950 100644
--- a/gtkhtml/htmldrawqueue.c
+++ b/gtkhtml/htmldrawqueue.c
@@ -32,9 +32,6 @@
#include "htmlsettings.h"
#include "gtkhtml.h"
-/* backward-compatibility cruft */
-#include "gtk-compat.h"
-
/* HTMLDrawQueueClearElement handling. */
static HTMLDrawQueueClearElement *
diff --git a/gtkhtml/htmlembedded.c b/gtkhtml/htmlembedded.c
index cf3ed4f..fdae86d 100644
--- a/gtkhtml/htmlembedded.c
+++ b/gtkhtml/htmlembedded.c
@@ -36,9 +36,6 @@
/*For use converter based on g_iconv*/
#include "htmltokenizer.h"
-/* backward-compatibility cruft */
-#include "gtk-compat.h"
-
HTMLEmbeddedClass html_embedded_class;
static HTMLObjectClass *parent_class = NULL;
diff --git a/gtkhtml/htmlengine.c b/gtkhtml/htmlengine.c
index 37cd422..af15495 100644
--- a/gtkhtml/htmlengine.c
+++ b/gtkhtml/htmlengine.c
@@ -99,9 +99,6 @@
#include "htmlmarshal.h"
#include "htmlstyle.h"
-/* backward-compatibility cruft */
-#include "gtk-compat.h"
-
/* #define CHECK_CURSOR */
static void html_engine_class_init (HTMLEngineClass *klass);
@@ -5775,7 +5772,7 @@ html_engine_intersection (HTMLEngine *e, gint *x1, gint *y1, gint *x2, gint *y2)
}
static void
-get_changed_objects (HTMLEngine *e, GdkRegion *region, GList *changed_objs)
+get_changed_objects (HTMLEngine *e, cairo_region_t *region, GList *changed_objs)
{
GList *cur;
@@ -5806,7 +5803,8 @@ get_changed_objects (HTMLEngine *e, GdkRegion *region, GList *changed_objs)
paint.width = cr->width;
paint.height = cr->height;
- gdk_region_union_with_rect (region, &paint);
+ if (paint.width > 0 && paint.height > 0)
+ cairo_region_union_rectangle (region, &paint);
}
g_free (cur->data);
}
@@ -5820,7 +5818,7 @@ struct HTMLEngineExpose {
};
static void
-get_pending_expose (HTMLEngine *e, GdkRegion *region)
+get_pending_expose (HTMLEngine *e, cairo_region_t *region)
{
GSList *l, *next;
@@ -5834,7 +5832,8 @@ get_pending_expose (HTMLEngine *e, GdkRegion *region)
next = l->next;
r = (struct HTMLEngineExpose *) l->data;
- gdk_region_union_with_rect (region, &r->area);
+ if (r->area.width > 0 && r->area.height > 0)
+ cairo_region_union_rectangle (region, &r->area);
g_free (r);
}
}
@@ -5931,7 +5930,7 @@ thaw_idle (gpointer data)
html_engine_queue_redraw_all (e);
} else if (gtk_widget_get_realized (GTK_WIDGET (e->widget))) {
gint nw, nh;
- GdkRegion *region = gdk_region_new ();
+ cairo_region_t *region = cairo_region_create ();
GdkRectangle paint;
get_pending_expose (e, region);
@@ -5946,21 +5945,23 @@ thaw_idle (gpointer data)
paint.width = e->width;
paint.height = e->height + e->y_offset - nh;
- gdk_region_union_with_rect (region, &paint);
+ if (paint.width > 0 && paint.height > 0)
+ cairo_region_union_rectangle (region, &paint);
}
if (nw < w && nw - e->x_offset < e->width) {
paint.x = nw;
paint.y = e->y_offset;
paint.width = e->width + e->x_offset - nw;
- gdk_region_union_with_rect (region, &paint);
+ if (paint.width > 0 && paint.height > 0)
+ cairo_region_union_rectangle (region, &paint);
}
g_list_free (changed_objs);
if (HTML_IS_GDK_PAINTER (e->painter))
gdk_window_invalidate_region (
HTML_GDK_PAINTER (e->painter)->window,
region, FALSE);
- gdk_region_destroy (region);
+ cairo_region_destroy (region);
html_engine_flush_draw_queue (e);
}
g_slist_free (e->pending_expose);
diff --git a/gtkhtml/htmlselect.c b/gtkhtml/htmlselect.c
index 1da5050..c842006 100644
--- a/gtkhtml/htmlselect.c
+++ b/gtkhtml/htmlselect.c
@@ -25,9 +25,6 @@
#include "htmlselect.h"
#include <string.h>
-/* backward-compatibility cruft */
-#include "gtk-compat.h"
-
HTMLSelectClass html_select_class;
static HTMLEmbeddedClass *parent_class = NULL;
@@ -245,16 +242,7 @@ html_select_init (HTMLSelect *select,
select->view, 120, req.height * size);
gtk_list_store_remove (store, &iter);
} else {
-#if GTK_CHECK_VERSION(2,23,0)
- widget = g_object_new (
- GTK_TYPE_COMBO_BOX,
- "model", select->model,
- "has-entry", TRUE,
- "entry-text-column", 0,
- NULL);
-#else
- widget = gtk_combo_box_entry_new_with_model (select->model, 0);
-#endif
+ widget = gtk_combo_box_new_with_model_and_entry (select->model);
gtk_widget_set_size_request (widget, 120, -1);
}
diff --git a/gtkhtml/htmltextinput.c b/gtkhtml/htmltextinput.c
index e2ceb99..b7f7df8 100644
--- a/gtkhtml/htmltextinput.c
+++ b/gtkhtml/htmltextinput.c
@@ -27,9 +27,6 @@
#include "htmltextinput.h"
#include "htmlform.h"
-/* backward-compatibility cruft */
-#include "gtk-compat.h"
-
HTMLTextInputClass html_text_input_class;
static HTMLEmbeddedClass *parent_class = NULL;
diff --git a/gtkhtml/test.c b/gtkhtml/test.c
index 4453e09..5ad4b03 100644
--- a/gtkhtml/test.c
+++ b/gtkhtml/test.c
@@ -38,9 +38,6 @@
#include "htmlengine.h"
-/* backward-compatibility cruft */
-#include "gtk-compat.h"
-
typedef struct _Example Example;
struct _Example {
diff --git a/gtkhtml/testgtkhtml.c b/gtkhtml/testgtkhtml.c
index 4039fe5..6d8edd8 100644
--- a/gtkhtml/testgtkhtml.c
+++ b/gtkhtml/testgtkhtml.c
@@ -49,9 +49,6 @@
#include "gtkhtmldebug.h"
-/* backward-compatibility cruft */
-#include "gtk-compat.h"
-
#ifndef O_BINARY
#define O_BINARY 0
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]