From ffb90f3df5e21b415f9acecd7d392a72eee667f3 Mon Sep 17 00:00:00 2001 From: cxl Date: Sun, 14 Mar 2010 22:15:32 +0000 Subject: [PATCH] .CtrlLib: ChGtk logger git-svn-id: svn://ultimatepp.org/upp/trunk@2228 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/CtrlLib/ChGtk.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/uppsrc/CtrlLib/ChGtk.cpp b/uppsrc/CtrlLib/ChGtk.cpp index 8f5170542..02d9dc874 100644 --- a/uppsrc/CtrlLib/ChGtk.cpp +++ b/uppsrc/CtrlLib/ChGtk.cpp @@ -121,6 +121,13 @@ struct GtkRangeLayout_ { GdkRectangle stepper_d; }; +void (*chgtkspy__)(const char *name, int state, int shadow, const char *detail, int type, int cx, int cy, const Value& look); + +void SetChGtkSpy_(void (*spy)(const char *name, int state, int shadow, const char *detail, int type, int cx, int cy, const Value& look)) +{ + chgtkspy__ = spy; +} + Image GetGTK(GtkWidget *widget, int state, int shadow, const char *detail, int type, int cx, int cy) { MemoryIgnoreLeaksBlock __; @@ -255,6 +262,8 @@ Image GetGTK(GtkWidget *widget, int state, int shadow, const char *detail, int t if(type == GTK_ICON) g_object_unref(icon); sLastImage = RecreateAlpha(m[0], m[1]); + if(chgtkspy__) + chgtkspy__(G_OBJECT_TYPE_NAME(widget), state, shadow, detail, type, cx, cy, sLastImage); return sLastImage; } @@ -389,6 +398,9 @@ Value GtkMakeCh(int shadow, int state, const Rect& r, const Rect& m) e.state = state; e.reduce = r; e.margins = m; + if(chgtkspy__) { + chgtkspy__ + } return RawToValue(e); } @@ -643,6 +655,9 @@ void ChHostSkin() ChLookFn(GtkLookFn); String engine = GtkStyleString("gtk-theme-name"); + + if(chgtkspy__) + engine.Clear(); int fontname = Font::ARIAL; int fontheight = 13;