gtkdatabox_cross_simple.c (gtkdatabox-0.9.3.1) | : | gtkdatabox_cross_simple.c (gtkdatabox-1.0.0) | ||
---|---|---|---|---|
skipping to change at line 17 | skipping to change at line 17 | |||
* as published by the Free Software Foundation; either version 2.1 | * as published by the Free Software Foundation; either version 2.1 | |||
* of the License, or (at your option) any later version. | * of the License, or (at your option) any later version. | |||
* | * | |||
* This program is distributed in the hope that it will be useful, | * This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU Lesser General Public License for more details. | * GNU Lesser General Public License for more details. | |||
* | * | |||
* You should have received a copy of the GNU General Public License | * You should have received a copy of the GNU General Public License | |||
* along with this program; if not, write to the Free Software | * along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |||
*/ | */ | |||
#include <gtkdatabox_cross_simple.h> | #include <gtkdatabox_cross_simple.h> | |||
G_DEFINE_TYPE(GtkDataboxCrossSimple, gtk_databox_cross_simple, | G_DEFINE_TYPE(GtkDataboxCrossSimple, gtk_databox_cross_simple, | |||
GTK_DATABOX_TYPE_MARKERS) | GTK_DATABOX_TYPE_MARKERS) | |||
static void | static void | |||
cross_simple_finalize (GObject * object) | cross_simple_finalize (GObject * object) | |||
{ | { | |||
skipping to change at line 50 | skipping to change at line 50 | |||
} | } | |||
static void | static void | |||
gtk_databox_cross_simple_class_init (GtkDataboxCrossSimpleClass *klass) | gtk_databox_cross_simple_class_init (GtkDataboxCrossSimpleClass *klass) | |||
{ | { | |||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass); | GObjectClass *gobject_class = G_OBJECT_CLASS (klass); | |||
gobject_class->finalize = cross_simple_finalize; | gobject_class->finalize = cross_simple_finalize; | |||
} | } | |||
static void gtk_databox_cross_simple_init(GtkDataboxCrossSimple *cross __attribu | static void gtk_databox_cross_simple_init(GtkDataboxCrossSimple *cross) | |||
te__((unused))) {} | { | |||
if (cross == NULL) g_warning ("cross_simple_init with NULL"); | ||||
} | ||||
/** | /** | |||
* gtk_databox_cross_simple_new: | * gtk_databox_cross_simple_new: | |||
* @color: color of the markers | * @color: color of the markers | |||
* @size: marker size or line width (depending on the @type) | * @size: marker size or line width (depending on the @type) | |||
* | * | |||
* Creates a new #GtkDataboxCrossSimple object which can be added to a #GtkDatab ox widget as nice decoration for other graphs. | * Creates a new #GtkDataboxCrossSimple object which can be added to a #GtkDatab ox widget as nice decoration for other graphs. | |||
* | * | |||
* Return value: A new #GtkDataboxCrossSimple object | * Return value: A new #GtkDataboxCrossSimple object | |||
**/ | **/ | |||
GtkDataboxGraph * | GtkDataboxGraph * | |||
gtk_databox_cross_simple_new (GdkColor * color, guint size) | gtk_databox_cross_simple_new (GdkRGBA * color, guint size) | |||
{ | { | |||
GtkDataboxCrossSimple *cross_simple; | GtkDataboxCrossSimple *cross_simple; | |||
gfloat *X = g_new0 (gfloat, 2); | gfloat *X = g_new0 (gfloat, 2); | |||
gfloat *Y = g_new0 (gfloat, 2); | gfloat *Y = g_new0 (gfloat, 2); | |||
gint len = 2; | gint len = 2; | |||
cross_simple = g_object_new (GTK_DATABOX_TYPE_CROSS_SIMPLE, | cross_simple = g_object_new (GTK_DATABOX_TYPE_CROSS_SIMPLE, | |||
"markers-type", GTK_DATABOX_MARKERS_SOLID_LINE, | "markers-type", GTK_DATABOX_MARKERS_SOLID_LINE, | |||
"X-Values", X, | "X-Values", X, | |||
"Y-Values", Y, | "Y-Values", Y, | |||
"xstart", 0, | ||||
"ystart", 0, | ||||
"xstride", 1, | ||||
"ystride", 1, | ||||
"xtype", G_TYPE_FLOAT, | ||||
"ytype", G_TYPE_FLOAT, | ||||
"length", len, | "length", len, | |||
"maxlen", len, | ||||
"color", color, "size", size, NULL); | "color", color, "size", size, NULL); | |||
gtk_databox_markers_set_position (GTK_DATABOX_MARKERS (cross_simple), 0, | gtk_databox_markers_set_position (GTK_DATABOX_MARKERS (cross_simple), 0, | |||
GTK_DATABOX_MARKERS_C); | GTK_DATABOX_MARKERS_C); | |||
gtk_databox_markers_set_label (GTK_DATABOX_MARKERS (cross_simple), 0, | gtk_databox_markers_set_label (GTK_DATABOX_MARKERS (cross_simple), 0, | |||
GTK_DATABOX_MARKERS_TEXT_SW, "0", FALSE); | GTK_DATABOX_MARKERS_TEXT_SW, "0", FALSE); | |||
gtk_databox_markers_set_position (GTK_DATABOX_MARKERS (cross_simple), 1, | gtk_databox_markers_set_position (GTK_DATABOX_MARKERS (cross_simple), 1, | |||
GTK_DATABOX_MARKERS_W); | GTK_DATABOX_MARKERS_W); | |||
return GTK_DATABOX_GRAPH (cross_simple); | return GTK_DATABOX_GRAPH (cross_simple); | |||
End of changes. 5 change blocks. | ||||
4 lines changed or deleted | 13 lines changed or added |