]> granicus.if.org Git - graphviz/commitdiff
*** empty log message ***
authorarif <devnull@localhost>
Tue, 4 Mar 2008 17:54:53 +0000 (17:54 +0000)
committerarif <devnull@localhost>
Tue, 4 Mar 2008 17:54:53 +0000 (17:54 +0000)
lib/glcomp/glcompset.c
lib/glcomp/glcompset.h
lib/glcomp/glcomptexture.c
lib/glcomp/glutils.c

index 21c0df1d0c9e0a5ee10f1301b90b3536c3ec2031..b8a0f9c6fe0e85410650428ee6cd54071565236d 100644 (file)
@@ -147,10 +147,10 @@ int glCompDrawLabel(glCompLabel* p)
                        p->pos.y=p->pos.y+p->panel->pos.y;
                }
 
-               fontSize (p->size);
+               fontSize ((int)p->size);
                fontColorA (p->color.R,p->color.G,p->color.B,p->color.A);
 
-               fontDrawString  ( p->pos.x,p->pos.y,p->text,p->size*p->fontsizefactor*strlen(p->text));
+               fontDrawString  ( (int)p->pos.x,(int)p->pos.y,p->text,(int)(p->size*p->fontsizefactor*strlen(p->text)));
                if (p->panel)
                {
                        p->pos.x=p->pos.x-p->panel->pos.x;
@@ -323,8 +323,8 @@ int glCompDrawButton(glCompButton* p)
        if (p->status==1)
        {
                color_fac=GLCOMPSET_BUTTON_BEVEL_BRIGHTNESS;
-               glColor4f(p->color.R/1.2,p->color.G/1.2,p->color.B/1.2,p->color.A);
-               p->thickness=p->thickness/1.2;
+               glColor4f(p->color.R/(GLfloat)1.2,p->color.G/(GLfloat)1.2,p->color.B/(GLfloat)1.2,p->color.A);
+               p->thickness=p->thickness/(GLfloat)1.2;
 
        }
 
@@ -332,7 +332,7 @@ int glCompDrawButton(glCompButton* p)
        {
                color_fac=1/GLCOMPSET_BUTTON_BEVEL_BRIGHTNESS;
                glColor4f(p->color.R,p->color.G,p->color.B,p->color.A);
-               p->thickness=p->thickness*1.2;
+               p->thickness=p->thickness*(GLfloat)1.2;
        }
        if (!p->hasglyph)
        {
@@ -378,20 +378,20 @@ int glCompDrawButton(glCompButton* p)
                glVertex3f(p->pos.x+p->thickness,p->pos.y+p->height-p->thickness,p->bevel);
                glEnd();
                //draw caption
-               fontx=(p->width-p->thickness*2-p->fontsize*strlen(p->caption)*GLCOMPSET_FONT_SIZE_FACTOR)/2.0+p->pos.x+p->thickness;
-               fonty=(p->height-p->thickness*2-p->fontsize)/2.0+p->pos.y+p->thickness;
-               fontSize (p->fontsize);
+               fontx=(p->width-p->thickness*(GLfloat)2-p->fontsize*strlen(p->caption)*GLCOMPSET_FONT_SIZE_FACTOR)/(GLfloat)2.0+p->pos.x+p->thickness;
+               fonty=(p->height-p->thickness*(GLfloat)2-p->fontsize)/(GLfloat)2.0+p->pos.y+p->thickness;
+               fontSize ((int)p->fontsize);
 //             fontColorA (p->fontcolor.R,p->fontcolor.B,p->fontcolor.G,p->fontcolor.A);
                fontColorA (0,0,0,1);
-               fontDrawString (fontx,fonty,p->caption,p->fontsize*strlen(p->caption)*GLCOMPSET_FONT_SIZE_FACTOR);
+               fontDrawString ((int)fontx,(int)fonty,p->caption,(int)(p->fontsize*strlen(p->caption)*GLCOMPSET_FONT_SIZE_FACTOR));
        }
        //put glyph
        else
        {
 
                glEnable( GL_TEXTURE_2D );
-               fontx=(p->width-p->thickness*2-p->glyphwidth)/2.0+p->pos.x+p->thickness;
-               fonty=(p->height-p->thickness*2-p->glyphheight)/2.0+p->pos.y+p->thickness;
+               fontx=(p->width-p->thickness*(GLfloat)2-p->glyphwidth)/(GLfloat)2.0+p->pos.x+p->thickness;
+               fonty=(p->height-p->thickness*(GLfloat)2-p->glyphheight)/(GLfloat)2.0+p->pos.y+p->thickness;
                glBindTexture( GL_TEXTURE_2D, p->glyph->id);
                glColor4f(1,1,1,1);
                glBegin(GL_QUADS);
@@ -464,7 +464,6 @@ int glCompSetRelease(glCompSet* s,int x,int y)
 {
        
        int ind=0;
-       printf("in release\n");
        for (ind=0 ; ind < s->buttoncount; ind ++)
        {
                if((s->buttons[ind]->visible) && (s->buttons[ind]->enabled))
@@ -511,15 +510,10 @@ void glCompSetGetPos(int x, int y,float* X,float* Y,float* Z)
        GLdouble posX, posY, posZ;
 
 
-       int ind;
-       GLdouble depth[5];
-       GLdouble raster[5];
        GLint viewport[4];
        GLdouble modelview[16];
        GLdouble projection[16];
        GLfloat winX, winY;
-       GLfloat winZ[36];
-       char buffer [200];
        float kts=1;
        glGetDoublev( GL_MODELVIEW_MATRIX, modelview );
        glGetDoublev( GL_PROJECTION_MATRIX, projection );
@@ -534,9 +528,9 @@ void glCompSetGetPos(int x, int y,float* X,float* Y,float* Z)
        winY = (float)viewport[3] - (float)y;
        gluUnProject( winX, winY, wwinZ, modelview, projection, viewport, &posX, &posY, &posZ);
 
-       *X=posX;
-       *Y=posY;
-       *Z=posZ;
+       *X=(float)posX;
+       *Y=(float)posY;
+       *Z=(float)posZ;
 }
 
 
index e455b14a48beaad527d8e8879509f1642bd0b501..bbc9b76745e71cabf9fb781bcc1f248dadc0fac3 100644 (file)
 //#include "gltemplate.h"
 #include "glcomptexture.h"
 
-#define        GLCOMPSET_PANEL_COLOR_R         0.16
-#define        GLCOMPSET_PANEL_COLOR_G         0.44
-#define        GLCOMPSET_PANEL_COLOR_B         0.87
-#define        GLCOMPSET_PANEL_COLOR_ALPHA     0.5
-#define        GLCOMPSET_PANEL_SHADOW_COLOR_R          0
-#define        GLCOMPSET_PANEL_SHADOW_COLOR_G          0
-#define        GLCOMPSET_PANEL_SHADOW_COLOR_B          0
-#define        GLCOMPSET_PANEL_SHADOW_COLOR_A          0.3
-#define GLCOMPSET_PANEL_SHADOW_WIDTH           4
-
-#define        GLCOMPSET_BUTTON_COLOR_R                0
-#define        GLCOMPSET_BUTTON_COLOR_G                1
-#define        GLCOMPSET_BUTTON_COLOR_B                0.3
-#define        GLCOMPSET_BUTTON_COLOR_ALPHA    0.6
-#define        GLCOMPSET_BUTTON_THICKNESS              3
-#define        GLCOMPSET_BUTTON_BEVEL_BRIGHTNESS               1.7
-#define GLCOMPSET_FONT_SIZE                            14
-#define        GLCOMPSET_BUTTON_FONT_COLOR_R           1
-#define        GLCOMPSET_BUTTON_FONT_COLOR_G           1
-#define        GLCOMPSET_BUTTON_FONT_COLOR_B           1
-#define        GLCOMPSET_BUTTON_FONT_COLOR_ALPHA       1
-#define GLCOMPSET_FONT_SIZE_FACTOR                     0.7
-#define        GLCOMPSET_LABEL_COLOR_R         0
-#define        GLCOMPSET_LABEL_COLOR_G         0
-#define        GLCOMPSET_LABEL_COLOR_B         0
-#define        GLCOMPSET_LABEL_COLOR_ALPHA     1
-
-#define GLCOMPSET_PANEL_BEVEL                          0.1
-#define        GLCOMPSET_BEVEL_DIFF                            0.001
+#define        GLCOMPSET_PANEL_COLOR_R         (GLfloat)0.16
+#define        GLCOMPSET_PANEL_COLOR_G         (GLfloat)0.44
+#define        GLCOMPSET_PANEL_COLOR_B         (GLfloat)0.87
+#define        GLCOMPSET_PANEL_COLOR_ALPHA     (GLfloat)0.5
+#define        GLCOMPSET_PANEL_SHADOW_COLOR_R          (GLfloat)0
+#define        GLCOMPSET_PANEL_SHADOW_COLOR_G          (GLfloat)0
+#define        GLCOMPSET_PANEL_SHADOW_COLOR_B          (GLfloat)0
+#define        GLCOMPSET_PANEL_SHADOW_COLOR_A          (GLfloat)0.3
+#define GLCOMPSET_PANEL_SHADOW_WIDTH           (GLfloat)4
+
+#define        GLCOMPSET_BUTTON_COLOR_R                (GLfloat)0
+#define        GLCOMPSET_BUTTON_COLOR_G                (GLfloat)1
+#define        GLCOMPSET_BUTTON_COLOR_B                (GLfloat)0.3
+#define        GLCOMPSET_BUTTON_COLOR_ALPHA    (GLfloat)0.6
+#define        GLCOMPSET_BUTTON_THICKNESS              (GLfloat)3
+#define        GLCOMPSET_BUTTON_BEVEL_BRIGHTNESS               (GLfloat)1.7
+#define GLCOMPSET_FONT_SIZE                            (GLfloat)14
+#define        GLCOMPSET_BUTTON_FONT_COLOR_R           (GLfloat)1
+#define        GLCOMPSET_BUTTON_FONT_COLOR_G           (GLfloat)1
+#define        GLCOMPSET_BUTTON_FONT_COLOR_B           (GLfloat)1
+#define        GLCOMPSET_BUTTON_FONT_COLOR_ALPHA       (GLfloat)1
+#define GLCOMPSET_FONT_SIZE_FACTOR                     (GLfloat)0.7
+#define        GLCOMPSET_LABEL_COLOR_R         (GLfloat)0
+#define        GLCOMPSET_LABEL_COLOR_G         (GLfloat)0
+#define        GLCOMPSET_LABEL_COLOR_B         (GLfloat)0
+#define        GLCOMPSET_LABEL_COLOR_ALPHA     (GLfloat)1
+
+#define GLCOMPSET_PANEL_BEVEL                          (GLfloat)0.1
+#define        GLCOMPSET_BEVEL_DIFF                            (GLfloat)0.001
 
 typedef void (*callbackfunc_t)(void* component);
 
@@ -152,6 +152,7 @@ int glCompDrawLabel(glCompLabel* p);
 int glCompLabelSetText(glCompLabel* p,char* text);
 int glCompPanelHide(glCompPanel* p);
 int glCompPanelShow(glCompPanel* p);
+int glCompSetDrawPanels(glCompSet* s);
 
 
 #endif
index 0dc258aa7ec86e69d4c98bebaed9d32b1bcba99c..d44a80f010063a632d9c65ae75fbc64a95b280ef 100644 (file)
@@ -35,9 +35,9 @@ glCompTexture* glCompCreateTextureFromRaw(char* filename,int width,int height,in
     // if wrap is true, the texture wraps over at the edges (repeat)
     //       ... false, the texture ends at the edges (clamp)
     glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S,
-                     wrap ? GL_REPEAT : GL_CLAMP );
+                     (GLfloat)wrap ? (GLfloat)GL_REPEAT : GL_CLAMP );
     glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T,
-                     wrap ? GL_REPEAT : GL_CLAMP );
+                     (GLfloat)wrap ? (GLfloat)GL_REPEAT : GL_CLAMP );
 
 /*     glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S,GL_REPEAT );
        glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
@@ -54,8 +54,8 @@ glCompTexture* glCompCreateTextureFromRaw(char* filename,int width,int height,in
 
     // free buffer
     free( data );
-       t->w=width;
-       t->h=height;
+       t->w=(float)width;
+       t->h=(float)height;
        return t;
 }
 int glCompDeleteTexture(glCompTexture* t)
index 738425eae4142ec626161f7849b5de174e13c583..d4b13fae20c5a580705b11d0721a1f8a42bae103 100644 (file)
@@ -46,15 +46,10 @@ int GetOGLPosRef(int x, int y,float* X,float* Y,float* Z)
        GLdouble posX, posY, posZ;
 
 
-       int ind;
-       GLdouble depth[5];
-       GLdouble raster[5];
        GLint viewport[4];
        GLdouble modelview[16];
        GLdouble projection[16];
        GLfloat winX, winY;
-       GLfloat winZ[36];
-       char buffer [200];
        float kts=1;
        //glTranslatef (0.0,0.0,0.0);
        glGetDoublev( GL_MODELVIEW_MATRIX, modelview );
@@ -70,9 +65,9 @@ int GetOGLPosRef(int x, int y,float* X,float* Y,float* Z)
        winY = (float)viewport[3] - (float)y;
        gluUnProject( winX, winY, wwinZ, modelview, projection, viewport, &posX, &posY, &posZ);
 
-       *X=posX;
-       *Y=posY;
-       *Z=posZ;
+       *X=(float)posX;
+       *Y=(float)posY;
+       *Z=(float)posZ;
        return 1;
 
 }
@@ -82,7 +77,6 @@ float GetOGLDistance(int l)
 {
 
        int x,y;
-       float*  X,Y, Z;
        GLdouble wwinX;
        GLdouble wwinY;
        GLdouble wwinZ;
@@ -90,15 +84,10 @@ float GetOGLDistance(int l)
        GLdouble posXX, posYY, posZZ;
 
 
-       int ind;
-       GLdouble depth[5];
-       GLdouble raster[5];
        GLint viewport[4];
        GLdouble modelview[16];
        GLdouble projection[16];
        GLfloat winX, winY;
-       GLfloat winZ[36];
-       char buffer [200];
        float kts=1;
        //glTranslatef (0.0,0.0,0.0);
        glGetDoublev( GL_MODELVIEW_MATRIX, modelview );
@@ -120,7 +109,6 @@ float GetOGLDistance(int l)
        winX = (float)x;
        winY = (float)viewport[3] - (float)y;
        gluUnProject( winX, winY, wwinZ, modelview, projection, viewport, &posXX, &posYY, &posZZ);
-       printf ("return value:%f\n:",((float)posXX-(float)posX));
        return ((float)(posXX-posX));
 
 }