Back to index

easystroke  0.5.5.1
Public Member Functions | Private Member Functions | Private Attributes
Composite Class Reference

#include <composite.h>

Inheritance diagram for Composite:
Inheritance graph
[legend]
Collaboration diagram for Composite:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Composite ()
virtual ~Composite ()
void draw (Point p)
void start (Point p)
void end ()
virtual void timeout ()

Private Member Functions

virtual void draw (Point p, Point q)
virtual void start_ ()
virtual void end_ ()

Private Attributes

int num_x
int num_y
Popup *** pieces

Detailed Description

Definition at line 32 of file composite.h.


Constructor & Destructor Documentation

Definition at line 48 of file composite.cc.

                     {
#define N 128
       int w = gdk_screen_width();
       int h = gdk_screen_height();
       num_x = (gdk_screen_width()  - 1)/N + 1;
       num_y = (gdk_screen_height() - 1)/N + 1;
       pieces = new Popup**[num_x];
       for (int i = 0; i < num_x; i++) {
              pieces[i] = new Popup*[num_y];
              for (int j = 0; j < num_y; j++)
                     pieces[i][j] = new Popup(i*N,j*N,MIN((i+1)*N,w),MIN((j+1)*N,h));

       }
}
Composite::~Composite ( ) [virtual]

Definition at line 137 of file composite.cc.

                      {
       for (int i = 0; i < num_x; i++) {
              for (int j = 0; j < num_y; j++)
                     delete pieces[i][j];
              delete[] pieces[i];
       }
       delete[] pieces;
}

Member Function Documentation

void Composite::draw ( Point  p,
Point  q 
) [private, virtual]

Implements Trace.

Definition at line 63 of file composite.cc.

                                     {
       if (!points.size()) {
              points.push_back(p);
       }
       points.push_back(q);
       int x1 = (int)(p.x < q.x ? p.x : q.x);
       int x2 = (int)(p.x < q.x ? q.x : p.x);
       int y1 = (int)(p.y < q.y ? p.y : q.y);
       int y2 = (int)(p.y < q.y ? q.y : p.y);
       int bw = (int)(width/2.0) + 2;
       x1 -= bw; y1 -= bw;
       x2 += bw; y2 += bw;
       if (x1 < 0)
              x1 = 0;
       if (y1 < 0)
              y1 = 0;
       for (int i = x1/N; i<num_x && i<=x2/N; i++)
              for (int j = y1/N; j<num_y && j<=y2/N; j++)
                     pieces[i][j]->invalidate(x1, y1, x2, y2);
}
void Trace::draw ( Point  p) [inline, inherited]

Definition at line 38 of file trace.h.

{ draw(last, p); last = p; }

Here is the call graph for this function:

Here is the caller graph for this function:

void Trace::end ( ) [inherited]

Definition at line 781 of file main.cc.

                {
       if (!active)
              return;
       active = false;
       XFixesShowCursor(dpy, ROOT);
       end_();
}

Here is the call graph for this function:

void Composite::end_ ( ) [private, virtual]

Implements Trace.

Definition at line 130 of file composite.cc.

                     {
       points.clear();
       for (int i = 0; i < num_x; i++)
              for (int j = 0; j < num_y; j++)
                     pieces[i][j]->hide();
}
void Trace::start ( Trace::Point  p) [inherited]

Definition at line 774 of file main.cc.

                              {
       last = p;
       active = true;
       XFixesHideCursor(dpy, ROOT);
       start_();
}

Here is the call graph for this function:

void Composite::start_ ( ) [private, virtual]

Implements Trace.

Definition at line 84 of file composite.cc.

                       {
       RGBA rgba = prefs.color.get();
       red = rgba.color.get_red_p();
       green = rgba.color.get_green_p();
       blue = rgba.color.get_blue_p();
       alpha = ((double)rgba.alpha)/65535.0;
       width = prefs.trace_width.get();
}

Here is the call graph for this function:

virtual void Trace::timeout ( ) [inline, virtual, inherited]

Reimplemented in Fire, and Shape.

Definition at line 41 of file trace.h.

{}

Member Data Documentation

int Composite::num_x [private]

Definition at line 33 of file composite.h.

int Composite::num_y [private]

Definition at line 33 of file composite.h.

Popup*** Composite::pieces [private]

Definition at line 34 of file composite.h.


The documentation for this class was generated from the following files: