cpw.qulogic.gtk3: 39e729a8: Port the markerline to cairo and the new...

qulogic at pidgin.im qulogic at pidgin.im
Tue Mar 15 00:42:16 EDT 2011


----------------------------------------------------------------------
Revision: 39e729a854eaa60f6f01599236fd3681706f4170
Parent:   5204b1b3816e4356312730935b2f3b6e9b940e1a
Author:   qulogic at pidgin.im
Date:     03/15/11 00:15:58
Branch:   im.pidgin.cpw.qulogic.gtk3
URL: http://d.pidgin.im/viewmtn/revision/info/39e729a854eaa60f6f01599236fd3681706f4170

Changelog: 

Port the markerline to cairo and the new draw signal.

Changes against parent 5204b1b3816e4356312730935b2f3b6e9b940e1a

  patched  pidgin/plugins/markerline.c

-------------- next part --------------
============================================================
--- pidgin/plugins/markerline.c	404442b07bf29ef52403238e4a0f3e01975666e9
+++ pidgin/plugins/markerline.c	d93cc1fdf4a84c30387ee33546e0c3c3a00bfabe
@@ -42,7 +42,7 @@ static int
 #define PREF_CHATS      PREF_PREFIX "/chats"
 
 static int
-imhtml_expose_cb(GtkWidget *widget, GdkEventExpose *event, PidginConversation *gtkconv)
+imhtml_expose_cb(GtkWidget *widget, cairo_t *cr, PidginConversation *gtkconv)
 {
 	int y, last_y, offset;
 	GdkRectangle visible_rect;
@@ -51,6 +51,7 @@ imhtml_expose_cb(GtkWidget *widget, GdkE
 	int pad;
 	PurpleConversation *conv = gtkconv->active_conv;
 	PurpleConversationType type = purple_conversation_get_type(conv);
+	GdkColor red = {0, 0xffff, 0, 0};
 
 	if ((type == PURPLE_CONV_TYPE_CHAT && !purple_prefs_get_bool(PREF_CHATS)) ||
 			(type == PURPLE_CONV_TYPE_IM && !purple_prefs_get_bool(PREF_IMS)))
@@ -76,20 +77,12 @@ imhtml_expose_cb(GtkWidget *widget, GdkE
 	gtk_text_view_buffer_to_window_coords(GTK_TEXT_VIEW(widget), GTK_TEXT_WINDOW_TEXT,
 										0, last_y, 0, &y);
 
-  /* TODO: port this to using Cairo 
-	if (y >= event->area.y)
-	{
-		GdkColor red = {0, 0xffff, 0, 0};
-		cairo_t *cr = gdk_cairo_create(GDK_DRAWABLE(event->window));
+	gdk_cairo_set_source_color(cr, &red);
+	cairo_move_to(cr, 0.0, y + 0.5);
+	cairo_rel_line_to(cr, visible_rect.width, 0.0);
+	cairo_set_line_width(cr, 1.0);
+	cairo_stroke(cr);
 
-		gdk_cairo_set_source_color(cr, &red);
-		cairo_move_to(cr, 0.0, y + 0.5);
-		cairo_rel_line_to(cr, visible_rect.width, 0.0);
-		cairo_set_line_width(cr, 1.0);
-		cairo_stroke(cr);
-		cairo_destroy(cr);
-	}
-  */
 	return FALSE;
 }
 
@@ -175,7 +168,7 @@ attach_to_gtkconv(PidginConversation *gt
 attach_to_gtkconv(PidginConversation *gtkconv, gpointer null)
 {
 	detach_from_gtkconv(gtkconv, NULL);
-	g_signal_connect(G_OBJECT(gtkconv->imhtml), "expose_event",
+	g_signal_connect(G_OBJECT(gtkconv->imhtml), "draw",
 					 G_CALLBACK(imhtml_expose_cb), gtkconv);
 }
 


More information about the Commits mailing list