Changes between Version 4 and Version 5 of WhatIsLibpurple


Ignore:
Timestamp:
04/25/07 23:57:14 (12 years ago)
Author:
MarkDoliner
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WhatIsLibpurple

    v4 v5  
    33libpurple is intended to be the core of an IM program.  When using libpurple, you'll basically be writing a UI for this core chunk of code.  Pidgin is a GTK+ frontend to libpurple, Finch is an ncurses frontend, and Adium is a Cocoa frontend.
    44
    5 Your program provides the int main() function.  Your main function will call libpurple_core_init(), which initializes libpurple.  Your main function will also register a whole bunch of "callback" functions that are called by libpurple any time there is something to tell the user.  For example, when libpurple receives an IM it'll call your function for handling an incoming IM.  When one of your buddies signs online libpurple will call your function to update the buddylist.
     5= How does it work? =
    66
    7 If your user fetches someones info then you'll call a libpurple function that sends the appropriate message across the network.  Then libpurple will get a response and call your function for handling buddy info.
     7You write a program in C or C++ that provides all the fancy windows and dialogs and anything that the user interacts with.  Your program registers a bunch of callback functions, called "UI ops," with libpurple.  This is done by populating the appropriate uiops structures (eg. PurpleAccountUiOps, PurpleBlistUiOps, etc.) and making them available to the libpurple core (by calling purple_account_set_ui_ops, purple_blist_set_ui_ops, etc.).  Thes ui ops are triggered  at specific events.  For example, the buddylist ui ops are used to update your buddylist window when a new buddy is added, or if a buddy goes away, or becomes idle, etc.
    88
    9 === TODO: Combine the following text with the above ===
    10 
    11 Applications that use libgaim provide the appropriate functions to perform the UI operations invoked by the core (libgaim). This is done by populating the uiops structures (eg. GaimAccountUiOps, GaimBlistUiOps etc.) and making them available to the core (by calling gaim_accounts_set_ui_ops, gaim_blist_set_ui_ops etc.). The functions in the uiops are triggered at specific events, eg. the buddylist-uiops are used to update the buddy list when a new buddy is added, or removed, or the status of a buddy is changed etc. The same happens for conversations, logging etc.
     9Your program provides the int main() function.  Your main function will call libpurple_core_init() which initializes libpurple.  Your main function will also register a whole bunch of "callback" functions that are called by libpurple any time there is something to tell the user.  For example, when libpurple receives an IM it'll call your function for handling an incoming IM.  When one of your buddies signs online then libpurple will call your function to update the buddylist.  The same thing happens for conversations, logging etc.
    1210
    1311While the uiops are sufficient for most of the ui operations, it's likely that you will want to use the gaim-signals as well to fine-tune some stuff.
     12
     13If your user fetches someone's info then you'll call a libpurple function that sends the appropriate message across the network.  Then libpurple will get a response and call your function for handling buddy info.
    1414
    1515libgaim uses the glib mainloop to do all the things. The application wanting to use libgaim will [likely] have to do the same.
All information, including names and email addresses, entered onto this website or sent to mailing lists affiliated with this website will be public. Do not post confidential information, especially passwords!