[E-devel] Patch for ecore tests
Greetings! The ecore tests fail to build because they need to be linked to eina, the error is that eina_log_domain_register is not found by the linker. The attached patch fixes that. Uli Index: Makefile.am === --- Makefile.am (revision 60224) +++ Makefile.am (working copy) @@ -22,7 +22,8 @@ ecore_suite_LDADD = \ @CHECK_LIBS@ \ $(top_builddir)/src/lib/ecore/libecore.la \ -$(top_builddir)/src/lib/ecore_con/libecore_con.la +$(top_builddir)/src/lib/ecore_con/libecore_con.la \ +@EINA_LIBS@ if BUILD_ECORE_X ecore_suite_LDADD += \ -- EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] patch for ecore function used to change the backlight property
Hi Carsten, Sorry for replying late. ok ecore 1.0 is out. this can now go into ecore 1.1 dev (trunk). first.. patch is broken. - just some errors: ecore_x_randr_12.c: In function ‘ecore_x_randr_screen_backlight_level_set’: ecore_x_randr_12.c:1919: error: ‘_backlight’ undeclared (first use in this function) ecore_x_randr_12.c:1919: error: (Each undeclared identifier is reported only once ecore_x_randr_12.c:1919: error: for each function it appears in.) ecore_x_randr_12.c: In function ‘ecore_x_randr_output_backlight_level_get’: ecore_x_randr_12.c:1967: error: ‘_backlight’ undeclared (first use in this function) ecore_x_randr_12.c: In function ‘ecore_x_randr_output_backlight_level_set’: ecore_x_randr_12.c:2012: warning: ‘return’ with no value, in function returning non-void ecore_x_randr_12.c:2014: error: ‘_backlight’ undeclared (first use in this function) make: *** [ecore_x_randr_12.lo] Error 1 where do you get _backlight from? _backlight is a Ecore_X_Atom type variable. Indeed the original patch was lacking one unique line of code (I forgot to move this line when I copied pasted the code from the ecore_xrand_13.c to ecore_xrand_12.c). I modified the patch accordingly. Please note that it is identical to the patch I send two days ago except that this one includes the missing line. I tried to compile it and it works perfectly now. One's again sorry for this mistake. > I should indicate that I plan to create a module for e17 which controls the > backlight properties but in order to do that I would like to ask a question. that's cool! and you'd need the ecore support for it to work - fine. > I would like to add a timer in this module in order decrease the backlight to > a lower value after 10 seconds of activity for instance. For course the timer > should be deactivited when the keyboard or the mouse are used but > unfortunately I do not know how to create such timer. ecore_timer_add() - grep fore that call all through any code. easy to find examples. but you need to know when inactivity has happened. for that you'd need to look at the xscreensaver extension - you can get idle timeout events. you could also poll every few seconds and get current idle time with ecore_x_screensaver_idle_time_get(); (returns idle time in seconds) thanks a lot for these info. I will look into it as soon as possible. By the way there is another patch for e17 (log domain related) in the mailing list. I have to improve it a bit since the svn update indicated conflicts on my side. Mathieu -- - Codito, ergo sum - "I code, therefore I am" -- The Rasterman (Carsten Haitzler)ras...@rasterman.com Index: xlib/ecore_x_randr_12.c === --- xlib/ecore_x_randr_12.c (revision 56606) +++ xlib/ecore_x_randr_12.c (working copy) @@ -36,6 +36,7 @@ Window window); extern int _randr_version; +static Ecore_X_Atom _backlight; #endif /** @@ -440,8 +441,8 @@ if (!mode_info) return; - if (mode_info->name) - free(mode_info->name); + if (mode_info->name) +free(mode_info->name); free(mode_info); mode_info = NULL; @@ -1904,3 +1905,149 @@ Ecore_X_Randr_Unset); #endif } + +/** + * @brief set up the backlight level to the given level. + * @param root the window's screen which will be set. + * @param level of the backlight between 0 and 100 + */ + +EAPI void +ecore_x_randr_screen_backlight_level_set(Ecore_X_Window root, double level) +{ +#ifdef ECORE_XRANDR + RANDR_CHECK_1_2_RET(); + + /* +* maybe move this in the init part the module. +* Initialize it if not already initialized +*/ + + if((level < 0)||(level > 100)) + { + WRN("Wrong value for the backlight level. It should be between 0 and 100."); + return; + } + + if(_backlight == None) + _backlight = XInternAtom (_ecore_x_disp, RANDR_PROPERTY_BACKLIGHT, True); + + // Clearly the server does not support it. + if(_backlight == None) + { + ERR("Backlight property is not suppported on this server"); + return; + } + + /* get the ressources */ + XRRScreenResources *resources = _ecore_x_randr_get_screen_resources (_ecore_x_disp, root); + + int o; + + if (!resources) return; + for (o = 0; o < resources->noutput; o++) + { + Ecore_X_Randr_Output output = resources->outputs[o]; + if (ecore_x_randr_output_backlight_level_get(root, output) != -1) + { + ecore_x_randr_output_backlight_level_set(root, output, level); + } + } + XRRFreeScreenResources (resources); +#endif +} + +/* + * @brief get the backlight level of the given output + * @param root window which's screen should be queried + * @param output from which the backlight level should retrieved + * @return the b
Re: [E-devel] patch for ecore function used to change the backlight property
On Sun, 16 Jan 2011 16:18:10 +0100 (CET) mathieu.taillefum...@free.fr said: > Hello, > > I wrote three additional functions allowing us yo change the backlight > properties of the screes supporting it. I discover that the functions are > already declared in the headers files but the code was not added so far. The > patch is simple and should be directly applied in the directory > src/lib/ecore_x/xlib after reviewing it. I am open for comments and > suggestions for improving these three functions. ok ecore 1.0 is out. this can now go into ecore 1.1 dev (trunk). first.. patch is broken. - just some errors: ecore_x_randr_12.c: In function ‘ecore_x_randr_screen_backlight_level_set’: ecore_x_randr_12.c:1919: error: ‘_backlight’ undeclared (first use in this function) ecore_x_randr_12.c:1919: error: (Each undeclared identifier is reported only once ecore_x_randr_12.c:1919: error: for each function it appears in.) ecore_x_randr_12.c: In function ‘ecore_x_randr_output_backlight_level_get’: ecore_x_randr_12.c:1967: error: ‘_backlight’ undeclared (first use in this function) ecore_x_randr_12.c: In function ‘ecore_x_randr_output_backlight_level_set’: ecore_x_randr_12.c:2012: warning: ‘return’ with no value, in function returning non-void ecore_x_randr_12.c:2014: error: ‘_backlight’ undeclared (first use in this function) make: *** [ecore_x_randr_12.lo] Error 1 where do you get _backlight from? > I should indicate that I plan to create a module for e17 which controls the > backlight properties but in order to do that I would like to ask a question. that's cool! and you'd need the ecore support for it to work - fine. > I would like to add a timer in this module in order decrease the backlight to > a lower value after 10 seconds of activity for instance. For course the timer > should be deactivited when the keyboard or the mouse are used but > unfortunately I do not know how to create such timer. ecore_timer_add() - grep fore that call all through any code. easy to find examples. but you need to know when inactivity has happened. for that you'd need to look at the xscreensaver extension - you can get idle timeout events. you could also poll every few seconds and get current idle time with ecore_x_screensaver_idle_time_get(); (returns idle time in seconds) -- - Codito, ergo sum - "I code, therefore I am" -- The Rasterman (Carsten Haitzler)ras...@rasterman.com -- Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] patch for ecore function used to change the backlight property
Hey, cool you've implemented this feature. I only implemented the edid property. I hope you were able to copy'n'paste from it. My driver doesn't support brightness control via randr, so I could not test anything regarding it. As Mike and Vincent already said, I guess it will have to move on top of the 'after freeze' patch-stack. Regarding your module: Brightness control is also part of ACPI, maybe check it out for more support regarding different setups. BR, Leif 2011/1/16 : > Hello, > > I wrote three additional functions allowing us yo change the backlight > properties of the screes supporting it. I discover that the functions are > already declared in the headers files but the code was not added so far. The > patch is simple and should be directly applied in the directory > src/lib/ecore_x/xlib after reviewing it. I am open for comments and > suggestions for improving these three functions. > > I should indicate that I plan to create a module for e17 which controls the > backlight properties but in order to do that I would like to ask a question. > I would like to add a timer in this module in order decrease the backlight to > a lower value after 10 seconds of activity for instance. For course the timer > should be deactivited when the keyboard or the mouse are used but > unfortunately I do not know how to create such timer. > > cheers > > Mathieu > -- > Protect Your Site and Customers from Malware Attacks > Learn about various malware tactics and how to avoid them. Understand > malware threats, the impact they can have on your business, and how you > can protect your company and customers by using code signing. > http://p.sf.net/sfu/oracle-sfdevnl > ___ > enlightenment-devel mailing list > enlightenment-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > > -- Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] patch for ecore function used to change the backlight property
I will wait then. Resubmission in one week. Mathieu - Mail Original - De: "Vincent Torri" À: "Mike Blumenkrantz" Cc: "mathieu taillefumier" , enlightenment-devel@lists.sourceforge.net Envoyé: Dimanche 16 Janvier 2011 16h42:10 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne Objet: Re: [E-devel] patch for ecore function used to change the backlight property On Sun, 16 Jan 2011, Mike Blumenkrantz wrote: > On Sun, 16 Jan 2011 16:18:10 +0100 (CET) > mathieu.taillefum...@free.fr wrote: > >> Hello, >> >> I wrote three additional functions allowing us yo change the backlight >> properties of the screes supporting it. I discover that the functions are >> already declared in the headers files but the code was not added so far. The >> patch is simple and should be directly applied in the directory >> src/lib/ecore_x/xlib after reviewing it. I am open for comments and >> suggestions for improving these three functions. >> >> I should indicate that I plan to create a module for e17 which controls the >> backlight properties but in order to do that I would like to ask a question. >> I would like to add a timer in this module in order decrease the backlight to >> a lower value after 10 seconds of activity for instance. For course the timer >> should be deactivited when the keyboard or the mouse are used but >> unfortunately I do not know how to create such timer. >> >> cheers >> >> Mathieu > code freeze, try back later. that is, wait one week :p -- Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] patch for ecore function used to change the backlight property
On Sun, 16 Jan 2011, Mike Blumenkrantz wrote: > On Sun, 16 Jan 2011 16:18:10 +0100 (CET) > mathieu.taillefum...@free.fr wrote: > >> Hello, >> >> I wrote three additional functions allowing us yo change the backlight >> properties of the screes supporting it. I discover that the functions are >> already declared in the headers files but the code was not added so far. The >> patch is simple and should be directly applied in the directory >> src/lib/ecore_x/xlib after reviewing it. I am open for comments and >> suggestions for improving these three functions. >> >> I should indicate that I plan to create a module for e17 which controls the >> backlight properties but in order to do that I would like to ask a question. >> I would like to add a timer in this module in order decrease the backlight to >> a lower value after 10 seconds of activity for instance. For course the timer >> should be deactivited when the keyboard or the mouse are used but >> unfortunately I do not know how to create such timer. >> >> cheers >> >> Mathieu > code freeze, try back later. that is, wait one week :p Vincent -- Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] patch for ecore function used to change the backlight property
On Sun, 16 Jan 2011 16:18:10 +0100 (CET) mathieu.taillefum...@free.fr wrote: > Hello, > > I wrote three additional functions allowing us yo change the backlight > properties of the screes supporting it. I discover that the functions are > already declared in the headers files but the code was not added so far. The > patch is simple and should be directly applied in the directory > src/lib/ecore_x/xlib after reviewing it. I am open for comments and > suggestions for improving these three functions. > > I should indicate that I plan to create a module for e17 which controls the > backlight properties but in order to do that I would like to ask a question. > I would like to add a timer in this module in order decrease the backlight to > a lower value after 10 seconds of activity for instance. For course the timer > should be deactivited when the keyboard or the mouse are used but > unfortunately I do not know how to create such timer. > > cheers > > Mathieu code freeze, try back later. -- Mike Blumenkrantz Zentific: NULL pointer dereferences now 50% off! -- Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. 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 for ecore function used to change the backlight property
Hello, I wrote three additional functions allowing us yo change the backlight properties of the screes supporting it. I discover that the functions are already declared in the headers files but the code was not added so far. The patch is simple and should be directly applied in the directory src/lib/ecore_x/xlib after reviewing it. I am open for comments and suggestions for improving these three functions. I should indicate that I plan to create a module for e17 which controls the backlight properties but in order to do that I would like to ask a question. I would like to add a timer in this module in order decrease the backlight to a lower value after 10 seconds of activity for instance. For course the timer should be deactivited when the keyboard or the mouse are used but unfortunately I do not know how to create such timer. cheers MathieuIndex: ecore_x_randr_12.c === --- ecore_x_randr_12.c (revision 56191) +++ ecore_x_randr_12.c (working copy) @@ -1902,3 +1902,135 @@ Ecore_X_Randr_Unset); #endif } + +EAPI void +ecore_x_randr_screen_backlight_level_set(Ecore_X_Window root, double level) +{ +#ifdef ECORE_XRANDR + RANDR_CHECK_1_2_RET(); + + /* +* maybe move this in the init part the module. +* Initialize it if not already initialized +*/ + + if(_backlight == None) + _backlight = XInternAtom (_ecore_x_disp, RANDR_PROPERTY_BACKLIGHT, True); + + // Clearly the server does not support it. + if(_backlight == None) + { + ERR("Backlight property is not suppported on this server"); + return; + } + + /* get the ressources */ + XRRScreenResources *resources = _ecore_x_randr_get_screen_resources (_ecore_x_disp, root); + + int o; + + if (!resources) return; + for (o = 0; o < resources->noutput; o++) + { + Ecore_X_Randr_Output output = resources->outputs[o]; + if (ecore_x_randr_output_backlight_level_get(root, output) != -1) + { + ecore_x_randr_output_backlight_level_set(root, output, level); + } + } + XRRFreeScreenResources (resources); +#endif +} + +/* + * @param root window which's screen should be queried + * @param output from which the backlight level should retrieved + * @return the backlight level + */ + + +EAPI double +ecore_x_randr_output_backlight_level_get(Ecore_X_Window root, + Ecore_X_Randr_Output output) +{ +#ifdef ECORE_XRANDR + RANDR_CHECK_1_2_RET(-1); + unsigned long nitems; + unsigned long bytes_after; + unsigned char *prop; + Atom actual_type; + int actual_format; + long value; + + if(_backlight == None) + _backlight = XInternAtom (_ecore_x_disp, RANDR_PROPERTY_BACKLIGHT, True); + if(_backlight == None) + { + ERR("Backlight property is not suppported on this server"); + return -1; + } + + if(!_ecore_x_randr_output_validate(root, output)) + return -1; + + if (XRRGetOutputProperty (_ecore_x_disp, output, _backlight, + 0, 4, False, False, None, + &actual_type, &actual_format, + &nitems, &bytes_after, &prop) != Success) { + WRN("Backlight not supported on this output"); + return -1; + } + + if (actual_type != XA_INTEGER || nitems != 1 || actual_format != 32) + value = -1; + else + value = *((long *) prop); + free (prop); + return value; +#else + return -1; +#endif +} + +/* + * @param root window which's screen should be queried + * @param output that should be set + * @param level for which the backlight should be set + * @return EINA_TRUE in case of success + */ + +EAPI Eina_Bool +ecore_x_randr_output_backlight_level_set(Ecore_X_Window root, + Ecore_X_Randr_Output output, + double level) +{ +#ifdef ECORE_XRANDR + RANDR_CHECK_1_2_RET(EINA_FALSE); + if(!_ecore_x_randr_output_validate(root, output)) +return; + + XRRPropertyInfo *info = XRRQueryOutputProperty (_ecore_x_disp, output, _backlight); + if (info) +{ + if (info->range && info->num_values == 2) + { + double min = info->values[0]; + double max = info->values[1]; + double tmp = (level * (max - min) / 100) + min; + long new = tmp; + if (new > max) new = max; + if (new < min) new = min; + + XRRChangeOutputProperty (_ecore_x_disp, output, _backlight, XA_INTEGER, 32, + PropModeReplace, (unsigned char *) &new, 1); + XFlush (_ecore_x_disp); + } + free(info); + return EINA_TRUE; +} + + return EINA_FALSE; +#else + return EINA_FALSE; +#endif +} -- Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can pro
Re: [E-devel] patch for ecore
> On Sat, Nov 7, 2009 at 11:44 AM, Mathieu Taillefumier > wrote: > >> Hello, >> >> herewith a patch for ecore that implement the eina_log inside ecore for >> logging messages. I have been using the patch for some time now and nothing >> happened since then. I double check the patch and everything should be >> compiling without error, but since nobody is perfect I can not warranty the >> win modules will compile (normally they should). >> >> I think all main libraries are converted already. I still have to work on >> edje, emotion and e itself. >> > sorry taking so long to reply, but here it goes: > > first of all, ecore-config is deprecated... so no need to really > convert it, but it doesn't hurt much either. > > + ERR("ipc.prop.set(%s->%s,\"%s\") => %d\n", theme ? theme->identifier : > "", > + key, val, ret); > > good, you're using ERR() and should have no problems with win32... but > the trailing \n is still there and eina log adds it as well :-/ > Learn it from converting evas to eina_log :-). > +# define D(fmt,args...) do { if(DEBUG>=0) DBG(fmt,## args); } while(0); > +# define E(lvl,args...) do { if(DEBUG>=(lvl)) ERR(## args); } while(0) > > these are bit useless, no need to do these in app/lib since it's done in eina. > I cleaned up my previous patch and corrected some errors I did not spot the first time. the list of changes is the following : - the messages have been suppressed when necessary. - the ecore_config file was changed following the suggestions of Gustavo :-). - finally add some additional line _ecore_module_name_log_dom = -1; after unregistering a log domain. I applied this to all the modules (including the windows one) Best Mathieu -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] patch for ecore
On Sat, Nov 7, 2009 at 11:44 AM, Mathieu Taillefumier wrote: > Hello, > > herewith a patch for ecore that implement the eina_log inside ecore for > logging messages. I have been using the patch for some time now and nothing > happened since then. I double check the patch and everything should be > compiling without error, but since nobody is perfect I can not warranty the > win modules will compile (normally they should). > > I think all main libraries are converted already. I still have to work on > edje, emotion and e itself. sorry taking so long to reply, but here it goes: first of all, ecore-config is deprecated... so no need to really convert it, but it doesn't hurt much either. + ERR("ipc.prop.set(%s->%s,\"%s\") => %d\n", theme ? theme->identifier : "", + key, val, ret); good, you're using ERR() and should have no problems with win32... but the trailing \n is still there and eina log adds it as well :-/ +# define D(fmt,args...) do { if(DEBUG>=0) DBG(fmt,## args); } while(0); +# define E(lvl,args...) do { if(DEBUG>=(lvl)) ERR(## args); } while(0) these are bit useless, no need to do these in app/lib since it's done in eina. + WRN("you are using ecore_config structures. These are very young"); + WRN(" and not complete - you have been warned"); similarly to previous where you left \n, this one was expected to be printed as one single phrase using previous debug, but now are 2 lines with prefix repeated... you better make it a single WRN() Last, make log domain variable -1 after unregister it: eina_log_domain_unregister(_ecore_imf_log_dom); + _ecore_imf_log_dom = -1; so we catch people calling module functions after it was shutdown. Eina log should not crash if you don't, but in some cases another domain may be registered with the same id and then you'll get wrong prefix and all. -- Gustavo Sverzut Barbieri http://profusion.mobi embedded systems -- MSN: barbi...@gmail.com Skype: gsbarbieri Mobile: +55 (19) 9225-2202 -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel