[E-devel] [Patch] elm_photocam patch

2011-11-29 Thread PRINCE KUMAR DUBEY
Hi,

Attachment to the mail is elm_photocam patch.

Change Log:
a. Handled memory allocation failure in function grid_create inside source file 
src/lib/elm_photocam.c of package elementary.
b. Fixed Memory leak in functiongrid_create due to return without releasing 
memory allocated for variable g of type Grid *.
Signed-Off-By: RAJEEV RANJAN rajee...@samsung.com
Signed-Off-By: PRINCE KUMAR DUBEY prince.du...@samsung.com


Thank you,
Prince

elm_photocam.patch
Description: Binary data
--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [Patch] elm_photocam patch

2011-11-29 Thread Tom Hacohen
On 29/11/11 12:33, PRINCE KUMAR DUBEY wrote:
 Change Log:
 a. Handled memory allocation failure in function grid_create inside source 
 file src/lib/elm_photocam.c of package elementary.

We usually don't handle memory allocation issues because if those fails, 
everything goes to hell anyway...

Maybe I'm wrong, but that's what I remember, seen in code, and follow.

Any comments anyone?

--
Tom.

--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [Patch] elm_photocam patch

2011-11-29 Thread Michael Blumenkrantz
On Tue, 29 Nov 2011 14:04:10 +0200
Tom Hacohen tom.haco...@partner.samsung.com wrote:

 On 29/11/11 12:33, PRINCE KUMAR DUBEY wrote:
  Change Log:
  a. Handled memory allocation failure in function grid_create inside source
  file src/lib/elm_photocam.c of package elementary.
 
 We usually don't handle memory allocation issues because if those fails, 
 everything goes to hell anyway...
 
 Maybe I'm wrong, but that's what I remember, seen in code, and follow.
 
 Any comments anyone?
 
 --
 Tom.
In libraries we handle, in apps we don't.

--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [Patch] elm_photocam patch

2011-11-29 Thread Tom Hacohen
On 29/11/11 14:07, Michael Blumenkrantz wrote:
 In libraries we handle, in apps we don't.

I remember we never do, but I might be wrong. :)

--
Tom.


--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [Patch] elm_photocam patch

2011-11-29 Thread Michael Blumenkrantz
On Tue, 29 Nov 2011 14:22:27 +0200
Tom Hacohen tom.haco...@partner.samsung.com wrote:

 On 29/11/11 14:07, Michael Blumenkrantz wrote:
  In libraries we handle, in apps we don't.
 
 I remember we never do, but I might be wrong. :)
 
 --
 Tom.
 
that's why there are ZERO alloc checks in all the libs right?

--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [Patch] elm_photocam patch

2011-11-29 Thread Daniel Juyung Seo
as far as i know, we checks it.

Daniel Juyung Seo (SeoZ)

On Tue, Nov 29, 2011 at 9:23 PM, Michael Blumenkrantz
michael.blumenkra...@gmail.com wrote:
 On Tue, 29 Nov 2011 14:22:27 +0200
 Tom Hacohen tom.haco...@partner.samsung.com wrote:

 On 29/11/11 14:07, Michael Blumenkrantz wrote:
  In libraries we handle, in apps we don't.

 I remember we never do, but I might be wrong. :)

 --
 Tom.

 that's why there are ZERO alloc checks in all the libs right?

 --
 All the data continuously generated in your IT infrastructure
 contains a definitive record of customers, application performance,
 security threats, fraudulent activity, and more. Splunk takes this
 data and makes sense of it. IT sense. And common sense.
 http://p.sf.net/sfu/splunk-novd2d
 ___
 enlightenment-devel mailing list
 enlightenment-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [Patch] elm_photocam patch

2011-11-29 Thread Tom Hacohen
On 29/11/11 14:23, Michael Blumenkrantz wrote:
 that's why there are ZERO alloc checks in all the libs right?

There are many, but not everywhere... We just check for Widget_Data, 
Evas_Object and etc, not in smaller pieces of code.

Anyhow, you are maybe/probably right.

--
Tom.


--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [Patch] elm_photocam patch

2011-11-29 Thread Michael Blumenkrantz
On Tue, 29 Nov 2011 15:40:28 +0200
Tom Hacohen tom.haco...@partner.samsung.com wrote:

 On 29/11/11 14:23, Michael Blumenkrantz wrote:
  that's why there are ZERO alloc checks in all the libs right?
 
 There are many, but not everywhere... We just check for Widget_Data, 
 Evas_Object and etc, not in smaller pieces of code.
 
 Anyhow, you are maybe/probably right.
 
 --
 Tom.
 
Those wd checks are bs. If any of those ever failed your app would go
down in flames anyway.

--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [Patch] elm_photocam patch

2011-11-29 Thread Tom Hacohen
On 29/11/11 15:44, Michael Blumenkrantz wrote:
 Those wd checks are bs. If any of those ever failed your app would go
 down in flames anyway.

That's what I said in my first reply, everything will break if malloc 
fails, so I don't think we check for malloc success.

--
Tom.


--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [Patch] elm_photocam patch

2011-11-29 Thread David Seikel
On Tue, 29 Nov 2011 18:03:01 +0200 Tom Hacohen
tom.haco...@partner.samsung.com wrote:

 On 29/11/11 15:44, Michael Blumenkrantz wrote:
  Those wd checks are bs. If any of those ever failed your app would
  go down in flames anyway.
 
 That's what I said in my first reply, everything will break if malloc 
 fails, so I don't think we check for malloc success.

Well, there are three possibilities -

A) Everything goes down in flames.

2) Everything goes down gracefully.

III) Some things go down gracefully as the app / library switches to a
low memory mode.  Perhaps it could free up some temporary or cached
memory it's not really needing right now, switch to an alternate lower
memory algorithm, or just tell the user I'm sorry Dave, I can't do
that.

Things might not be going down in flames if it's a big allocation that
failed, and you can still allocate lots of smaller stuff.  So instead
of just using a bad alloc and at some point in the future having a
mysterious crash, it's better to tell the user Um, you don't have
enough RAM to use that 5 TB highly detailed image of the surface of
Mars as a window icon, try something a bit smaller.

But yeah, if there is not enough RAM available to allocate the string
Fuck you and your dog, not enough bytes to tell you to go to hell,
then crashing mysteriously might be a valid option.  Or you could pre
allocate it, like we do for the White Box of Death.

-- 
A big old stinking pile of genius that no one wants
coz there are too many silver coated monkeys in the world.


signature.asc
Description: PGP signature
--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [Patch] elm_photocam patch

2011-11-29 Thread Michael Blumenkrantz
On Tue, 29 Nov 2011 18:03:01 +0200
Tom Hacohen tom.haco...@partner.samsung.com wrote:

 On 29/11/11 15:44, Michael Blumenkrantz wrote:
  Those wd checks are bs. If any of those ever failed your app would go
  down in flames anyway.
 
 That's what I said in my first reply, everything will break if malloc 
 fails, so I don't think we check for malloc success.
 
 --
 Tom.
 
We still do in libs.

--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [Patch] elm_photocam patch

2011-11-29 Thread ChunEon Park
in. rev 65698

-Regards, Hermet-
 
-Original Message-
From: PRINCE KUMAR DUBEYlt;prince.du...@samsung.comgt; 
To: 
enlightenment-devel@lists.sourceforge.netlt;enlightenment-devel@lists.sourceforge.netgt;
Cc: 
Sent: 11-11-29(화) 19:33:44
Subject: [E-devel] [Patch] elm_photocam patch
Hi,
Attachment to the mail is elm_photocam patch.
Change Log:
a. Handled memory allocation failure in function grid_create inside source file 
src/lib/elm_photocam.c of package elementary.
b. Fixed Memory leak in functiongrid_create due to return without releasing 
memory allocated for variable g of type Grid *.
Signed-Off-By: RAJEEV RANJAN lt;rajee...@samsung.comgt;
Signed-Off-By: PRINCE KUMAR DUBEY lt;prince.du...@samsung.comgt;
Thank you,
Prince--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [PATCH] elm_photocam patch for supporting keyboard input

2011-01-05 Thread The Rasterman
On Fri, 24 Dec 2010 14:36:47 +0900 김지훈 imfin...@gmail.com said:

indeed thanks! in svn it goes! :)

 Hi, All.
 
 elm_photocam widget does not support keyboard input.
 This patch makes elm_photocam be able to process keyboard input such as Left,
 Right, Up, Down, PgDn, and PgUp key.
 In addition, image will be zoomed in or out when '+' or '-' key in
 keypad is pressed.
 
 Please review it and let me know if there is any problem in this patch.


-- 
- Codito, ergo sum - I code, therefore I am --
The Rasterman (Carsten Haitzler)ras...@rasterman.com


--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


[E-devel] [PATCH] elm_photocam patch for supporting keyboard input

2010-12-24 Thread 김지훈
Hi, All.

elm_photocam widget does not support keyboard input.
This patch makes elm_photocam be able to process keyboard input such as Left,
Right, Up, Down, PgDn, and PgUp key.
In addition, image will be zoomed in or out when '+' or '-' key in
keypad is pressed.

Please review it and let me know if there is any problem in this patch.
Index: elm_photocam.c
===
--- elm_photocam.c	(revision 55742)
+++ elm_photocam.c	(working copy)
@@ -143,6 +143,8 @@ static void _on_focus_hook(void *data, Evas_Object
 //static void _show_region_hook(void *data, Evas_Object *obj);
 static void _sizing_eval(Evas_Object *obj);
 static void _calc_job(void *data);
+static Eina_Bool _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__,
+ Evas_Callback_Type type, void *event_info);
 static void grid_place(Evas_Object *obj, Grid *g, Evas_Coord px, Evas_Coord py, Evas_Coord ox, Evas_Coord oy, Evas_Coord ow, Evas_Coord oh);
 static void grid_clear(Evas_Object *obj, Grid *g);
 static Grid *grid_create(Evas_Object *obj);
@@ -957,6 +959,91 @@ _scr_scroll(void *data, Evas_Object *obj __UNUSED_
evas_object_smart_callback_call(data, scroll, NULL);
 }
 
+static Eina_Bool 
+_event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__,
+ Evas_Callback_Type type, void *event_info)
+{
+   double zoom;
+   if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
+   Evas_Event_Key_Down *ev = event_info;
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return EINA_FALSE;
+   if (ev-event_flags  EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
+
+   Evas_Coord x = 0;
+   Evas_Coord y = 0;
+   Evas_Coord step_x = 0;
+   Evas_Coord step_y = 0;
+   Evas_Coord v_w = 0;
+   Evas_Coord v_h = 0;
+   Evas_Coord page_x = 0;
+   Evas_Coord page_y = 0;
+
+   elm_smart_scroller_child_pos_get(wd-scr, x, y);
+   elm_smart_scroller_step_size_get(wd-scr, step_x, step_y);
+   elm_smart_scroller_page_size_get(wd-scr, page_x, page_y);
+   elm_smart_scroller_child_viewport_size_get(wd-scr, v_w, v_h);
+
+   if ((!strcmp(ev-keyname, Left)) || 
+   (!strcmp(ev-keyname, KP_Left)))
+ {
+x -= step_x;
+ }
+   else if ((!strcmp(ev-keyname, Right)) || 
+(!strcmp(ev-keyname, KP_Right)))
+ {
+x += step_x;
+ }
+   else if ((!strcmp(ev-keyname, Up))  || 
+(!strcmp(ev-keyname, KP_Up)))
+ {
+y -= step_y;
+ }
+   else if ((!strcmp(ev-keyname, Down)) || 
+(!strcmp(ev-keyname, KP_Down)))
+ {
+y += step_y;
+ }
+   else if ((!strcmp(ev-keyname, Prior)) || 
+(!strcmp(ev-keyname, KP_Prior)))
+ {
+if (page_y  0)
+   y -= -(page_y * v_h) / 100;
+else
+   y -= page_y;
+ }
+   else if ((!strcmp(ev-keyname, Next)) || 
+(!strcmp(ev-keyname, KP_Next)))
+ {
+if (page_y  0)
+   y += -(page_y * v_h) / 100;
+else
+   y += page_y;
+ }
+   else if ((!strcmp(ev-keyname, KP_Add)))
+ {
+zoom = elm_photocam_zoom_get(obj);
+zoom -= 0.5;
+elm_photocam_zoom_mode_set(obj, ELM_PHOTOCAM_ZOOM_MODE_MANUAL);
+elm_photocam_zoom_set(obj, zoom);
+return EINA_TRUE;
+ } 
+   else if ((!strcmp(ev-keyname, KP_Subtract)))
+ {
+zoom = elm_photocam_zoom_get(obj);
+zoom += 0.5;
+elm_photocam_zoom_mode_set(obj, ELM_PHOTOCAM_ZOOM_MODE_MANUAL);
+elm_photocam_zoom_set(obj, zoom);
+return EINA_TRUE;
+ }
+   else return EINA_FALSE;
+
+   ev-event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+   elm_smart_scroller_child_pos_set(wd-scr, x, y);
+
+   return EINA_TRUE;
+}
+
 /**
  * Add a new Photocam object
  *
@@ -989,6 +1076,7 @@ elm_photocam_add(Evas_Object *parent)
elm_widget_del_hook_set(obj, _del_hook);
elm_widget_theme_hook_set(obj, _theme_hook);
elm_widget_can_focus_set(obj, EINA_TRUE);
+   elm_widget_event_hook_set(obj, _event_hook);
 
wd-scr = elm_smart_scroller_add(e);
elm_smart_scroller_widget_set(wd-scr, obj);
--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel