Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

painting images from imlib2 with cairo #17

Closed
wujek-srujek opened this issue Jul 3, 2013 · 5 comments
Closed

painting images from imlib2 with cairo #17

wujek-srujek opened this issue Jul 3, 2013 · 5 comments
Labels
question issue where reporter seeks information about conky or a problem they encounter while running it

Comments

@wujek-srujek
Copy link

I noticed there is some new functionality to paint images from imlib2 with cairo. I build conky today from master and it seems not to work properly, or I'm doing things wrong. When I scale an image down, the transparency in png or gif does not work and the background is black. If I scale a png up, I get quite a few funny artifacts.
Also, the new function as of now just allows to paint an image with full opacity, I think. It would be much better to allow users to set custom transparency as well. Actually, the best thing would be to allow the call:
local surface = cairo_image_surface_create_for_data(imlib_image_get_data_for_reading_only(), ..
to work fine. Currently I always get the errors that argument #1 is userdata but should be string - I guess that's because the cairo functions takes unsigned char* and tolua++ needs a string there? (I guess that's the main reason for the function, but I am not sure.) As I have little idea about c or c++, even less about lua and don't know nothing about tolua++, I am not sure if this is doable.

@mswanson-me
Copy link
Collaborator

Is this issue still outstanding in the current version of Conky? If so, please update this issue. Otherwise, the issue will be closed in 2 weeks.

@zcot
Copy link

zcot commented Mar 16, 2018

As far as I can tell the aforementioned example doesn't work. See random sample here: https://gist.github.com/wxg4net/7210517

It is possible to use the imlib2 stuff but I'm not aware of being able to intermix it with cairo like that exactly. You can do transparency with imlib but are limited once you don't have png specifically, and I'm not aware of any cairo transparency image function directly, so you need to mix them, and it may not be possible.

Is there any documentation on that issue directly?

If someone wants a non-png watermark, is it possible? Can you directly use a jpg as a transparent image?

@lasers lasers added question issue where reporter seeks information about conky or a problem they encounter while running it and removed Pending Closure labels Aug 5, 2018
brndnmtthws pushed a commit that referenced this issue Aug 7, 2018
brndnmtthws pushed a commit that referenced this issue Aug 7, 2018
brndnmtthws pushed a commit that referenced this issue Aug 7, 2018
brndnmtthws added a commit that referenced this issue Aug 7, 2018
* Try to amend #31

* BUILD_WLAN should be available for all OS.

Keep BUILD_WLAN OFF by default for compatibility reasons.

* WLAN-related variables should be available for every OS.

There are some problems (probably null-dereference)

* Fix $wireless_essid crashing conky if no argument provided.

Conky wasn't parsing the argument of the variable as it should, thus wasn't allocating the `dev` member variable.

Also fix some documentation stuff.

* Improve `get_freq` #20

Using the Intel® Power Gadget API (https://software.intel.com/en-us/blogs/2012/12/13/using-the-intel-power-gadget-api-on-mac-os-x) we can now get actual Core frequency and not the constant factory one.

Though, for some weird reason the API gives the same freq for all Cores, thus the |cpu| arg becomes useless.

* Oops, this accidently slipped in

* Introduce BUILD_IPGFREQ build option

This build option has been introduced for one particular reason:

On macOS getting current core-frequency is not supported by the APIs.  A solution is to install Intel's ® Power Gadget which comes with an .app, a Framework and a kernel-extension.  Though, this may trouble some alot, thus introduce BUILD_IPGFREQ.

* Forgot static here.

* Some improvements for get_freq again.

Fix frequency not printing correctly (I wasn't using the divisor)
Add more guards.

* Setup cmake files and project code for Objective-C code #17

We want to use CoreWLAN framework.

* update_cpu_usage() now supports multiple cores

Also, some cleanup.

* Updated default conky config to monitor Mac Networking

* Made Mac Friendly BuildOptions and generic default conky configs

* Undid Xdamage config and cleaned up previous IF statements

* Re-Added XDamage fix

* Finish up the algorithm. I think its now correct. Closes: #33

* Cleanup macro and introduce a no-op free_cpu() function for ALL cpu-related variables

free_cpu() must be implemented for every OS and on all except macOS its a no-op function.

* Reformat, add empty comment.
lasers pushed a commit that referenced this issue Aug 12, 2018
* Try to amend #31

* BUILD_WLAN should be available for all OS.

Keep BUILD_WLAN OFF by default for compatibility reasons.

* WLAN-related variables should be available for every OS.

There are some problems (probably null-dereference)

* Fix $wireless_essid crashing conky if no argument provided.

Conky wasn't parsing the argument of the variable as it should, thus wasn't allocating the `dev` member variable.

Also fix some documentation stuff.

* Improve `get_freq` #20

Using the Intel® Power Gadget API (https://software.intel.com/en-us/blogs/2012/12/13/using-the-intel-power-gadget-api-on-mac-os-x) we can now get actual Core frequency and not the constant factory one.

Though, for some weird reason the API gives the same freq for all Cores, thus the |cpu| arg becomes useless.

* Oops, this accidently slipped in

* Introduce BUILD_IPGFREQ build option

This build option has been introduced for one particular reason:

On macOS getting current core-frequency is not supported by the APIs.  A solution is to install Intel's ® Power Gadget which comes with an .app, a Framework and a kernel-extension.  Though, this may trouble some alot, thus introduce BUILD_IPGFREQ.

* Forgot static here.

* Some improvements for get_freq again.

Fix frequency not printing correctly (I wasn't using the divisor)
Add more guards.

* Setup cmake files and project code for Objective-C code #17

We want to use CoreWLAN framework.

* update_cpu_usage() now supports multiple cores

Also, some cleanup.

* Updated default conky config to monitor Mac Networking

* Made Mac Friendly BuildOptions and generic default conky configs

* Undid Xdamage config and cleaned up previous IF statements

* Re-Added XDamage fix

* Finish up the algorithm. I think its now correct. Closes: #33

* Cleanup macro and introduce a no-op free_cpu() function for ALL cpu-related variables

free_cpu() must be implemented for every OS and on all except macOS its a no-op function.

* Reformat, add empty comment.
@lasers
Copy link
Contributor

lasers commented Aug 14, 2018

@plikhari Are you able to help here?

@plikhari
Copy link

From what I have understood - cairo does not use imlib2 - and cairo needs to interact with lua - and so far the support is only for png images.

Most people look at cairo with python or c bindings and get all excited - but here we have cairo with lua bindings - to put things into perspective.

So if we have images that are non png - I use Imagemagick to manipulate and display it with lua + cairo.

We can close this as it is beyond the scope of conky + lua + cairo at present time.

@lasers
Copy link
Contributor

lasers commented Aug 14, 2018

We can close this as it is beyond the scope of conky + lua + cairo at present time.

Sounds good to me. This issue has been left open for a little too long.
Rounding the duration up to 5 years, 1 month, 11 days.

@wujek-srujek @zcot, I hope you find the above comment useful. I'll be closing this. If you had found your answers long ago or had some more information to share, please share them with us. Thank you.

@lasers lasers closed this as completed Aug 14, 2018
lasers pushed a commit that referenced this issue Sep 21, 2018
brndnmtthws pushed a commit that referenced this issue Oct 11, 2018
* Work for #17 : Now we have ssid

* Since we are using Objective-C++ NSStrings, we need to link to Foundation.framework, too!

* If interface is UP use the interface SSID; otherwise "off/any" following the Linux implementation.
Add more

* More

* cleanup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question issue where reporter seeks information about conky or a problem they encounter while running it
Projects
None yet
Development

No branches or pull requests

5 participants