LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Now hosting the new Gtk RGBA module I created on Launchpad (https://www.linuxquestions.org/questions/programming-9/now-hosting-the-new-gtk-rgba-module-i-created-on-launchpad-794198/)

Kenny_Strawn 03-09-2010 06:59 AM

Now hosting the new Gtk RGBA module I created on Launchpad
 
https://launchpad.net/librgba-c++

Essentially, this module can be fine-tuned to the user's liking, using four integers instead of a boolean. By allowing for the red, green, blue, and alpha values to be fine-tuned, the user can control how transparent or opaque their desktop is. And how is this possible? C++ instead of C.

How do you guys think of being able to customize RGBA?

paulsm4 03-10-2010 04:08 PM

Cool. Any chance you can port it to C :)?

GrapefruiTgirl 03-10-2010 04:11 PM

It does sound cool!

Can you explain a bit more about "controlling the transparency of the desktop" ? What does this mean-- ALL things on the desktop, or application windows, or.. what? Does this transparency use/require compositing?

Thanks,
Sasha

Sergei Steshenko 03-10-2010 07:34 PM

Quote:

Originally Posted by Kenny_Strawn (Post 3891452)
https://launchpad.net/librgba-c++

Essentially, this module can be fine-tuned to the user's liking, using four integers instead of a boolean. By allowing for the red, green, blue, and alpha values to be fine-tuned, the user can control how transparent or opaque their desktop is. And how is this possible? C++ instead of C.

How do you guys think of being able to customize RGBA?

Out of curiosity I visited the link and examined the source:


http://bazaar.launchpad.net/~mango-k...ba-c%2B%2B.cpp :



Code:

1        5       

#include <iostream>

2               

3               

using namespace std;

4               

5               

int rgba (int Red, int Green, int Blue, int Alpha)

6               

{

7               

        return 0;

8               

};

- sorry, I am too lazy to change formatting manually.

Well, what can I say - your sense of humor appears to be much more black and acid than mine.

GrapefruiTgirl 03-10-2010 08:14 PM

Forgive my C novice-ness, but is that the entire program?

Sergei Steshenko 03-10-2010 08:15 PM

Quote:

Originally Posted by GrapefruiTgirl (Post 3893640)
Forgive my C novice-ness, but is that the entire program?

The question in this case is irrelevant - the function always returns 0.

Kenny_Strawn 03-10-2010 08:59 PM

It is supposed to be a library, not a program.

In any case, what else other than "return 0" can I use inside the curly braces?

Kenny_Strawn 03-10-2010 09:09 PM

Quote:

Originally Posted by GrapefruiTgirl (Post 3893413)
It does sound cool!

Can you explain a bit more about "controlling the transparency of the desktop" ? What does this mean-- ALL things on the desktop, or application windows, or.. what? Does this transparency use/require compositing?

Thanks,
Sasha

To answer your question, the current RGBA module only has two functions: on or off. This is supposed to allow for in-between values, like Clutter's RGBA does.

Kenny_Strawn 03-10-2010 10:24 PM

I made some changes to the code that I will soon upload

Code:

#include <iostream>

using namespace std;

int rgba (int Red, int Green, int Blue, int Alpha)
{
        int alphaRed = Alpha*(Red);
        int alphaGreen = Alpha*(Green);
        int alphaBlue = Alpha*(Blue);
        int alphaEquation = alphaRed + alphaGreen + (1 - alphaGreen - alphaRed)*alphaBlue;
        return 0;
};

Essentially, I added the equation to calculate the transparency effect. Hopefully, this will solve the problem. At least it compiled successfully.

Kenny_Strawn 03-10-2010 11:11 PM

For the education of some members, listen up:

As I said before, the current RGBA module for Gtk+ only has two settings: on or off.

This is because C does not support object-oriented programming (OOP), and therefore does not support variables, which are key to allowing RGBA to support values in-between.

Think of comparing this RGBA module to the current one as comparing Windows 7's UAC to Vista's UAC (sorry if this may be off topic). The difference is that the latter has in-between settings, allowing you to customize it in such a way that it is less intrusive.

Similarly, this RGBA module allows the user to tweak its four values (Red, Green, Blue, and Alpha) in such a way that you are not bound by a boolean.

Sergei Steshenko 03-11-2010 02:16 PM

Quote:

Originally Posted by Kenny_Strawn (Post 3893719)
I made some changes to the code that I will soon upload

Code:

#include <iostream>

using namespace std;

int rgba (int Red, int Green, int Blue, int Alpha)
{
        int alphaRed = Alpha*(Red);
        int alphaGreen = Alpha*(Green);
        int alphaBlue = Alpha*(Blue);
        int alphaEquation = alphaRed + alphaGreen + (1 - alphaGreen - alphaRed)*alphaBlue;
        return 0;
};

Essentially, I added the equation to calculate the transparency effect. Hopefully, this will solve the problem. At least it compiled successfully.

Nonsense - your code still returns zero.

Sergei Steshenko 03-11-2010 02:17 PM

Quote:

Originally Posted by Kenny_Strawn (Post 3893766)
For the education of some members, listen up:

As I said before, the current RGBA module for Gtk+ only has two settings: on or off.

This is because C does not support object-oriented programming (OOP), and therefore does not support variables, which are key to allowing RGBA to support values in-between.

Think of comparing this RGBA module to the current one as comparing Windows 7's UAC to Vista's UAC (sorry if this may be off topic). The difference is that the latter has in-between settings, allowing you to customize it in such a way that it is less intrusive.

Similarly, this RGBA module allows the user to tweak its four values (Red, Green, Blue, and Alpha) in such a way that you are not bound by a boolean.


Nonsense.

Sergei Steshenko 03-11-2010 02:18 PM

Quote:

Originally Posted by Kenny_Strawn (Post 3893665)
It is supposed to be a library, not a program.

In any case, what else other than "return 0" can I use inside the curly braces?


First learn, then ask.

Kenny_Strawn 03-12-2010 05:27 PM

Here is the final code:

http://bazaar.launchpad.net/~mango-k...ba-c%2B%2B.cpp

Hopefully this is correct.

Sergei Steshenko 03-12-2010 07:37 PM

Quote:

Originally Posted by Kenny_Strawn (Post 3896249)
Here is the final code:

http://bazaar.launchpad.net/~mango-k...ba-c%2B%2B.cpp

Hopefully this is correct.

Nonsense.


All times are GMT -5. The time now is 09:25 PM.