gnome-power-manager r3051 - in trunk: . src



Author: rhughes
Date: Mon Nov  3 17:06:00 2008
New Revision: 3051
URL: http://svn.gnome.org/viewvc/gnome-power-manager?rev=3051&view=rev

Log:
2008-11-03  Richard Hughes  <richard hughsie com>

* src/gpm-point-obj.c: (dkp_point_obj_copy), (dkp_point_obj_new),
(dkp_point_obj_free):
* src/gpm-point-obj.h:
Add a sinple structure of a point object.


Added:
   trunk/src/gpm-point-obj.c
   trunk/src/gpm-point-obj.h
Modified:
   trunk/ChangeLog

Added: trunk/src/gpm-point-obj.c
==============================================================================
--- (empty file)
+++ trunk/src/gpm-point-obj.c	Mon Nov  3 17:06:00 2008
@@ -0,0 +1,64 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2008 Richard Hughes <richard hughsie com>
+ *
+ * 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 Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#include <glib.h>
+
+#include "egg-debug.h"
+#include "gpm-point-obj.h"
+
+/**
+ * dkp_point_obj_copy:
+ **/
+GpmPointObj *
+dkp_point_obj_copy (const GpmPointObj *cobj)
+{
+	GpmPointObj *obj;
+	obj = g_new0 (GpmPointObj, 1);
+	obj->x = cobj->x;
+	obj->y = cobj->y;
+	obj->color = cobj->color;
+	return obj;
+}
+
+/**
+ * dkp_point_obj_new:
+ **/
+GpmPointObj *
+dkp_point_obj_new (void)
+{
+	GpmPointObj *obj;
+	obj = g_new0 (GpmPointObj, 1);
+	obj->x = 0.0f;
+	obj->y = 0.0f;
+	obj->color = 0x0;
+	return obj;
+}
+
+/**
+ * dkp_point_obj_free:
+ **/
+void
+dkp_point_obj_free (GpmPointObj *obj)
+{
+	if (obj == NULL)
+		return;
+	g_free (obj);
+}
+

Added: trunk/src/gpm-point-obj.h
==============================================================================
--- (empty file)
+++ trunk/src/gpm-point-obj.h	Mon Nov  3 17:06:00 2008
@@ -0,0 +1,42 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2008 Richard Hughes <richard hughsie com>
+ *
+ * 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 Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#ifndef __GPM_POINT_OBJ_H__
+#define __GPM_POINT_OBJ_H__
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+typedef struct
+{
+	gfloat		 x;
+	gfloat		 y;
+	guint32		 color;
+} GpmPointObj;
+
+GpmPointObj	*dkp_point_obj_new		(void);
+GpmPointObj	*dkp_point_obj_copy		(const GpmPointObj	*cobj);
+void		 dkp_point_obj_free		(GpmPointObj		*obj);
+
+G_END_DECLS
+
+#endif /* __GPM_POINT_OBJ_H__ */
+



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]