annotate src/gtkticker.h @ 1522:31c0850f9340

[gaim-migrate @ 1532] this should fix a segfault or two committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Thu, 01 Mar 2001 10:05:18 +0000
parents c61f9c384413
children 6190f75950ff
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
1 /* GTK - The GIMP Toolkit
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
3 *
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
4 * This library is free software; you can redistribute it and/or
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
5 * modify it under the terms of the GNU Library General Public
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
6 * License as published by the Free Software Foundation; either
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
7 * version 2 of the License, or (at your option) any later version.
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
8 *
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
9 * This library is distributed in the hope that it will be useful,
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
12 * Library General Public License for more details.
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
13 *
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
14 * You should have received a copy of the GNU Library General Public
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
15 * License along with this library; if not, write to the
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
17 * Boston, MA 02111-1307, USA.
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
18 */
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
19
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
20 /*
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
21 * Copyright 2000 Syd Logan
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
22 */
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
23
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
24 #ifndef __GTK_TICKER_H__
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
25 #define __GTK_TICKER_H__
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
26
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
27
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
28 #include <gdk/gdk.h>
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
29 #include <gtk/gtkcontainer.h>
1114
c61f9c384413 [gaim-migrate @ 1124]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 430
diff changeset
30 #include <gtk/gtkmain.h>
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
31
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
32
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
33 #ifdef __cplusplus
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
34 extern "C" {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
35 #endif /* __cplusplus */
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
36
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
37 #define GTK_TYPE_TICKER (gtk_ticker_get_type ())
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
38 #define GTK_TICKER(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_TICKER, GtkTicker))
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
39 #define GTK_TICKER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_TICKER, GtkTickerClass))
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
40 #define GTK_IS_TICKER(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_TICKER))
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
41 #define GTK_IS_TICKER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TICKER))
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
42
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
43
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
44 typedef struct _GtkTicker GtkTicker;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
45 typedef struct _GtkTickerClass GtkTickerClass;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
46 typedef struct _GtkTickerChild GtkTickerChild;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
47
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
48 // XXX children move from right to left, should be able to go other way
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
49
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
50 struct _GtkTicker
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
51 {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
52 GtkContainer container;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
53 guint interval; // how often to scootch
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
54 guint spacing; // inter-child horizontal spacing
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
55 guint scootch; // how many pixels to move each scootch
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
56 gint timer; // timer object
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
57 guint total; // total width of widgets
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
58 guint width; // width of containing window
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
59 gboolean dirty;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
60 GList *children;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
61 };
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
62
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
63 struct _GtkTickerClass
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
64 {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
65 GtkContainerClass parent_class;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
66 };
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
67
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
68 struct _GtkTickerChild
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
69 {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
70 GtkWidget *widget;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
71 gint x; // current position
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
72 gint offset; // offset in list
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
73 };
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
74
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
75
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
76 GtkType gtk_ticker_get_type (void);
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
77 GtkWidget* gtk_ticker_new (void);
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
78 void gtk_ticker_add (GtkTicker *ticker,
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
79 GtkWidget *widget);
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
80 void gtk_ticker_remove (GtkTicker *ticker,
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
81 GtkWidget *widget);
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
82 void gtk_ticker_set_interval (GtkTicker *ticker,
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
83 gint interval);
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
84 guint gtk_ticker_get_interval (GtkTicker *ticker);
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
85 void gtk_ticker_set_spacing (GtkTicker *ticker,
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
86 gint spacing);
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
87 guint gtk_ticker_get_spacing (GtkTicker *ticker);
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
88 void gtk_ticker_set_scootch (GtkTicker *ticker,
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
89 gint scootch);
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
90 guint gtk_ticker_get_scootch (GtkTicker *ticker);
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
91 void gtk_ticker_start_scroll (GtkTicker *ticker);
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
92 void gtk_ticker_stop_scroll (GtkTicker *ticker);
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
93
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
94 #ifdef __cplusplus
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
95 }
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
96 #endif /* __cplusplus */
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
97
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
98
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
99 #endif /* __GTK_TICKER_H__ */