#include <gtk/gtk.h>
#include <gdk/gdk.h>
Go to the source code of this file.
<File description>="">
Definition in file gtkContentListItem.h.
#define CURSOR_BOX_MIN_WIDTH (LISTER_BOX_BORDER - HBOX_TEXT_THUMB_SPACING) |
Definition at line 49 of file gtkContentListItem.h.
#define GTK_CONTENT_LIST_ITEM | ( | obj | ) | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_CONTENT_LIST_ITEM_TYPE, GtkContentListItem)) |
Definition at line 61 of file gtkContentListItem.h.
#define GTK_CONTENT_LIST_ITEM_CLASS | ( | klass | ) | (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_CONTENT_LIST_ITEM_TYPE, GtkContentListItemClass)) |
Definition at line 62 of file gtkContentListItem.h.
#define GTK_CONTENT_LIST_ITEM_TYPE (gtk_content_list_item_get_type ()) |
Definition at line 60 of file gtkContentListItem.h.
#define HBOX_TEXT_BORDER 15 |
Definition at line 43 of file gtkContentListItem.h.
#define HBOX_TEXT_TEXT_SPACING 4 |
Definition at line 42 of file gtkContentListItem.h.
#define HBOX_TEXT_THUMB_SPACING 5 |
Definition at line 41 of file gtkContentListItem.h.
#define IS_GTK_CONTENT_LIST_ITEM | ( | obj | ) | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_CONTENT_LIST_ITEM_TYPE)) |
Definition at line 63 of file gtkContentListItem.h.
#define IS_GTK_CONTENT_LIST_ITEM_CLASS | ( | klass | ) | (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_CONTENT_LIST_ITEM_TYPE)) |
Definition at line 64 of file gtkContentListItem.h.
#define ITEM_MAX_THUMB_HEIGHT 115 |
Definition at line 39 of file gtkContentListItem.h.
#define ITEM_MAX_THUMB_WIDTH 91 |
Definition at line 38 of file gtkContentListItem.h.
#define TEXT_BOX_MIN_WIDTH 570 |
Definition at line 48 of file gtkContentListItem.h.
#define THUMB_BOX_MIN_WIDTH 91 |
Definition at line 47 of file gtkContentListItem.h.
#define VBOX_TEXT_BORDER 11 |
Definition at line 45 of file gtkContentListItem.h.
#define VBOX_TEXT_TEXT_SPACING 2 |
Definition at line 44 of file gtkContentListItem.h.
typedef struct _GtkContentListItem GtkContentListItem |
Definition at line 66 of file gtkContentListItem.h.
typedef struct _GtkContentListItemClass GtkContentListItemClass |
Definition at line 67 of file gtkContentListItem.h.
GType gtk_content_list_item_get_type | ( | void | ) |
returns type of GtkListItem widget
Definition at line 64 of file gtkContentListItem.c.
00065 { 00066 static GType content_list_item_type = 0; 00067 00068 if (!content_list_item_type) 00069 { 00070 static const GTypeInfo content_list_item_info = { 00071 sizeof(GtkContentListItemClass), 00072 NULL, /* base_init */ 00073 NULL, /* base_finalize */ 00074 (GClassInitFunc) gtk_content_list_item_class_init, 00075 NULL, /* class_finalize */ 00076 NULL, /* class_data */ 00077 sizeof(GtkContentListItem), 00078 0, /* n_preallocs */ 00079 (GInstanceInitFunc) gtk_content_list_item_init, 00080 }; 00081 00082 content_list_item_type = g_type_register_static(GTK_TYPE_HBOX, "ListItem", &content_list_item_info, 0); 00083 } 00084 return content_list_item_type; 00085 }
void gtk_content_list_item_hide_thumb | ( | GtkContentListItem * | item | ) |
Hide thumb
item | the GtkListItem widget |
Definition at line 290 of file gtkContentListItem.c.
00291 { 00292 g_return_if_fail(IS_GTK_CONTENT_LIST_ITEM(item)); 00293 gtk_widget_hide(GTK_WIDGET(item->image)); 00294 }
GtkWidget* gtk_content_list_item_new | ( | int | index | ) |
creates a new GtkListItem widget
index | - the widget location on the lister page |
void gtk_content_list_item_set_description | ( | GtkContentListItem * | item, | |
const gchar * | text | |||
) |
Set description text of GtkListItem widget
item | the GtkListItem widget | |
text |
Definition at line 213 of file gtkContentListItem.c.
00214 { 00215 g_return_if_fail(IS_GTK_CONTENT_LIST_ITEM(item)); 00216 g_return_if_fail(text != NULL); 00217 CL_LOGPRINTF("text %s", text); 00218 00219 // check length 00220 if (strlen(text) >= 2 * MAX_CHARACTERS || get_string_lines(text) >= 2) 00221 { 00222 // can not handle multi lines, TODO 00223 gtk_label_set_ellipsize(GTK_LABEL(item->description), PANGO_ELLIPSIZE_END); 00224 } 00225 else 00226 { 00227 gtk_label_set_ellipsize(GTK_LABEL(item->description), PANGO_ELLIPSIZE_NONE); 00228 } 00229 gtk_label_set_text(GTK_LABEL(item->description), text); 00230 }
void gtk_content_list_item_set_icon_thumb | ( | GtkContentListItem * | item, | |
unsigned int | iconID | |||
) |
Set thumb of GtkListItem widget
item | the GtkListItem widget | |
iconID | icon identification |
Definition at line 270 of file gtkContentListItem.c.
00271 { 00272 GdkPixbuf *pixbuf; 00273 00274 g_return_if_fail(IS_GTK_CONTENT_LIST_ITEM(item)); 00275 00276 pixbuf = icons_get(iconID); 00277 00278 if (pixbuf) 00279 { 00280 gtk_image_set_from_pixbuf(GTK_IMAGE(item->image), pixbuf); 00281 gtk_widget_show(GTK_WIDGET(item->image)); 00282 } 00283 else 00284 { 00285 gtk_widget_hide(GTK_WIDGET(item->image)); 00286 } 00287 return; 00288 }
void gtk_content_list_item_set_information | ( | GtkContentListItem * | item, | |
const gchar * | text | |||
) |
Set information text of GtkListItem widget
item | the GtkListItem widget | |
text |
Definition at line 232 of file gtkContentListItem.c.
00233 { 00234 g_return_if_fail(IS_GTK_CONTENT_LIST_ITEM(item)); 00235 g_return_if_fail(text != NULL); 00236 CL_LOGPRINTF("text %s", text); 00237 gtk_label_set_text(GTK_LABEL(item->information), text); 00238 }
void gtk_content_list_item_set_subtitle | ( | GtkContentListItem * | item, | |
const gchar * | text | |||
) |
Set subtitle text of GtkListItem widget
item | the GtkListItem widget | |
text |
Definition at line 203 of file gtkContentListItem.c.
00204 { 00205 g_return_if_fail(IS_GTK_CONTENT_LIST_ITEM(item)); 00206 g_return_if_fail(text != NULL); 00207 00208 CL_LOGPRINTF("text %s", text); 00209 00210 gtk_label_set_text(GTK_LABEL(item->subtitle), text); 00211 }
void gtk_content_list_item_set_thumb | ( | GtkContentListItem * | item, | |
const char * | iconURL | |||
) |
Set thumb of GtkListItem widget
item | the GtkListItem widget | |
iconURL | icon path |
Definition at line 240 of file gtkContentListItem.c.
00241 { 00242 GdkPixbuf *pixbuf = NULL; 00243 00244 g_return_if_fail(IS_GTK_CONTENT_LIST_ITEM(item)); 00245 g_return_if_fail(NULL != iconURL); 00246 00247 pixbuf = icons_load(iconURL); 00248 if (pixbuf) 00249 { 00250 // free the old one 00251 if (item->pixmap) 00252 { 00253 icons_unload(item->pixmap); 00254 item->pixmap = NULL; 00255 } 00256 // set the new one 00257 item->pixmap = pixbuf; 00258 00259 gtk_image_set_from_pixbuf(GTK_IMAGE(item->image), pixbuf); 00260 00261 gtk_widget_show(GTK_WIDGET(item->image)); 00262 } 00263 else 00264 { 00265 gtk_widget_hide(GTK_WIDGET(item->image)); 00266 } 00267 return; 00268 }
void gtk_content_list_item_set_title | ( | GtkContentListItem * | item, | |
const gchar * | text | |||
) |
Set title text of GtkListItem widget
text |
Definition at line 193 of file gtkContentListItem.c.
00194 { 00195 g_return_if_fail(IS_GTK_CONTENT_LIST_ITEM(item)); 00196 g_return_if_fail(text != NULL); 00197 00198 CL_LOGPRINTF("text %s", text); 00199 00200 gtk_label_set_text(GTK_LABEL(item->title), text); 00201 }
void gtk_content_list_item_show_cursor | ( | GtkContentListItem * | item, | |
gboolean | show | |||
) |
Clear thumb and free allocated resources of the GtkListItem widget
item | the GtkListItem widget | |
show |
Definition at line 296 of file gtkContentListItem.c.
00297 { 00298 g_return_if_fail(IS_GTK_CONTENT_LIST_ITEM(item)); 00299 00300 CL_CURSORPRINTF("entry %s", (show == TRUE) ? "TRUE" : "FALSE"); 00301 00302 if (show) 00303 { 00304 gtk_widget_show(item->cursorbox); 00305 } 00306 else 00307 { 00308 gtk_widget_hide(item->cursorbox); 00309 } 00310 }