sven

Check-in [1b1aa5dd33]
Login

Check-in [1b1aa5dd33]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:gtkosd.c: shape-combine: confirm that drawing directly to monochrome bitmap not supported, we need to do it the way we are doing it (draw to colour bitmap and the reduce to monochrome)
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 1b1aa5dd334e4729c0db777b9168fd2581f072d4
User & Date: jamesbond 2023-07-02 04:57:03.189
Context
2023-07-02
07:42
(step): feature: dump key and mouse configuration to stdout. Each record is a newline-separated list of key=value pairs. Double newline is the awk-friendly record separator. check-in: 8640c32cac user: jamesbond tags: trunk
04:57
gtkosd.c: shape-combine: confirm that drawing directly to monochrome bitmap not supported, we need to do it the way we are doing it (draw to colour bitmap and the reduce to monochrome) check-in: 1b1aa5dd33 user: jamesbond tags: trunk
04:52
gtkosd.c: tidy up the shape-combine code, remove all old commented code and no-longer-helpful comments. I can always recall them from fossil history if needed. check-in: 33e7ed3b4e user: jamesbond tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to libsven/gtkosd.c.
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167


	// ============ MASK CREATION ===========

	// Create the colour bitmap which we will use as the MASK for the window,
	// depth is -1 which means identical to window.
	// We do this instead of going with monochrome bitmap, because
	// gdk_draw_layout (which uses pango?) cannot draw directly on monochrome bitmap? (need to test)
	bitmap = gdk_pixmap_new(osd->darea->window,osd->width,osd->height,-1); 

	// clear the area
	gdk_draw_rectangle (bitmap,bg_gc,TRUE,0,0,osd->width,osd->height);

	// draw the slider
	draw_bar (osd,bitmap,fg_gc, 4,((((osd->height/2)-((osd->extent.height/2)/3))/4)+(osd->height/2)),osd->bar_set,osd->is_slider ,1);







|







153
154
155
156
157
158
159
160
161
162
163
164
165
166
167


	// ============ MASK CREATION ===========

	// Create the colour bitmap which we will use as the MASK for the window,
	// depth is -1 which means identical to window.
	// We do this instead of going with monochrome bitmap, because
	// gdk_draw_layout cannot draw directly on monochrome bitmap (X error: BadMatch)
	bitmap = gdk_pixmap_new(osd->darea->window,osd->width,osd->height,-1); 

	// clear the area
	gdk_draw_rectangle (bitmap,bg_gc,TRUE,0,0,osd->width,osd->height);

	// draw the slider
	draw_bar (osd,bitmap,fg_gc, 4,((((osd->height/2)-((osd->extent.height/2)/3))/4)+(osd->height/2)),osd->bar_set,osd->is_slider ,1);
205
206
207
208
209
210
211

212
213
214
215
216

217
218
219
220
221
222
223
224
225
226
227
228
229
				gdk_image_put_pixel (image2, i,j, 0);
		}
	}
	mask_gc = gdk_gc_new(mask);
	gdk_draw_image (mask, mask_gc, image2, 0,0, 0,0, -1,-1);

	// ============ APPLY MASK ===========

	gtk_widget_shape_combine_mask (GTK_WIDGET(osd->osd_window), mask,0,0);

	// cleanup
	gdk_gc_unref( fg_gc );
	gdk_gc_unref( bg_gc );


	g_object_unref(bitmap);
	g_object_unref(mask);
	g_object_unref(image);
	g_object_unref(image2);
	gdk_gc_unref( mask_gc );
}

static void greate_osd_drawing(GtkOSD *osd)
{
	GdkGC *fg_gc=NULL;
	GdkColor fg_color;
	GdkColor bg_color;







>





>





<







205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223

224
225
226
227
228
229
230
				gdk_image_put_pixel (image2, i,j, 0);
		}
	}
	mask_gc = gdk_gc_new(mask);
	gdk_draw_image (mask, mask_gc, image2, 0,0, 0,0, -1,-1);

	// ============ APPLY MASK ===========

	gtk_widget_shape_combine_mask (GTK_WIDGET(osd->osd_window), mask,0,0);

	// cleanup
	gdk_gc_unref( fg_gc );
	gdk_gc_unref( bg_gc );
	gdk_gc_unref( mask_gc );

	g_object_unref(bitmap);
	g_object_unref(mask);
	g_object_unref(image);
	g_object_unref(image2);

}

static void greate_osd_drawing(GtkOSD *osd)
{
	GdkGC *fg_gc=NULL;
	GdkColor fg_color;
	GdkColor bg_color;