Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
1ed6ea18
Commit
1ed6ea18
authored
Jan 14, 2011
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Glow and flow widgets destructor fix
parent
4d3f271d
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
59 additions
and
21 deletions
+59
-21
xtt/lib/flow/gtk/flow_browwidget_gtk.cpp
xtt/lib/flow/gtk/flow_browwidget_gtk.cpp
+1
-2
xtt/lib/flow/gtk/flow_draw_gtk.cpp
xtt/lib/flow/gtk/flow_draw_gtk.cpp
+10
-1
xtt/lib/flow/gtk/flow_draw_gtk.h
xtt/lib/flow/gtk/flow_draw_gtk.h
+1
-0
xtt/lib/flow/gtk/flow_widget_gtk.cpp
xtt/lib/flow/gtk/flow_widget_gtk.cpp
+1
-2
xtt/lib/glow/gtk/glow_curvewidget_gtk.cpp
xtt/lib/glow/gtk/glow_curvewidget_gtk.cpp
+24
-0
xtt/lib/glow/gtk/glow_draw_gtk.cpp
xtt/lib/glow/gtk/glow_draw_gtk.cpp
+8
-2
xtt/lib/glow/gtk/glow_draw_gtk.h
xtt/lib/glow/gtk/glow_draw_gtk.h
+13
-13
xtt/lib/glow/gtk/glow_growwidget_gtk.cpp
xtt/lib/glow/gtk/glow_growwidget_gtk.cpp
+1
-1
No files found.
xtt/lib/flow/gtk/flow_browwidget_gtk.cpp
View file @
1ed6ea18
...
...
@@ -351,12 +351,11 @@ static void browwidgetgtk_destroy( GtkObject *object)
BrowWidgetGtk
*
brow
=
(
BrowWidgetGtk
*
)
object
;
if
(
!
brow
->
destroyed
)
{
brow
->
destroyed
=
1
;
if
(
brow
->
scroll_timerid
)
g_source_remove
(
brow
->
scroll_timerid
);
if
(
!
brow
->
is_navigator
)
delete
(
FlowDrawGtk
*
)
brow
->
draw_ctx
;
brow
->
destroyed
=
1
;
}
GTK_OBJECT_CLASS
(
browwidgetgtk_parent_class
)
->
destroy
(
object
);
...
...
xtt/lib/flow/gtk/flow_draw_gtk.cpp
View file @
1ed6ea18
...
...
@@ -312,10 +312,15 @@ static GdkColor flow_allocate_color( FlowDrawGtk *draw_ctx, const char *named_co
FlowDrawGtk
::~
FlowDrawGtk
()
{
closing_down
=
1
;
basectx
->
set_nodraw
();
delete
basectx
;
draw_free_gc
(
this
);
gdk_colormap_free_colors
(
colormap
,
color_vect
,
color_vect_cnt
);
if
(
timer_id
)
g_source_remove
(
timer_id
);
}
int
FlowDrawGtk
::
create_secondary_ctx
(
...
...
@@ -387,7 +392,8 @@ FlowDrawGtk::FlowDrawGtk(
flow_eCtxType
type
)
:
toplevel
(
x_toplevel
),
nav_shell
(
0
),
nav_toplevel
(
0
),
display
(
0
),
window
(
0
),
nav_window
(
0
),
screen
(
0
),
timer_id
(
0
),
color_vect_cnt
(
0
)
window
(
0
),
nav_window
(
0
),
screen
(
0
),
timer_id
(
0
),
color_vect_cnt
(
0
),
closing_down
(
0
)
{
memset
(
gcs
,
0
,
sizeof
(
gcs
));
...
...
@@ -449,6 +455,9 @@ int FlowDrawGtk::event_handler( FlowCtx *ctx, GdkEvent event)
static
int
last_press_y
=
0
;
int
sts
=
1
;
if
(
closing_down
)
return
1
;
if
(
event
.
any
.
window
==
window
||
event
.
type
==
GDK_KEY_PRESS
)
{
switch
(
event
.
type
)
{
case
GDK_KEY_PRESS
:
{
...
...
xtt/lib/flow/gtk/flow_draw_gtk.h
View file @
1ed6ea18
...
...
@@ -50,6 +50,7 @@ class FlowDrawGtk : public FlowDraw {
guint
timer_id
;
GdkColor
color_vect
[
20
];
int
color_vect_cnt
;
int
closing_down
;
FlowDrawGtk
(
GtkWidget
*
toplevel
,
void
**
flow_ctx
,
...
...
xtt/lib/flow/gtk/flow_widget_gtk.cpp
View file @
1ed6ea18
...
...
@@ -344,12 +344,11 @@ static void flowwidgetgtk_destroy( GtkObject *object)
FlowWidgetGtk
*
flow
=
(
FlowWidgetGtk
*
)
object
;
if
(
!
flow
->
destroyed
)
{
flow
->
destroyed
=
1
;
if
(
flow
->
scroll_timerid
)
g_source_remove
(
flow
->
scroll_timerid
);
if
(
!
flow
->
is_navigator
)
delete
(
FlowDrawGtk
*
)
flow
->
draw_ctx
;
flow
->
destroyed
=
1
;
}
GTK_OBJECT_CLASS
(
flowwidgetgtk_parent_class
)
->
destroy
(
object
);
}
...
...
xtt/lib/glow/gtk/glow_curvewidget_gtk.cpp
View file @
1ed6ea18
...
...
@@ -68,6 +68,7 @@ struct _CurveWidgetGtk {
gint
scroll_timerid
;
glow_sScroll
scroll_data
;
int
scroll_configure
;
int
destroyed
;
};
struct
_CurveWidgetGtkClass
{
...
...
@@ -261,8 +262,27 @@ static void curvewidgetgtk_grab_focus( GtkWidget *glow)
gdk_window_focus
(
glow
->
window
,
GDK_CURRENT_TIME
);
}
static
void
curvewidgetgtk_destroy
(
GtkObject
*
object
)
{
CurveWidgetGtk
*
curvew
=
(
CurveWidgetGtk
*
)
object
;
if
(
!
curvew
->
destroyed
)
{
curvew
->
destroyed
=
1
;
if
(
curvew
->
scroll_timerid
)
g_source_remove
(
curvew
->
scroll_timerid
);
if
(
curvew
->
is_navigator
&&
curvew
->
curve_ctx
)
((
CurveCtx
*
)
curvew
->
curve_ctx
)
->
no_nav
=
1
;
else
delete
(
GlowDrawGtk
*
)
curvew
->
draw_ctx
;
}
GTK_OBJECT_CLASS
(
curvewidgetgtk_parent_class
)
->
destroy
(
object
);
}
static
gboolean
curvewidgetgtk_event
(
GtkWidget
*
glow
,
GdkEvent
*
event
)
{
if
(
((
CurveWidgetGtk
*
)
glow
)
->
destroyed
)
return
TRUE
;
if
(
!
((
CurveWidgetGtk
*
)
glow
)
->
curve_ctx
)
// Navigator not yet created
return
TRUE
;
...
...
@@ -360,11 +380,15 @@ static void curvewidgetgtk_realize( GtkWidget *widget)
static
void
curvewidgetgtk_class_init
(
CurveWidgetGtkClass
*
klass
)
{
GtkWidgetClass
*
widget_class
;
GtkObjectClass
*
object_class
;
widget_class
=
GTK_WIDGET_CLASS
(
klass
);
object_class
=
GTK_OBJECT_CLASS
(
klass
);
widget_class
->
realize
=
curvewidgetgtk_realize
;
widget_class
->
expose_event
=
curvewidgetgtk_expose
;
widget_class
->
event
=
curvewidgetgtk_event
;
widget_class
->
grab_focus
=
curvewidgetgtk_grab_focus
;
object_class
->
destroy
=
curvewidgetgtk_destroy
;
}
static
void
curvewidgetgtk_init
(
CurveWidgetGtk
*
glow
)
...
...
xtt/lib/glow/gtk/glow_draw_gtk.cpp
View file @
1ed6ea18
...
...
@@ -484,7 +484,7 @@ static GdkColor glow_allocate_color( GlowDrawGtk *draw_ctx, int rgb_red,
GlowDrawGtk
::~
GlowDrawGtk
()
{
c
ancel_event_timer
(
ctx
)
;
c
losing_down
=
1
;
ctx
->
set_nodraw
();
if
(
ctx
->
type
()
==
glow_eCtxType_Grow
)
...
...
@@ -504,6 +504,9 @@ GlowDrawGtk::~GlowDrawGtk()
g_object_unref
(
nav_wind
.
buffer
);
if
(
nav_wind
.
background_pixmap
)
g_object_unref
(
nav_wind
.
background_pixmap
);
if
(
timer_id
)
g_source_remove
(
timer_id
);
}
int
GlowDrawGtk
::
init_nav
(
GtkWidget
*
nav_widget
)
...
...
@@ -524,7 +527,7 @@ GlowDrawGtk::GlowDrawGtk(
int
(
*
init_proc
)(
GtkWidget
*
w
,
GlowCtx
*
ctx
,
void
*
client_data
),
void
*
client_data
,
glow_eCtxType
type
)
:
ef
(
0
),
timer_id
(
0
),
click_sensitivity
(
0
),
color_vect_cnt
(
0
)
:
ef
(
0
),
timer_id
(
0
),
click_sensitivity
(
0
),
color_vect_cnt
(
0
)
,
closing_down
(
0
)
{
memset
(
gcs
,
0
,
sizeof
(
gcs
));
memset
(
font
,
0
,
sizeof
(
font
));
...
...
@@ -580,6 +583,9 @@ int GlowDrawGtk::event_handler( GdkEvent event)
static
int
last_press_y
=
0
;
int
sts
=
1
;
if
(
closing_down
)
return
1
;
// cout << "Event : button_pressed " << button_pressed << " clicked " <<
// button_clicked << " c&p " << button_clicked_and_pressed << endl;
...
...
xtt/lib/glow/gtk/glow_draw_gtk.h
View file @
1ed6ea18
...
...
@@ -61,25 +61,25 @@ class GlowDrawGtk : public GlowDraw {
glow_eCtxType
type
);
~
GlowDrawGtk
();
DrawWindGtk
m_wind
;
DrawWindGtk
nav_wind
;
DrawWindGtk
m_wind
;
DrawWindGtk
nav_wind
;
GdkDisplay
*
display
;
GdkScreen
*
screen
;
GdkGC
*
gc
;
GdkGC
*
gc_erase
;
GdkGC
*
gc_inverse
;
GdkGC
*
gcs
[
glow_eDrawType__
][
DRAW_TYPE_SIZE
];
// XFontStruct *font_struct[glow_eDrawFont__][DRAW_FONT_SIZE];
GdkGC
*
gc
;
GdkGC
*
gc_erase
;
GdkGC
*
gc_inverse
;
GdkGC
*
gcs
[
glow_eDrawType__
][
DRAW_TYPE_SIZE
];
GdkFont
*
font
[
glow_eFont__
][
glow_eDrawFont__
][
DRAW_FONT_SIZE
];
GdkCursor
*
cursors
[
glow_eDrawCursor__
];
int
ef
;
GdkColormap
*
colormap
;
GdkColor
background
;
GdkColor
original_background
;
guint
timer_id
;
int
click_sensitivity
;
int
ef
;
GdkColormap
*
colormap
;
GdkColor
background
;
GdkColor
original_background
;
guint
timer_id
;
int
click_sensitivity
;
GdkColor
color_vect
[
320
];
int
color_vect_cnt
;
int
closing_down
;
int
event_handler
(
GdkEvent
event
);
virtual
void
enable_event
(
glow_eEvent
event
,
...
...
xtt/lib/glow/gtk/glow_growwidget_gtk.cpp
View file @
1ed6ea18
...
...
@@ -271,13 +271,13 @@ static void growwidgetgtk_destroy( GtkObject *object)
GrowWidgetGtk
*
grow
=
(
GrowWidgetGtk
*
)
object
;
if
(
!
grow
->
destroyed
)
{
grow
->
destroyed
=
1
;
if
(
grow
->
scroll_timerid
)
g_source_remove
(
grow
->
scroll_timerid
);
if
(
grow
->
is_navigator
&&
grow
->
grow_ctx
)
((
GrowCtx
*
)
grow
->
grow_ctx
)
->
no_nav
=
1
;
else
delete
(
GlowDrawGtk
*
)
grow
->
draw_ctx
;
grow
->
destroyed
=
1
;
}
GTK_OBJECT_CLASS
(
growwidgetgtk_parent_class
)
->
destroy
(
object
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment