Yattm - unified GTK instant-messaging client logo
   [Generated for version 0.2-17 - Mon Jan 6 19:01:23 GMT+1 2003]

Home - Main Page - Data Structures - File List - Data Fields - Globals

nomodule.c File Reference

#include "intl.h"
#include <gtk/gtk.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "service.h"
#include "chat_window.h"
#include "away_window.h"
#include "util.h"
#include "status.h"
#include "gtk_globals.h"
#include "dialog.h"
#include "message_parse.h"
#include "chat_room.h"
#include "value_pair.h"
#include "info_window.h"
#include "gtk_eb_html.h"
#include "input_list.h"
#include "pixmaps/nomodule_away.xpm"

Include dependency graph for nomodule.c:

Include dependency graph

Go to the source code of this file.

Data Structures

struct  eb_nomodule_account_data
struct  eb_nomodule_local_account_data

Defines

#define SERVICE_INFO   nomodule_SERVICE_INFO

Enumerations

enum  { NOMODULE_OFFLINE = 0 }

Functions

eb_accounteb_nomodule_new_account (gchar *account)
void eb_nomodule_add_user (eb_account *account)
void eb_nomodule_login (eb_local_account *account)
void eb_nomodule_logout (eb_local_account *account)
void eb_nomodule_init_pixmaps ()
gboolean eb_nomodule_query_connected (eb_account *account)
void eb_nomodule_send_im (eb_local_account *account_from, eb_account *account_to, gchar *message)
eb_local_accounteb_nomodule_read_local_config (GList *pairs)
GList * eb_nomodule_write_local_config (eb_local_account *account)
eb_accounteb_nomodule_read_config (GList *config, struct contact *contact)
GList * eb_nomodule_get_states ()
char * eb_nomodule_check_login (char *login, char *pass)
gint eb_nomodule_get_current_state (eb_local_account *account)
void eb_nomodule_set_current_state (eb_local_account *account, gint state)
void eb_nomodule_del_user (eb_account *account)
gchar * eb_nomodule_get_status_string (eb_account *account)
void eb_nomodule_get_status_pixmap (eb_account *account, GdkPixmap **pm, GdkBitmap **bm)
void eb_nomodule_set_idle (eb_local_account *ela, gint idle)
void eb_nomodule_set_away (eb_local_account *account, gchar *message)
void eb_nomodule_get_info (eb_local_account *from, eb_account *account_to)
input_listeb_nomodule_get_prefs ()
void eb_nomodule_read_prefs_config (GList *values)
GList * eb_nomodule_write_prefs_config ()
service_callbackseb_nomodule_query_callbacks ()

Variables

service SERVICE_INFO = { NULL, -1, FALSE, FALSE, FALSE, FALSE, NULL }
gint pixmaps = 0
GdkPixmap * eb_nomodule_pixmap [NOMODULE_OFFLINE+1]
GdkBitmap * eb_nomodule_bitmap [NOMODULE_OFFLINE+1]


Define Documentation

#define SERVICE_INFO   nomodule_SERVICE_INFO
 

Definition at line 59 of file nomodule.c.


Enumeration Type Documentation

anonymous enum
 

Enumeration values:
NOMODULE_OFFLINE 

Definition at line 76 of file nomodule.c.

00077 {
00078     NOMODULE_OFFLINE=0
00079 };


Function Documentation

void eb_nomodule_add_user eb_account   account
 

Definition at line 243 of file nomodule.c.

Referenced by eb_nomodule_query_callbacks().

00244 {
00245     return;
00246 }

char* eb_nomodule_check_login char *    login,
char *    pass
 

Definition at line 228 of file nomodule.c.

Referenced by eb_nomodule_query_callbacks().

00229 {
00230     return NULL;
00231 }

void eb_nomodule_del_user eb_account   account
 

Definition at line 248 of file nomodule.c.

Referenced by eb_nomodule_query_callbacks().

00249 {
00250     return;
00251 }

gint eb_nomodule_get_current_state eb_local_account   account
 

Definition at line 233 of file nomodule.c.

Referenced by eb_nomodule_query_callbacks().

00234 {
00235     return 0;
00236 }

void eb_nomodule_get_info eb_local_account   from,
eb_account   account_to
 

Definition at line 291 of file nomodule.c.

Referenced by eb_nomodule_query_callbacks().

00292 {
00293     return;
00294 }

input_list* eb_nomodule_get_prefs  
 

Definition at line 296 of file nomodule.c.

00297 {
00298     return NULL;
00299 }

GList* eb_nomodule_get_states  
 

Definition at line 217 of file nomodule.c.

References _.

Referenced by eb_nomodule_query_callbacks().

00218 {
00219     GList * states = NULL;
00220     states = g_list_append(states, _("No Module or broken account"));
00221     
00222     return states;
00223 }

void eb_nomodule_get_status_pixmap eb_account   account,
GdkPixmap **    pm,
GdkBitmap **    bm
 

Definition at line 267 of file nomodule.c.

References eb_nomodule_bitmap, eb_nomodule_init_pixmaps(), eb_nomodule_pixmap, pixmaps, account::protocol_account_data, and eb_nomodule_account_data::status.

Referenced by eb_nomodule_query_callbacks().

00268 {
00269     struct eb_nomodule_account_data * aad;
00270     
00271     if (!pixmaps)
00272         eb_nomodule_init_pixmaps();
00273     
00274     aad = account->protocol_account_data;
00275     
00276     *pm = eb_nomodule_pixmap[aad->status];
00277     *bm = eb_nomodule_bitmap[aad->status];
00278 }

gchar* eb_nomodule_get_status_string eb_account   account
 

Definition at line 258 of file nomodule.c.

References _.

Referenced by eb_nomodule_query_callbacks().

00259 {
00260     static gchar string[255];
00261 
00262     g_snprintf(string, 255, _("(Offline)"));        
00263 
00264     return string;
00265 }

void eb_nomodule_init_pixmaps  
 

Definition at line 105 of file nomodule.c.

References eb_nomodule_bitmap, eb_nomodule_pixmap, NOMODULE_OFFLINE, and pixmaps.

Referenced by eb_nomodule_get_status_pixmap().

00106 {
00107     gint i = NOMODULE_OFFLINE;
00108     gchar ** xpm;
00109 
00110     xpm = nomodule_away_xpm;
00111     eb_nomodule_pixmap[i] = gdk_pixmap_create_from_xpm_d(statuswindow->window,
00112         &eb_nomodule_bitmap[i], NULL, xpm);
00113     pixmaps = 1;
00114 }

void eb_nomodule_login eb_local_account   account
 

Definition at line 123 of file nomodule.c.

Referenced by eb_nomodule_query_callbacks().

00124 {
00125     return;                           
00126 }

void eb_nomodule_logout eb_local_account   account
 

Definition at line 128 of file nomodule.c.

Referenced by eb_nomodule_query_callbacks().

00129 {
00130     return;
00131 }

eb_account * eb_nomodule_new_account gchar *    account
 

Definition at line 253 of file nomodule.c.

00254 {
00255     return NULL;
00256 }

struct service_callbacks* eb_nomodule_query_callbacks  
 

Definition at line 311 of file nomodule.c.

References service_callbacks::accept_invite, service_callbacks::add_user, service_callbacks::check_login, service_callbacks::decline_invite, service_callbacks::del_user, eb_nomodule_add_user(), eb_nomodule_check_login(), eb_nomodule_del_user(), eb_nomodule_get_current_state(), eb_nomodule_get_info(), eb_nomodule_get_states(), eb_nomodule_get_status_pixmap(), eb_nomodule_get_status_string(), eb_nomodule_login(), eb_nomodule_logout(), eb_nomodule_query_connected(), eb_nomodule_read_prefs_config(), eb_nomodule_send_im(), eb_nomodule_set_away(), eb_nomodule_set_current_state(), eb_nomodule_set_idle(), eb_nomodule_write_local_config(), eb_nomodule_write_prefs_config(), service_callbacks::get_current_state, service_callbacks::get_info, service_callbacks::get_prefs, service_callbacks::get_states, service_callbacks::get_status_pixmap, service_callbacks::get_status_string, service_callbacks::join_chat_room, service_callbacks::leave_chat_room, service_callbacks::login, service_callbacks::logout, service_callbacks::make_chat_room, service_callbacks::new_account, service_callbacks::query_connected, service_callbacks::read_account_config, service_callbacks::read_local_account_config, service_callbacks::read_prefs_config, service_callbacks::send_chat_room_message, service_callbacks::send_im, service_callbacks::send_invite, service_callbacks::set_away, service_callbacks::set_current_state, service_callbacks::set_idle, service_callbacks::write_local_config, and service_callbacks::write_prefs_config.

Referenced by get_service_id(), and unload_module().

00312 {
00313     struct service_callbacks * sc;
00314     
00315     sc = g_new0( struct service_callbacks, 1 );
00316     sc->query_connected = eb_nomodule_query_connected;
00317     sc->login = eb_nomodule_login;
00318     sc->logout = eb_nomodule_logout;
00319     sc->send_im = eb_nomodule_send_im;
00320     sc->read_local_account_config = eb_nomodule_read_local_config;
00321     sc->write_local_config = eb_nomodule_write_local_config;
00322     sc->read_account_config = eb_nomodule_read_config;
00323     sc->get_states = eb_nomodule_get_states;
00324     sc->get_current_state = eb_nomodule_get_current_state;
00325     sc->set_current_state = eb_nomodule_set_current_state;
00326     sc->check_login = eb_nomodule_check_login;
00327     sc->add_user = eb_nomodule_add_user;
00328     sc->del_user = eb_nomodule_del_user;
00329     sc->new_account = eb_nomodule_new_account;
00330     sc->get_status_string = eb_nomodule_get_status_string;
00331     sc->get_status_pixmap = eb_nomodule_get_status_pixmap;
00332     sc->set_idle = eb_nomodule_set_idle;
00333     sc->set_away = eb_nomodule_set_away;
00334     sc->send_chat_room_message = NULL;
00335     sc->join_chat_room = NULL;
00336     sc->leave_chat_room = NULL;
00337     sc->make_chat_room = NULL;
00338     sc->send_invite = NULL;
00339     sc->accept_invite = NULL;
00340     sc->decline_invite = NULL;
00341     sc->get_info = eb_nomodule_get_info;
00342 
00343     sc->get_prefs = eb_nomodule_get_prefs;
00344     sc->read_prefs_config = eb_nomodule_read_prefs_config;
00345     sc->write_prefs_config = eb_nomodule_write_prefs_config;
00346 
00347     return sc;
00348 }

gboolean eb_nomodule_query_connected eb_account   account
 

Definition at line 118 of file nomodule.c.

Referenced by eb_nomodule_query_callbacks().

00119 {       
00120     return FALSE;
00121 }

eb_account* eb_nomodule_read_config GList *    config,
struct contact   contact
 

Definition at line 194 of file nomodule.c.

References account::account_contact, account::handle, account::icon_handler, account::list_item, account::online, account::pix, account::protocol_account_data, service::protocol_id, account::service_id, account::status, eb_nomodule_account_data::status, and account::status_handler.

00195 {
00196     eb_account * ea = g_new0(eb_account, 1 );
00197     struct eb_nomodule_account_data * aad =  g_new0(struct eb_nomodule_account_data,1);
00198     
00199     aad->status = 0;
00200 
00201     /*you know, eventually error handling should be put in here*/
00202     strncpy(ea->handle, value_pair_get_value( config, "NAME"), 255);
00203 
00204     ea->service_id = SERVICE_INFO.protocol_id;
00205     ea->protocol_account_data = aad;
00206     ea->account_contact = contact;
00207     ea->list_item = NULL;
00208     ea->online = 0;
00209     ea->status = NULL;
00210     ea->pix = NULL;
00211     ea->icon_handler = -1;
00212     ea->status_handler = -1;
00213     
00214     return ea;
00215 }

eb_local_account* eb_nomodule_read_local_config GList *    pairs
 

Definition at line 140 of file nomodule.c.

References local_account::alias, DBG_CORE, eb_debug, local_account::handle, eb_nomodule_local_account_data::password, service::protocol_id, local_account::protocol_local_account_data, local_account::service_id, eb_nomodule_local_account_data::status, and value_pair_get_value().

00141 {
00142 
00143     eb_local_account * ela = g_new0(eb_local_account, 1);
00144     struct eb_nomodule_local_account_data * ala = g_new0(struct eb_nomodule_local_account_data, 1);
00145     char *ptr=NULL;
00146     
00147     eb_debug(DBG_CORE, "eb_nomodule_read_local_config: entering\n");    
00148     /*you know, eventually error handling should be put in here*/
00149     ptr = value_pair_get_value(pairs, "SCREEN_NAME");
00150     if(!ptr) {
00151         fprintf(stderr, "Error!  Invalid account config no SCREEN_NAME defined!\n");
00152         exit(1);
00153     }
00154     ela->handle=strdup(ptr);
00155     strncpy(ela->alias, ela->handle, 255);
00156     ptr = value_pair_get_value(pairs, "PASSWORD");
00157     if(!ptr) {
00158         fprintf(stderr, "Warning!  No password specified for handle %s\n", ela->handle);
00159     }
00160     else {
00161         strncpy(ala->password, value_pair_get_value(pairs, "PASSWORD"), 255);
00162     }
00163     ela->service_id = SERVICE_INFO.protocol_id;
00164     ela->protocol_local_account_data = ala;
00165     ala->status = 0;
00166     eb_debug(DBG_CORE, "eb_nomodule_read_local_config: leaving\n");
00167 
00168     return ela;
00169 }

void eb_nomodule_read_prefs_config GList *    values
 

Definition at line 301 of file nomodule.c.

Referenced by eb_nomodule_query_callbacks().

00302 {
00303     return;
00304 }

void eb_nomodule_send_im eb_local_account   account_from,
eb_account   account_to,
gchar *    message
 

Definition at line 133 of file nomodule.c.

Referenced by eb_nomodule_query_callbacks().

00136 {
00137     return;
00138 }

void eb_nomodule_set_away eb_local_account   account,
gchar *    message
 

Definition at line 285 of file nomodule.c.

Referenced by eb_nomodule_query_callbacks().

00286 {
00287     return;
00288 }

void eb_nomodule_set_current_state eb_local_account   account,
gint    state
 

Definition at line 238 of file nomodule.c.

Referenced by eb_nomodule_query_callbacks().

00239 {
00240     return;
00241 }

void eb_nomodule_set_idle eb_local_account   ela,
gint    idle
 

Definition at line 280 of file nomodule.c.

Referenced by eb_nomodule_query_callbacks().

00281 {
00282     return;
00283 }

GList* eb_nomodule_write_local_config eb_local_account   account
 

Definition at line 171 of file nomodule.c.

References local_account::handle, _value_pair::key, eb_nomodule_local_account_data::password, local_account::protocol_local_account_data, and _value_pair::value.

Referenced by eb_nomodule_query_callbacks().

00172 {
00173     GList * list = NULL;
00174     value_pair * vp;
00175     struct eb_nomodule_local_account_data * alad = account->protocol_local_account_data; 
00176 
00177     vp = g_new0(value_pair, 1);
00178 
00179     strcpy(vp->key, "SCREEN_NAME");
00180     strcpy(vp->value, escape_string(account->handle) );
00181 
00182     list = g_list_append( list, vp );
00183 
00184     vp = g_new0(value_pair, 1);
00185 
00186     strcpy(vp->key, "PASSWORD");
00187     strcpy(vp->value, escape_string(alad->password) );
00188 
00189     list = g_list_append(list, vp);
00190 
00191     return list;
00192 }

GList* eb_nomodule_write_prefs_config  
 

Definition at line 306 of file nomodule.c.

Referenced by eb_nomodule_query_callbacks().

00307 {
00308     return NULL;
00309 }


Variable Documentation

GdkBitmap* eb_nomodule_bitmap[NOMODULE_OFFLINE+1] [static]
 

Definition at line 103 of file nomodule.c.

Referenced by eb_nomodule_get_status_pixmap(), and eb_nomodule_init_pixmaps().

GdkPixmap* eb_nomodule_pixmap[NOMODULE_OFFLINE+1] [static]
 

Definition at line 102 of file nomodule.c.

Referenced by eb_nomodule_get_status_pixmap(), and eb_nomodule_init_pixmaps().

gint pixmaps = 0 [static]
 

Definition at line 101 of file nomodule.c.

Referenced by eb_nomodule_get_status_pixmap(), and eb_nomodule_init_pixmaps().

struct service SERVICE_INFO = { NULL, -1, FALSE, FALSE, FALSE, FALSE, NULL }
 

Definition at line 61 of file nomodule.c.


Contact: Andy Maloney     [Documentation generated by doxygen]