Skip to content
Browse files

* toys/mug: remove gtk2 compat code, small cleanups

  • Loading branch information...
1 parent 06e5559 commit 1abb497104ad177e47ebda899a1353e4191eb53d @djcb committed
View
13 toys/mug/mu-msg-header-view.c
@@ -45,21 +45,12 @@ struct _MuMsgHeaderViewPrivate {
MU_TYPE_MSG_HEADER_VIEW, \
MuMsgHeaderViewPrivate))
/* globals */
-#ifdef HAVE_GTK3
static GtkBoxClass *parent_class = NULL;
-#else
-static GtkVBoxClass *parent_class = NULL;
-#endif /*!HAVE_GTK3*/
-
/* uncomment the following if you have defined any signals */
/* static guint signals[LAST_SIGNAL] = {0}; */
-#ifdef HAVE_GTK3
G_DEFINE_TYPE (MuMsgHeaderView, mu_msg_header_view, GTK_TYPE_BOX);
-#else
-G_DEFINE_TYPE (MuMsgHeaderView, mu_msg_header_view, GTK_TYPE_VBOX);
-#endif /*!HAVE_GTK3*/
static void
@@ -85,11 +76,7 @@ static void
mu_msg_header_view_init (MuMsgHeaderView *obj)
{
-/* #ifdef HAVE_GTK3 */
/* static GtkBoxClass *parent_class = NULL; */
-/* #endif /\*!HAVE_GTK3*\/ */
-
-
obj->_priv = MU_MSG_HEADER_VIEW_GET_PRIVATE(obj);
obj->_priv->_grid = NULL;
}
View
10 toys/mug/mu-msg-header-view.h
@@ -42,24 +42,14 @@ typedef struct _MuMsgHeaderViewClass MuMsgHeaderViewClass;
typedef struct _MuMsgHeaderViewPrivate MuMsgHeaderViewPrivate;
struct _MuMsgHeaderView {
-#ifdef HAVE_GTK3
GtkBox parent;
-#else
- GtkVBox parent;
-#endif /*!HAVE_GTK3*/
-
/* insert public members, if any */
-
/* private */
MuMsgHeaderViewPrivate *_priv;
};
struct _MuMsgHeaderViewClass {
-#ifdef HAVE_GTK3
GtkBoxClass parent_class;
-#else
- GtkVBoxClass parent_class;
-#endif /*!HAVE_GTK3*/
/* insert signal callback declarations, e.g. */
/* void (* my_event) (MuMsgHeaderView* obj); */
};
View
18 toys/mug/mu-msg-view.c
@@ -48,24 +48,12 @@ struct _MuMsgViewPrivate {
MU_TYPE_MSG_VIEW, \
MuMsgViewPrivate))
/* globals */
-#ifdef HAVE_GTK3
static GtkBoxClass *parent_class = NULL;
-#else
-static GtkVBoxClass *parent_class = NULL;
-#endif /*!HAVE_GTK3*/
-
/* uncomment the following if you have defined any signals */
/* static guint signals[LAST_SIGNAL] = {0}; */
-#ifdef HAVE_GTK3
G_DEFINE_TYPE (MuMsgView, mu_msg_view, GTK_TYPE_BOX);
-#else
-G_DEFINE_TYPE (MuMsgView, mu_msg_view, GTK_TYPE_VBOX);
-#endif /*HAVE_GTK3*/
-
-
-
static void
set_message (MuMsgView *self, MuMsg *msg)
@@ -154,12 +142,12 @@ on_attach_activated (GtkWidget *w, guint partnum, MuMsg *msg)
static void
mu_msg_view_init (MuMsgView *self)
{
- self->_priv = MU_MSG_VIEW_GET_PRIVATE(self);
+ gtk_orientable_set_orientation (GTK_ORIENTABLE(self),
+ GTK_ORIENTATION_VERTICAL);
+ self->_priv = MU_MSG_VIEW_GET_PRIVATE(self);
self->_priv->_msg = NULL;
-
self->_priv->_headers = mu_msg_header_view_new ();
-
self->_priv->_attach = mu_msg_attach_view_new ();
self->_priv->_attachexpander = gtk_expander_new_with_mnemonic
("_Attachments");
View
9 toys/mug/mu-msg-view.h
@@ -42,22 +42,13 @@ typedef struct _MuMsgViewClass MuMsgViewClass;
typedef struct _MuMsgViewPrivate MuMsgViewPrivate;
struct _MuMsgView {
-#ifdef HAVE_GTK3
GtkBox parent;
-#else
- GtkVBox parent;
-#endif /*!HAVE_GTK3*/
-
/* private */
MuMsgViewPrivate *_priv;
};
struct _MuMsgViewClass {
-#ifdef HAVE_GTK3
GtkBoxClass parent_class;
-#else
- GtkVBoxClass parent_class;
-#endif /*!HAVE_GTK3*/
/* void (* my_event) (MuMsgView* obj); */
};
View
5 toys/mug/mug-msg-view.c
@@ -46,13 +46,8 @@ struct _MugMsgViewPrivate {
#define MUG_MSG_VIEW_GET_PRIVATE(o)(G_TYPE_INSTANCE_GET_PRIVATE((o),MUG_TYPE_MSG_VIEW, MugMsgViewPrivate))
/* globals */
-#ifdef HAVE_GTK3
static GtkBoxClass *parent_class = NULL;
G_DEFINE_TYPE (MugMsgView, mug_msg_view, GTK_TYPE_BOX);
-#else
-static GtkVBoxClass *parent_class = NULL;
-G_DEFINE_TYPE (MugMsgView, mug_msg_view, GTK_TYPE_VBOX);
-#endif /*!HAVE_GTK3*/
/* uncomment the following if you have defined any signals */
/* static guint signals[LAST_SIGNAL] = {0}; */
View
17 toys/mug/mug-msg-view.h
@@ -1,5 +1,5 @@
/*
-** Copyright (C) 2010 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
+** Copyright (C) 2010-2013 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
**
** 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
@@ -23,9 +23,6 @@
#include <gtk/gtk.h>
/* other include files */
-
-
-
G_BEGIN_DECLS
/* convenience macros */
#define MUG_TYPE_MSG_VIEW (mug_msg_view_get_type())
@@ -38,20 +35,11 @@ typedef struct _MugMsgView MugMsgView;
typedef struct _MugMsgViewClass MugMsgViewClass;
struct _MugMsgView {
-#ifdef HAVE_GTK3
GtkBox parent;
-#else
- GtkVBox parent;
-#endif /*!HAVE_GTK3*/
};
struct _MugMsgViewClass {
-#ifdef HAVE_GTK3
GtkBoxClass parent_class;
-#else
- GtkVBoxClass parent_class;
-#endif /*!HAVE_GTK3*/
-
/* insert signal callback declarations, e.g. */
/* void (* my_event) (MugMsg* obj); */
};
@@ -66,4 +54,5 @@ gboolean mug_msg_view_set_msg (MugMsgView * self, const char *msgpath);
void mug_msg_view_set_note (MugMsgView * self, const char* html);
G_END_DECLS
-#endif /* __MUG_MSG_VIEW_H__ */
+
+#endif /* __MUG_MSG_VIEW_H__ */
View
6 toys/mug/mug-query-bar.c
@@ -29,13 +29,7 @@ static GtkContainerClass *parent_class = NULL;
static guint signals[LAST_SIGNAL] = { 0 };
-
-#ifdef HAVE_GTK3
G_DEFINE_TYPE (MugQueryBar, mug_query_bar, GTK_TYPE_BOX);
-#else
-G_DEFINE_TYPE (MugQueryBar, mug_query_bar, GTK_TYPE_HBOX);
-#endif /*!HAVE_GTK3*/
-
static void
mug_query_bar_class_init (MugQueryBarClass * klass)
View
10 toys/mug/mug-query-bar.h
@@ -22,22 +22,12 @@ typedef struct _MugQueryBar MugQueryBar;
typedef struct _MugQueryBarClass MugQueryBarClass;
struct _MugQueryBar {
-#ifdef HAVE_GTK3
GtkBox parent;
-#else
- GtkHBox parent;
-#endif /*!HAVE_GTK3*/
};
struct _MugQueryBarClass {
-#ifdef HAVE_GTK3
GtkBox parent;
GtkBoxClass parent_class;
-#else
- GtkHBox parent;
- GtkHBoxClass parent_class;
-#endif /*!HAVE_GTK3*/
-
/* insert signal callback declarations, e.g. */
void (*query_changed) (MugQueryBar * obj, const char *query);
};
View
10 toys/mug/mug-shortcuts.c
@@ -49,13 +49,8 @@ struct _MugShortcutsPrivate {
static guint signals[LAST_SIGNAL] = { 0 };
-#ifdef HAVE_GTK3
static GtkBoxClass *parent_class = NULL;
G_DEFINE_TYPE (MugShortcuts, mug_shortcuts, GTK_TYPE_BOX);
-#else
-static GtkVBoxClass *parent_class = NULL;
-G_DEFINE_TYPE (MugShortcuts, mug_shortcuts, GTK_TYPE_VBOX);
-#endif /*!HAVE_GTK3*/
static void
mug_shortcuts_class_init (MugShortcutsClass * klass)
@@ -87,12 +82,7 @@ static void
mug_shortcuts_init (MugShortcuts * obj)
{
obj->_priv = MUG_SHORTCUTS_GET_PRIVATE (obj);
-
-#ifdef HAVE_GTK3
obj->_priv->_bbox = gtk_button_box_new (GTK_ORIENTATION_VERTICAL);
-#else
- obj->_priv->_bbox = gtk_vbutton_box_new ();
-#endif /*!HAVE_GTK3*/
gtk_button_box_set_layout (GTK_BUTTON_BOX (obj->_priv->_bbox),
GTK_BUTTONBOX_START);
View
17 toys/mug/mug-shortcuts.h
@@ -41,30 +41,18 @@ typedef struct _MugShortcutsClass MugShortcutsClass;
typedef struct _MugShortcutsPrivate MugShortcutsPrivate;
struct _MugShortcuts {
-#ifdef HAVE_GTK3
GtkBox parent;
-#else
- GtkVBox parent;
-#endif /*!HAVE_GTK3*/
-
/* private */
MugShortcutsPrivate *_priv;
};
struct _MugShortcutsClass {
-#ifdef HAVE_GTK3
GtkBoxClass parent_class;
-#else
- GtkVBoxClass parent_class;
-#endif /*!HAVE_GTK3*/
-
void (*clicked) (MugShortcuts * obj, const char *query);
};
/* member functions */
-GType
-mug_shortcuts_get_type (void)
- G_GNUC_CONST;
+GType mug_shortcuts_get_type (void) G_GNUC_CONST;
/* parameter-less _new function (constructor) */
/* if this is a kind of GtkWidget, it should probably return at GtkWidget* */
@@ -76,4 +64,5 @@ mug_shortcuts_new (const char *bmpath);
/* gboolean mug_shortcuts_has_foo (MugShortcuts *self, gint value); */
G_END_DECLS
-#endif /* __MUG_SHORTCUTS_H__ */
+
+#endif /* __MUG_SHORTCUTS_H__ */

0 comments on commit 1abb497

Please sign in to comment.
Something went wrong with that request. Please try again.