Beispiel #1
0
static Object P_Create_Cursor (Object srcp, Object maskp, Object x, Object y,
                               Object f, Object b) {
    Pixmap sp = Get_Pixmap (srcp), mp;
    Display *d = PIXMAP(srcp)->dpy;

    mp = EQ(maskp, Sym_None) ? None : Get_Pixmap (maskp);
    return Make_Cursor (d, XCreatePixmapCursor (d, sp, mp,
        Get_Color (f), Get_Color (b), Get_Integer (x), Get_Integer (y)));
}
Beispiel #2
0
static Object P_Create_Glyph_Cursor (Object srcf, Object srcc, Object maskf,
                                     Object maskc, Object f, Object b) {
    Font sf = Get_Font (srcf), mf;
    Display *d = FONT(srcf)->dpy;

    mf = EQ(maskf, Sym_None) ? None : Get_Font (maskf);
    return Make_Cursor (d, XCreateGlyphCursor (d, sf, mf,
        Get_Integer (srcc), mf == None ? 0 : Get_Integer (maskc),
        Get_Color (f), Get_Color (b)));
}
Beispiel #3
0
void Cursor_Task(void *parg)//用于显示闪烁的光标
{
	COLOR ctmp;
	(void)parg;
	for(;;)
	{
		ctmp=Get_Color();
		Set_Color(WHITE,BLACK);
		Show_Char('|',cursor.x,cursor.y);
		Set_Color(ctmp.BC,ctmp.FC);
		OSTimeDlyHMSM(0,0,0,500);//延时500ms
		ctmp=Get_Color();
		Set_Color(WHITE,BLACK);
		Show_Char(' ',cursor.x,cursor.y);
		Set_Color(ctmp.BC,ctmp.FC);
		OSTimeDlyHMSM(0,0,0,500);//延时500ms
	}
}
void CModbusPollView::OnEditAdd()
{
	int Index;
	if(m_Hide_Alias_Columns!=0)//都是数值的
	{
		//Index=(m_Current_Col-1)*(m_MsDataGrid.get_Rows()-1)+(m_Current_Row-1);
        if (m_Current_Col%2!=0)
        {
            return;
        }
        else
        {

            Index=(m_Current_Col/2-1)*(m_MsDataGrid.get_Rows()-1)+(m_Current_Row-1);
        }
	}
	else//含义名字的
	{
		if (m_Current_Col%3!=0)
		{
			    return;
		}
		else
		{
			 
			Index=(m_Current_Col/3-1)*(m_MsDataGrid.get_Rows()-1)+(m_Current_Row-1);
		}

	 
	}
	 
	int address=Get_Reg_Add(Index);
	CString RegName;
	RegName.Format(_T("Reg:%d"),address);
	Registers_Infor temp_reginfor;
	temp_reginfor.Reg_Name=RegName;
	temp_reginfor.address=address;
	temp_reginfor.Point_Color=Get_Color(g_Color_Index);
	++g_Color_Index;
	g_vectRegisters.push_back(temp_reginfor);


}
//---------------------------------------------------------
inline void CSG_3DView_Canvas::_Draw_Triangle_Line(int y, double xa, double xb, double za, double zb, double ca, double cb, double da, double db, double dim)
{
	if( xb < xa )
	{
		double	d;

		d	= xa;	xa	= xb;	xb	= d;
		d	= za;	za	= zb;	zb	= d;
		d	= ca;	ca	= cb;	cb	= d;
		d	= da;	da	= db;	db	= d;
	}

	if( xb > xa )
	{
		double	dz	= (zb - za) / (xb - xa);
		double	dc	= (cb - ca) / (xb - xa);
		double	dd	= (db - da) / (xb - xa);

		int		ax	= (int)xa;	if( ax < 0 )	ax	= 0;	if( ax < xa )	ax++;
		int		bx	= (int)xb;	if( bx >= m_Image_NX )	bx	= m_Image_NX - 1;

		for(int x=ax; x<=bx; x++)
		{
			double	z	= za + dz * (x - xa);
			double	c	= ca + dc * (x - xa);
			double	d	= da + dd * (x - xa);

			if( m_pDrape )
			{
				if( m_pDrape->Get_Value(c, d, c, m_Drape_Mode, false, true) )
				{
					_Draw_Pixel(x, y, z, _Dim_Color((int)(0.5 + c), dim));
				}
			}
			else
			{
				_Draw_Pixel(x, y, z, _Dim_Color(Get_Color(c), dim));
			}
		}
	}
}
Beispiel #6
0
static Object P_Recolor_Cursor (Object c, Object f, Object b) {
    Check_Type (c, T_Cursor);
    XRecolorCursor (CURSOR(c)->dpy, CURSOR(c)->cursor, Get_Color (f),
        Get_Color (b));
    return Void;
}
Beispiel #7
0
/****************************************************************************************
* Creer une image
* Attention la largeur doit etre un multiple de 4
****************************************************************************************/
image * Creer_Image(char * nom_bas, int hauteur, int largeur, int col, int niv) {
    image *img = NULL;

    // Allocation de l'image

    img = (image *)malloc(sizeof(image));
	if (img == NULL) {
		printf ("Creer_Image 1 : Impossible d'initialiser avec malloc\n" );
		exit(EXIT_FAILURE);
	}

    // Remplissage des parametres

    strncpy(img->nom_base, nom_bas, FIC_BA_SIZE);

	img->largeur = largeur;
	img->hauteur = hauteur;
	img->nb_pix = largeur * hauteur;

	img->bitpix = BIT_PIXEL;
	img->offset = HEADER_SIZE;
	img->taille = img->offset + (3* (img->largeur + img->largeur%4) * img->hauteur);

    // Creation du header

    img->header = (unsigned char *)calloc(1, HEADER_SIZE);
	if (img->header == NULL) {
		printf ("Creer_Image 2 : Impossible d'initialiser avec malloc\n");
		exit(EXIT_FAILURE);
	}

    img->header[0] = 'B';
    img->header[1] = 'M';

	memcpy(&img->header[2], &img->taille, sizeof(unsigned long int));

	img->header[6] = 'E';     // Applic ID
	img->header[7] = 'R';
	img->header[8] = 'I';
	img->header[9] = 'C';

	memcpy(&img->header[10], &img->offset, sizeof(unsigned long int));

	img->header[14] = HEADER_SIZE - 14;

	memcpy(&img->header[18], &img->largeur, sizeof(int));

	memcpy(&img->header[22], &img->hauteur, sizeof(int));

	img->header[26] = 1;                    // Planes = 1 : ImageMagick

	img->header[28] = img->bitpix;          // 24 bits par pixel

    // Creation de l'image

    img->pic = Malloc_Pic(img->hauteur, img->largeur);

    Initialiser_Image(img, Get_Color(col, niv) );

    return img;
}