gtk intf: first try to debug caret bug

git-svn-id: trunk@15426 -
This commit is contained in:
mattias 2008-06-14 17:26:23 +00:00
parent daf9bb41ce
commit b713bcb5bb

View File

@ -168,6 +168,8 @@ function GTKAPIWidgetClient_FocusIn(AWidget: PGTKWidget;
Event: PGdkEventFocus): GTKEventResult; cdecl; forward; Event: PGdkEventFocus): GTKEventResult; cdecl; forward;
function GTKAPIWidgetClient_FocusOut(AWidget: PGTKWidget; function GTKAPIWidgetClient_FocusOut(AWidget: PGTKWidget;
Event: PGdkEventFocus): GTKEventResult; cdecl; forward; Event: PGdkEventFocus): GTKEventResult; cdecl; forward;
function GTKAPIWidgetClient_Expose(widget: PGtkWidget;
event: PGdkEventExpose): gboolean; cdecl; forward;
procedure GTKAPIWidgetClient_ClassInit(theClass: Pointer);cdecl; forward; procedure GTKAPIWidgetClient_ClassInit(theClass: Pointer);cdecl; forward;
{$ifdef gtk2} {$ifdef gtk2}
@ -284,6 +286,7 @@ begin
key_press_event := @GTKAPIWidgetClient_KeyPress; key_press_event := @GTKAPIWidgetClient_KeyPress;
focus_in_event := @GTKAPIWidgetClient_FocusIn; focus_in_event := @GTKAPIWidgetClient_FocusIn;
focus_out_event := @GTKAPIWidgetClient_FocusOut; focus_out_event := @GTKAPIWidgetClient_FocusOut;
expose_event := @GTKAPIWidgetClient_Expose;
end; end;
end; end;
@ -592,6 +595,17 @@ begin
Result := gtk_False; Result := gtk_False;
end; end;
function GTKAPIWidgetClient_Expose(widget: PGtkWidget; event: PGdkEventExpose): gboolean; cdecl;
//var
//Client: PGTKAPIWidgetClient;
begin
//DebugLn(['GTKAPIWidgetClient_Expose ',GTK_WIDGET_DOUBLE_BUFFERED(Widget)]);
{Client:=PGTKAPIWidgetClient(Widget);
if GTK_WIDGET_DOUBLE_BUFFERED(Widget) then
Client^.Caret.IsDrawn:=false;}
Result := gtk_False;
end;
procedure GTKAPIWidgetClient_HideCaret(Client: PGTKAPIWidgetClient; procedure GTKAPIWidgetClient_HideCaret(Client: PGTKAPIWidgetClient;
var OldVisible: boolean); var OldVisible: boolean);
begin begin
@ -658,13 +672,18 @@ begin
if (BackPixmap <> nil) if (BackPixmap <> nil)
and (Widget<>nil) and (Widget<>nil)
and (WidgetStyle<>nil) and (WidgetStyle<>nil)
then gdk_draw_pixmap( then begin
gdk_draw_pixmap(
Widget^.Window, Widget^.Window,
WidgetStyle^.bg_gc[GTK_STATE_NORMAL], WidgetStyle^.bg_gc[GTK_STATE_NORMAL],
BackPixmap, 0, 0, BackPixmap, 0, 0,
X, Y-1, // Y-1 for Delphi compatibility X, Y-1, // Y-1 for Delphi compatibility
Width, Height Width, Height
); );
{$IFDEF VerboseCaret}
DebugLn(['GTKAPIWidgetClient_DrawCaret Hide ',X,',',Y]);
{$ENDIF}
end;
IsDrawn := False; IsDrawn := False;
end end
else else
@ -690,7 +709,11 @@ begin
and (Widget<>nil) and (Widget<>nil)
and (WidgetStyle<>nil) and (WidgetStyle<>nil)
and (Width>0) and (Height>0) and (Width>0) and (Height>0)
then gdk_draw_pixmap( then begin
{$IFDEF VerboseCaret}
DebugLn(['GTKAPIWidgetClient_DrawCaret Store ',X,',',Y]);
{$ENDIF}
gdk_draw_pixmap(
BackPixmap, BackPixmap,
WidgetStyle^.bg_gc[GTK_STATE_NORMAL], WidgetStyle^.bg_gc[GTK_STATE_NORMAL],
Widget^.Window, Widget^.Window,
@ -698,6 +721,7 @@ begin
0, 0, 0, 0,
Width, Height Width, Height
); );
end;
// draw caret // draw caret
{$IFDEF VerboseCaret} {$IFDEF VerboseCaret}
@ -718,7 +742,7 @@ begin
//gdk_gc_get_values(ForeGroundGC,@ForeGroundGCValues); //gdk_gc_get_values(ForeGroundGC,@ForeGroundGCValues);
//OldGdkFunction:=ForeGroundGCValues.thefunction; //OldGdkFunction:=ForeGroundGCValues.thefunction;
{$IFDEF VerboseCaret} {$IFDEF VerboseCaret}
DebugLn('GTKAPIWidgetClient_DrawCaret ',DbgS(Client),' Real Drawing Caret '); DebugLn('GTKAPIWidgetClient_DrawCaret ',DbgS(Client),' Real Drawing Caret ',X,',',Y);
{$ENDIF} {$ENDIF}
gdk_gc_set_function(ForeGroundGC,GDK_invert); gdk_gc_set_function(ForeGroundGC,GDK_invert);
try try