File: sdpgtkclist.cpp

package info (click to toggle)
k3d 0.4.3.0-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 51,716 kB
  • ctags: 81,610
  • sloc: cpp: 283,698; ansic: 64,095; xml: 61,533; sh: 9,026; makefile: 5,282; python: 431; perl: 308; awk: 130
file content (764 lines) | stat: -rw-r--r-- 17,342 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764

// SDPGTK Library
// Copyright (c) 1995-2004, Timothy M. Shead
//
// Contact: tshead@k-3d.com
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

#include "sdpgtkclist.h"
#include "sdpgtkutility.h"

sdpGtkCList::sdpGtkCList() : sdpGtkContainer()
{
}

sdpGtkCList::sdpGtkCList(GtkCList* CList) : sdpGtkContainer(GTK_CONTAINER(CList))
{
}

bool sdpGtkCList::Create(gint Columns)
{
	// Sanity checks ...
	g_assert(Columns);

	m_Object = GTK_OBJECT(gtk_clist_new(Columns));
	return Attached();
}

bool sdpGtkCList::Create(sdpGtkIObjectContainer* const ObjectContainer, sdpxml::Document& Document, sdpxml::Element& Element)
{
	// Sanity checks ...
	g_assert(ObjectContainer);

	const gulong columns = sdpxml::GetAttribute(Element, "columns", 0);
	sdpGtkMarkAttribute(Document, Element, "columns");

	g_return_val_if_fail(columns, false);	// You MUST specify how many columns you want!

	return Create(columns);
}

bool sdpGtkCList::CreateOptions(sdpGtkIObjectContainer* const ObjectContainer, sdpxml::Document& Document, sdpxml::Element& Element)
{
	// Sanity checks ...
	g_assert(ObjectContainer);

	// Selection mode ...
	const sdpString selectionmodetext = sdpxml::GetAttribute<sdpString>(Element, "selectionmode", "single");
	sdpGtkMarkAttribute(Document, Element, "selectionmode");
	
	GtkSelectionMode selectionmode = GTK_SELECTION_SINGLE;
	if(selectionmodetext == "single")
		selectionmode = GTK_SELECTION_SINGLE;
	else if(selectionmodetext == "browse")
		selectionmode = GTK_SELECTION_BROWSE;
	else if(selectionmodetext == "multiple")
		selectionmode = GTK_SELECTION_MULTIPLE;
	else if(selectionmodetext == "extended")
		selectionmode = GTK_SELECTION_EXTENDED;
	else
		g_return_val_if_fail(0, false);

	SetSelectionMode(selectionmode);

	// Shadow type ...
	SetShadowType(sdpGtkGetShadowType(Document, Element, GTK_SHADOW_ETCHED_IN));

	return sdpGtkContainer::CreateOptions(ObjectContainer, Document, Element);
}

GtkAdjustment* sdpGtkCList::GetHAdjustment()
{
	// Sanity checks ...
	g_return_val_if_fail(Attached(), 0);

	return gtk_clist_get_hadjustment(*this);
}

GtkAdjustment* sdpGtkCList::GetVAdjustment()
{
	// Sanity checks ...
	g_return_val_if_fail(Attached(), 0);

	return gtk_clist_get_vadjustment(*this);
}

void sdpGtkCList::SetHAdjustment(GtkAdjustment* Adjustment)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_set_hadjustment(*this, Adjustment);
}

void sdpGtkCList::SetVAdjustment(GtkAdjustment* Adjustment)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_set_vadjustment(*this, Adjustment);
}

void sdpGtkCList::SetShadowType(GtkShadowType ShadowType)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_set_shadow_type(*this, ShadowType);
}

void sdpGtkCList::SetSelectionMode(GtkSelectionMode SelectionMode)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_set_selection_mode(*this, SelectionMode);
}

void sdpGtkCList::Freeze()
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_freeze(*this);
}

void sdpGtkCList::Thaw()
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_thaw(*this);
}

void sdpGtkCList::SelectAll()
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_select_all(*this);
}

void sdpGtkCList::DeselectAll()
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_unselect_all(*this);
}

void sdpGtkCList::UndoSelection()
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_undo_selection(*this);
}

void sdpGtkCList::Clear()
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_clear(*this);
}

void sdpGtkCList::MoveTo(gint Row, gint Column, gfloat RowAlign, gfloat ColumnAlign)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_moveto(*this, Row, Column, RowAlign, ColumnAlign);
}

gint sdpGtkCList::GetHitInfo(gint X, gint Y, gint* Row, gint* Column)
{
	// Sanity checks ...
	g_return_val_if_fail(Attached(), -1);

	return gtk_clist_get_selection_info(*this, X, Y, Row, Column);
}

gint sdpGtkCList::ColumnCount()
{
	// Sanity checks ...
	g_return_val_if_fail(Attached(), -1);

	return GTK_CLIST(m_Object)->columns;
}

void sdpGtkCList::ShowColumnTitles()
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_column_titles_show(*this);
}

void sdpGtkCList::HideColumnTitles()
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_column_titles_hide(*this);
}

void sdpGtkCList::ColumnTitlesActive()
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_column_titles_active(*this);
}

void sdpGtkCList::ColumnTitlesPassive()
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_column_titles_passive(*this);
}

void sdpGtkCList::ColumnTitleActive(gint Column)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_column_title_active(*this, Column);
}

void sdpGtkCList::ColumnTitlePassive(gint Column)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_column_title_passive(*this, Column);
}

void sdpGtkCList::SetColumnTitle(gint Column, SDPCSTRING Title)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_set_column_title(*this, Column, Title);
}

void sdpGtkCList::SetColumnWidget(gint Column, GtkWidget* Widget)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_set_column_widget(*this, Column, Widget);
}

SDPSTRING sdpGtkCList::GetColumnTitle(gint Column)
{
	// Sanity checks ...
	g_return_val_if_fail(Attached(), 0);

	return gtk_clist_get_column_title(*this, Column);
}

GtkWidget* sdpGtkCList::GetColumnWidget(gint Column)
{
	// Sanity checks ...
	g_return_val_if_fail(Attached(), 0);

	return gtk_clist_get_column_widget(*this, Column);
}

void sdpGtkCList::SetColumnJustification(gint Column, GtkJustification Justification)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_set_column_justification(*this, Column, Justification);
}

void sdpGtkCList::SetColumnVisibility(gint Column, gboolean Visible)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_set_column_visibility(*this, Column, Visible);
}

void sdpGtkCList::SetColumnResizeable(gint Column, gboolean Resizeable)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_set_column_resizeable(*this, Column, Resizeable);
}

void sdpGtkCList::SetColumnAutoResize(gint Column, gboolean AutoResize)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_set_column_auto_resize(*this, Column, AutoResize);
}

gint sdpGtkCList::GetOptimalColumnWidth(gint Column)
{
	// Sanity checks ...
	g_return_val_if_fail(Attached(), -1);

	return gtk_clist_optimal_column_width(*this, Column);
}

void sdpGtkCList::SetColumnWidth(gint Column, gint Width)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_set_column_width(*this, Column, Width);
}

void sdpGtkCList::SetColumnMinWidth(gint Column, gint MinWidth)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_set_column_min_width(*this, Column, MinWidth);
}

void sdpGtkCList::SetColumnMaxWidth(gint Column, gint MaxWidth)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_set_column_max_width(*this, Column, MaxWidth);
}

gint sdpGtkCList::RowCount()
{
	// Sanity checks ...
	g_return_val_if_fail(Attached(), -1);

	return GTK_CLIST(m_Object)->rows;
}

void sdpGtkCList::SetRowHeight(guint Height)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_set_row_height(*this, Height);
}

GtkVisibility sdpGtkCList::GetRowVisible(gint Row)
{
	// Sanity checks ...
	g_return_val_if_fail(Attached(), GtkVisibility(-1));

	return gtk_clist_row_is_visible(*this, Row);
}

void sdpGtkCList::SetRowStyle(gint Row, GtkStyle* Style)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_set_row_style(*this, Row, Style);
}

GtkStyle* sdpGtkCList::GetRowStyle(gint Row)
{
	// Sanity checks ...
	g_return_val_if_fail(Attached(), 0);

	return gtk_clist_get_row_style(*this, Row);
}

void sdpGtkCList::SetSelectable(gint Row, gboolean Selectable)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_set_selectable(*this, Row, Selectable);
}

gboolean sdpGtkCList::GetSelectable(gint Row)
{
	// Sanity checks ...
	g_return_val_if_fail(Attached(), false);

	return gtk_clist_get_selectable(*this, Row) ? true : false;
}

void sdpGtkCList::SetForegroundColor(gint Row, GdkColor* Color)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_set_foreground(*this, Row, Color);
}

void sdpGtkCList::SetBackgroundColor(gint Row, GdkColor* Color)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_set_background(*this, Row, Color);
}

gint sdpGtkCList::Prepend(SDPCSTRING Text)
{
	// Sanity checks ...
	g_return_val_if_fail(Attached(), -1);

	return gtk_clist_prepend(*this, const_cast<gchar**>(&Text));
}

gint sdpGtkCList::Prepend(SDPCSTRING Text[])
{
	// Sanity checks ...
	g_return_val_if_fail(Attached(), -1);

	return gtk_clist_prepend(*this, const_cast<gchar**>(Text));
}

gint sdpGtkCList::Append(SDPCSTRING Text)
{
	// Sanity checks ...
	g_return_val_if_fail(Attached(), -1);

	return gtk_clist_append(*this, const_cast<gchar**>(&Text));
}

gint sdpGtkCList::Append(SDPCSTRING Text[])
{
	// Sanity checks ...
	g_return_val_if_fail(Attached(), -1);

	return gtk_clist_append(*this, const_cast<gchar**>(Text));
}

gint sdpGtkCList::Insert(gint Row, SDPCSTRING Text)
{
	// Sanity checks ...
	g_return_val_if_fail(Attached(), -1);

	return gtk_clist_insert(*this, Row, const_cast<gchar**>(&Text));
}

gint sdpGtkCList::Insert(gint Row, SDPCSTRING Text[])
{
	// Sanity checks ...
	g_return_val_if_fail(Attached(), -1);

	return gtk_clist_insert(*this, Row, const_cast<gchar**>(Text));
}

void sdpGtkCList::Remove(gint Row)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_remove(*this, Row);
}

void sdpGtkCList::SetRowData(gint Row, gpointer Data)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_set_row_data(*this, Row, Data);
}

gpointer sdpGtkCList::GetRowData(gint Row)
{
	// Sanity checks ...
	g_return_val_if_fail(Attached(), 0);

	return gtk_clist_get_row_data(*this, Row);
}

gint sdpGtkCList::FindRowFromData(gpointer Data)
{
	// Sanity checks ...
	g_return_val_if_fail(Attached(), -1);

	return gtk_clist_find_row_from_data(*this, Data);
}

void sdpGtkCList::SelectRow(gint Row, gint Column)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_select_row(*this, Row, Column);
}

void sdpGtkCList::DeselectRow(gint Row, gint Column)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_unselect_row(*this, Row, Column);
}

void sdpGtkCList::SwapRows(gint Row1, gint Row2)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_swap_rows(*this, Row1, Row2);
}

void sdpGtkCList::MoveRow(gint Source, gint Destination)
{
	// Not implemented ...
	g_return_if_fail(0);

/*
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_row_move(*this, Source, Destination);
*/
}

GtkCellType sdpGtkCList::GetCellType(gint Row, gint Column)
{
	// Sanity checks ...
	g_return_val_if_fail(Attached(), GtkCellType(-1));

	return gtk_clist_get_cell_type(*this, Row, Column);
}

void sdpGtkCList::SetCellStyle(gint Row, gint Column, GtkStyle* Style)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_set_cell_style(*this, Row, Column, Style);
}

GtkStyle* sdpGtkCList::GetCellStyle(gint Row, gint Column)
{
	// Sanity checks ...
	g_return_val_if_fail(Attached(), 0);

	return gtk_clist_get_cell_style(*this, Row, Column);
}

void sdpGtkCList::SetShift(gint Row, gint Column, gint Vertical, gint Horizontal)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_set_shift(*this, Row, Column, Vertical, Horizontal);
}

void sdpGtkCList::SetText(gint Row, gint Column, SDPCSTRING Text)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_set_text(*this, Row, Column, Text);
}

void sdpGtkCList::SetPixmap(gint Row, gint Column, GdkPixmap* Pixmap, GdkBitmap* Mask)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_set_pixmap(*this, Row, Column, Pixmap, Mask);
}

void sdpGtkCList::SetPixmapText(gint Row, gint Column, SDPCSTRING Text, guint8 Spacing, GdkPixmap* Pixmap, GdkBitmap* Mask)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_set_pixtext(*this, Row, Column, Text, Spacing, Pixmap, Mask);
}

sdpString sdpGtkCList::GetText(gint Row, gint Column)
{
	// Sanity checks ...
	sdpString tmpResult;
	g_return_val_if_fail(Attached(), tmpResult);
	
	gchar* text = 0;
	gtk_clist_get_text(*this, Row, Column, &text);
	
	return sdpString(text);
}

gint sdpGtkCList::GetPixmap(gint Row, gint Column, GdkPixmap** Pixmap, GdkBitmap** Mask)
{
	// Sanity checks ...
	g_return_val_if_fail(Attached(), -1);

	return gtk_clist_get_pixmap(*this, Row, Column, Pixmap, Mask);
}

gint sdpGtkCList::GetPixmapText(gint Row, gint Column, SDPSTRING* Text, guint8* Spacing, GdkPixmap** Pixmap, GdkBitmap** Mask)
{
	// Sanity checks ...
	g_return_val_if_fail(Attached(), -1);

	return gtk_clist_get_pixtext(*this, Row, Column, Text, Spacing, Pixmap, Mask);
}

void sdpGtkCList::SetCompareFunction(GtkCListCompareFunc Function)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_set_compare_func(*this, Function);
}

void sdpGtkCList::SetSortColumn(gint Column)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_set_sort_column(*this, Column);
}

void sdpGtkCList::SetSortType(GtkSortType Type)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_set_sort_type(*this, Type);
}

void sdpGtkCList::Sort()
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_sort(*this);
}

void sdpGtkCList::SetAutoSort(gboolean AutoSort)
{
	// Sanity checks ...
	g_return_if_fail(Attached());

	gtk_clist_set_auto_sort(*this, AutoSort);
}

static bool RowCoordinates(sdpGtkCList& List, const gint Row, gint& Top, gint& Bottom)
{
	// Sanity checks ...
	g_assert(List.Attached());
	g_assert(Row >= 0);

	Top = INT_MAX;
	Bottom = -INT_MAX;

	bool result = false;

	gint testrow, testcolumn;	
	for(gint i = 0; i < List.Height(); i++)
		{
			List.GetHitInfo(0, i, &testrow, &testcolumn);
			if(Row == testrow)
				{
					result = true;
					
					Top = std::min(Top, i);
					Bottom = std::max(Bottom, i);
				}
		}

	return result;
}

bool sdpGtkCList::InteractiveWarpPointer(const gint Row, const gdouble Speed, const bool Pause)
{
	// Sanity checks ...
	g_return_val_if_fail(Attached(), false);
	
	return InteractiveWarpPointer(Row, 0.5, 0.5, Speed, Pause);
}

bool sdpGtkCList::InteractiveWarpPointer(const gint Row, const gdouble XPercent, const gdouble YPercent, const gdouble Speed, const bool Pause)
{
	// Sanity checks ...
	g_return_val_if_fail(Attached(), false);

	// Make sure the row's visible ...
	MoveTo(Row, 0, 0.5, 0.0);

	// Get the row's dimensions ...
	gint top, bottom;
	g_return_val_if_fail(RowCoordinates(*this, Row, top, bottom), false);
						
	GtkWidget* widget = GTK_WIDGET(m_Object);

#ifdef K3D_HAVE_GTK2
	const gint xthickness = 0;
	const gint ythickness = 0;
#else
	const gint xthickness = widget->style->klass->xthickness;
	const gint ythickness = widget->style->klass->ythickness;
#endif

	return sdpGtkWidget::InteractiveWarpPointer(gint(XPercent * widget->allocation.width) + xthickness, gint(YPercent * (bottom - top)) + top + ythickness, Speed, Pause, false);
}

bool sdpGtkCList::InteractiveWarpPointer(const gint Row, const gint XOffset, const gint YOffset, const gdouble Speed, const bool Pause)
{
	// Sanity checks ...
	g_return_val_if_fail(Attached(), false);

	// Make sure the row's visible ...
	MoveTo(Row, 0, 0.5, 0.0);

	// Get the row's dimensions ...
	gint top, bottom;
	g_return_val_if_fail(RowCoordinates(*this, Row, top, bottom), false);

	GtkWidget* widget = GTK_WIDGET(m_Object);

#ifdef K3D_HAVE_GTK2
	const gint xthickness = 0;
	const gint ythickness = 0;
#else
	const gint xthickness = widget->style->klass->xthickness;
	const gint ythickness = widget->style->klass->ythickness;
#endif
	
	return sdpGtkWidget::InteractiveWarpPointer(XOffset + xthickness, YOffset + top + ythickness, Speed, Pause, false);
}

sdpGtkCList::Rows sdpGtkCList::GetSelectedRows()
{
	// Sanity checks ...
	sdpGtkCList::Rows tmpResult;
	g_return_val_if_fail(Attached(), tmpResult);
	g_return_val_if_fail(!GTK_IS_CTREE(m_Object), tmpResult); // CTree stores a different type of data in GtkCList->selection, so you can't use this method!!!

	Rows result;

	GtkCList* list = *this;
	for(GList* selection = list->selection; selection; selection = selection->next)
		{
			guint rowindex = GPOINTER_TO_UINT(selection->data);
			result.push_back(rowindex);
		}
			
	return result;
}