Main Page | Directories | File List | File Members

hildon-status-bar-main.h

Go to the documentation of this file.
00001 /*
00002  * This file is part of maemo-af-desktop
00003  *
00004  * Copyright (C) 2005 Nokia Corporation.
00005  *
00006  * Contact: Karoliina Salminen <karoliina.t.salminen@nokia.com>
00007  *
00008  * This library is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU Lesser General Public License
00010  * version 2.1 as published by the Free Software Foundation.
00011  *
00012  * This library is distributed in the hope that it will be useful, but
00013  * WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with this library; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
00020  * 02110-1301 USA
00021  *
00022  */
00023 
00028 #ifndef __HILDON_STATUS_BAR_MAIN__H__
00029 #define __HILDON_STATUS_BAR_MAIN__H__
00030 
00031 #include <libosso.h>
00032 
00033 #include "libdesktop/hildon-log.h"
00034 
00035 G_BEGIN_DECLS
00036 
00037 #define HILDON_STATUS_BAR_NAME     "statusbar"
00038 #define HILDON_STATUS_BAR_VERSION  "2.0"
00039 
00040 #define HSB_MAX_NO_OF_ITEMS       30 /* maximum number of items */
00041 #define HSB_VISIBLE_ITEMS_IN_ROW  7  /* max num of visible items in one row */
00042 #define HSB_VISIBLE_ITEMS_IN_1ROW_EXTENSION  12 /* max num of visible items in */
00043 #define HSB_VISIBLE_ITEMS_IN_2ROW_EXTENSION  18 /* window panel extension */
00044 
00045 /* FIXME: check the true marging */
00046 #define HSB_MARGIN_DEFAULT       6
00047 /* FIXME: Fetched from matchbox theme, should be asked from the panel */
00048 #define HSB_PANEL_DEFAULT_WIDTH  280
00049 #define HSB_ITEM_HEIGHT          50
00050 #define HSB_ITEM_WIDTH           40
00051 
00052 #define HSB_ARROW_ICON_NAME "qgn_stat_more"
00053 #define HSB_ARROW_ICON_SIZE HSB_ITEM_WIDTH
00054 
00055 /* hardcoded pixel positions for the icons */
00056 /* CHECKME: Why isn't y=0 at top? -2 seems to be much better.. */  
00057 #define HSB_ITEM_Y         0
00058 #define HSB_ITEM_X_OFFSET  40
00059 #define HSB_ITEM_Y_OFFSET  40
00060 
00061 /* hardcoded slot position for the five prespecified items, 0,1,2.. */
00062 #define HSB_PRESENCE_SLOT   4
00063 #define HSB_DISPLAY_SLOT    3
00064 #define HSB_SOUND_SLOT      2
00065 #define HSB_INTERNET_SLOT   1
00066 #define HSB_BATTERY_SLOT    0
00067 
00068 #define XLIB_FORMAT_32_BIT 32
00069 
00070 #define HSB_PLUGIN_USER_CONFIG_DIR      "/.osso/hildon-status-bar/"
00071 #define HSB_PLUGIN_USER_CONFIG_FILE     "/.osso/hildon-status-bar/plugins.conf"
00072 #define HSB_PLUGIN_FACTORY_CONFIG_FILE  "/etc/hildon-status-bar/plugins.conf"
00073 
00074 /* Plugins.conf file key fields */
00075 #define HSB_PLUGIN_CONFIG_LIBRARY_KEY   "Library"
00076 #define HSB_PLUGIN_CONFIG_CATEGORY_KEY  "Category"
00077 #define HSB_PLUGIN_CONFIG_POSITION_KEY  "Position"
00078 #define HSB_PLUGIN_CONFIG_MANDATORY_KEY "Mandatory"
00079 
00080 /* library key value for not loaading plugin */
00081 
00082 #define HSB_PLUGIN_CONFIG_LIBRARY_VALUE "None"
00083 
00084 /* Plugin categories */
00085 #define HSB_PLUGIN_CATEGORY_PERMANENT   "permanent"
00086 #define HSB_PLUGIN_CATEGORY_CONDITIONAL "conditional"
00087 #define HSB_PLUGIN_CATEGORY_TEMPORAL    "temporal"
00088 
00089 #define HSB_PLUGIN_LOG_FILE             "/.osso/statusbar.log"
00090 #define HSB_PLUGIN_LOG_KEY_START    "Init"
00091 #define HSB_PLUGIN_LOG_KEY_END      "End"
00092 
00093 
00094 /* Status Bar panel */
00095 typedef struct status_bar_st StatusBar;
00096 
00097 struct status_bar_st
00098 {
00099     GtkWidget *window;                      /* GTK Window */
00100     GtkWidget *popup;                       /* GTK Window */
00101     GtkWidget *fixed;                       /* GTK Fixed item container */ 
00102     GtkWidget *popup_fixed;                 /* GTK Fixed item container */ 
00103 
00104     GtkWidget *items[HSB_MAX_NO_OF_ITEMS];  /* Shown plugin items */ 
00105     GtkWidget *buffer_items[HSB_MAX_NO_OF_ITEMS];
00106     
00107     GtkWidget *arrow_button;
00108     gboolean   arrow_button_toggled;
00109 
00110     HildonLog *log;
00111 
00112     guint item_num;
00113     
00114     /* fixed X pixel coordinates for the plugins */
00115     gint plugin_pos_x[HSB_MAX_NO_OF_ITEMS];
00116     /* fixed Y pixel coordinates for the plugins */
00117     gint plugin_pos_y[HSB_MAX_NO_OF_ITEMS];
00118 
00119     osso_context_t *osso;
00120 };
00121 
00122 
00123 /* Task delayed info banner 27092005 */
00124 typedef struct status_bar_del_ib_st SBDelayedInfobanner;
00125 
00126 struct status_bar_del_ib_st
00127 {
00128   gint32 displaytime;
00129   gchar *text;
00130   guint timeout_to_show_id;
00131   guint timeout_onscreen_id;
00132   GtkWidget *banner;
00133 };
00134 
00135 
00136 /* Status Bar plugin structure */
00137 typedef struct _statusbarplugin StatusBarPlugin;
00138 
00139 struct _statusbarplugin
00140 {
00141   gchar *library;
00142   gint position;
00143   gboolean conditional;
00144   gboolean mandatory;  
00145 };
00146 
00147 
00148 /* Public function declarations */
00149 int status_bar_main(osso_context_t *osso, StatusBar **panel);
00150 void status_bar_deinitialize(osso_context_t *osso, StatusBar **panel);
00151 
00152 
00153 G_END_DECLS
00154 
00155 #endif

Generated on Thu Dec 21 11:26:52 2006 for maemo-af-desktop-documentation by  doxygen 1.4.2