From: arif Date: Tue, 4 Mar 2008 17:54:53 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: LAST_LIBGRAPH~32^2~4575 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c84d5bfa0728d48990e14219e37dbc0363b926e5;p=graphviz *** empty log message *** --- diff --git a/lib/glcomp/glcompset.c b/lib/glcomp/glcompset.c index 21c0df1d0..b8a0f9c6f 100644 --- a/lib/glcomp/glcompset.c +++ b/lib/glcomp/glcompset.c @@ -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; } diff --git a/lib/glcomp/glcompset.h b/lib/glcomp/glcompset.h index e455b14a4..bbc9b7674 100644 --- a/lib/glcomp/glcompset.h +++ b/lib/glcomp/glcompset.h @@ -11,35 +11,35 @@ //#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 diff --git a/lib/glcomp/glcomptexture.c b/lib/glcomp/glcomptexture.c index 0dc258aa7..d44a80f01 100644 --- a/lib/glcomp/glcomptexture.c +++ b/lib/glcomp/glcomptexture.c @@ -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) diff --git a/lib/glcomp/glutils.c b/lib/glcomp/glutils.c index 738425eae..d4b13fae2 100644 --- a/lib/glcomp/glutils.c +++ b/lib/glcomp/glutils.c @@ -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)); }