LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > Kenny the one-teen comittee to stamp out Proprietary $uckware
User Name
Password

Notices


I decided to post a little introduction to myself here: Ask me who I was last March, and I would have had WinBloze 7 Beta on my main computer and would have been part of Micro$uck's test project for WinBloze 7 and would have been excited about it. However, that changed as soon as my network adapter changed and the new one worked with Linux. As soon as I tested the new adapter with Mint (I'd say about a year ago, in July 2009) I began to really value Linux for what it is.

However, I knew about Linux long before that. I started with gOS 2, which was my first distro. I had tried it back in about February 2008. I first learned about Linux back in mid-2007, from an article in PCMag that spanned several pages. I had quite a hard time back then, and Ubuntu Hardy was no different than gOS.

So then what took me so long from knowing about Linux to finally becoming an active user? My house was nothing but Wi-Fi. My mother set a secure wireless network up back then, and I couldn't connect to it because my adapter (Linksys WUSB54GSC) wasn't recognized by Linux. I had the patience to continue.

Then, in June 2008, my family got hit by the economic collapse here in the USA: The mortgage on my old house doubled and my family had to leave because of the rate increase. So, we were stuck in a hotel room until my family and I could end up in a new house. That Christmas, I wanted a netbook, and got my wish (the one I'm typing on, an Acer Aspire One AOA110-1545). It came with Linux preinstalled, and I liked it all around.

From then to June 2009, I still had WinBloze on my desktop, as Linux still didn't work with my wireless network adapter. Then, in June 2009 as I said, I got a new wireless network adapter, and in July decided to test it with Linux Mint 7. It worked, even from the Live CD! Now,

Rate this Entry

GTK+: Possible code to enable geometric compositing (speculation)

Posted 07-19-2010 at 12:17 AM by Kenny_Strawn

Here's something for you guys:

Code:
#include <glib.h>
#include <glib/gtypes.h>
#include <gtk/gtk.h>

struct GtkPrism {
    guint32 Left;
    guint32 Top;
    guint32 Rear;

    guint32 Right;
    guint32 Bottom;
    guint32 Front;
}
Instead of just using a rectangle to draw GTK+ widgets, to use a 3D prism would make it a whole lot better, since it would allow developers of applications to take advantage of 3D acceleration and painter's algorithm.

This is especially good for the development of 3D games: You essentially could lay out a bunch of vector images inside one of these objects that is in turn RGBA'd to 0. This will require hundreds of lines less of code than having to vector-draw complex game widgets by hand.

This can also be used for compositing in a GUI as well: If an app in the GNOME interface like, say, Metacity uses one of these objects to in turn draw windows or workspaces on or inside, such effects as desktop cubes or 3D window switchers could result.

What do you guys think? The GTK+ community will certainly like this.
Posted in Uncategorized
Views 7327 Comments 7
« Prev     Main     Next »
Total Comments 7

Comments

  1. Old Comment
    Posted this on GNOME Bugzilla for the GNOME developers to look at.
    Posted 07-19-2010 at 01:17 PM by Kenny_Strawn Kenny_Strawn is offline
  2. Old Comment
    Nothing is executable in the above code, so it doesn't enable anything.
    Posted 08-02-2010 at 12:15 AM by Sergei Steshenko Sergei Steshenko is offline
  3. Old Comment
    And, by the way, it's worth reading http://www.freesoftwaremagazine.com/...ompiz_and_more before reinventing the wheels - the link as about existing 3d desktops as one can see from the name.
    Posted 08-02-2010 at 01:20 AM by Sergei Steshenko Sergei Steshenko is offline
  4. Old Comment
    Okay fine. Here's what I was really planning: 3D geometry types to essentially draw widgets (like windows, borders, and panels/menus) in 3D. Witness:

    Code:
    #include <glib.h>
    #include <glib/gtypes.h>
    #include <gtk/gtk.h>
    #include <gdk/gdk.h>
    
    #define __GDK_TYPES_H__
    
    struct _GdkPoint {
      guint32 x;
      guint32 y;
      guint32 z;
    }
    
    struct _GdkBox {
      guint32 x;
      guint32 y;
      guint32 z;
      guint32 width;
      guint32 height;
      guint32 depth;
    }
    
    struct _GdkSegment {
      guint32 x1;
      guint32 y1;
      guint32 z1;
      guint32 x2;
      guint32 y2;
      guint32 z2;
    }
    
    struct _GdkSpan {
      guint32 x;
      guint32 y;
      guint32 z;
      guinn32 width;
    }
    
    typedef struct _GdkPoint     GdkPoint;
    typedef struct _GdkBox       GdkBox;
    typedef struct _GdkSegment   GdkSegment;
    typedef struct _GdkSpan      GdkSpan;
    
    #undef __GDK_TYPES_H__
    Please note that this is a LIBRARY, not an application, so it doesn't necessarily have to be executable until used. Sergei, please tell me you know the difference between a program and a library.
    Posted 08-13-2010 at 04:40 PM by Kenny_Strawn Kenny_Strawn is offline
  5. Old Comment
    Quote:
    Originally Posted by Kenny_Strawn View Comment
    Okay fine. Here's what I was really planning: 3D geometry types to essentially draw widgets (like windows, borders, and panels/menus) in 3D. Witness:

    Code:
    #include <glib.h>
    #include <glib/gtypes.h>
    #include <gtk/gtk.h>
    #include <gdk/gdk.h>
    
    #define __GDK_TYPES_H__
    
    struct _GdkPoint {
      guint32 x;
      guint32 y;
      guint32 z;
    }
    
    struct _GdkBox {
      guint32 x;
      guint32 y;
      guint32 z;
      guint32 width;
      guint32 height;
      guint32 depth;
    }
    
    struct _GdkSegment {
      guint32 x1;
      guint32 y1;
      guint32 z1;
      guint32 x2;
      guint32 y2;
      guint32 z2;
    }
    
    struct _GdkSpan {
      guint32 x;
      guint32 y;
      guint32 z;
      guinn32 width;
    }
    
    typedef struct _GdkPoint     GdkPoint;
    typedef struct _GdkBox       GdkBox;
    typedef struct _GdkSegment   GdkSegment;
    typedef struct _GdkSpan      GdkSpan;
    
    #undef __GDK_TYPES_H__
    Please note that this is a LIBRARY, not an application, so it doesn't necessarily have to be executable until used. Sergei, please tell me you know the difference between a program and a library.
    Program is a code which is executed - typically programs are processes from OS point of view.

    Library is a set functions with, if necessary, related global data, and libraries are used within other functions/programs.

    The code you've published is a header, not a library, and you've clarified it as such. Even though it is a bunch of type definitions, these definitions define fundamental graphical geometry. Without them, there is no GUI. And because this graphical geometry API is in 3D, plenty of visual effects can arise from it.
    Posted 08-14-2010 at 05:36 AM by Sergei Steshenko Sergei Steshenko is offline
    Updated 08-16-2010 at 10:34 AM by Kenny_Strawn (Removed agressive text from comment)
  6. Old Comment
    Actually, it's supposed to be a header. Other programs are supposed to use these types in programs that are then to be compiled.

    These are more then just type definitions. They are geometry definitions and 3D ones. The GdkPrism, for example, is the 3D equivalent of GdkRectangle. Also: GdkPoint has an extra coordinate ('z') that allows it to exist in space, not a plane. And the GdkSegment has 3D coordinates (z1 and z2) to allow the segment to exist in space instead of a plane. Please look more closely before you go ahead and bash. Your comments will be edited or deleted if you keep it up.
    Posted 08-16-2010 at 10:27 AM by Kenny_Strawn Kenny_Strawn is offline
  7. Old Comment
    Quote:
    Originally Posted by Kenny_Strawn View Comment
    ... Your comments will be edited or deleted if you keep it up.
    I don't care. You are still failing to grasp the main problem: gtk+ has no ways of knowing about your code. You are developing your code not even trying to make sure gtk+ will know about it and will work it.

    It's like you are developing a yet unknown jet engine to power a car with manual transmission, not even thing about a need of some shank in the engine which should match the manual transmission gearbox.
    Posted 08-16-2010 at 07:13 PM by Sergei Steshenko Sergei Steshenko is offline
    Updated 08-22-2010 at 01:45 AM by Kenny_Strawn (Removed profanity; no profanity allowed in my blog.)
 

  



All times are GMT -5. The time now is 06:53 PM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration