princeamd pushed a commit to branch enlightenment-0.17.
commit 652db147cac372b66be9e698ad77bb4a574e6fce
Author: Christopher Michael <[email protected]>
Date: Tue Feb 19 10:55:04 2013 +0000
Backport: fbb5bae :: Initial rewrite of randr widget.
Signed-off-by: Christopher Michael <[email protected]>
SVN revision: 84116
Signed-off-by: Deon Thomas <[email protected]>
---
src/modules/conf_randr/e_smart_randr.c | 139 +++++++++++++++++++++++++++++++++
src/modules/conf_randr/e_smart_randr.h | 9 +++
2 files changed, 148 insertions(+)
diff --git a/src/modules/conf_randr/e_smart_randr.c
b/src/modules/conf_randr/e_smart_randr.c
new file mode 100644
index 0000000..64d269a
--- /dev/null
+++ b/src/modules/conf_randr/e_smart_randr.c
@@ -0,0 +1,139 @@
+#include "e.h"
+#include "e_mod_main.h"
+#include "e_smart_randr.h"
+
+/* local structures */
+typedef struct _E_Smart_Data E_Smart_Data;
+struct _E_Smart_Data
+{
+ /* visible flag */
+ Eina_Bool visible : 1;
+};
+
+/* local function prototypes */
+static void _e_smart_add(Evas_Object *obj);
+static void _e_smart_del(Evas_Object *obj);
+static void _e_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
+static void _e_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h);
+static void _e_smart_show(Evas_Object *obj);
+static void _e_smart_hide(Evas_Object *obj);
+static void _e_smart_clip_set(Evas_Object *obj, Evas_Object *clip);
+static void _e_smart_clip_unset(Evas_Object *obj);
+
+/* external functions exposed by this widget */
+Evas_Object *
+e_smart_randr_add(Evas *evas)
+{
+ static Evas_Smart *smart = NULL;
+ static const Evas_Smart_Class sc =
+ {
+ "smart_randr", EVAS_SMART_CLASS_VERSION,
+ _e_smart_add, _e_smart_del, _e_smart_move, _e_smart_resize,
+ _e_smart_show, _e_smart_hide, NULL,
+ _e_smart_clip_set, _e_smart_clip_unset,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL
+ };
+
+ /* if we have never created the smart class, do it now */
+ if (!smart)
+ if (!(smart = evas_smart_class_new(&sc)))
+ return NULL;
+
+ /* return a newly created smart randr widget */
+ return evas_object_smart_add(evas, smart);
+}
+
+/* local functions */
+static void
+_e_smart_add(Evas_Object *obj)
+{
+ E_Smart_Data *sd;
+ Evas *evas;
+
+ /* try to allocate the smart data structure */
+ if (!(sd = E_NEW(E_Smart_Data, 1))) return;
+
+ /* grab the canvas */
+ evas = evas_object_evas_get(obj);
+}
+
+static void
+_e_smart_del(Evas_Object *obj)
+{
+ E_Smart_Data *sd;
+
+ /* try to get the objects smart data */
+ if (!(sd = evas_object_smart_data_get(obj))) return;
+
+ /* try to free the allocated structure */
+ E_FREE(sd);
+
+ /* set the objects smart data to null */
+ evas_object_smart_data_set(obj, NULL);
+}
+
+static void
+_e_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
+{
+ E_Smart_Data *sd;
+
+ /* try to get the objects smart data */
+ if (!(sd = evas_object_smart_data_get(obj))) return;
+}
+
+static void
+_e_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
+{
+ E_Smart_Data *sd;
+
+ /* try to get the objects smart data */
+ if (!(sd = evas_object_smart_data_get(obj))) return;
+}
+
+static void
+_e_smart_show(Evas_Object *obj)
+{
+ E_Smart_Data *sd;
+
+ /* try to get the objects smart data */
+ if (!(sd = evas_object_smart_data_get(obj))) return;
+
+ /* if it is already visible, get out */
+ if (sd->visible) return;
+
+ /* set visibility flag */
+ sd->visible = EINA_TRUE;
+}
+
+static void
+_e_smart_hide(Evas_Object *obj)
+{
+ E_Smart_Data *sd;
+
+ /* try to get the objects smart data */
+ if (!(sd = evas_object_smart_data_get(obj))) return;
+
+ /* if it is not visible, we have nothing to do */
+ if (!sd->visible) return;
+
+ /* set visibility flag */
+ sd->visible = EINA_FALSE;
+}
+
+static void
+_e_smart_clip_set(Evas_Object *obj, Evas_Object *clip)
+{
+ E_Smart_Data *sd;
+
+ /* try to get the objects smart data */
+ if (!(sd = evas_object_smart_data_get(obj))) return;
+}
+
+static void
+_e_smart_clip_unset(Evas_Object *obj)
+{
+ E_Smart_Data *sd;
+
+ /* try to get the objects smart data */
+ if (!(sd = evas_object_smart_data_get(obj))) return;
+}
diff --git a/src/modules/conf_randr/e_smart_randr.h
b/src/modules/conf_randr/e_smart_randr.h
new file mode 100644
index 0000000..4095ce1
--- /dev/null
+++ b/src/modules/conf_randr/e_smart_randr.h
@@ -0,0 +1,9 @@
+#ifdef E_TYPEDEFS
+#else
+# ifndef E_SMART_RANDR_H
+# define E_SMART_RANDR_H
+
+Evas_Object *e_smart_randr_add(Evas *evas);
+
+# endif
+#endif
--
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev