diff --git a/gtk/Jamfile b/gtk/Jamfile index 1439ed043..59269f8e3 100644 --- a/gtk/Jamfile +++ b/gtk/Jamfile @@ -1,6 +1,6 @@ SubDir TOP gtk ; -GTK_SRC = conf.c main.c prefs.c util.c gtkcellrenderertorrent.c ; +GTK_SRC = conf.c dialogs.c main.c trcellrenderertorrent.c util.c ; Main transmission-gtk : $(GTK_SRC) ; LinkLibraries transmission-gtk : libtransmission.a ; diff --git a/gtk/prefs.c b/gtk/dialogs.c similarity index 99% rename from gtk/prefs.c rename to gtk/dialogs.c index f8a438087..1f3e21029 100644 --- a/gtk/prefs.c +++ b/gtk/dialogs.c @@ -32,7 +32,7 @@ #include #include "conf.h" -#include "prefs.h" +#include "dialogs.h" #include "transmission.h" #include "util.h" diff --git a/gtk/prefs.h b/gtk/dialogs.h similarity index 100% rename from gtk/prefs.h rename to gtk/dialogs.h diff --git a/gtk/main.c b/gtk/main.c index 30f3755b8..e04159f80 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -36,9 +36,9 @@ #include #include "conf.h" -#include "gtkcellrenderertorrent.h" -#include "prefs.h" +#include "dialogs.h" #include "transmission.h" +#include "trcellrenderertorrent.h" #include "util.h" #define TRACKER_EXIT_TIMEOUT 5 @@ -466,7 +466,7 @@ makewind_list(struct cbdata *data) { gtk_tree_view_column_set_expand(col, TRUE); gtk_tree_view_append_column(GTK_TREE_VIEW(view), col); - progrend = gtk_cell_renderer_torrent_new(); + progrend = tr_cell_renderer_torrent_new(); g_object_set(progrend, "label", " fnord fnord ", NULL); col = gtk_tree_view_column_new_with_attributes("Progress", progrend, NULL); gtk_tree_view_column_set_cell_data_func(col, progrend, dfprog, NULL, NULL); @@ -493,7 +493,7 @@ makewind_list(struct cbdata *data) { static void stylekludge(GObject *obj, GParamSpec *spec, gpointer gdata) { if(0 == strcmp("style", spec->name)) { - gtk_cell_renderer_torrent_reset_style(GTK_CELL_RENDERER_TORRENT(gdata)); + tr_cell_renderer_torrent_reset_style(TR_CELL_RENDERER_TORRENT(gdata)); gtk_widget_queue_draw(GTK_WIDGET(obj)); } } diff --git a/gtk/gtkcellrenderertorrent.c b/gtk/trcellrenderertorrent.c similarity index 90% rename from gtk/gtkcellrenderertorrent.c rename to gtk/trcellrenderertorrent.c index 2b776a0ed..c2ce72b42 100644 --- a/gtk/gtkcellrenderertorrent.c +++ b/gtk/trcellrenderertorrent.c @@ -1,4 +1,4 @@ -/* gtkcellrenderertorrent.c +/* trcellrenderertorrent.c * Copyright (C) 2002 Naba Kumar * heavily modified by Jörgen Scheibengruber * heavily modified by Marco Pesenti Gritti @@ -28,12 +28,12 @@ #include -#include "gtkcellrenderertorrent.h" +#include "trcellrenderertorrent.h" #include "util.h" enum { PROP_0, PROP_VALUE, PROP_TEXT, PROP_LABEL }; -struct _GtkCellRendererTorrentPrivate { +struct _TrCellRendererTorrentPrivate { gfloat value; gchar *text; PangoAttrList *text_attrs; @@ -56,10 +56,10 @@ render(GtkCellRenderer *cell, GdkWindow *window, GtkWidget *widget, GdkRectangle *bg, GdkRectangle *area, GdkRectangle *exp, guint flags); -G_DEFINE_TYPE(GtkCellRendererTorrent, gtk_cell_renderer_torrent, GTK_TYPE_CELL_RENDERER); +G_DEFINE_TYPE(TrCellRendererTorrent, tr_cell_renderer_torrent, GTK_TYPE_CELL_RENDERER); static void -gtk_cell_renderer_torrent_class_init (GtkCellRendererTorrentClass *klass) { +tr_cell_renderer_torrent_class_init (TrCellRendererTorrentClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS (klass); @@ -87,13 +87,13 @@ gtk_cell_renderer_torrent_class_init (GtkCellRendererTorrentClass *klass) { NULL, G_PARAM_READWRITE)); g_type_class_add_private (object_class, - sizeof (GtkCellRendererTorrentPrivate)); + sizeof (TrCellRendererTorrentPrivate)); } static void -gtk_cell_renderer_torrent_init(GtkCellRendererTorrent *tcell) { +tr_cell_renderer_torrent_init(TrCellRendererTorrent *tcell) { tcell->priv = G_TYPE_INSTANCE_GET_PRIVATE( - tcell, GTK_TYPE_CELL_RENDERER_TORRENT, GtkCellRendererTorrentPrivate); + tcell, GTK_TYPE_CELL_RENDERER_TORRENT, TrCellRendererTorrentPrivate); tcell->priv->value = 0.0; tcell->priv->text = g_strdup(""); tcell->priv->text_attrs = NULL; @@ -103,13 +103,13 @@ gtk_cell_renderer_torrent_init(GtkCellRendererTorrent *tcell) { } GtkCellRenderer* -gtk_cell_renderer_torrent_new(void) { +tr_cell_renderer_torrent_new(void) { return g_object_new (GTK_TYPE_CELL_RENDERER_TORRENT, NULL); } /* XXX need to do this better somehow */ void -gtk_cell_renderer_torrent_reset_style(GtkCellRendererTorrent *tor) { +tr_cell_renderer_torrent_reset_style(TrCellRendererTorrent *tor) { if(NULL != tor->priv->style) { gtk_style_detach(tor->priv->style); gtk_style_unref(tor->priv->style); @@ -119,7 +119,7 @@ gtk_cell_renderer_torrent_reset_style(GtkCellRendererTorrent *tor) { static void finalize(GObject *object) { - GtkCellRendererTorrent *tcell = GTK_CELL_RENDERER_TORRENT(object); + TrCellRendererTorrent *tcell = TR_CELL_RENDERER_TORRENT(object); g_free(tcell->priv->text); g_free(tcell->priv->label); @@ -133,12 +133,12 @@ finalize(GObject *object) { gtk_style_unref(tcell->priv->style); } - G_OBJECT_CLASS (gtk_cell_renderer_torrent_parent_class)->finalize(object); + G_OBJECT_CLASS (tr_cell_renderer_torrent_parent_class)->finalize(object); } static void get_property(GObject *object, guint id, GValue *value, GParamSpec *pspec) { - GtkCellRendererTorrent *tcell = GTK_CELL_RENDERER_TORRENT (object); + TrCellRendererTorrent *tcell = TR_CELL_RENDERER_TORRENT (object); switch (id) { case PROP_VALUE: @@ -157,7 +157,7 @@ get_property(GObject *object, guint id, GValue *value, GParamSpec *pspec) { static void set_property(GObject *obj, guint id, const GValue *value, GParamSpec *spec) { - GtkCellRendererTorrent *tcell = GTK_CELL_RENDERER_TORRENT(obj); + TrCellRendererTorrent *tcell = TR_CELL_RENDERER_TORRENT(obj); gchar **prop = NULL; PangoAttrList **attrs = NULL; /*GError *err = NULL;*/ @@ -205,7 +205,7 @@ set_property(GObject *obj, guint id, const GValue *value, GParamSpec *spec) { static void get_size(GtkCellRenderer *cell, GtkWidget *widget, GdkRectangle *area, gint *xoff, gint *yoff, gint *width, gint *height) { - GtkCellRendererTorrent *tcell = GTK_CELL_RENDERER_TORRENT(cell); + TrCellRendererTorrent *tcell = TR_CELL_RENDERER_TORRENT(cell); /* XXX do I have to unref the context? */ PangoLayout *layout = pango_layout_new(gtk_widget_get_pango_context(widget)); PangoRectangle rect; @@ -240,7 +240,7 @@ static void render(GtkCellRenderer *cell, GdkWindow *window, GtkWidget *widget, GdkRectangle *bg SHUTUP, GdkRectangle *area, GdkRectangle *exp SHUTUP, guint flags) { - GtkCellRendererTorrent *tcell = GTK_CELL_RENDERER_TORRENT(cell); + TrCellRendererTorrent *tcell = TR_CELL_RENDERER_TORRENT(cell); PangoContext *ctx = gtk_widget_get_pango_context(widget); PangoLayout *llayout, *tlayout; PangoRectangle lrect, trect; diff --git a/gtk/gtkcellrenderertorrent.h b/gtk/trcellrenderertorrent.h similarity index 58% rename from gtk/gtkcellrenderertorrent.h rename to gtk/trcellrenderertorrent.h index d905a38d6..dffad3160 100644 --- a/gtk/gtkcellrenderertorrent.h +++ b/gtk/trcellrenderertorrent.h @@ -1,4 +1,4 @@ -/* gtkcellrenderertorrent.h +/* trcellrenderertorrent.h * Copyright (C) 2002 Naba Kumar * modified by Jörgen Scheibengruber * @@ -24,33 +24,33 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#ifndef __GTK_CELL_RENDERER_TORRENT_H__ -#define __GTK_CELL_RENDERER_TORRENT_H__ +#ifndef __TR_CELL_RENDERER_TORRENT_H__ +#define __TR_CELL_RENDERER_TORRENT_H__ #include G_BEGIN_DECLS -#define GTK_TYPE_CELL_RENDERER_TORRENT (gtk_cell_renderer_torrent_get_type ()) -#define GTK_CELL_RENDERER_TORRENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CELL_RENDERER_TORRENT, GtkCellRendererTorrent)) -#define GTK_CELL_RENDERER_TORRENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CELL_RENDERER_TORRENT, GtkCellRendererTorrentClass)) +#define GTK_TYPE_CELL_RENDERER_TORRENT (tr_cell_renderer_torrent_get_type ()) +#define TR_CELL_RENDERER_TORRENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CELL_RENDERER_TORRENT, TrCellRendererTorrent)) +#define TR_CELL_RENDERER_TORRENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CELL_RENDERER_TORRENT, TrCellRendererTorrentClass)) #define GTK_IS_CELL_RENDERER_TORRENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CELL_RENDERER_TORRENT)) #define GTK_IS_CELL_RENDERER_TORRENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CELL_RENDERER_TORRENT)) -#define GTK_CELL_RENDERER_TORRENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CELL_RENDERER_TORRENT, GtkCellRendererTorrentClass)) +#define TR_CELL_RENDERER_TORRENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CELL_RENDERER_TORRENT, TrCellRendererTorrentClass)) -typedef struct _GtkCellRendererTorrent GtkCellRendererTorrent; -typedef struct _GtkCellRendererTorrentClass GtkCellRendererTorrentClass; -typedef struct _GtkCellRendererTorrentPrivate GtkCellRendererTorrentPrivate; +typedef struct _TrCellRendererTorrent TrCellRendererTorrent; +typedef struct _TrCellRendererTorrentClass TrCellRendererTorrentClass; +typedef struct _TrCellRendererTorrentPrivate TrCellRendererTorrentPrivate; -struct _GtkCellRendererTorrent +struct _TrCellRendererTorrent { GtkCellRenderer parent_instance; /*< private >*/ - GtkCellRendererTorrentPrivate *priv; + TrCellRendererTorrentPrivate *priv; }; -struct _GtkCellRendererTorrentClass +struct _TrCellRendererTorrentClass { GtkCellRendererClass parent_class; @@ -61,10 +61,10 @@ struct _GtkCellRendererTorrentClass void (*_gtk_reserved4) (void); }; -GType gtk_cell_renderer_torrent_get_type (void) G_GNUC_CONST; -GtkCellRenderer* gtk_cell_renderer_torrent_new (void); -void gtk_cell_renderer_torrent_reset_style(GtkCellRendererTorrent *); +GType tr_cell_renderer_torrent_get_type (void) G_GNUC_CONST; +GtkCellRenderer* tr_cell_renderer_torrent_new (void); +void tr_cell_renderer_torrent_reset_style(TrCellRendererTorrent *); G_END_DECLS -#endif /* __GTK_CELL_RENDERER_TORRENT_H__ */ +#endif /* __TR_CELL_RENDERER_TORRENT_H__ */