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
|
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "GtkDefs.h"
static void
svrefcnt_dec(gpointer data) {
SvREFCNT_dec((SV*)data);
}
MODULE = Gtk::CList PACKAGE = Gtk::CList PREFIX = gtk_clist_
#ifdef GTK_CLIST
Gtk::CList_Sink
new(Class, columns)
SV* Class
int columns
CODE:
RETVAL = (GtkCList*)(gtk_clist_new(columns));
OUTPUT:
RETVAL
#ARG: $title string (text to put in the first column title)
#ARG: ... list (additional strings to put in the second, third... column titles)
Gtk::CList_Sink
new_with_titles(Class, title, ...)
SV * Class
SV * title
CODE:
{
int columns = items - 1;
int i;
char** titles = malloc(columns * sizeof(gchar*));
for (i=1; i < items; ++i)
titles[i-1] = SvPV(ST(i),PL_na);
RETVAL = (GtkCList*)(gtk_clist_new_with_titles(columns, titles));
free(titles);
}
OUTPUT:
RETVAL
void
gtk_clist_set_shadow_type(clist, type)
Gtk::CList clist
Gtk::ShadowType type
ALIAS:
Gtk::CList::set_border = 1
CODE:
#if GTK_HVER < 0x010103
/* DEPRECATED */
gtk_clist_set_border(clist, type);
#else
gtk_clist_set_shadow_type(clist, type);
#endif
void
gtk_clist_set_selection_mode(clist, mode)
Gtk::CList clist
Gtk::SelectionMode mode
#if GTK_HVER < 0x010105
void
gtk_clist_set_policy(clist, vscrollbar_policy, hscrollbar_policy)
Gtk::CList clist
Gtk::PolicyType hscrollbar_policy
Gtk::PolicyType vscrollbar_policy
#endif
void
gtk_clist_freeze(clist)
Gtk::CList clist
ALIAS:
Gtk::CList::freeze = 0
Gtk::CList::thaw = 1
Gtk::CList::column_titles_show = 2
Gtk::CList::column_titles_hide = 3
Gtk::CList::column_titles_active = 4
Gtk::CList::column_titles_passive = 5
Gtk::CList::clear = 6
Gtk::CList::sort = 7
Gtk::CList::select_all = 8
Gtk::CList::unselect_all = 9
Gtk::CList::undo_selection = 10
CODE:
switch (ix) {
case 0: gtk_clist_freeze(clist); break;
case 1: gtk_clist_thaw(clist); break;
case 2: gtk_clist_column_titles_show(clist); break;
case 3: gtk_clist_column_titles_hide(clist); break;
case 4: gtk_clist_column_titles_active(clist); break;
case 5: gtk_clist_column_titles_passive(clist); break;
case 6: gtk_clist_clear(clist); break;
case 7: gtk_clist_sort(clist); break;
case 8: gtk_clist_select_all(clist); break;
case 9: gtk_clist_unselect_all(clist); break;
case 10: gtk_clist_undo_selection(clist); break;
}
void
gtk_clist_column_title_active (clist, column)
Gtk::CList clist
int column
void
gtk_clist_column_title_passive (clist, column)
Gtk::CList clist
int column
void
gtk_clist_set_column_title(clist, column, title)
Gtk::CList clist
int column
char* title
void
gtk_clist_set_column_widget(clist, column, widget)
Gtk::CList clist
int column
Gtk::Widget widget
Gtk::Widget
gtk_clist_get_column_widget(clist, column)
Gtk::CList clist
int column
void
gtk_clist_set_column_justification(clist, column, justification)
Gtk::CList clist
int column
Gtk::Justification justification
void
gtk_clist_set_column_width(clist, column, width)
Gtk::CList clist
int column
int width
void
gtk_clist_set_row_height(clist, height)
Gtk::CList clist
int height
void
gtk_clist_moveto(clist, row, column, row_align, column_align)
Gtk::CList clist
int row
int column
double row_align
double column_align
Gtk::Visibility
gtk_clist_row_is_visible (clist, row)
Gtk::CList clist
int row
Gtk::CellType
gtk_clist_get_cell_type (clist, row, column)
Gtk::CList clist
int row
int column
#if GTK_HVER >= 0x010108
void
gtk_clist_set_reorderable(clist, reorderable)
Gtk::CList clist
gboolean reorderable
#endif
void
gtk_clist_set_text(clist, row, column, text)
Gtk::CList clist
int row
int column
char* text
char*
gtk_clist_get_text (clist, row, column)
Gtk::CList clist
int row
int column
CODE:
{
gchar* text=NULL;
gtk_clist_get_text(clist, row, column, &text);
RETVAL = text;
}
OUTPUT:
RETVAL
void
gtk_clist_set_pixmap(clist, row, column, pixmap, mask)
Gtk::CList clist
int row
int column
Gtk::Gdk::Pixmap pixmap
Gtk::Gdk::Bitmap_OrNULL mask
void
gtk_clist_get_pixmap (clist, row, column)
Gtk::CList clist
int row
int column
PPCODE:
{
GdkPixmap * pixmap = NULL;
GdkBitmap * bitmap = NULL;
int result;
result = gtk_clist_get_pixmap(clist, row, column, &pixmap, (GIMME == G_ARRAY) ?&bitmap: NULL);
if ( result ) {
if ( pixmap ) {
EXTEND(sp, 1);
PUSHs(sv_2mortal(newSVGdkPixmap(pixmap)));
}
if (bitmap ) {
EXTEND(sp, 1);
PUSHs(sv_2mortal(newSVGdkBitmap(bitmap)));
}
}
}
void
gtk_clist_set_pixtext(clist, row, column, text, spacing, pixmap, mask)
Gtk::CList clist
int row
int column
char* text
int spacing
Gtk::Gdk::Pixmap pixmap
Gtk::Gdk::Bitmap_OrNULL mask
void
gtk_clist_get_pixtext (clist, row, column)
Gtk::CList clist
int row
int column
PPCODE:
{
gchar* text = NULL;
guint8 spacing;
GdkPixmap * pixmap = NULL;
GdkBitmap * bitmap = NULL;
int result;
/* FIXME: require GIMME == G_ARRAY? */
result = gtk_clist_get_pixtext(clist, row, column, &text, &spacing, &pixmap, &bitmap);
if ( result ) {
EXTEND(sp, 4);
if ( text )
PUSHs(sv_2mortal(newSVpv(text, 0)));
else
PUSHs(sv_2mortal(newSVsv(&PL_sv_undef)));
PUSHs(sv_2mortal(newSViv(spacing)));
if ( pixmap )
PUSHs(sv_2mortal(newSVGdkPixmap(pixmap)));
else
PUSHs(sv_2mortal(newSVsv(&PL_sv_undef)));
if (bitmap )
PUSHs(sv_2mortal(newSVGdkBitmap(bitmap)));
else
PUSHs(sv_2mortal(newSVsv(&PL_sv_undef)));
}
}
void
gtk_clist_set_foreground(clist, row, color)
Gtk::CList clist
int row
Gtk::Gdk::Color color
void
gtk_clist_set_background(clist, row, color)
Gtk::CList clist
int row
Gtk::Gdk::Color color
void
gtk_clist_set_shift(clist, row, column, verticle, horizontal)
Gtk::CList clist
int row
int column
int verticle
int horizontal
#ARG: $text string (text to put in the first column)
#ARG: ... list (additional strings to put in the second, third... columns)
int
gtk_clist_append(clist, text, ...)
Gtk::CList clist
SV * text
CODE:
{
int num = items-1;
int i;
char** val = malloc(clist->columns*sizeof(char*));
if (num > clist->columns)
num = clist->columns;
for (i=0; i < num; ++i)
val[i] = SvPV(ST(i+1),PL_na);
for(i=num; i < clist->columns; i++)
val[i] = "";
RETVAL = gtk_clist_append(clist, val);
free(val);
}
OUTPUT:
RETVAL
#ARG: $text string (text to put in the first column)
#ARG: ... list (additional strings to put in the second, third... columns)
void
gtk_clist_insert(clist, row, text, ...)
Gtk::CList clist
int row
SV * text
CODE:
{
int num = items-2;
int i;
char** val = malloc(clist->columns*sizeof(char*));
if (num > clist->columns)
num = clist->columns;
for (i=0; i < num; ++i)
val[i] = SvPV(ST(i+2),PL_na);
for(i=num; i < clist->columns; i++)
val[i] = "";
gtk_clist_insert(clist, row, val);
free(val);
}
void
gtk_clist_remove(clist, row)
Gtk::CList clist
int row
#ARG: $row integer (row number)
#ARG: $data reference (reference to the data you want to associate with $row)
void
gtk_clist_set_row_data(clist, row, data)
Gtk::CList clist
int row
SV * data
CODE:
{
SV * sv = (SV*)SvRV(data);
/*\ Hearken: we are given a reference, called 'data', which refers to
* some SV, called 'sv'. The RV is ephemeral, and we must
* not form a permanent reference to it. Instead, we
* increment the refcount of the target sv, and store that
* sv's pointer as the row data. When the row data is
* deallocated, the sv's refcount will be decremented.
\*/
if (!sv)
croak("Data must be a reference");
SvREFCNT_inc(sv);
gtk_clist_set_row_data_full(clist, row, sv, svrefcnt_dec);
}
#RETURNS: the reference set with $clist->set_row_data().
SV*
gtk_clist_get_row_data(clist, row)
Gtk::CList clist
int row
CODE:
{
SV * sv = (SV*)gtk_clist_get_row_data(clist, row);
RETVAL = sv ? newRV_inc(sv) : newSVsv(&PL_sv_undef);
}
OUTPUT:
RETVAL
int
gtk_clist_find_row_from_data (clist, data)
Gtk::CList clist
SV * data
CODE:
{
SV * sv = (SV*)SvRV(data);
if (!sv)
croak("Data must be a reference");
RETVAL = gtk_clist_find_row_from_data(clist, sv);
}
OUTPUT:
RETVAL
void
gtk_clist_select_row(clist, row, column)
Gtk::CList clist
int row
int column
void
gtk_clist_unselect_row(clist, row, column)
Gtk::CList clist
int row
int column
void
gtk_clist_get_selection_info (clist, x, y)
Gtk::CList clist
int x
int y
PPCODE:
{
int row, column;
if (gtk_clist_get_selection_info (clist, x, y, &row, &column)) {
EXTEND(sp, 2);
PUSHs(sv_2mortal(newSViv(row)));
PUSHs(sv_2mortal(newSViv(column)));
}
}
Gtk::Gdk::Window
clist_window (clist)
Gtk::CList clist
CODE:
RETVAL = clist->clist_window;
OUTPUT:
RETVAL
int
rows(clist)
Gtk::CList clist
CODE:
RETVAL=clist->rows;
OUTPUT:
RETVAL
int
columns(clist)
Gtk::CList clist
CODE:
RETVAL=clist->columns;
OUTPUT:
RETVAL
Gtk::SelectionMode
selection_mode (clist)
Gtk::CList clist
CODE:
RETVAL=clist->selection_mode;
OUTPUT:
RETVAL
#RETURNS: a list of the row numbers of the current selection
void
selection (clist)
Gtk::CList clist
PPCODE:
{
GList * selection = clist->selection;
while(selection) {
EXTEND(sp, 1);
PUSHs(sv_2mortal(newSVgint(GPOINTER_TO_INT(selection->data))));
selection=g_list_next(selection);
}
}
#RETURNS: a list of Gtk::CListRow
void
row_list (clist)
Gtk::CList clist
PPCODE:
{
GList * row_list = clist->row_list;
while(row_list) {
EXTEND(sp, 1);
PUSHs(sv_2mortal(newSVGtkCListRow(row_list->data)));
row_list=g_list_next(row_list);
}
}
#if GTK_HVER >= 0x010103
void
gtk_clist_set_column_resizeable(clist, column, resizeable=TRUE)
Gtk::CList clist
int column
bool resizeable
void
gtk_clist_set_column_visibility(clist, column, visible=TRUE)
Gtk::CList clist
int column
bool visible
void
gtk_clist_set_column_auto_resize(clist, column, resize=TRUE)
Gtk::CList clist
int column
bool resize
#endif
#if GTK_HVER >= 0x010200
void
gtk_clist_set_cell_style(clist, row, column, style)
Gtk::CList clist
int row
int column
Gtk::Style style
Gtk::Style
gtk_clist_get_cell_style(clist, row, column)
Gtk::CList clist
int row
int column
void
gtk_clist_set_row_style(clist, row, style)
Gtk::CList clist
int row
Gtk::Style style
Gtk::Style
gtk_clist_get_row_style(clist, row)
Gtk::CList clist
int row
#endif
#endif
|