Permalink
Browse files

Merge pull request #98 from thynson/for-hcy

For hcy
  • Loading branch information...
2 parents bea7d48 + 5c25bb0 commit 74f8acfacb0d17e1129efadb73f8adcf2160c993 @kernelhcy committed Mar 28, 2012
@@ -25,13 +25,13 @@
// ------------------------------------------
//
-#define QQ_CHAT_TEXTVIEW(obj) GTK_CHECK_CAST(obj\
+#define QQ_CHAT_TEXTVIEW(obj) G_TYPE_CHECK_INSTANCE_CAST(obj\
, qq_chat_textview_get_type()\
, QQChatTextview)
-#define QQ_CHAT_TEXTVIEWCLASS(c) GTK_CHECK_CLASS_CAST(c\
+#define QQ_CHAT_TEXTVIEWCLASS(c) G_TYPE_CHECK_CLASS_CAST(c\
, qq_chat_textview_get_type()\
, QQChatTextviewClass)
-#define QQ_IS_CHAT_TEXTVIEW(obj) GTK_CHECK_TYPE(obj\
+#define QQ_IS_CHAT_TEXTVIEW(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj\
, qq_chat_textview_get_type())
typedef struct __QQChatTextview QQChatTextview;
@@ -25,12 +25,12 @@
// | |
// ----------------------------------------------
//
-#define QQ_CHATWIDGET(obj) GTK_CHECK_CAST(obj, qq_chatwidget_get_type()\
+#define QQ_CHATWIDGET(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, qq_chatwidget_get_type()\
, QQChatWidget)
-#define QQ_CHATWIDGETCLASS(c) GTK_CHECK_CLASS_CAST(c\
+#define QQ_CHATWIDGETCLASS(c) G_TYPE_CHECK_CLASS_CAST(c\
, qq_chatwidget_get_type()\
, QQChatWidgetClass)
-#define QQ_IS_CHATWIDGET(obj) GTK_CHECK_TYPE(obj, qq_chatwidget_get_type())
+#define QQ_IS_CHATWIDGET(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, qq_chatwidget_get_type())
typedef struct __QQChatWidget QQChatWidget;
typedef struct __QQChatWidgetClass QQChatWidgetClass;
View
@@ -31,7 +31,7 @@ typedef struct{
GtkWidget *name_label, *lnick_label;
GtkWidget *chat_widget;
-
+
GtkWidget *send_btn, *close_btn;
}QQChatWindowPriv;
@@ -169,9 +169,9 @@ static gboolean qq_input_textview_key_press(GtkWidget *widget, GdkEvent *e
, gpointer data)
{
GdkEventKey *event = (GdkEventKey*)e;
- if(event -> keyval == GDK_Return || event -> keyval == GDK_KP_Enter
- || event -> keyval == GDK_ISO_Enter){
- if((event -> state & GDK_CONTROL_MASK) != 0
+ if(event -> keyval == GDK_KEY_Return || event -> keyval == GDK_KEY_KP_Enter
+ || event -> keyval == GDK_KEY_ISO_Enter){
+ if((event -> state & GDK_CONTROL_MASK) != 0
|| (event -> state & GDK_SHIFT_MASK) != 0){
return FALSE;
}
@@ -188,8 +188,8 @@ static gboolean qq_chatwindow_key_press(GtkWidget *widget, GdkEvent *e
, gpointer data)
{
GdkEventKey *event = (GdkEventKey*)e;
- if((event -> state & GDK_CONTROL_MASK) != 0
- && (event -> keyval == GDK_w || event -> keyval == GDK_W)){
+ if((event -> state & GDK_CONTROL_MASK) != 0
+ && (event -> keyval == GDK_KEY_w || event -> keyval == GDK_KEY_W)){
QQChatWindowPriv *priv = data;
gqq_config_remove_ht(cfg, "chat_window_map", priv -> uin);
gtk_widget_destroy(widget);
@@ -215,7 +215,7 @@ static void qq_chatwindow_init(QQChatWindow *win)
pb = gdk_pixbuf_new_from_file(buf, NULL);
gtk_window_set_icon(GTK_WINDOW(win), pb);
g_object_unref(pb);
- g_snprintf(buf, 500, "Talking with %s", bdy == NULL ? priv -> uin
+ g_snprintf(buf, 500, "Talking with %s", bdy == NULL ? priv -> uin
: bdy -> nick -> str);
gtk_window_set_title(GTK_WINDOW(win), buf);
@@ -227,17 +227,17 @@ static void qq_chatwindow_init(QQChatWindow *win)
priv -> name_label = gtk_label_new("");
priv -> lnick_label = gtk_label_new("");
gtk_box_pack_start(GTK_BOX(header_hbox), priv -> faceimage
- , FALSE, FALSE, 5);
- gtk_box_pack_start(GTK_BOX(vbox), priv -> name_label, FALSE, FALSE, 0);
- gtk_box_pack_start(GTK_BOX(vbox), priv -> lnick_label, FALSE, FALSE, 0);
- gtk_box_pack_start(GTK_BOX(header_hbox), vbox, FALSE, FALSE, 5);
+ , FALSE, FALSE, 5);
+ gtk_box_pack_start(GTK_BOX(vbox), priv -> name_label, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), priv -> lnick_label, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(header_hbox), vbox, FALSE, FALSE, 5);
gtk_box_pack_start(GTK_BOX(priv -> body_vbox), header_hbox
, FALSE, FALSE, 5);
// message text view
priv -> chat_widget = qq_chatwidget_new();
gtk_box_pack_start(GTK_BOX(priv -> body_vbox), priv -> chat_widget
- , TRUE, TRUE, 0);
+ , TRUE, TRUE, 0);
// buttons
GtkWidget *buttonbox = gtk_hbutton_box_new();
@@ -251,7 +251,7 @@ static void qq_chatwindow_init(QQChatWindow *win)
G_CALLBACK(qq_chatwindow_on_send_clicked), win);
gtk_container_add(GTK_CONTAINER(buttonbox), priv -> close_btn);
gtk_container_add(GTK_CONTAINER(buttonbox), priv -> send_btn);
- gtk_box_pack_start(GTK_BOX(priv -> body_vbox), buttonbox, FALSE, FALSE, 3);
+ gtk_box_pack_start(GTK_BOX(priv -> body_vbox), buttonbox, FALSE, FALSE, 3);
GtkWidget *w = GTK_WIDGET(win);
gtk_window_resize(GTK_WINDOW(w), 500, 450);
@@ -279,17 +279,17 @@ static void qq_chatwindow_init(QQChatWindow *win)
/*
* The getter.
*/
-static void qq_chatwindow_getter(GObject *object, guint property_id,
+static void qq_chatwindow_getter(GObject *object, guint property_id,
GValue *value, GParamSpec *pspec)
{
if(object == NULL || value == NULL || property_id < 0){
return;
}
-
+
QQChatWindowPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE(
object, qq_chatwindow_get_type()
, QQChatWindowPriv);
-
+
switch (property_id)
{
case QQ_CHATWINDOW_PROPERTY_UIN:
@@ -304,7 +304,7 @@ static void qq_chatwindow_getter(GObject *object, guint property_id,
/*
* The setter.
*/
-static void qq_chatwindow_setter(GObject *object, guint property_id,
+static void qq_chatwindow_setter(GObject *object, guint property_id,
const GValue *value, GParamSpec *pspec)
{
if(object == NULL || value == NULL || property_id < 0){
@@ -313,7 +313,7 @@ static void qq_chatwindow_setter(GObject *object, guint property_id,
QQChatWindowPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE(
object, qq_chatwindow_get_type()
, QQChatWindowPriv);
- gchar buf[500];
+ gchar buf[500];
GdkPixbuf *pb = NULL;
switch (property_id)
{
@@ -351,7 +351,7 @@ static void qq_chatwindow_setter(GObject *object, guint property_id,
name = bdy -> markname -> str;
}
// set status and name
- if(g_strcmp0("online", bdy -> status -> str) == 0
+ if(g_strcmp0("online", bdy -> status -> str) == 0
|| g_strcmp0("away", bdy -> status -> str) == 0
|| g_strcmp0("busy", bdy -> status -> str) == 0
|| g_strcmp0("silent", bdy -> status -> str) == 0
@@ -3,12 +3,12 @@
#include <gtk/gtk.h>
#include <qq.h>
-#define QQ_CHATWINDOW(obj) GTK_CHECK_CAST(obj, qq_chatwindow_get_type()\
+#define QQ_CHATWINDOW(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, qq_chatwindow_get_type()\
, QQChatWindow)
-#define QQ_CHATWINDOWCLASS(c) GTK_CHECK_CLASS_CAST(c\
+#define QQ_CHATWINDOWCLASS(c) G_TYPE_CHECK_CLASS_CAST(c\
, qq_chatwindow_get_type()\
, QQChatWindowClass)
-#define QQ_IS_CHATWINDOW(obj) GTK_CHECK_TYPE(obj, qq_chatwindow_get_type())
+#define QQ_IS_CHATWINDOW(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, qq_chatwindow_get_type())
typedef struct __QQChatWindow QQChatWindow;
typedef struct __QQChatWindowClass QQChatWindowClass;
@@ -116,7 +116,7 @@ static void qq_face_popup_window_init(QQFacePopupWindow *win)
gtk_window_set_skip_taskbar_hint(GTK_WINDOW(win), TRUE);
g_signal_connect(win, "focus-out-event"
- , GTK_SIGNAL_FUNC(qq_face_popup_window_focus_out), win);
+ , G_CALLBACK(qq_face_popup_window_focus_out), win);
GtkWidget *table, *img, *eventbox, *frame;
gint i, j, k;
@@ -136,16 +136,16 @@ static void qq_face_popup_window_init(QQFacePopupWindow *win)
par -> face = face_transfer_table[k];
par -> win = GTK_WIDGET(win);
++k;
- g_signal_connect(eventbox , "button-release-event"
- , GTK_SIGNAL_FUNC(face_popup_window_clicked)
+ g_signal_connect(eventbox , "button-release-event"
+ , G_CALLBACK(face_popup_window_clicked)
, par);
frame = gtk_frame_new(NULL);
gtk_container_add(GTK_CONTAINER(frame), eventbox);
- g_signal_connect(eventbox , "enter-notify-event"
- , GTK_SIGNAL_FUNC(face_enter_notify_event)
+ g_signal_connect(eventbox , "enter-notify-event"
+ , G_CALLBACK(face_enter_notify_event)
, frame);
- g_signal_connect(eventbox , "leave-notify-event"
- , GTK_SIGNAL_FUNC(face_leave_notify_event)
+ g_signal_connect(eventbox , "leave-notify-event"
+ , G_CALLBACK(face_leave_notify_event)
, frame);
gtk_table_attach_defaults(GTK_TABLE(table), frame
, j, j + 1, i, i + 1);
@@ -171,9 +171,9 @@ static void qq_face_popup_windowclass_init(QQFacePopupWindowClass *klass)
//install the 'face-clicked' signal
klass -> face_clicked_default_handler = default_handler;
//void signal_handler(gpointer instance, gint face, gpointer data)
- klass -> face_clicked_signal_id =
+ klass -> face_clicked_signal_id =
g_signal_new("face-clicked"
- , G_TYPE_FROM_CLASS(klass)
+ , G_TYPE_FROM_CLASS(klass)
, G_SIGNAL_RUN_LAST //run after the default handler
, G_STRUCT_OFFSET(QQFacePopupWindowClass
, face_clicked_default_handler)
@@ -5,13 +5,13 @@
#include <qq.h>
#define QQ_TYPE_FACE_POPUP_WINDOW qq_face_popup_window_get_type()
-#define QQ_FACE_POPUP_WINDOW(obj) GTK_CHECK_CAST(obj\
+#define QQ_FACE_POPUP_WINDOW(obj) G_TYPE_CHECK_INSTANCE_CAST(obj\
, QQ_TYPE_FACE_POPUP_WINDOW\
, QQFacePopupWindow)
-#define QQ_FACE_POPUP_WINDOWCLASS(c) GTK_CHECK_CLASS_CAST(c\
+#define QQ_FACE_POPUP_WINDOWCLASS(c) G_TYPE_CHECK_CLASS_CAST(c\
, QQ_TYPE_FACE_POPUP_WINDOW\
, QQFacePopupWindowClass)
-#define QQ_IS_FACE_POPUP_WINDOW(obj) GTK_CHECK_TYPE(obj\
+#define QQ_IS_FACE_POPUP_WINDOW(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj\
, QQ_TYPE_FACE_POPUP_WINDOW)
typedef struct __QQFacePopupWindow QQFacePopupWindow;
Oops, something went wrong.

0 comments on commit 74f8acf

Please sign in to comment.