Mercurial > pidgin
view src/mediastreamer/mssync.h @ 12116:e75ef7aa913e
[gaim-migrate @ 14416]
" This patch implements a replacement for the queuing
system from 1.x. It also obsoletes a previous patch
[#1338873] I submitted to prioritize the unseen states
in gtk conversations.
The attached envelope.png is ripped from the
msgunread.png already included in gaim. It should be
dropped in the pixmaps directory (Makefile.am is
updated accordingly in this patch).
The two separate queuing preferences from 1.x, queuing
messages while away and queuing all new messages (from
docklet), are replaced with a single 3-way preference
for conversations. The new preference is "Hide new IM
conversations". This preference can be set to never,
away and always.
When a gtk conversation is created, it may be placed in
a hidden conversation window instead of being placed
normally. This decision is based upon the preference
and possibly the away state of the account the
conversation is being created for. This *will* effect
conversations the user explicitly requests to be
created, so in these cases the caller must be sure to
present the conversation to the user, using
gaim_gtkconv_present_conversation(). This is done
already in gtkdialogs.c which handles creating
conversations requested by the user from gaim proper
(menus, double-clicking on budy in blist, etc.).
The main advantage to not queuing messages is that the
conversations exist, the message is written to the
conversation (and logged if appropriate) and the unseen
state is set on the conversation. This means no
additional features are needed to track whether there
are queued messages or not, just use the unseen state
on conversations.
Since conversations may not be visible (messages
"queued"), gaim proper needs some notification that
there are messages waiting. I opted for a menutray icon
that shows up when an im conversation has an unseen
message. Clicking this icon will focus (and show if
hidden) the first conversation with an unseen message.
This is essentially the same behavior of the docklet in
cvs right now, except that the icon is only visible
when there is a conversation with an unread message.
The api that is added is flexible enough to allow
either the docklet or the new blist menutray icon to be
visible for conversations of any/all types and for
unseen messages >= any state. Currently they are set to
only IM conversations and only unseen states >= TEXT
(system messages and no log messages will not trigger
blinking the docklet or showing the blist tray icon),
but these could be made preferences relatively easily
in the future. Other plugins could probably benefit as
well: gaim_gtk_conversations_get_first_unseen().
There is probably some limit to comment size, so I'll
stop rambling now. If anyone has more
questions/comments, catch me in #gaim, here or on
gaim-devel."
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Wed, 16 Nov 2005 18:17:01 +0000 |
parents | e67993da8a22 |
children |
line wrap: on
line source
/* The mediastreamer library aims at providing modular media processing and I/O for linphone, but also for any telephony application. Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef MS_SYNC_H #define MS_SYNC_H #include "msfilter.h" struct _MSSync { struct _MSSyncClass *klass; GMutex *lock; MSFilter **attached_filters; /* pointer to a table of pointer of filters*/ GList *execution_list; /* the list of filters to be executed. This is filled with compilation */ gint filters; /*number of filters attached to the sync */ gint run; /* flag to indicate whether the sync must be run or not */ GThread * thread; /* the thread ressource if this sync is run by a thread*/ GCond *thread_cond; GCond *stop_cond; guint32 flags; gint interval; /* in miliseconds*/ #define MS_SYNC_NEED_UPDATE (0x0001) /* a modification has occured in the processing chains attached to this sync; so the execution list has to be updated */ guint samples_per_tick; /* number of bytes produced by sources of the processing chains*/ guint32 ticks; guint32 time; /* a time since the start of the sync expressed in milisec*/ }; typedef struct _MSSync MSSync; typedef void (*MSSyncDestroyFunc)(MSSync*); typedef void (*MSSyncSyncFunc)(MSSync*); typedef int (*MSSyncAttachFunc)(MSSync*,MSFilter*); typedef int (*MSSyncDetachFunc)(MSSync*,MSFilter*); typedef struct _MSSyncClass { gint max_filters; /* the maximum number of filters that can be attached to this sync*/ MSSyncSyncFunc synchronize; MSSyncDestroyFunc destroy; MSSyncAttachFunc attach; MSSyncDetachFunc detach; } MSSyncClass; /* private */ void ms_sync_init(MSSync *sync); void ms_sync_class_init(MSSyncClass *klass); int ms_sync_attach_generic(MSSync *sync,MSFilter *f); int ms_sync_detach_generic(MSSync *sync,MSFilter *f); /* public*/ #define MS_SYNC(sync) ((MSSync*)(sync)) #define MS_SYNC_CLASS(klass) ((MSSyncClass*)(klass)) #define ms_sync_synchronize(_sync) \ do \ { \ MSSync *__sync=_sync; \ __sync->ticks++; \ ((__sync)->klass->synchronize((__sync))); \ }while(0) void ms_sync_setup(MSSync *sync); void ms_sync_unsetup(MSSync *sync); #define ms_sync_update(sync) (sync)->flags|=MS_SYNC_NEED_UPDATE #define ms_sync_get_samples_per_tick(sync) ((sync)->samples_per_tick) void ms_sync_set_samples_per_tick(MSSync *sync,gint size); #define ms_sync_get_tick_count(sync) ((sync)->ticks) #define ms_sync_suspend(sync) g_cond_wait((sync)->thread_cond,(sync)->lock) #define ms_sync_lock(sync) g_mutex_lock((sync)->lock) #define ms_sync_unlock(sync) g_mutex_unlock((sync)->lock) #define ms_sync_trylock(sync) g_mutex_trylock((sync)->lock) /** * function_name:ms_sync_attach * @sync: A #MSSync object. * @f: A #MSFilter object. * * Attach a chain of filters to a synchronisation source. Filter @f must be the first filter of the processing chain. * * Returns: 0 if successfull, a negative value reprensenting the errno.h error. */ int ms_sync_attach(MSSync *sync,MSFilter *f); /** * ms_sync_detach: * @sync: A #MSSync object. * @f: A #MSFilter object. * * Dettach a chain of filters to a synchronisation source. Filter @f must be the first filter of the processing chain. * The processing chain will no more be executed. * * Returns: 0 if successfull, a negative value reprensenting the errno.h error. */ int ms_sync_detach(MSSync *sync,MSFilter *f); int ms_sync_uninit(MSSync *sync); #define ms_sync_start(sync) ms_start((sync)) #define ms_sync_stop(sync) ms_stop((sync)) /*destroy*/ #define ms_sync_destroy(sync) (sync)->klass->destroy((sync)) #endif