Changeset 61
- Timestamp:
- 06/05/07 16:10:16 (2 years ago)
- Files:
-
- osso-statusbar-cpu/trunk/configure.ac (modified) (4 diffs)
- osso-statusbar-cpu/trunk/debian/changelog (modified) (1 diff)
- osso-statusbar-cpu/trunk/debian/control (modified) (1 diff)
- osso-statusbar-cpu/trunk/debian/osso-statusbar-cpu.files (modified) (1 diff)
- osso-statusbar-cpu/trunk/debian/osso-statusbar-cpu.init (deleted)
- osso-statusbar-cpu/trunk/debian/osso-statusbar-cpu.postinst (modified) (1 diff)
- osso-statusbar-cpu/trunk/debian/rules (modified) (1 diff)
- osso-statusbar-cpu/trunk/osso-statusbar-cpu.desktop.in (moved) (moved from osso-statusbar-cpu/trunk/osso-statusbar-cpu.desktop) (1 diff)
- osso-statusbar-cpu/trunk/osso-statusbar-cpu.schemas (modified) (1 diff)
- osso-statusbar-cpu/trunk/src/Makefile.am (modified) (2 diffs)
- osso-statusbar-cpu/trunk/src/common.c (modified) (2 diffs)
- osso-statusbar-cpu/trunk/src/common.h (modified) (1 diff)
- osso-statusbar-cpu/trunk/src/dialog.c (modified) (1 diff)
- osso-statusbar-cpu/trunk/src/osso-applet-graph.c (modified) (4 diffs)
- osso-statusbar-cpu/trunk/src/osso-statusbar-combo.c (modified) (18 diffs)
- osso-statusbar-cpu/trunk/src/osso-statusbar-combo.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
osso-statusbar-cpu/trunk/configure.ac
r51 r61 2 2 3 3 # Mandatory, inits autoconf 4 AC_INIT(osso-statusbar-cpu, 0.6. 0)4 AC_INIT(osso-statusbar-cpu, 0.6.1) 5 5 6 6 # Tests that source dir exists … … 32 32 AC_HEADER_STDBOOL 33 33 34 CFLAGS="$CFLAGS -O2 -s"34 #CFLAGS="$CFLAGS -O2 -s" 35 35 #CFLAGS="$CFLAGS -ggdb -O0 -DDEBUG" 36 36 … … 43 43 AC_SUBST(CFLAGS) 44 44 45 OSSI_TARGET_BOARD=`echo $OSSI_TARGET_BOARD` 46 AC_SUBST(OSSI_TARGET_BOARD) 45 PKG_CHECK_MODULES(BASE, gtk+-2.0 >= 2.4.0 glib-2.0 >= 2.2.0 gconf-2.0 >= 2.6.4) 46 AC_SUBST(BASE_LIBS) 47 AC_SUBST(BASE_CFLAGS) 48 PKG_CHECK_MODULES(OSSO, libosso >= 2.3, [ossodisplay=yes], [ossodisplay=no]) 49 if test "$ossodisplay" == "yes"; then 50 AC_DEFINE(OSSODISPLAY, 1, [Osso display notifications]) 51 else 52 PKG_CHECK_MODULES(OSSO, libosso >= 0.0.3) 53 fi 54 AC_SUBST(OSSO_LIBS) 55 AC_SUBST(OSSO_CFLAGS) 56 PKG_CHECK_MODULES(HILDONDESKTOP, libhildondesktop, [hildondesktop=yes], [hildondesktop=no]) 57 if test "$hildondesktop" == "yes"; then 58 AC_DEFINE(HILDONDESKTOP, 1, [Hildon desktop used]) 59 else 60 AC_DEFINE(HILDONDESKTOP, 0, [Hildon desktop used]) 61 PKG_CHECK_MODULES(DESK, hildon-status-bar-lib >= 0.7.1) 62 fi 63 AC_SUBST(HILDONDESKTOP_LIBS) 64 AC_SUBST(HILDONDESKTOP_CFLAGS) 47 65 48 PKG_CHECK_MODULES(DEPS,gtk+-2.0 >= 2.4.0 glib-2.0 >= 2.2.0 dbus-glib-1 >= 0.20 libosso >= 0.0.3 dbus-1 >= 0.22 hildon-status-bar-lib >= 0.7.1 hildon-libs >= 0.7.1 gconf-2.0 >= 2.6.4) 49 AC_SUBST(DEPS_LIBS) 50 AC_SUBST(DEPS_CFLAGS) 66 PKG_CHECK_MODULES(HILDON, hildon-1 >= 0.9.9, hildon1=yes, hildon1=no) 67 if test "$hildon1" == "yes"; then 68 AC_DEFINE(HILDON, 1, [Version of hildon libraries]) 69 else 70 PKG_CHECK_MODULES(HILDON, hildon-libs >= 0.12.0) 71 AC_DEFINE(HILDON, 0, [Version of hildon libraries]) 72 fi 73 AC_SUBST(HILDON_LIBS) 74 AC_SUBST(HILDON_CFLAGS) 51 75 52 76 # Localisation-related … … 63 87 src/Makefile 64 88 Doxyfile 89 osso-statusbar-cpu.desktop 65 90 ]) 66 91 92 if test "$hildondesktop" == "yes"; then 93 hildonstatusbarplugindir=`pkg-config osso-af-settings --variable=hildondesktoplibdir` 94 hildonstatusbardesktopdir=`pkg-config osso-af-settings --variable=statusbardesktopentrydir` 95 PTYPE="Type=default" 96 XPATH="X-Path" 97 else 67 98 hildonstatusbarplugindir=`pkg-config hildon-status-bar-lib --variable=pluginlibdir` 99 hildonstatusbardesktopdir=/usr/share/applications/hildon-status-bar 100 XPATH="X-status-bar-plugin" 101 fi 102 AC_SUBST(XPATH) 103 AC_SUBST(PTYPE) 68 104 AC_SUBST(hildonstatusbarplugindir) 69 105 70 hildonstatusbardesktopdir=/usr/share/applications/hildon-status-bar71 106 AC_SUBST(hildonstatusbardesktopdir) 72 107 osso-statusbar-cpu/trunk/debian/changelog
r51 r61 1 osso-statusbar-cpu (0.6.1) mistral; urgency=low 2 3 * Add hildon-1 and hildon-desktop support. 4 5 -- Santtu Lakkala <ext-santtu.1.lakkala@nokia.com> Tue, 5 Jun 2007 16:07:25 +0300 6 1 7 osso-statusbar-cpu (0.6.0) mistral; urgency=low 2 8 osso-statusbar-cpu/trunk/debian/control
r3 r61 3 3 Priority: optional 4 4 Maintainer: Santtu Lakkala <inz@inz.fi> 5 Build-Depends: debhelper (>= 4.1.0), hildon-base-lib-dev (>= 0.8.0),hildon-status-bar-lib-dev (>= 0.8.0), libgconf2-dev (>= 2.6.4), hildon-control-panel-dev5 Build-Depends: debhelper (>= 4.1.0), libhildon1-dev | hildon-libs-dev, libhildondesktop-dev | hildon-status-bar-lib-dev (>= 0.8.0), libgconf2-dev (>= 2.6.4), hildon-control-panel-dev 6 6 Standards-Version: 3.6.1 7 7 osso-statusbar-cpu/trunk/debian/osso-statusbar-cpu.files
r3 r61 1 1 usr/lib/hildon-status-bar/*.so 2 2 usr/lib/hildon-control-panel/*.so 3 usr/lib/hildon-desktop/*.so 3 4 usr/share 4 5 etc/gconf osso-statusbar-cpu/trunk/debian/osso-statusbar-cpu.postinst
r3 r61 7 7 8 8 #DEBHELPER# 9 10 if [ -f /home/user/.osso/hildon-desktop/statusbar.conf ]; then 11 if ! grep -q osso-statusbar-cpu /home/user/.osso/hildon-desktop/statusbar.conf; then 12 echo "[/usr/share/applications/hildon-status-bar/osso-statusbar-cpu.desktop]" >> /home/user/.osso/hildon-desktop/statusbar.conf 13 fi 14 else 15 cat /etc/hildon-desktop/statusbar.conf - <<FOO 2>/dev/null > /home/user/.osso/hildon-desktop/statusbar.conf 16 [/usr/share/applications/hildon-status-bar/osso-statusbar-cpu.desktop] 17 FOO 18 chown user:users /home/user/.osso/hildon-desktop/statusbar.conf 19 fi osso-statusbar-cpu/trunk/debian/rules
r51 r61 88 88 # dh_installpam 89 89 # dh_installmime 90 #dh_gconf91 dh_installinit -- defaults 60 40 90 dh_gconf 91 # dh_installinit 92 92 # dh_installcron 93 93 # dh_installinfo osso-statusbar-cpu/trunk/osso-statusbar-cpu.desktop.in
r51 r61 4 4 Category=permanent 5 5 Mandatory=false 6 X-status-bar-plugin=libcombo.so 6 @PTYPE@ 7 @XPATH@=libcombo.so osso-statusbar-cpu/trunk/osso-statusbar-cpu.schemas
r51 r61 47 47 <owner>osso-statusbar-cpu</owner> 48 48 <type>bool</type> 49 <default> true</default>49 <default>false</default> 50 50 <locale name="C"> 51 51 <short>Show clock</short> osso-statusbar-cpu/trunk/src/Makefile.am
r51 r61 1 1 # These come from configure-script's module dependency checks 2 INCLUDES = $(DEPS_CFLAGS) -DPREFIX=\"$(prefix)\" -DLOCALEDIR=\"$(localedir)\" \ 3 -DVERSION=\"$(VERSION)\" 2 INCLUDES = $(BASE_CFLAGS) 3 CFLAGS += -DPREFIX=\"$(prefix)\" -DLOCALEDIR=\"$(localedir)\" \ 4 -DVERSION=\"$(VERSION)\" -Wno-unused-parameter 4 5 AM_LDFLAGS = -module -avoid-version 5 6 … … 8 9 hildoncontrolpaneldesktop_DATA = cpgraph.desktop 9 10 10 libcombo_la_LIBADD = $(DEPS_LIBS) 11 libgraph_la_LIBADD = $(DEPS_LIBS) 11 libcombo_la_CFLAGS = $(HILDONDESKTOP_CFLAGS) $(HILDON_CFLAGS) $(OSSO_CFLAGS) 12 libcombo_la_LIBADD = $(BASE_LIBS) $(HILDONDESKTOP_LIBS) $(OSSO_LIBS) 13 libgraph_la_CFLAGS = $(HILDON_CFLAGS) 14 libgraph_la_LIBADD = $(BASE_LIBS) $(HILDON_LIBS) $(HILDONCP_LIBS) 12 15 13 16 libcombo_la_SOURCES = osso-statusbar-combo.c osso-statusbar-combo.h \ osso-statusbar-cpu/trunk/src/common.c
r51 r61 34 34 for (y = AREA_Y; y < AREA_Y + AREA_H; y++) { 35 35 for (x = xx; x < xx + w - 1; x++) { 36 guchar temp; 36 37 p = pixels + y * rowstride + x * n_channels; 37 38 p0 = pixels + y * rowstride + (x + 1) * n_channels; 38 39 39 p[0] = p0[0]; 40 temp = p0[0]; 41 p[0] = temp; 42 temp = p0[1]; 43 p[1] = temp; 44 temp = p0[2]; 45 p[2] = temp; 46 /* p[0] = p0[0]; 40 47 p[1] = p0[1]; 41 p[2] = p0[2]; 48 p[2] = p0[2]; */ 42 49 } 43 50 } … … 219 226 } 220 227 221 void clock_overlay(GtkWidget *image) { 228 void clock_overlay(GtkWidget *image) 229 { 230 gchar buffer[128]; 231 time_t curtime = time(NULL); 232 struct tm mytime; 233 g_unsetenv("TZ"); 234 tzset(); 235 localtime_r(&curtime, &mytime); 236 237 buffer[127] = 0; 238 strftime(buffer, 127, "%H:%M", &mytime); 239 240 text_overlay(image, buffer); 241 } 242 243 void text_overlay(GtkWidget *image, const gchar *text) 244 { 222 245 PangoLayout *layout; 223 246 PangoFontDescription *fd; 224 247 const PangoFontDescription *old_fd; 225 gchar buffer[128]; 226 time_t curtime = time(NULL); 227 struct tm mytime; 228 229 g_unsetenv("TZ"); 230 tzset(); 231 localtime_r(&curtime, &mytime); 232 233 buffer[127] = 0; 234 strftime(buffer, 127, "%H:%M", &mytime); 235 236 layout = gtk_widget_create_pango_layout(image, buffer); 248 249 layout = gtk_widget_create_pango_layout(image, text); 237 250 238 251 old_fd = pango_layout_get_font_description(layout); osso-statusbar-cpu/trunk/src/common.h
r3 r61 39 39 void append_items(GtkMenuShell *shell, GConfClient *client, osso_context_t *osso); 40 40 void clock_overlay(GtkWidget *image); 41 void text_overlay(GtkWidget *image, const gchar *text); 41 42 42 43 #endif osso-statusbar-cpu/trunk/src/dialog.c
r3 r61 9 9 #include <string.h> 10 10 #include <signal.h> 11 #ifdef HAVE_CONFIG_H 12 #include <config.h> 13 #endif 14 #if HILDON == 1 15 #include <hildon/hildon-note.h> 16 #else 11 17 #include <hildon-widgets/hildon-note.h> 18 #endif 12 19 #include "dialog.h" 13 20 osso-statusbar-cpu/trunk/src/osso-applet-graph.c
r51 r61 1 1 #include <glib.h> 2 2 #include <gtk/gtk.h> 3 #include <hildon-widgets/hildon-color-button.h> 4 #include <hildon-widgets/hildon-caption.h> 3 4 #ifdef HAVE_CONFIG_H 5 #include <config.h> 6 #endif 7 #if HILDON == 1 8 # include <hildon/hildon-color-button.h> 9 # include <hildon/hildon-caption.h> 10 #else 11 # include <hildon-widgets/hildon-color-button.h> 12 # include <hildon-widgets/hildon-caption.h> 13 #endif 5 14 6 15 #include <libosso.h> … … 284 293 ); 285 294 gtk_container_add(GTK_CONTAINER(dialog_vbox), 295 GTK_WIDGET(gtk_hseparator_new())); 296 gtk_container_add(GTK_CONTAINER(dialog_vbox), 286 297 GTK_WIDGET(applet->clock_caption) 287 298 ); … … 396 407 static void cpu_color_clicked(GtkWidget *widget, GraphApplet *applet) 397 408 { 409 #if HILDON == 1 410 GdkColor rcolor; 411 GdkColor *color = &rcolor; 412 hildon_color_button_get_color(HILDON_COLOR_BUTTON(widget), color); 413 #else 398 414 GdkColor *color = 399 415 hildon_color_button_get_color(HILDON_COLOR_BUTTON(widget) 400 416 ); 417 #endif 401 418 402 419 applet->cpu_color = (color->red & 0xff00) << 8 | … … 407 424 static void mem_color_clicked(GtkWidget *widget, GraphApplet *applet) 408 425 { 426 #if HILDON == 1 427 GdkColor rcolor; 428 GdkColor *color = &rcolor; 429 hildon_color_button_get_color(HILDON_COLOR_BUTTON(widget), color); 430 #else 409 431 GdkColor *color = 410 432 hildon_color_button_get_color(HILDON_COLOR_BUTTON(widget) 411 433 ); 434 #endif 412 435 413 436 applet->mem_color = (color->red & 0xff00) << 8 | osso-statusbar-cpu/trunk/src/osso-statusbar-combo.c
r51 r61 1 #include <hildon-status-bar-lib/hildon-status-bar-item.h>2 1 #include <stdlib.h> 3 2 #include <signal.h> … … 12 11 #include <gtk/gtkentry.h> 13 12 #include <gtk/gtkdialog.h> 14 #include <hildon-widgets/hildon-note.h>15 13 16 14 #include <glib.h> … … 18 16 #ifdef HAVE_CONFIG_H 19 17 #include <config.h> 18 #endif 19 20 #if HILDONDESKTOP == 1 21 # include <libhildondesktop/libhildondesktop.h> 22 #else 23 # include <hildon-status-bar-lib/hildon-status-bar-item.h> 20 24 #endif 21 25 … … 25 29 #include "common.h" 26 30 #include "dialog.h" 31 32 #if HILDONDESKTOP == 1 33 HD_DEFINE_PLUGIN(OssoStatusbarCpu, 34 osso_statusbar_cpu, 35 STATUSBAR_TYPE_ITEM); 36 #define OSSO_STATUSBAR_CPU_GET_PRIVATE(x) \ 37 (G_TYPE_INSTANCE_GET_PRIVATE((x), \ 38 OSSO_TYPE_STATUSBAR_CPU, \ 39 OssoStatusbarCpuPrivate)) 40 #endif 27 41 28 42 struct ShowRequest { … … 47 61 guint conn, 48 62 GConfEntry * entry, gpointer user_data); 63 #ifdef OSSODISPLAY 64 static void osso_statusbar_cpu_inact(osso_display_state_t state, 65 gpointer user_data) 66 #else 49 67 static void combo_inact(osso_hw_state_t * state, gpointer user_data); 68 #endif 50 69 static void combo_popup(GtkToggleButton *button, gpointer user_data); 51 70 static void my_notify(gpointer data, GObject *has_been); 52 71 72 #if HILDONDESKTOP == 1 73 void osso_statusbar_cpu_finalize(GObject *object); 74 static void osso_statusbar_cpu_class_init(OssoStatusbarCpuClass *klass) 75 { 76 GObjectClass *object_class = G_OBJECT_CLASS(klass); 77 object_class->finalize = osso_statusbar_cpu_finalize; 78 g_type_class_add_private(klass, sizeof(OssoStatusbarCpuPrivate)); 79 } 80 #else 53 81 void combo_entry(HildonStatusBarPluginFn_st *fn) 54 82 { … … 59 87 fn->get_priority = combo_get_priority; 60 88 } 61 89 #endif 90 91 #if HILDONDESKTOP == 1 92 static void osso_statusbar_cpu_init(OssoStatusbarCpu *cpu) 93 #else 62 94 void *combo_initialize(HildonStatusBarItem *item, GtkWidget **button) 95 #endif 63 96 { 64 97 osso_hw_state_t osso_states = { … … 71 104 GdkPixbuf *icon_pixbuf = NULL; 72 105 GError *error = NULL; 73 PluginInfo*info = NULL;106 OssoStatusbarCpuPrivate *info = NULL; 74 107 GtkIconTheme *theme = NULL; 108 109 #if HILDONDESKTOP != 1 75 110 g_return_val_if_fail(item, NULL); 111 #endif 76 112 77 113 theme = gtk_icon_theme_get_default(); 78 114 icon_pixbuf = gtk_icon_theme_load_icon(theme, HILDON_STATUS_BAR_COMBO_ICON_NAME, 79 115 40, GTK_ICON_LOOKUP_NO_SVG, NULL); 116 #if HILDONDESKTOP != 1 80 117 if (icon_pixbuf == NULL) { 81 118 gtk_widget_destroy(GTK_WIDGET(item)); 82 119 return NULL; 83 120 } 84 85 info = g_new0(PluginInfo, 1); 121 #endif 122 123 /* Take a modifyable copy. */ 124 if (icon_pixbuf) { 125 GdkPixbuf *temp = gdk_pixbuf_copy(icon_pixbuf); 126 g_object_unref(icon_pixbuf); 127 icon_pixbuf = temp; 128 } 129 130 #if HILDONDESKTOP == 1 131 info = OSSO_STATUSBAR_CPU_GET_PRIVATE(cpu); 132 #else 133 info = g_new0(OssoStatusbarCpuPrivate, 1); 86 134 g_return_val_if_fail(info, NULL); 87 88 info->item = item; 135 #endif 89 136 90 137 info->osso = 91 osso_initialize("osso_statusbar_c ombo", VERSION, FALSE,138 osso_initialize("osso_statusbar_cpu", VERSION, FALSE, 92 139 NULL); 140 #if OSSODISPLAY 141 osso_hw_set_display_event_cb(info->osso, 142 osso_statusbar_cpu_inact, 143 (gpointer)info); 144 #else 93 145 osso_hw_set_event_cb(info->osso, &osso_states, combo_inact, 94 146 (gpointer)info); 147 #endif 95 148 96 149 info->gcc = gconf_client_get_default(); … … 123 176 GTK_WIDGET(info->icon)); 124 177 178 #if HILDONDESKTOP == 1 179 gtk_container_add(GTK_CONTAINER(cpu), 180 GTK_WIDGET(info->button)); 181 #else 125 182 *button = info->button; 183 #endif 126 184 127 185 info->notify_id = 0; … … 169 227 gtk_widget_show_all(info->button); 170 228 229 #if HILDONDESKTOP == 0 171 230 return info; 172 } 173 231 #endif 232 } 233 234 #if HILDONDESKTOP == 1 235 void osso_statusbar_cpu_finalize(GObject *object) 236 #else 174 237 void combo_destroy(void *data) 238 #endif 175 239 { 176 240 osso_hw_state_t osso_states = { FALSE, FALSE, FALSE, FALSE, 0 }; 177 PluginInfo *info; 241 OssoStatusbarCpuPrivate *info; 242 243 #if HILDONDESKTOP == 1 244 info = OSSO_STATUSBAR_CPU_GET_PRIVATE(object); 245 #else 246 info = (OssoStatusbarCpuPrivate *)data; 178 247 g_return_if_fail(data); 179 180 info = (PluginInfo *)data; 248 #endif 181 249 182 250 g_source_remove(info->notify_id); … … 195 263 osso_deinitialize(info->osso); 196 264 265 #if HILDONDESKTOP == 0 197 266 g_free(data); 198 } 199 267 #endif 268 } 269 270 #if HILDONDESKTOP == 0 200 271 gint combo_get_priority(void *data) 201 272 { … … 206 277 void combo_update(void *data, gint value1, gint value2, const gchar *str) 207 278 { 208 PluginInfo *info = (PluginInfo *)data;209 g_return_if_fail(info);210 211 279 (void)value1; 280 (void)value2; 212 281 (void)str; 213 214 if (value2 == 0) 215 gtk_widget_destroy(GTK_WIDGET(info->item)); 216 return; 217 } 282 (void)data; 283 } 284 #endif 218 285 219 286 static gboolean my_timeout(gpointer data) 220 287 { 221 PluginInfo *info = (PluginInfo*)data;288 OssoStatusbarCpuPrivate *info = (OssoStatusbarCpuPrivate *)data; 222 289 GtkImage *image = GTK_IMAGE(info->icon); 223 290 GdkPixbuf *buf = gtk_image_get_pixbuf(image); … … 281 348 GConfEntry *entry, gpointer user_data) 282 349 { 283 PluginInfo*info = user_data;350 OssoStatusbarCpuPrivate *info = user_data; 284 351 285 352 (void)gcc; … … 303 370 GConfEntry *entry, gpointer user_data) 304 371 { 305 PluginInfo*info = user_data;372 OssoStatusbarCpuPrivate *info = user_data; 306 373 307 374 (void)gcc; … … 325 392 guint conn, GConfEntry * entry, gpointer data) 326 393 { 327 PluginInfo *info = (PluginInfo*)data;394 OssoStatusbarCpuPrivate *info = (OssoStatusbarCpuPrivate *)data; 328 395 329 396 (void)gcc; … … 342 409 guint conn, GConfEntry * entry, gpointer data) 343 410 { 344 PluginInfo *info = (PluginInfo*)data;411 OssoStatusbarCpuPrivate *info = (OssoStatusbarCpuPrivate *)data; 345 412 346 413 (void)gcc; … … 352 419 g_signal_handler_disconnect(info->icon, info->clock_id); 353 420 info->clock_id = 0; 354 } else {421 } else if (info->clock && !info->clock_id) { 355 422 info->clock_id = 356 423 g_signal_connect_after(info->icon, "expose-event", … … 360 427 } 361 428 429 #ifdef OSSODISPLAY 430 static void osso_statusbar_cpu_inact(osso_display_state_t state, 431 gpointer user_data) 432 #else 362 433 static void combo_inact(osso_hw_state_t * state, gpointer user_data) 363 { 364 PluginInfo *info = (PluginInfo *)user_data; 365 434 #endif 435 { 436 OssoStatusbarCpuPrivate *info = (OssoStatusbarCpuPrivate *)user_data; 437 438 #ifdef OSSODISPLAY 439 if (state == OSSO_DISPLAY_OFF) { 440 #else 366 441 if (state->system_inactivity_ind) { 442 #endif 367 443 if (info->notify_id) { 368 444 g_source_remove(info->notify_id); … … 380 456 { 381 457 GtkWidget *menu_item; 382 PluginInfo *info = (PluginInfo*)user_data;458 OssoStatusbarCpuPrivate *info = (OssoStatusbarCpuPrivate *)user_data; 383 459 GtkWidget *menu; 384 460 osso-statusbar-cpu/trunk/src/osso-statusbar-combo.h
r51 r61 6 6 #include <gconf/gconf-client.h> 7 7 8 #ifdef HAVE_CONFIG_H 9 #include <config.h> 10 #endif 11 12 8 13 G_BEGIN_DECLS 9 14 #define HILDON_STATUS_BAR_COMBO_ICON_NAME "qgn_statusbar_graph_base" … … 11 16 #define HILDON_STATUS_BAR_CPU_PRIORITY 1 12 17 13 typedef struct { 14 HildonStatusBarItem *item; 18 #if HILDONDESKTOP == 1 19 #define OSSO_TYPE_STATUSBAR_CPU (osso_statusbar_cpu_get_type()) 20 #define OSSO_STATUSBAR_CPU(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), OSSO_TYPE_STATUSBAR_CPU, OssoStatusbarCpu)) 21 #define OSSO_STATUSBAR_CPU_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), OSSO_TYPE_STATUS_BAR_DISPLAY, OssoStatusbarCpuClass)) 22 #define OSSO_IS_STATUSBAR_CPU(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), OSSO_TYPE_STATUSBAR_CPU)) 23 #define OSSO_IS_STATUSBAR_CPU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), OSSO_TYPE_STATUSBAR_CPU)) 24 #define OSSO_STATUSBAR_CPU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), OSSO_TYPE_STATUSBAR_CPU, OssoStatusbarCpuClass)) 25 26 typedef struct _OssoStatusbarCpu OssoStatusbarCpu; 27 typedef struct _OssoStatusbarCpuClass OssoStatusbarCpuClass; 28 29 struct _OssoStatusbarCpu { 30 StatusbarItem parent; 31 }; 32 33 struct _OssoStatusbarCpuClass { 34 StatusbarItemClass parent_class; 35 }; 36 37 GType osso_statusbar_cpu_get_type(void); 38 #else 39 void combo_entry(HildonStatusBarPluginFn_st *fn); 40 void *combo_initialize(HildonStatusBarItem *item, GtkWidget **button); 41 void combo_destroy(void *data); 42 void combo_update(void *data, gint value1, gint value2, const gchar *str); 43 int combo_get_priority(void *data); 44 #endif 45 46 typedef struct _OssoStatusbarCpuPrivate OssoStatusbarCpuPrivate; 47 48 struct _OssoStatusbarCpuPrivate { 15 49 GtkWidget *icon; /* Icon in StatusBar */ 16 50 GtkWidget *button; … … 29 63 gboolean show_cpu; 30 64 gboolean show_mem; 31 } PluginInfo; 32 33 void combo_entry(HildonStatusBarPluginFn_st *fn); 34 void *combo_initialize(HildonStatusBarItem *item, GtkWidget **button); 35 void combo_destroy(void *data); 36 void combo_update(void *data, gint value1, gint value2, const gchar *str); 37 int combo_get_priority(void *data); 65 }; 38 66 39 67 G_END_DECLS
