forked from kernelhcy/gtkqq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
chatwidget.h
67 lines (57 loc) · 2.2 KB
/
chatwidget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef __GTKQQ_CHATWIDGET_H
#define __GTKQQ_CHATWIDGET_H
#include <gtk/gtk.h>
#include <qq.h>
//
// Chat widget
// Contians:
// message text view, font tool bar, tool bar
// Both the buddy chat window and the group chat window use this widget.
//
// ----------------------------------------------
// | |
// | |
// | message text view | <-- message text view
// | |
// | |
// ----------------------------------------------
// | font|v| size|v| |a| |a| |a| |clor| | <-- font tool bar (may hide)
// ----------------------------------------------
// | |font| |face| ....... |clrscr| | <-- tool bar
// ----------------------------------------------
// | |
// | input text view | <-- input text view
// | |
// ----------------------------------------------
//
#define QQ_CHATWIDGET(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, qq_chatwidget_get_type()\
, QQChatWidget)
#define QQ_CHATWIDGETCLASS(c) G_TYPE_CHECK_CLASS_CAST(c\
, qq_chatwidget_get_type()\
, QQChatWidgetClass)
#define QQ_IS_CHATWIDGET(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, qq_chatwidget_get_type())
typedef struct __QQChatWidget QQChatWidget;
typedef struct __QQChatWidgetClass QQChatWidgetClass;
struct __QQChatWidget{
GtkVBox parent;
};
struct __QQChatWidgetClass{
GtkVBoxClass parent;
};
GtkWidget* qq_chatwidget_new();
GType qq_chatwidget_get_type();
//
// Add messages
//
void qq_chatwidget_add_recv_message(GtkWidget *widget, QQRecvMsg *msg);
void qq_chatwidget_add_send_message(GtkWidget *widget, QQSendMsg *msg);
//
// Get the text view
//
GtkWidget* qq_chatwidget_get_message_textview(GtkWidget *widget);
GtkWidget* qq_chatwidget_get_input_textview(GtkWidget *widget);
//
// Get the font of font tool bar
//
QQMsgContent* qq_chatwidget_get_font(GtkWidget *widget);
#endif