Loading...
Searching...
No Matches
whiteboard.h
Go to the documentation of this file.
/* purple
*
* Purple is the legal property of its developers, whose names are too numerous
* to list here. Please refer to the COPYRIGHT file distributed with this
* source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
#ifndef _PURPLE_WHITEBOARD_H_
#define _PURPLE_WHITEBOARD_H_
typedef struct _PurpleWhiteboardPrplOps PurpleWhiteboardPrplOps;
#include "account.h"
typedef struct _PurpleWhiteboard
{
int state;
PurpleAccount *account;
char *who;
void *ui_data;
void *proto_data;
PurpleWhiteboardPrplOps *prpl_ops;
GList *draw_list;
} PurpleWhiteboard;
typedef struct _PurpleWhiteboardUiOps
{
void (*create)(PurpleWhiteboard *wb);
void (*destroy)(PurpleWhiteboard *wb);
void (*set_dimensions)(PurpleWhiteboard *wb, int width, int height);
void (*set_brush) (PurpleWhiteboard *wb, int size, int color);
void (*draw_point)(PurpleWhiteboard *wb, int x, int y,
int color, int size);
void (*draw_line)(PurpleWhiteboard *wb, int x1, int y1,
int x2, int y2,
int color, int size);
void (*clear)(PurpleWhiteboard *wb);
void (*_purple_reserved1)(void);
void (*_purple_reserved2)(void);
void (*_purple_reserved3)(void);
void (*_purple_reserved4)(void);
} PurpleWhiteboardUiOps;
struct _PurpleWhiteboardPrplOps
{
void (*start)(PurpleWhiteboard *wb);
void (*end)(PurpleWhiteboard *wb);
void (*get_dimensions)(const PurpleWhiteboard *wb, int *width, int *height);
void (*set_dimensions)(PurpleWhiteboard *wb, int width, int height);
void (*get_brush) (const PurpleWhiteboard *wb, int *size, int *color);
void (*set_brush) (PurpleWhiteboard *wb, int size, int color);
void (*send_draw_list)(PurpleWhiteboard *wb, GList *draw_list);
void (*clear)(PurpleWhiteboard *wb);
void (*_purple_reserved1)(void);
void (*_purple_reserved2)(void);
void (*_purple_reserved3)(void);
void (*_purple_reserved4)(void);
};
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/******************************************************************************/
/******************************************************************************/
void purple_whiteboard_set_ui_ops(PurpleWhiteboardUiOps *ops);
void purple_whiteboard_set_prpl_ops(PurpleWhiteboard *wb, PurpleWhiteboardPrplOps *ops);
PurpleWhiteboard *purple_whiteboard_create(PurpleAccount *account, const char *who, int state);
void purple_whiteboard_destroy(PurpleWhiteboard *wb);
void purple_whiteboard_start(PurpleWhiteboard *wb);
PurpleWhiteboard *purple_whiteboard_get_session(const PurpleAccount *account, const char *who);
void purple_whiteboard_draw_list_destroy(GList *draw_list);
gboolean purple_whiteboard_get_dimensions(const PurpleWhiteboard *wb, int *width, int *height);
void purple_whiteboard_set_dimensions(PurpleWhiteboard *wb, int width, int height);
void purple_whiteboard_draw_point(PurpleWhiteboard *wb, int x, int y, int color, int size);
void purple_whiteboard_send_draw_list(PurpleWhiteboard *wb, GList *list);
void purple_whiteboard_draw_line(PurpleWhiteboard *wb, int x1, int y1, int x2, int y2, int color, int size);
void purple_whiteboard_clear(PurpleWhiteboard *wb);
void purple_whiteboard_send_clear(PurpleWhiteboard *wb);
void purple_whiteboard_send_brush(PurpleWhiteboard *wb, int size, int color);
gboolean purple_whiteboard_get_brush(const PurpleWhiteboard *wb, int *size, int *color);
void purple_whiteboard_set_brush(PurpleWhiteboard *wb, int size, int color);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* _PURPLE_WHITEBOARD_H_ */
account.h
Account API.
PurpleAccount
struct _PurpleAccount PurpleAccount
Structure representing an account.
Definition account.h:38
_PurpleWhiteboardPrplOps
PurpleWhiteboard PRPL Operations.
Definition whiteboard.h:79
_PurpleWhiteboardPrplOps::start
void(* start)(PurpleWhiteboard *wb)
start function
Definition whiteboard.h:80
_PurpleWhiteboardPrplOps::get_dimensions
void(* get_dimensions)(const PurpleWhiteboard *wb, int *width, int *height)
get_dimensions function
Definition whiteboard.h:82
_PurpleWhiteboardPrplOps::set_brush
void(* set_brush)(PurpleWhiteboard *wb, int size, int color)
set the brush size and color
Definition whiteboard.h:85
_PurpleWhiteboardPrplOps::clear
void(* clear)(PurpleWhiteboard *wb)
clear function
Definition whiteboard.h:87
_PurpleWhiteboardPrplOps::send_draw_list
void(* send_draw_list)(PurpleWhiteboard *wb, GList *draw_list)
send_draw_list function
Definition whiteboard.h:86
_PurpleWhiteboardPrplOps::end
void(* end)(PurpleWhiteboard *wb)
end function
Definition whiteboard.h:81
_PurpleWhiteboardPrplOps::set_dimensions
void(* set_dimensions)(PurpleWhiteboard *wb, int width, int height)
set_dimensions function
Definition whiteboard.h:83
_PurpleWhiteboardPrplOps::get_brush
void(* get_brush)(const PurpleWhiteboard *wb, int *size, int *color)
get the brush size and color
Definition whiteboard.h:84
_PurpleWhiteboardUiOps
The PurpleWhiteboard UI Operations.
Definition whiteboard.h:57
_PurpleWhiteboardUiOps::draw_line
void(* draw_line)(PurpleWhiteboard *wb, int x1, int y1, int x2, int y2, int color, int size)
draw_line function
Definition whiteboard.h:64
_PurpleWhiteboardUiOps::destroy
void(* destroy)(PurpleWhiteboard *wb)
destory function
Definition whiteboard.h:59
_PurpleWhiteboardUiOps::clear
void(* clear)(PurpleWhiteboard *wb)
clear function
Definition whiteboard.h:67
_PurpleWhiteboardUiOps::create
void(* create)(PurpleWhiteboard *wb)
create function
Definition whiteboard.h:58
_PurpleWhiteboardUiOps::set_dimensions
void(* set_dimensions)(PurpleWhiteboard *wb, int width, int height)
set_dimensions function
Definition whiteboard.h:60
_PurpleWhiteboardUiOps::draw_point
void(* draw_point)(PurpleWhiteboard *wb, int x, int y, int color, int size)
draw_point function
Definition whiteboard.h:62
_PurpleWhiteboardUiOps::set_brush
void(* set_brush)(PurpleWhiteboard *wb, int size, int color)
set the size and color of the brush
Definition whiteboard.h:61
_PurpleWhiteboard
A PurpleWhiteboard.
Definition whiteboard.h:40
_PurpleWhiteboard::ui_data
void * ui_data
Graphical user-interface data.
Definition whiteboard.h:46
_PurpleWhiteboard::draw_list
GList * draw_list
List of drawing elements/deltas to send.
Definition whiteboard.h:50
_PurpleWhiteboard::account
PurpleAccount * account
Account associated with this session.
Definition whiteboard.h:43
_PurpleWhiteboard::proto_data
void * proto_data
Protocol specific data.
Definition whiteboard.h:47
_PurpleWhiteboard::who
char * who
Name of the remote user.
Definition whiteboard.h:44
_PurpleWhiteboard::prpl_ops
PurpleWhiteboardPrplOps * prpl_ops
Protocol-plugin operations.
Definition whiteboard.h:48
_PurpleWhiteboard::state
int state
State of whiteboard session.
Definition whiteboard.h:41
purple_whiteboard_get_session
PurpleWhiteboard * purple_whiteboard_get_session(const PurpleAccount *account, const char *who)
Finds a whiteboard from an account and user.
PurpleWhiteboardUiOps
struct _PurpleWhiteboardUiOps PurpleWhiteboardUiOps
The PurpleWhiteboard UI Operations.
purple_whiteboard_create
PurpleWhiteboard * purple_whiteboard_create(PurpleAccount *account, const char *who, int state)
Creates a whiteboard.
purple_whiteboard_destroy
void purple_whiteboard_destroy(PurpleWhiteboard *wb)
Destroys a whiteboard.
purple_whiteboard_draw_line
void purple_whiteboard_draw_line(PurpleWhiteboard *wb, int x1, int y1, int x2, int y2, int color, int size)
Draws a line on a whiteboard.
purple_whiteboard_get_brush
gboolean purple_whiteboard_get_brush(const PurpleWhiteboard *wb, int *size, int *color)
Gets the size and color of the brush.
purple_whiteboard_send_clear
void purple_whiteboard_send_clear(PurpleWhiteboard *wb)
Sends a request to the buddy to clear the whiteboard.
purple_whiteboard_start
void purple_whiteboard_start(PurpleWhiteboard *wb)
Starts a whiteboard.
purple_whiteboard_set_ui_ops
void purple_whiteboard_set_ui_ops(PurpleWhiteboardUiOps *ops)
Sets the UI operations.
PurpleWhiteboardPrplOps
struct _PurpleWhiteboardPrplOps PurpleWhiteboardPrplOps
Whiteboard PRPL Operations.
Definition whiteboard.h:32
purple_whiteboard_set_brush
void purple_whiteboard_set_brush(PurpleWhiteboard *wb, int size, int color)
Sets the size and color of the brush.
PurpleWhiteboard
struct _PurpleWhiteboard PurpleWhiteboard
A PurpleWhiteboard.
purple_whiteboard_get_dimensions
gboolean purple_whiteboard_get_dimensions(const PurpleWhiteboard *wb, int *width, int *height)
Gets the dimension of a whiteboard.
purple_whiteboard_send_brush
void purple_whiteboard_send_brush(PurpleWhiteboard *wb, int size, int color)
Sends a request to change the size and color of the brush.
purple_whiteboard_set_prpl_ops
void purple_whiteboard_set_prpl_ops(PurpleWhiteboard *wb, PurpleWhiteboardPrplOps *ops)
Sets the prpl operations for a whiteboard.
purple_whiteboard_draw_list_destroy
void purple_whiteboard_draw_list_destroy(GList *draw_list)
Destorys a drawing list for a whiteboard.
purple_whiteboard_draw_point
void purple_whiteboard_draw_point(PurpleWhiteboard *wb, int x, int y, int color, int size)
Draws a point on a whiteboard.
purple_whiteboard_set_dimensions
void purple_whiteboard_set_dimensions(PurpleWhiteboard *wb, int width, int height)
Sets the dimensions for a whiteboard.
purple_whiteboard_send_draw_list
void purple_whiteboard_send_draw_list(PurpleWhiteboard *wb, GList *list)
Send a list of points to draw to the buddy.
purple_whiteboard_clear
void purple_whiteboard_clear(PurpleWhiteboard *wb)
Clears a whiteboard.