annotate src/gtkcellview.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 a7486f12e56f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10703
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
1 /* gtkcellview.h
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
2 * Copyright (C) 2002, 2003 Kristian Rietveld <kris@gtk.org>
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
3 *
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
4 * This library is free software; you can redistribute it and/or
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
5 * modify it under the terms of the GNU Library General Public
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
6 * License as published by the Free Software Foundation; either
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
7 * version 2 of the License, or (at your option) any later version.
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
8 *
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
9 * This library is distributed in the hope that it will be useful,
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
12 * Library General Public License for more details.
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
13 *
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
14 * You should have received a copy of the GNU Library General Public
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
15 * License along with this library; if not, write to the
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
17 * Boston, MA 02111-1307, USA.
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
18 */
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
19
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
20 #ifndef __GTK_CELL_VIEW_H__
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
21 #define __GTK_CELL_VIEW_H__
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
22
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
23 #include <gtk/gtkwidget.h>
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
24 #include <gtk/gtkcellrenderer.h>
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
25 #include <gtk/gtktreemodel.h>
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
26
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
27 G_BEGIN_DECLS
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
28
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
29 #define GTK_TYPE_CELL_VIEW (gtk_cell_view_get_type ())
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
30 #define GTK_CELL_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CELL_VIEW, GtkCellView))
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
31 #define GTK_CELL_VIEW_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), GTK_TYPE_CELL_VIEW, GtkCellViewClass))
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
32 #define GTK_IS_CELL_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CELL_VIEW))
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
33 #define GTK_IS_CELL_VIEW_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), GTK_TYPE_CELL_VIEW))
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
34 #define GTK_CELL_VIEW_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), GTK_TYPE_CELL_VIEW, GtkCellViewClass))
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
35
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
36 typedef struct _GtkCellView GtkCellView;
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
37 typedef struct _GtkCellViewClass GtkCellViewClass;
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
38 typedef struct _GtkCellViewPrivate GtkCellViewPrivate;
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
39
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
40 struct _GtkCellView
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
41 {
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
42 GtkWidget parent_instance;
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
43
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
44 /*< private >*/
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
45 GtkCellViewPrivate *priv;
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
46 };
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
47
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
48 struct _GtkCellViewClass
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
49 {
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
50 GtkWidgetClass parent_class;
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
51 };
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
52
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
53 GType gtk_cell_view_get_type (void);
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
54 GtkWidget *gtk_cell_view_new (void);
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
55 GtkWidget *gtk_cell_view_new_with_text (const gchar *text);
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
56 GtkWidget *gtk_cell_view_new_with_markup (const gchar *markup);
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
57 GtkWidget *gtk_cell_view_new_with_pixbuf (GdkPixbuf *pixbuf);
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
58
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
59
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
60 void gtk_cell_view_set_value (GtkCellView *cell_view,
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
61 GtkCellRenderer *renderer,
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
62 gchar *property,
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
63 GValue *value);
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
64 void gtk_cell_view_set_values (GtkCellView *cell_view,
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
65 GtkCellRenderer *renderer,
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
66 ...);
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
67
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
68 void gtk_cell_view_set_model (GtkCellView *cell_view,
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
69 GtkTreeModel *model);
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
70 void gtk_cell_view_set_displayed_row (GtkCellView *cell_view,
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
71 GtkTreePath *path);
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
72 GtkTreePath *gtk_cell_view_get_displayed_row (GtkCellView *cell_view);
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
73 gboolean gtk_cell_view_get_size_of_row (GtkCellView *cell_view,
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
74 GtkTreePath *path,
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
75 GtkRequisition *requisition);
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
76
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
77 void gtk_cell_view_set_background_color (GtkCellView *cell_view,
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
78 const GdkColor *color);
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
79
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
80 G_END_DECLS
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
81
a7486f12e56f [gaim-migrate @ 12286]
Stu Tomlinson <stu@nosnilmot.com>
parents:
diff changeset
82 #endif /* __GTK_CELL_VIEW_H__ */