#include <stdio.h>
#include <string.h>
#include <math.h>
#include <sys/time.h>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <X11/Xutil.h>
#include <X11/cursorfont.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Shell.h>
#include "machine.h"
#include "version.h"
#include "math_graphics.h"
#include "sci_mem_alloc.h"
#include "periX11.h"
#include "color.h"
#include "bcg.h"
#include "Events.h"
#include "clipping.h"
#include "WindowList.h"
#include "sciprint.h"
#include "GetProperty.h"
#include "SetProperty.h"
#include "prompt.h"
#include <varargs.h>
#include <setjmp.h>
Include dependency graph for periX11.c:
Go to the source code of this file.
Data Structures | |
struct | alinfo |
struct | bgc |
struct | FontInfo |
struct | FontAlias |
struct | Offset |
Defines | |
#define | MESSAGE4 "Can't allocate point vector" |
#define | MESSAGE5 "Can't re-allocate point vector" |
#define | Char2Int(x) ( x & 0x000000ff ) |
#define | FONTNUMBER 11 |
#define | FONTMAXSIZE 6 |
#define | SYMBOLNUMBER 10 |
#define | MAXDASH 6 |
#define | DASH_TAB_SIZE 4 |
#define | NUMSETFONC 32 |
#define | MAXERRMSGLEN 512 |
#define | MAXPRINTF 512 |
#define | DbugInfo0(x) |
#define | DbugInfo1(x, y) |
#define | DbugInfo3(x, y, z, t) |
#define | STR0 "ScilabGraphic%d" |
#define | STR1 "BG%d" |
#define | STR2 "objfigure1" |
Functions | |
void AddMenu | __PARAMS ((integer *win_num, char *button_name, char **entries, integer *ne, integer *typ, char *fname, integer *ierr)) |
int | XRotDrawString (Display *dpy, XFontStruct *font, float angle, Drawable drawable, GC gc_, int x, int y, char *str) |
void ChangeBandF | __PARAMS ((int win_num, Pixel fg, Pixel bg)) |
void CreatePopupWindow | __PARAMS ((integer WinNum, Widget top, struct BCG *, Pixel *fg, Pixel *bg)) |
void GViewportResize | __PARAMS ((struct BCG *ScilabXgc, int *width, int *height)) |
integer | C2F (ismenu) |
Window Find_X_Scilab | __PARAMS ((void)) |
Window Find_BG_Window | __PARAMS ((int i)) |
Window GetWindowNumber | __PARAMS ((int)) |
static void | DrawMark (integer *x, integer *y) |
static void | LoadFonts (void) |
static void | LoadSymbFonts (void) |
static void C2F() | loadfamily_n (char *name, integer *j) |
static void PixmapClear | __PARAMS ((struct BCG *Xgc, int x, int y, int w, int h)) |
static void xset_colormap | __PARAMS ((integer *v1, integer *v2, integer *v3, integer *v4, integer *v5, integer *v6, double *a)) |
static void xset_dashstyle | __PARAMS ((integer *v1, integer *v2, integer *v3)) |
typedef | void (xset_f) |
void | XgcFreeColors (struct BCG *xgc) |
static void | xset_pixmapclear (integer *v1, integer *v2, integer *v3, integer *v4) |
int | WithBackingStore (void) |
static void | xset_show (integer *v1, integer *v2, integer *v3, integer *v4) |
void | sci_pixmap_resize (struct BCG *Xgc, int x, int y) |
void | CPixmapResize (int x, int y) |
static void | PixmapClear (struct BCG *Xgc, int x, int y, int w, int h) |
void | CPixmapResize1 (void) |
void C2F() | xselgraphic (char *v1, integer *v2, integer *v3, integer *v4, integer *v5, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4) |
void C2F() | xendgraphic (void) |
void C2F() | xend (char *v1, integer *v2, integer *v3, integer *v4, integer *v5, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4) |
void C2F() | clearwindow (char *v1, integer *v2, integer *v3, integer *v4, integer *v5, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4) |
void | Setpopupname (char *string) |
void C2F() | setpopupname (char *x0, integer *v2, integer *v3, integer *v4, integer *v5, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4, integer lx0) |
static void | set_client_message_on (void) |
static void | set_client_message_off (void) |
int | get_xclick_client_message_flag (void) |
void | set_wait_click (int val) |
void | set_event_select (int val) |
void | SciClick (integer *ibutton, integer *x1, integer *yy1, integer *iflag, int getmouse, int getrelease, int dyn_men, char *str, integer *lstr) |
void C2F() | xclick_any (char *str, integer *ibutton, integer *x1, integer *yy1, integer *iwin, integer *iflag, integer *istr, double *dv1, double *dv2, double *dv3, double *dv4) |
void C2F() | xclick (char *str, integer *ibutton, integer *x1, integer *yy1, integer *iflag, integer *istr, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4) |
void C2F() | xgetmouse (char *str, integer *ibutton, integer *x1, integer *yy1, integer *iflag, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4) |
void C2F() | cleararea (char *str, integer *x, integer *y, integer *w, integer *h, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4) |
static void | xget_windowpos (integer *verbose, integer *x, integer *narg, double *dummy) |
static void | xset_windowpos (integer *x, integer *y, integer *v3, integer *v4) |
void C2F() | getwindowdim (integer *verbose, integer *x, integer *narg, double *dummy) |
static void | xget_windowdim (integer *verbose, integer *x, integer *narg, double *dummy) |
static void | xset_windowdim (integer *x, integer *y, integer *v3, integer *v4) |
static void | xget_popupdim (integer *verbose, integer *x, integer *narg, double *dummy) |
static void | xset_popupdim (integer *x, integer *y, integer *v3, integer *v4) |
static void | xget_viewport (integer *verbose, integer *x, integer *narg, double *dummy) |
static void | xset_viewport (integer *x, integer *y, integer *v3, integer *v4) |
void | SwitchWindow (integer *intnum) |
static void | xset_curwin (integer *intnum, integer *v2, integer *v3, integer *v4) |
static void | xset_scilabFigure (integer *v1, integer *v2, integer *v3, integer *v4, integer *v5, integer *v6, double *figure) |
static void | xget_scilabFigure (integer *verbose, integer *x, integer *narg, double *figure) |
static void | xset_scilabxgc (integer *v1, integer *v2, integer *v3, integer *v4) |
static void | xget_scilabxgc (integer *verbose, integer *x, integer *narg, double *dummy) |
static void | xget_curwin (integer *verbose, integer *intnum, integer *narg, double *dummy) |
static void | xset_clip (integer *x, integer *y, integer *w, integer *h) |
static void | xset_unclip (integer *v1, integer *v2, integer *v3, integer *v4) |
static void | xget_clip (integer *verbose, integer *x, integer *narg, double *dummy) |
static void | xset_absourel (integer *num, integer *v2, integer *v3, integer *v4) |
static void | xget_absourel (integer *verbose, integer *num, integer *narg, double *dummy) |
void | set_c (integer col) |
static void | idfromname (char *name1, integer *num) |
void | xset_alufunction (char *string) |
static void | xset_alufunction1 (integer *num, integer *v2, integer *v3, integer *v4) |
static void | xset_alufunction2 (struct BCG *Xgc, integer *num, integer *v2, integer *v3, integer *v4) |
static void | xget_alufunction (integer *verbose, integer *value, integer *narg, double *dummy) |
static void | setRealDashStyle (integer lineThickness, integer dashStyle, integer dashStyleSize) |
static void | xset_thickness (integer *value, integer *v2, integer *v3, integer *v4) |
static void | xget_thickness (integer *verbose, integer *value, integer *narg, double *dummy) |
void C2F() | CreatePatterns (Pixel whitepixel, Pixel blackpixel) |
static void | xset_pattern (integer *num, integer *v2, integer *v3, integer *v4) |
static void | xget_pattern (integer *verbose, integer *num, integer *narg, double *dummy) |
static void | xget_last (integer *verbose, integer *num, integer *narg, double *dummy) |
static void | xset_dash (integer *value, integer *v2, integer *v3, integer *v4) |
static void | xset_dash_or_color (integer *value, integer *v2, integer *v3, integer *v4) |
static void | xset_dash_and_color (integer *value, integer *v2, integer *v3, integer *v4) |
static void | xset_line_style (integer *value, integer *v2, integer *v3, integer *v4) |
static void | xset_dashstyle (integer *value, integer *xx, integer *n) |
static void | xget_dash_or_color (integer *verbose, integer *value, integer *narg, double *dummy) |
static void | xget_dash (integer *verbose, integer *value, integer *narg, double *dummy) |
static void | xget_dash_and_color (integer *verbose, integer *value, integer *narg, double *dummy) |
static void | xset_usecolor (integer *num, integer *v1, integer *v2, integer *v3) |
static void | xget_usecolor (integer *verbose, integer *num, integer *narg, double *dummy) |
static void | xset_pixmapOn (integer *num, integer *v2, integer *v3, integer *v4) |
static void | xget_pixmapOn (integer *verbose, integer *value, integer *narg, double *dummy) |
static void | xset_wresize (integer *num, integer *v2, integer *v3, integer *v4) |
static void | xget_wresize (integer *verbose, integer *value, integer *narg, double *dummy) |
int C2F() | sedeco (int *flag) |
Pixel | RGB2pixO (unsigned int r, unsigned int g, unsigned int b, long unsigned int r_mask, long unsigned int g_mask, long unsigned int b_mask) |
static char * | hex_string (int r, int g, int b) |
Pixel | RGB2pix (unsigned int r, unsigned int g, unsigned int b, long unsigned int r_mask, long unsigned int g_mask, long unsigned int b_mask) |
void | set_default_colormap1 (int m) |
void | set_default_colormap2 (int m) |
void | set_default_colormap3 (int m) |
void | set_default_colormap (void) |
void | setcolormapg (struct BCG *XGC, integer *v1, integer *v2, double *a, integer *v3) |
void | setcolormap1 (struct BCG *XGC, integer m, double *a, integer *v3) |
void | setcolormap2 (struct BCG *XGC, integer m, double *a, integer *v3) |
void | setcolormap3 (struct BCG *XGC, integer m, double *a, integer *v3) |
static void | xset_colormap (integer *v1, integer *v2, integer *v3, integer *v4, integer *v5, integer *v6, double *a) |
static void | xset_gccolormap (integer *v1, integer *v2, double *a, struct BCG *XGC, integer *v3) |
static void | xget_colormap_size (integer *verbose, integer *num, integer *narg, double *val) |
static void | xget_colormap (integer *verbose, integer *num, integer *narg, double *val) |
int | IsPrivateCmap (void) |
static void | xset_background (integer *num, integer *v2, integer *v3, integer *v4) |
static void | xget_background (integer *verbose, integer *num, integer *narg, double *dummy) |
static void | xset_foreground (integer *num, integer *v2, integer *v3, integer *v4) |
static void | xget_foreground (integer *verbose, integer *num, integer *narg, double *dummy) |
static void | xset_hidden3d (integer *num, integer *v2, integer *v3, integer *v4) |
static void | xget_hidden3d (integer *verbose, integer *num, integer *narg, double *dummy) |
void | set_cmap (Window w) |
int | get_pixel (int i) |
Pixmap | get_pixmap (int i) |
int | CheckColormap (int *m) |
void | get_r (int i, float *r) |
void | get_g (int i, float *g) |
void | get_b (int i, float *b) |
static void | InitMissileXgc (integer *v1, integer *v2, integer *v3, integer *v4) |
static void | xset_empty (integer *verbose, integer *v2, integer *v3, integer *v4) |
static void | xget_empty (integer *verbose, integer *v2, integer *v3, double *dummy) |
void C2F() | MissileGCget (char *str, integer *verbose, integer *x1, integer *x2, integer *x3, integer *x4, integer *x5, double *dv1, double *dv2, double *dv3, double *dv4) |
void C2F() | MissileGCset (char *str, integer *x1, integer *x2, integer *x3, integer *x4, integer *x5, integer *x6, double *dv1, double *dv2, double *dv3, double *dv4) |
void C2F() | MissileGCGetorSet (char *str, integer flag, integer *verbose, integer *x1, integer *x2, integer *x3, integer *x4, integer *x5, integer *x6, double *dv1) |
void C2F() | displaystring (char *string, integer *x, integer *y, integer *v1, integer *flag, integer *v6, integer *v7, double *angle, double *dv2, double *dv3, double *dv4) |
void C2F() | DispStringAngle (integer *x, integer *y, char *string, double *angle) |
void C2F() | DispStringAngleold (integer *x0, integer *yy0, char *string, double *angle) |
void C2F() | boundingbox (char *string, integer *x, integer *y, integer *rect, integer *v5, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4) |
void C2F() | drawline (integer *x1, integer *yy1, integer *x2, integer *y2) |
void C2F() | drawsegments (char *str, integer *vx, integer *vy, integer *n, integer *style, integer *iflag, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4) |
void C2F() | drawarrows (char *str, integer *vx, integer *vy, integer *n, integer *as, integer *style, integer *iflag, double *dv1, double *dv2, double *dv3, double *dv4) |
void C2F() | drawrectangles (char *str, integer *vects, integer *fillvect, integer *n, integer *v5, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4) |
void C2F() | drawrectangle (char *str, integer *x, integer *y, integer *width, integer *height, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4) |
void C2F() | fillrectangle (char *str, integer *x, integer *y, integer *width, integer *height, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4) |
void | fill_grid_rectangles (integer *x, integer *y, double *z, integer n1, integer n2) |
void | fill_grid_rectangles1 (integer *x, integer *y, double *z, integer n1, integer n2) |
void C2F() | fillarcs (char *str, integer *vects, integer *fillvect, integer *n, integer *v5, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4) |
void C2F() | drawarcs (char *str, integer *vects, integer *style, integer *n, integer *v5, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4) |
void C2F() | drawarc (char *str, integer *x, integer *y, integer *width, integer *height, integer *angle1, integer *angle2, double *dv1, double *dv2, double *dv3, double *dv4) |
void C2F() | fillarc (char *str, integer *x, integer *y, integer *width, integer *height, integer *angle1, integer *angle2, double *dv1, double *dv2, double *dv3, double *dv4) |
void C2F() | drawpolylines (char *str, integer *vectsx, integer *vectsy, integer *drawvect, integer *n, integer *p, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4) |
void C2F() | fillpolylines (char *str, integer *vectsx, integer *vectsy, integer *fillvect, integer *n, integer *p, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4) |
static void C2F() | analyze_points (integer n, integer *vx, integer *vy, integer onemore) |
void C2F() | drawClippedPolyline (char *str, integer *n, integer *vx, integer *vy, integer *closeflag, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4) |
void C2F() | drawpolyline (char *str, integer *n, integer *vx, integer *vy, integer *closeflag, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4) |
void C2F() | fillpolyline (char *str, integer *n, integer *vx, integer *vy, integer *closeflag, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4) |
void C2F() | drawpolymark (char *str, integer *n, integer *vx, integer *vy, integer *v5, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4) |
BCG * | AddNewWindowToList (void) |
void | DeleteWindowToList (integer num) |
void | DeleteSGWin (integer intnum) |
Window | GetWindowNumber (int wincount) |
static struct BCG *GetWinXgc | __PARAMS ((WindowList *, integer)) |
static struct BCG * | GetWinXgc (WindowList *listptr, integer i) |
Window | GetBGWindowNumber (int wincount) |
int | GetEventWindow (XEvent *event) |
static int | X_error_handler (Display *d, XErrorEvent *err_ev) |
void C2F() | initgraphic (char *string, integer *v2, integer *v3, integer *v4, integer *v5, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4) |
void C2F() | xinfo (char *message, integer *v2, integer *v3, integer *v4, integer *v5, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4) |
void | wininfo (va_alist) |
void | SendScilab (Window local, integer winnum) |
static int | CheckWin (Window w) |
Window | Window_With_Name (Window top, char *name, int j, char *ResList0, char *ResList1, char *ResList2) |
Window | Find_X_Scilab (void) |
Window | Find_ScilabGraphic_Window (integer i) |
Window | Find_BG_Window (integer i) |
static void | Ignore_Err (Display *d, XErrorEvent *err_ev) |
static void | ResetScilabXgc (void) |
void C2F() | drawaxis (char *str, integer *alpha, integer *nsteps, integer *v2, integer *initpoint, integer *v6, integer *v7, double *size, double *dx2, double *dx3, double *dx4) |
void C2F() | getFontMaxSize (char *str, integer *sizeMin, integer *sizeMax, integer *v1, integer *v2, integer *v3, integer *v4, double *dx1, double *dx2, double *dx3, double *dx4) |
void C2F() | displaynumbers (char *str, integer *x, integer *y, integer *v1, integer *v2, integer *n, integer *flag, double *z, double *alpha, double *dx3, double *dx4) |
void C2F() | bitmap (char *string, integer w, integer h) |
int | fontidscale (int fontsize) |
static void | xset_font (integer *fontid, integer *fontsize, integer *v3, integer *v4) |
static void | xget_font (integer *verbose, integer *font, integer *nargs, double *dummy) |
static void | xset_mark (integer *number, integer *size, integer *v3, integer *v4) |
static void | xget_mark (integer *verbose, integer *symb, integer *narg, double *dummy) |
void C2F() | loadfamily (char *name, integer *j, integer *v3, integer *v4, integer *v5, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4) |
void C2F() | queryfamily (char *name, integer *j, integer *v3, integer *v4, integer *v5, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4) |
int C2F() | CurSymbXOffset (void) |
int C2F() | CurSymbYOffset (void) |
static XPoint * | get_xpoints (void) |
int C2F() | store_points (integer n, integer *vx, integer *vy, integer onemore) |
static int | ReallocVector (integer n) |
void | deletePoints (void) |
void | XDroutine (int npts) |
static int | clip_point (integer x, integer y) |
void | set_clip_box (integer xxleft, integer xxright, integer yybot, integer yytop) |
void | clip_line (integer x1, integer yy1, integer x2, integer y2, integer *x1n, integer *yy1n, integer *x2n, integer *y2n, integer *flag) |
integer | first_in (integer n, integer ideb, integer *vx, integer *vy) |
integer | first_out (integer n, integer ideb, integer *vx, integer *vy) |
int | CheckScilabXgc (void) |
void | getcolordef (integer *screenc) |
void | setcolordef (int screenc) |
Variables | |
double | t = 0. |
static GC | gc |
static Cursor | arrowcursor |
static Cursor | normalcursor |
static Cursor | crosscursor |
static Window | root = (Window) NULL |
static Display * | dpy = (Display *) NULL |
static Pixel | DefaultBackground |
static Pixel | DefaultForeground |
static double * | vdouble = 0 |
static int | depth |
static unsigned long | maxcol |
Visual * | visual |
static int | wpixel |
static int | bpixel |
unsigned short | default_colors [] |
BCG * | ScilabXgc = (struct BCG *) 0 |
static int | client_message = 0 |
static struct alinfo | AluStruc_ [] |
static integer | DashTab [MAXDASH][DASH_TAB_SIZE] |
Pixmap | Tabpix_ [GREYNUMBER] |
static char | grey0 [GREYNUMBER][8] |
static int | set_default_colormap_flag = 1 |
static char | hex_str [10] |
static struct bgc | MissileGCTab_ [] |
Atom | NewGraphWindowMessageAtom |
static char * | ResList [] = { SCI_VERSION_STRING,"BG","ScilabGraphic"} |
static jmp_buf | my_env |
FontInfo | FontInfoTab_ [FONTNUMBER] |
static char * | size_ [] = { "08" ,"10","12","14","18","24"} |
static int | i_size_ [] = { 8 ,10,12,14,18,24} |
FontAlias | fonttab [] |
static char * | size_n_ [] = { "8" ,"10","12","14","18","24"} |
static Offset | ListOffset_ [FONTMAXSIZE] |
static char | Marks [] |
static XPoint * | points = NULL |
static int | xleft |
static int | xright |
static int | ybot |
static int | ytop |
static int | screencolor = 1 |
#define DASH_TAB_SIZE 4 |
#define DbugInfo0 | ( | x | ) |
Definition at line 3671 of file periX11.c.
Referenced by Find_BG_Window(), Find_ScilabGraphic_Window(), Find_X_Scilab(), and Window_With_Name().
#define FONTMAXSIZE 6 |
#define FONTNUMBER 11 |
#define MAXERRMSGLEN 512 |
#define MESSAGE4 "Can't allocate point vector" |
#define MESSAGE5 "Can't re-allocate point vector" |
#define STR0 "ScilabGraphic%d" |
#define STR1 "BG%d" |
#define SYMBOLNUMBER 10 |
static struct BCG* GetWinXgc __PARAMS | ( | (WindowList *, integer) | ) | [static] |
static void xset_colormap __PARAMS | ( | (integer *v1, integer *v2, integer *v3, integer *v4, integer *v5, integer *v6, double *a) | ) | [static] |
Window GetWindowNumber __PARAMS | ( | (int) | ) |
Window Find_X_Scilab __PARAMS | ( | (void) | ) |
functions
void CreatePopupWindow __PARAMS | ( | (integer WinNum, Widget top, struct BCG *, Pixel *fg, Pixel *bg) | ) |
void AddMenu __PARAMS | ( | (integer *win_num, char *button_name, char **entries, integer *ne, integer *typ, char *fname, integer *ierr) | ) |
struct BCG* AddNewWindowToList | ( | void | ) |
static void C2F() analyze_points | ( | integer | n, | |
integer * | vx, | |||
integer * | vy, | |||
integer | onemore | |||
) | [static] |
Definition at line 4021 of file periX11.c.
References BCG::Cdrawable, BCG::CurPixmapStatus, BCG::CWindow, and ScilabXgc.
04022 { 04023 static XImage *setimage; 04024 setimage = XCreateImage (dpy, XDefaultVisual (dpy, DefaultScreen(dpy)), 04025 1, XYBitmap, 0, string,w,h, 8, 0); 04026 setimage->data = string; 04027 if (ScilabXgc->Cdrawable != (Drawable) 0) 04028 XPutImage (dpy, ScilabXgc->Cdrawable, gc, setimage, 0, 0, 10,10,w,h); 04029 if (ScilabXgc->CurPixmapStatus != 1) 04030 XPutImage (dpy, (Drawable) ScilabXgc->CWindow, gc, setimage, 0, 0, 10,10,w,h); 04031 04032 XDestroyImage(setimage); 04033 }
void C2F() boundingbox | ( | char * | string, | |
integer * | x, | |||
integer * | y, | |||
integer * | rect, | |||
integer * | v5, | |||
integer * | v6, | |||
integer * | v7, | |||
double * | dv1, | |||
double * | dv2, | |||
double * | dv3, | |||
double * | dv4 | |||
) |
To get the bounding rectangle of a string
text mode is supposed to be bottom
Definition at line 2719 of file periX11.c.
References dir, BCG::FontXID, and ScilabXgc.
02720 { 02721 int dir,asc,dsc; 02722 XCharStruct charret; 02723 if (strlen(string) !=0) { 02724 XQueryTextExtents(dpy,ScilabXgc->FontXID, 02725 string,strlen(string),&dir,&asc,&dsc,&charret); 02726 rect[0]= *x ; 02727 rect[1]= *y-charret.ascent-charret.descent; 02728 rect[2]= charret.width; 02729 rect[3]= charret.ascent+charret.descent; 02730 } 02731 else { 02732 rect[0]= *x ; 02733 rect[1]= *y; 02734 rect[2]= 0; 02735 rect[3]= 0; 02736 } 02737 }
integer C2F | ( | ismenu | ) |
Definition at line 2477 of file periX11.c.
References BCG::CmapFlag, BCG::Numcolors, and ScilabXgc.
02478 { 02479 if ( ScilabXgc != (struct BCG *) 0 ) 02480 { 02481 *m = ScilabXgc->Numcolors; 02482 if ( ScilabXgc->CmapFlag != 1) 02483 return 1; 02484 else 02485 return 0; 02486 } 02487 else 02488 { 02489 *m=0; 02490 return(0); 02491 } 02492 }
int CheckScilabXgc | ( | void | ) |
Definition at line 4621 of file periX11.c.
References ScilabXgc.
Referenced by initgraphicfromscreenGif(), and initgraphicGif().
Here is the caller graph for this function:
static int CheckWin | ( | Window | w | ) | [static] |
Definition at line 3796 of file periX11.c.
References Ignore_Err(), and int.
Referenced by Window_With_Name().
03797 { 03798 Window root_ret; 03799 int x, y; 03800 unsigned width= -1, height= -1, bw, idepth; 03801 int (*curh)(); 03802 curh=XSetErrorHandler((XErrorHandler) Ignore_Err); 03803 if ( setjmp(my_env)) 03804 { 03806 XSetErrorHandler((XErrorHandler) curh); 03807 return(0); 03808 } 03809 else 03810 { 03811 XGetGeometry (dpy, w, &root_ret, &x, &y, &width, &height, &bw, &idepth); 03812 XSync (dpy, 0); 03813 XSetErrorHandler((XErrorHandler) curh); 03814 return(1);} 03815 }
Here is the call graph for this function:
Here is the caller graph for this function:
void C2F() cleararea | ( | char * | str, | |
integer * | x, | |||
integer * | y, | |||
integer * | w, | |||
integer * | h, | |||
integer * | v6, | |||
integer * | v7, | |||
double * | dv1, | |||
double * | dv2, | |||
double * | dv3, | |||
double * | dv4 | |||
) |
Definition at line 664 of file periX11.c.
References BCG::Cdrawable, PixmapClear(), and ScilabXgc.
00665 { 00666 if (ScilabXgc->Cdrawable != (Drawable) 0 ) 00667 PixmapClear(ScilabXgc,*x,*y,*w,*h); 00668 if (ScilabXgc->CurPixmapStatus != 1) 00669 XClearArea(dpy,ScilabXgc->CWindow,(int)*x,(int) *y,(unsigned) *w, 00670 (unsigned) *h,False); 00671 XFlush(dpy); 00672 }
Here is the call graph for this function:
void C2F() clearwindow | ( | char * | v1, | |
integer * | v2, | |||
integer * | v3, | |||
integer * | v4, | |||
integer * | v5, | |||
integer * | v6, | |||
integer * | v7, | |||
double * | dv1, | |||
double * | dv2, | |||
double * | dv3, | |||
double * | dv4 | |||
) |
Clear the current graphic window
verifier ce qui se passe si on est en Xor ? XXXXXXXX
Definition at line 404 of file periX11.c.
References BCG::Cdrawable, BCG::CWindow, PI0, ScilabXgc, and xset_pixmapclear().
00405 { 00406 if (ScilabXgc->Cdrawable != (Drawable) 0 ) 00407 xset_pixmapclear(PI0,PI0,PI0,PI0); 00408 XClearWindow(dpy, ScilabXgc->CWindow); 00409 XFlush(dpy); 00410 }
Here is the call graph for this function:
void clip_line | ( | integer | x1, | |
integer | yy1, | |||
integer | x2, | |||
integer | y2, | |||
integer * | x1n, | |||
integer * | yy1n, | |||
integer * | x2n, | |||
integer * | y2n, | |||
integer * | flag | |||
) |
Definition at line 4469 of file periX11.c.
References clip_point(), count, dx, and dy.
04470 { 04471 integer x_intr[2], y_intr[2]; /* used to store intersection points 04472 * at most two points 04473 */ 04474 integer x, y, dx, dy, count, pos1, pos2; 04475 04476 *x1n=x1;*yy1n=yy1;*x2n=x2;*y2n=y2;*flag=4; 04477 pos1 = clip_point(x1, yy1); 04478 pos2 = clip_point(x2, y2); 04479 if (pos1 || pos2) { 04480 if (pos1 & pos2) { *flag=0;return;} 04481 /* segment is totally out. */ 04482 04483 /* Here part of the segment MAy be inside. test the intersection 04484 * of this segment with the 4 boundaries for hopefully 2 intersections 04485 * in. If non found segment is totaly out. 04486 */ 04487 count = 0; 04488 dx = x2 - x1; 04489 dy = y2 - yy1; 04490 04491 /* Find intersections with the x parallel bbox lines: */ 04492 if (dy != 0) { 04493 x = (int) (ybot - y2) * ((double) dx / (double) dy) + x2; 04494 /* Test for ybot boundary. */ 04495 if (x >= xleft && x <= xright) { 04496 x_intr[count] = x; 04497 y_intr[count++] = ybot; 04498 } 04499 x = (ytop - y2) * ((double) dx / (double) dy) + x2; 04500 /* Test for ytop boundary. */ 04501 if (x >= xleft && x <= xright) { 04502 x_intr[count] = x; 04503 y_intr[count++] = ytop; 04504 } 04505 } 04506 if ( count < 2 ) 04507 { 04508 /* Find intersections with the y parallel bbox lines: */ 04509 if (dx != 0) { 04510 y = (xleft - x2) * ((double) dy / (double) dx) + y2; 04511 /* Test for xleft boundary. */ 04512 if (y >= ybot && y <= ytop) { 04513 x_intr[count] = xleft; 04514 y_intr[count++] = y; 04515 } 04516 if ( count < 2 ) 04517 { 04518 y = (xright - x2) * ((double) dy / (double) dx) + y2; 04519 /* Test for xright boundary. */ 04520 if (y >= ybot && y <= ytop) { 04521 x_intr[count] = xright; 04522 y_intr[count++] = y; 04523 } 04524 } 04525 } 04526 } 04527 04528 if (count == 2) { 04529 if (pos1 && pos2) { /* Both were out - update both */ 04530 *x1n = x_intr[0]; 04531 *yy1n = y_intr[0]; 04532 *x2n = x_intr[1]; 04533 *y2n = y_intr[1]; 04534 *flag=3;return; 04535 } 04536 else if (pos1) { /* Only x1/yy1 was out - update only it */ 04537 if (dx * (x2 - x_intr[0]) + dy * (y2 - y_intr[0]) >= 0) { 04538 *x1n = x_intr[0]; 04539 *yy1n = y_intr[0]; 04540 *flag=1;return; 04541 } 04542 else { 04543 *x1n = x_intr[1]; 04544 *yy1n = y_intr[1]; 04545 *flag=1;return; 04546 } 04547 } 04548 else { /* Only x2/y2 was out - update only it */ 04549 if (dx * (x_intr[0] - x1) + dy * (y_intr[0] - yy1) >= 0) { 04550 *x2n = x_intr[0]; 04551 *y2n = y_intr[0]; 04552 *flag=2;return; 04553 } 04554 else { 04555 *x2n = x_intr[1]; 04556 *y2n = y_intr[1]; 04557 *flag=2;return; 04558 } 04559 } 04560 } 04561 else 04562 { 04563 /* count != 0 */ 04564 *flag=0;return; 04565 } 04566 } 04567 }
Here is the call graph for this function:
Definition at line 334 of file periX11.c.
References sci_pixmap_resize(), and ScilabXgc.
00335 { 00336 sci_pixmap_resize(ScilabXgc,x,y); 00337 }
Here is the call graph for this function:
void CPixmapResize1 | ( | void | ) |
Definition at line 361 of file periX11.c.
References BCG::Cdrawable, CPixmapResize(), BCG::CWindow, and ScilabXgc.
00362 { 00363 XWindowAttributes war; 00364 if (ScilabXgc->Cdrawable != (Drawable) 0 ) 00365 { 00366 XGetWindowAttributes(dpy,ScilabXgc->CWindow,&war); 00367 CPixmapResize(war.width,war.height); 00368 } 00369 }
Here is the call graph for this function:
int C2F() CurSymbXOffset | ( | void | ) |
Definition at line 4338 of file periX11.c.
References BCG::CurHardSymb, BCG::CurHardSymbSize, ListOffset_, ScilabXgc, and Offset::xoffset.
04339 { 04340 return(-(ListOffset_[ScilabXgc->CurHardSymbSize].xoffset) 04341 [ScilabXgc->CurHardSymb]); 04342 }
int C2F() CurSymbYOffset | ( | void | ) |
Definition at line 4344 of file periX11.c.
References BCG::CurHardSymb, BCG::CurHardSymbSize, ListOffset_, ScilabXgc, and Offset::yoffset.
04345 { 04346 return((ListOffset_[ScilabXgc->CurHardSymbSize].yoffset) 04347 [ScilabXgc->CurHardSymb]); 04348 }
void deletePoints | ( | void | ) |
void DeleteSGWin | ( | integer | intnum | ) |
destruction d'une fenetre
No more graphic window ;
fix the new current graphic window
Definition at line 3348 of file periX11.c.
References curwin(), BCG::CurWindow, del_window_scale(), DeleteWindowToList(), get_window_scale(), getFirstWindow(), isWindowListEmpty(), NULL, ResetScilabXgc(), and ScilabXgc.
Referenced by C2F(), Delete(), and SendCountDelete().
03349 { 03350 int curwin; 03351 if ( ScilabXgc == NULL ) { return ; } 03352 03353 curwin = ScilabXgc->CurWindow ; 03354 DeleteWindowToList(intnum); 03355 /*XXXX: jpc 2000: I also delete the scale list associated to that window */ 03356 del_window_scale(intnum); 03357 if ( curwin == intnum ) 03358 { 03359 if ( isWindowListEmpty() ) 03360 { 03362 ScilabXgc = NULL ; 03363 } 03364 else 03365 { 03367 ScilabXgc = getFirstWindow() ; 03368 ResetScilabXgc (); 03369 get_window_scale(ScilabXgc->CurWindow,NULL); 03370 } 03371 } 03372 }
Here is the call graph for this function:
Here is the caller graph for this function:
void DeleteWindowToList | ( | integer | num | ) |
Definition at line 3330 of file periX11.c.
References BCG::CBGWindow, getWindowXgcNumber(), NULL, BCG::popup, removeWindowItem(), and XgcFreeColors().
03331 { 03332 Widget popup = NULL ; 03333 struct BCG * window = getWindowXgcNumber( num ) ; 03334 03335 if ( window == NULL ) { return ; } 03336 03337 popup = XtWindowToWidget(dpy,window->CBGWindow); 03338 XtDestroyWidget( popup ) ; 03339 XgcFreeColors( window ) ; 03340 03341 removeWindowItem( window ) ; 03342 03343 }
Here is the call graph for this function:
void C2F() displaynumbers | ( | char * | str, | |
integer * | x, | |||
integer * | y, | |||
integer * | v1, | |||
integer * | v2, | |||
integer * | n, | |||
integer * | flag, | |||
double * | z, | |||
double * | alpha, | |||
double * | dx3, | |||
double * | dx4 | |||
) |
Definition at line 4011 of file periX11.c.
References buf, C2F, BCG::CurNumberDispFormat, displaystring(), i, PD0, PI0, and ScilabXgc.
04012 { integer i ; 04013 char buf[20]; 04014 for (i=0 ; i< *n ; i++) 04015 { sprintf(buf,ScilabXgc->CurNumberDispFormat,z[i]); 04016 C2F(displaystring)(buf,&(x[i]),&(y[i]),PI0,flag,PI0,PI0,&(alpha[i]),PD0,PD0,PD0) ; 04017 } 04018 XFlush(dpy); 04019 }
Here is the call graph for this function:
void C2F() displaystring | ( | char * | string, | |
integer * | x, | |||
integer * | y, | |||
integer * | v1, | |||
integer * | flag, | |||
integer * | v6, | |||
integer * | v7, | |||
double * | angle, | |||
double * | dv2, | |||
double * | dv3, | |||
double * | dv4 | |||
) |
Definition at line 2627 of file periX11.c.
References Abs, C2F, BCG::Cdrawable, BCG::CurPixmapStatus, BCG::CWindow, dir, DispStringAngle(), drawrectangle(), BCG::FontXID, PD0, PI0, and ScilabXgc.
02628 { 02629 if ( Abs(*angle) <= 0.1) 02630 { 02631 int dir,asc,dsc,xpos; 02632 XCharStruct charret; 02633 if(strlen(string) !=0) { 02634 XQueryTextExtents(dpy,ScilabXgc->FontXID, 02635 string,strlen(string),&dir,&asc,&dsc,&charret); 02636 xpos= *x+ (charret.width)/(2.0*strlen(string)); 02637 if(ScilabXgc->Cdrawable != (Drawable) 0 ) 02638 XDrawString(dpy, ScilabXgc->Cdrawable,gc,(int) *x,(int) *y-charret.descent, 02639 string,strlen(string)); 02640 if(ScilabXgc->CurPixmapStatus !=1) 02641 XDrawString(dpy, (Drawable) ScilabXgc->CWindow,gc,(int) *x,(int) *y-charret.descent, 02642 string,strlen(string)); 02643 02644 if ( *flag == 1) 02645 { 02646 integer rect[4]; 02647 rect[0]= *x ; 02648 rect[1]= *y-charret.ascent-charret.descent; 02649 rect[2]= charret.width; 02650 rect[3]= charret.ascent+charret.descent; 02651 C2F(drawrectangle)(string,rect,rect+1,rect+2,rect+3, 02652 PI0,PI0,PD0,PD0,PD0,PD0); 02653 } 02654 } 02655 } 02656 else 02657 C2F(DispStringAngle)(x,y,string,angle); 02658 XFlush(dpy); 02659 }
Here is the call graph for this function:
Definition at line 2661 of file periX11.c.
References BCG::Cdrawable, BCG::CurPixmapStatus, BCG::CWindow, font, BCG::FontId, BCG::FontSize, M_PI, ScilabXgc, and XRotDrawString().
Referenced by displaystring().
02662 { 02663 float ang; 02664 XFontStruct *font; 02665 02666 font=FontsList_[ScilabXgc->FontId][ScilabXgc->FontSize]; 02667 ang= - *angle * M_PI/180.0; 02668 02669 if (ScilabXgc->Cdrawable != (Drawable) 0) 02670 XRotDrawString(dpy, font, ang, ScilabXgc->Cdrawable, gc, *x, *y, string); 02671 if (ScilabXgc->CurPixmapStatus != 1) 02672 XRotDrawString(dpy, font, ang, (Drawable) ScilabXgc->CWindow, gc, *x, *y, string); 02673 }
Here is the call graph for this function:
Here is the caller graph for this function:
Definition at line 2675 of file periX11.c.
References Abs, boundingbox(), C2F, BCG::Cdrawable, BCG::CurPixmapStatus, BCG::CWindow, i, l, M_PI, PD0, PI0, ScilabXgc, str1, and str2.
02676 { 02677 int i; 02678 integer x,y, rect[4]; 02679 double sina ,cosa,l; 02680 char str1[2]; 02681 str1[1]='\0'; 02682 x= *x0; 02683 y= *yy0; 02684 sina= sin(*angle * M_PI/180.0); 02685 cosa= cos(*angle * M_PI/180.0); 02686 for ( i = 0 ; i < (int)strlen(string); i++) 02687 { 02688 str1[0]=string[i]; 02689 if (ScilabXgc->Cdrawable != (Drawable) 0) 02690 XDrawString(dpy,ScilabXgc->Cdrawable,gc,(int) x,(int) y ,str1,1); 02691 if (ScilabXgc->CurPixmapStatus != 1) 02692 XDrawString(dpy,(Drawable) ScilabXgc->CWindow,gc,(int) x,(int) y ,str1,1); 02693 02694 C2F(boundingbox)(str1,&x,&y,rect,PI0,PI0,PI0,PD0,PD0,PD0,PD0); 02696 if ( cosa <= 0.0 && i < (int)strlen(string)-1) 02697 { char str2[2]; 02700 str2[1]='\0';str2[0]=string[i+1]; 02701 C2F(boundingbox)(str2,&x,&y,rect,PI0,PI0,PI0,PD0,PD0,PD0,PD0); 02702 } 02703 if ( Abs(cosa) >= 1.e-8 ) 02704 { 02705 if ( Abs(sina/cosa) <= Abs(((double)rect[3])/((double)rect[2]))) 02706 l = Abs(rect[2]/cosa); 02707 else 02708 l = Abs(rect[3]/sina); 02709 } 02710 else 02711 l = Abs(rect[3]/sina); 02712 x += cosa*l*1.1; 02713 y += sina*l*1.1; 02714 } 02715 }
Here is the call graph for this function:
void C2F() drawarc | ( | char * | str, | |
integer * | x, | |||
integer * | y, | |||
integer * | width, | |||
integer * | height, | |||
integer * | angle1, | |||
integer * | angle2, | |||
double * | dv1, | |||
double * | dv2, | |||
double * | dv3, | |||
double * | dv4 | |||
) |
Draw a single ellipsis or part of it
Ellipse(hdc,(int) *x,(int) *y,(int) *width + *x ,(int) *height + *y );
180*64
Definition at line 3052 of file periX11.c.
References BCG::Cdrawable, BCG::CurPixmapStatus, BCG::CWindow, and ScilabXgc.
03053 { 03054 if (ScilabXgc->Cdrawable != (Drawable) 0) 03055 XDrawArc(dpy, ScilabXgc->Cdrawable, gc, *x, *y,(unsigned)*width, 03056 (unsigned)*height,*angle1, *angle2); 03057 if (ScilabXgc->CurPixmapStatus != 1) 03058 XDrawArc(dpy, (Drawable) ScilabXgc->CWindow, gc, *x, *y,(unsigned)*width, 03059 (unsigned)*height,*angle1, *angle2); 03060 XFlush(dpy); }
void C2F() drawarcs | ( | char * | str, | |
integer * | vects, | |||
integer * | style, | |||
integer * | n, | |||
integer * | v5, | |||
integer * | v6, | |||
integer * | v7, | |||
double * | dv1, | |||
double * | dv2, | |||
double * | dv3, | |||
double * | dv4 | |||
) |
caution : angle=degreangle*64
Definition at line 3034 of file periX11.c.
References C2F, drawarc(), i, PD0, PI0, xget_dash_and_color(), xset_dash_and_color(), and xset_line_style().
03035 { 03036 integer verbose=0,Dnarg,Dvalue[10],NDvalue,i; 03037 /* store the current values */ 03038 xget_dash_and_color(&verbose,Dvalue,&Dnarg,vdouble); 03039 for (i=0 ; i< *n ; i++) 03040 { 03041 NDvalue = style[i]; 03042 xset_line_style(&NDvalue,PI0,PI0,PI0); 03043 C2F(drawarc)(str,vects+6*i,vects+6*i+1, 03044 vects+6*i+2,vects+6*i+3, 03045 vects+6*i+4,vects+6*i+5,PD0,PD0,PD0,PD0); 03046 } 03047 xset_dash_and_color( Dvalue,PI0,PI0,PI0); 03048 }
Here is the call graph for this function:
void C2F() drawarrows | ( | char * | str, | |
integer * | vx, | |||
integer * | vy, | |||
integer * | n, | |||
integer * | as, | |||
integer * | style, | |||
integer * | iflag, | |||
double * | dv1, | |||
double * | dv2, | |||
double * | dv3, | |||
double * | dv4 | |||
) |
as is 10*arsize (arsize) the size of the arrow head in pixels
Definition at line 2801 of file periX11.c.
References Abs, C2F, BCG::Cdrawable, BCG::CurPixmapStatus, BCG::CWindow, dx, dy, fillpolylines(), i, inint, M_PI, p, PD0, PI0, ScilabXgc, SMDOUBLE, xget_dash_and_color(), xset_dash_and_color(), and xset_line_style().
02802 { 02803 integer verbose=0,Dnarg,Dvalue[10],NDvalue,i; 02804 double cos20=cos(20.0*M_PI/180.0); 02805 double sin20=sin(20.0*M_PI/180.0); 02806 integer polyx[4],polyy[4]; 02807 xget_dash_and_color(&verbose,Dvalue,&Dnarg,vdouble); 02808 for (i=0 ; i < *n/2 ; i++) 02809 { 02810 double dx,dy,norm; 02811 NDvalue = ( (int) *iflag == 1) ? style[i] : ((*style >= 1) ? *style : Dvalue[0]); 02812 xset_line_style(&NDvalue,PI0,PI0,PI0); 02813 dx=( vx[2*i+1]-vx[2*i]); 02814 dy=( vy[2*i+1]-vy[2*i]); 02815 norm = sqrt(dx*dx+dy*dy); 02816 if ( Abs(norm) > SMDOUBLE ) 02817 { integer nn=1,p=3; 02818 dx=(*as/10.0)*dx/norm;dy=(*as/10.0)*dy/norm; 02819 polyx[0]= polyx[3]=vx[2*i+1]; 02820 polyx[1]= inint(polyx[0] - cos20*dx -sin20*dy ); 02821 polyx[2]= inint(polyx[0] - cos20*dx + sin20*dy); 02822 polyy[0]= polyy[3]=vy[2*i+1]; 02823 polyy[1]= inint(polyy[0] + sin20*dx -cos20*dy) ; 02824 polyy[2]= inint(polyy[0] - sin20*dx - cos20*dy) ; 02825 C2F(fillpolylines)("v",polyx,polyy,&NDvalue,&nn,&p,PI0,PD0,PD0,PD0,PD0); 02826 } 02827 if (ScilabXgc->Cdrawable != (Drawable) 0) 02828 XDrawLine(dpy,ScilabXgc->Cdrawable,gc,(int) vx[2*i],(int)vy[2*i], 02829 (int)(vx[2*i+1]-dx*cos20),(int)(vy[2*i+1]-dy*cos20)); 02830 if (ScilabXgc->CurPixmapStatus != 1) 02831 XDrawLine(dpy,(Drawable) ScilabXgc->CWindow,gc,(int) vx[2*i],(int)vy[2*i], 02832 (int)(vx[2*i+1]-dx*cos20),(int)(vy[2*i+1]-dy*cos20)); 02833 02834 } 02835 xset_dash_and_color( Dvalue,PI0,PI0,PI0); 02836 XFlush(dpy); 02837 }
Here is the call graph for this function:
void C2F() drawaxis | ( | char * | str, | |
integer * | alpha, | |||
integer * | nsteps, | |||
integer * | v2, | |||
integer * | initpoint, | |||
integer * | v6, | |||
integer * | v7, | |||
double * | size, | |||
double * | dx2, | |||
double * | dx3, | |||
double * | dx4 | |||
) |
Definition at line 3960 of file periX11.c.
References BCG::Cdrawable, BCG::CurPixmapStatus, BCG::CWindow, i, inint, M_PI, ScilabXgc, xi, and yi.
03961 { integer i; 03962 double xi,yi,xf,yf; 03963 double cosal,sinal; 03964 cosal= cos( (double)M_PI * (*alpha)/180.0); 03965 sinal= sin( (double)M_PI * (*alpha)/180.0); 03966 for (i=0; i <= nsteps[0]*nsteps[1]; i++) 03967 { 03968 if (( i % nsteps[0]) != 0) 03969 { 03970 xi = initpoint[0]+i*size[0]*cosal; 03971 yi = initpoint[1]+i*size[0]*sinal; 03972 xf = xi - ( size[1]*sinal); 03973 yf = yi + ( size[1]*cosal); 03974 if (ScilabXgc->Cdrawable != (Drawable) 0) 03975 XDrawLine(dpy,ScilabXgc->Cdrawable,gc,inint(xi),inint(yi),inint(xf),inint(yf)); 03976 if (ScilabXgc->CurPixmapStatus != 1) 03977 XDrawLine(dpy,(Drawable) ScilabXgc->CWindow,gc,inint(xi),inint(yi),inint(xf),inint(yf)); 03978 } 03979 } 03980 for (i=0; i <= nsteps[1]; i++) 03981 { xi = initpoint[0]+i*nsteps[0]*size[0]*cosal; 03982 yi = initpoint[1]+i*nsteps[0]*size[0]*sinal; 03983 xf = xi - ( size[1]*size[2]*sinal); 03984 yf = yi + ( size[1]*size[2]*cosal); 03985 if (ScilabXgc->Cdrawable != (Drawable) 0) 03986 XDrawLine(dpy,ScilabXgc->Cdrawable,gc,inint(xi),inint(yi),inint(xf),inint(yf)); 03987 if (ScilabXgc->CurPixmapStatus != 1) 03988 XDrawLine(dpy,(Drawable) ScilabXgc->CWindow,gc,inint(xi),inint(yi),inint(xf),inint(yf)); 03989 } 03990 03991 XFlush(dpy); 03992 }
void C2F() drawClippedPolyline | ( | char * | str, | |
integer * | n, | |||
integer * | vx, | |||
integer * | vy, | |||
integer * | closeflag, | |||
integer * | v6, | |||
integer * | v7, | |||
double * | dv1, | |||
double * | dv2, | |||
double * | dv3, | |||
double * | dv4 | |||
) |
ths routine also perform clipping to avoid overflow
Definition at line 3170 of file periX11.c.
References analyze_points(), C2F, and n1.
03171 { 03172 integer n1; 03173 if ( *closeflag ) 03174 { 03175 n1 = *n+1 ; 03176 } 03177 else 03178 { 03179 n1= *n ; 03180 } 03181 if (n1 >= 2) 03182 { 03183 C2F(analyze_points)(*n, vx, vy,*closeflag); 03184 /*Old code replaced by a routine with clipping */ 03185 /* if (C2F(store_points)(*n, vx, vy,*closeflag)) */ 03186 /* { */ 03187 /* /\* draw the points *\/ */ 03188 /* XDroutine( n1 ) ; */ 03189 /* /\*XDrawLines (dpy, ScilabXgc->Cdrawable, gc, get_xpoints(), (int) n1, */ 03190 /* ScilabXgc->CurVectorStyle);*\/ */ 03191 /* XFlush(dpy); */ 03192 /* } */ 03193 /*XFlush(dpy);*/ 03194 } 03195 }
Here is the call graph for this function:
Definition at line 2743 of file periX11.c.
References BCG::Cdrawable, BCG::CurPixmapStatus, BCG::CWindow, and ScilabXgc.
02744 { 02745 if (ScilabXgc->Cdrawable != (Drawable) 0) 02746 XDrawLine(dpy, ScilabXgc->Cdrawable, gc,(int) *x1,(int) *yy1,(int) *x2,(int) *y2); 02747 if (ScilabXgc->CurPixmapStatus != 1) 02748 XDrawLine(dpy,(Drawable) ScilabXgc->CWindow, gc,(int) *x1,(int) *yy1,(int) *x2,(int) *y2); 02749 XFlush(dpy); 02750 }
Definition at line 4350 of file periX11.c.
References C2F, BCG::Cdrawable, BCG::CurHardSymb, BCG::CurPixmapStatus, CurSymbXOffset(), CurSymbYOffset(), BCG::CWindow, and ScilabXgc.
04351 { 04352 char str[1]; 04353 str[0]=Marks[ScilabXgc->CurHardSymb]; 04354 if (ScilabXgc->Cdrawable != (Drawable) 0) 04355 XDrawString(dpy,ScilabXgc->Cdrawable,gc,(int) *x+C2F(CurSymbXOffset)(), 04356 (int)*y+C2F(CurSymbYOffset)(),str,1); 04357 if (ScilabXgc->CurPixmapStatus != 1) 04358 XDrawString(dpy,(Drawable) ScilabXgc->CWindow,gc,(int) *x+C2F(CurSymbXOffset)(), 04359 (int)*y+C2F(CurSymbYOffset)(),str,1); 04360 XFlush(dpy); 04361 }
Here is the call graph for this function:
void C2F() drawpolyline | ( | char * | str, | |
integer * | n, | |||
integer * | vx, | |||
integer * | vy, | |||
integer * | closeflag, | |||
integer * | v6, | |||
integer * | v7, | |||
double * | dv1, | |||
double * | dv2, | |||
double * | dv3, | |||
double * | dv4 | |||
) |
n is the number of points of the polyline
Definition at line 3204 of file periX11.c.
References C2F, n1, store_points(), and XDroutine().
03205 { 03206 integer n1; 03207 if ( *closeflag ) 03208 { 03209 n1 = *n+1 ; 03210 } 03211 else 03212 { 03213 n1= *n ; 03214 } 03215 if (n1 >= 2) 03216 { 03217 03218 /*Old code replaced by a routine with clipping */ 03219 if (C2F(store_points)(*n, vx, vy,*closeflag)) 03220 { 03221 /* draw the points */ 03222 XDroutine( n1 ) ; 03223 03224 XFlush(dpy); 03225 } 03226 03227 } 03228 }
Here is the call graph for this function:
void C2F() drawpolylines | ( | char * | str, | |
integer * | vectsx, | |||
integer * | vectsy, | |||
integer * | drawvect, | |||
integer * | n, | |||
integer * | p, | |||
integer * | v7, | |||
double * | dv1, | |||
double * | dv2, | |||
double * | dv3, | |||
double * | dv4 | |||
) |
drawvect[i] < 0 use a line style for i
we use the markid : drawvect[i] : with current dash
we use the line-style number abs(drawvect[i])
back to default values
Definition at line 3083 of file periX11.c.
References C2F, close(), drawClippedPolyline(), drawpolymark(), i, PD0, PI0, xget_dash_and_color(), xget_mark(), xset_dash_and_color(), xset_line_style(), xset_mark(), and xset_pattern().
03084 { integer verbose=0 ,symb[2],Mnarg,Dnarg,Dvalue[10],NDvalue,i,close; 03085 /* store the current values */ 03086 xget_mark(&verbose,symb,&Mnarg,vdouble); 03087 xget_dash_and_color(&verbose,Dvalue,&Dnarg,vdouble); 03088 for (i=0 ; i< *n ; i++) 03089 { 03090 if (drawvect[i] <= 0) 03091 { 03092 NDvalue = - drawvect[i]; 03093 xset_mark(&NDvalue,symb+1,PI0,PI0); 03094 xset_pattern(Dvalue+6,PI0,PI0,PI0); 03095 03096 C2F(drawpolymark)(str,p,vectsx+(*p)*i,vectsy+(*p)*i,PI0,PI0,PI0,PD0,PD0,PD0,PD0); 03097 } 03098 else 03099 { 03100 xset_line_style(drawvect+i,PI0,PI0,PI0); 03101 close = 0; 03102 C2F(drawClippedPolyline)(str,p,vectsx+(*p)*i,vectsy+(*p)*i,&close, 03103 PI0,PI0,PD0,PD0,PD0,PD0); 03104 } 03105 } 03107 xset_dash_and_color( Dvalue,PI0,PI0,PI0); 03108 xset_mark(symb,symb+1,PI0,PI0); 03109 }
Here is the call graph for this function:
void C2F() drawpolymark | ( | char * | str, | |
integer * | n, | |||
integer * | vx, | |||
integer * | vy, | |||
integer * | v5, | |||
integer * | v6, | |||
integer * | v7, | |||
double * | dv1, | |||
double * | dv2, | |||
double * | dv3, | |||
double * | dv4 | |||
) |
by vx and vy (vx[i],vy[i])
the symbol font
Definition at line 3255 of file periX11.c.
References C2F, BCG::Cdrawable, CoordModeOrigin, BCG::CurHardSymb, BCG::CurHardSymbSize, BCG::CurPixmapStatus, BCG::CWindow, DrawMark(), BCG::FontId, BCG::FontSize, get_xpoints(), i, L, PI0, ScilabXgc, store_points(), XDrawPoints(), and xset_font().
03256 { 03257 if ( ScilabXgc->CurHardSymb == 0 ) 03258 {if (C2F(store_points)(*n, vx, vy,(integer)0L)){ 03259 if (ScilabXgc->Cdrawable != (Drawable) 0) 03260 XDrawPoints (dpy, ScilabXgc->Cdrawable, gc, get_xpoints(), *n,CoordModeOrigin); 03261 if (ScilabXgc->CurPixmapStatus != 1) 03262 XDrawPoints (dpy, (Drawable) ScilabXgc->CWindow, gc, get_xpoints(), *n,CoordModeOrigin); 03263 } 03264 XFlush(dpy); 03265 } 03266 else 03267 { 03268 integer i,keepid,keepsize,hds; 03269 i=1; 03270 keepid = ScilabXgc->FontId; 03271 keepsize= ScilabXgc->FontSize; 03272 hds= ScilabXgc->CurHardSymbSize; 03273 xset_font(&i,&hds,PI0,PI0); 03274 for ( i=0; i< *n ;i++) DrawMark(vx+i,vy+i); 03275 xset_font(&keepid,&keepsize,PI0,PI0); 03276 } 03277 }
Here is the call graph for this function:
void C2F() drawrectangle | ( | char * | str, | |
integer * | x, | |||
integer * | y, | |||
integer * | width, | |||
integer * | height, | |||
integer * | v6, | |||
integer * | v7, | |||
double * | dv1, | |||
double * | dv2, | |||
double * | dv3, | |||
double * | dv4 | |||
) |
Draw one rectangle with current line style
Definition at line 2884 of file periX11.c.
References BCG::Cdrawable, BCG::CurPixmapStatus, BCG::CWindow, and ScilabXgc.
02885 { 02886 if (ScilabXgc->Cdrawable != (Drawable) 0) 02887 XDrawRectangle(dpy, ScilabXgc->Cdrawable, gc, *x, *y, (unsigned)*width,(unsigned)*height); 02888 if (ScilabXgc->CurPixmapStatus != 1) 02889 XDrawRectangle(dpy, (Drawable) ScilabXgc->CWindow, gc, *x, *y, (unsigned)*width,(unsigned)*height); 02890 XFlush(dpy); }
void C2F() drawrectangles | ( | char * | str, | |
integer * | vects, | |||
integer * | fillvect, | |||
integer * | n, | |||
integer * | v5, | |||
integer * | v6, | |||
integer * | v7, | |||
double * | dv1, | |||
double * | dv2, | |||
double * | dv3, | |||
double * | dv4 | |||
) |
if fillvect[i] is < 0 then draw the rectangle with -fillvect[i]
Definition at line 2853 of file periX11.c.
References C2F, drawrectangle(), fillrectangle(), i, PD0, PI0, xget_dash_and_color(), xget_pattern(), xset_dash_and_color(), xset_line_style(), and xset_pattern().
02854 { 02855 integer i,cpat,verbose=0,num,cd[10]; 02856 xget_pattern(&verbose,&cpat,&num,vdouble); 02857 xget_dash_and_color(&verbose,cd,&num,vdouble); 02858 for (i = 0 ; i < *n ; i++) 02859 { 02860 if ( fillvect[i] < 0 ) 02861 { 02862 int dash = - fillvect[i]; 02863 xset_line_style(&dash,PI0,PI0,PI0); 02864 C2F(drawrectangle)(str,vects+4*i,vects+4*i+1,vects+4*i+2,vects+4*i+3 02865 ,PI0,PI0,PD0,PD0,PD0,PD0); 02866 } 02867 else if ( fillvect[i] == 0 ) 02868 { 02869 /* xset_line_style(cd,PI0,PI0,PI0);*/ 02870 C2F(drawrectangle)(str,vects+4*i,vects+4*i+1,vects+4*i+2,vects+4*i+3 02871 ,PI0,PI0,PD0,PD0,PD0,PD0); 02872 } 02873 else 02874 { 02875 xset_pattern(&(fillvect[i]),PI0,PI0,PI0); 02876 C2F(fillrectangle)(str,vects+4*i,vects+4*i+1,vects+4*i+2,vects+4*i+3,PI0,PI0,PD0,PD0,PD0,PD0); 02877 } 02878 } 02879 xset_dash_and_color(cd,PI0,PI0,PI0); 02880 }
Here is the call graph for this function:
void C2F() drawsegments | ( | char * | str, | |
integer * | vx, | |||
integer * | vy, | |||
integer * | n, | |||
integer * | style, | |||
integer * | iflag, | |||
integer * | v7, | |||
double * | dv1, | |||
double * | dv2, | |||
double * | dv3, | |||
double * | dv4 | |||
) |
n is the size of vx and vy
Definition at line 2757 of file periX11.c.
References BCG::Cdrawable, BCG::CurPixmapStatus, BCG::CWindow, i, PI0, ScilabXgc, xget_dash_and_color(), xset_dash_and_color(), and xset_line_style().
02758 { 02759 integer verbose=0,Dnarg,Dvalue[10],NDvalue; 02760 integer i; 02761 xget_dash_and_color(&verbose,Dvalue,&Dnarg,vdouble); 02762 02763 if ( (int) *iflag == 1) { /* one style per segment */ 02764 for (i=0 ; i < *n/2 ; i++) { 02765 NDvalue = style[i]; 02766 xset_line_style(&NDvalue,PI0,PI0,PI0); 02767 if (ScilabXgc->Cdrawable != (Drawable) 0) 02768 XDrawLine(dpy,ScilabXgc->Cdrawable,gc, (int) vx[2*i], 02769 (int) vy[2*i],(int) vx[2*i+1],(int) vy[2*i+1]) ; 02770 if (ScilabXgc->CurPixmapStatus != 1) 02771 XDrawLine(dpy,(Drawable) ScilabXgc->CWindow,gc, (int) vx[2*i], 02772 (int) vy[2*i],(int) vx[2*i+1],(int) vy[2*i+1]) ; 02773 XFlush(dpy); 02774 } 02775 } 02776 else { 02777 if (*style >= 1) /* set color */ 02778 xset_line_style(style,PI0,PI0,PI0); 02779 02780 for (i=0 ; i < *n/2 ; i++) { 02781 if (ScilabXgc->Cdrawable != (Drawable) 0) 02782 XDrawLine(dpy,ScilabXgc->Cdrawable,gc, (int) vx[2*i], 02783 (int) vy[2*i],(int) vx[2*i+1],(int) vy[2*i+1]) ; 02784 if (ScilabXgc->CurPixmapStatus != 1) 02785 XDrawLine(dpy,(Drawable) ScilabXgc->CWindow,gc, (int) vx[2*i], 02786 (int) vy[2*i],(int) vx[2*i+1],(int) vy[2*i+1]) ; 02787 XFlush(dpy); 02788 } 02789 } 02790 02791 xset_dash_and_color( Dvalue,PI0,PI0,PI0); 02792 }
Here is the call graph for this function:
Definition at line 2911 of file periX11.c.
References Abs, BCG::Cdrawable, BCG::CurPixmapStatus, BCG::CWindow, i, inint, int16max, j, Maxi(), Mini(), PI0, ScilabXgc, SMDOUBLE, uns16max, xget_last(), xget_pattern(), xget_windowdim(), and xset_pattern().
02912 { 02913 double zmoy,zmax,zmin,zmaxmin; 02914 integer i,j,verbose=0,whiteid,narg,fill[1],cpat,xz[2]; 02915 zmin=Mini(z,(n1)*(n2)); 02916 zmax=Maxi(z,(n1)*(n2)); 02917 zmaxmin=zmax-zmin; 02918 if (zmaxmin <= SMDOUBLE) zmaxmin=SMDOUBLE; 02919 02920 xget_last(&verbose,&whiteid,&narg,vdouble); 02921 xget_pattern(&verbose,&cpat,&narg,vdouble); 02922 xget_windowdim(&verbose,xz,&narg,vdouble); 02923 02924 for (i = 0 ; i < (n1)-1 ; i++) 02925 for (j = 0 ; j < (n2)-1 ; j++) 02926 { 02927 integer w,h; 02928 zmoy=1/4.0*(z[i+n1*j]+z[i+n1*(j+1)]+z[i+1+n1*j]+z[i+1+n1*(j+1)]); 02929 fill[0]=1 + inint((whiteid-1)*(zmoy-zmin)/(zmaxmin)); 02930 /* if (x[n1] == 1) fill[0]= inint(z[j+ (i*n2)]);*/ /* NG */ 02931 xset_pattern(fill,PI0,PI0,PI0); 02932 w=Abs(x[i+1]-x[i]);h=Abs(y[j+1]-y[j]); 02933 /* We don't trace rectangle which are totally out **/ 02934 if ( w != 0 && h != 0 && x[i] < xz[0] && y[j+1] < xz[1] && x[i]+w > 0 && y[j+1]+h > 0 ) 02935 if ( Abs(x[i]) < int16max && Abs(y[j+1]) < int16max && w < uns16max && h < uns16max) { 02936 if (ScilabXgc->Cdrawable != (Drawable) 0) 02937 XFillRectangle(dpy,ScilabXgc->Cdrawable,gc,x[i],y[j+1],w,h); 02938 if (ScilabXgc->CurPixmapStatus != 1) 02939 XFillRectangle(dpy,(Drawable) ScilabXgc->CWindow,gc,x[i],y[j+1],w,h); 02940 } 02941 } 02942 xset_pattern(&cpat,PI0,PI0,PI0); 02943 }
Here is the call graph for this function:
Definition at line 2955 of file periX11.c.
References Abs, BCG::Cdrawable, BCG::CurPixmapStatus, BCG::CWindow, i, int16max, j, PI0, ScilabXgc, uns16max, xget_pattern(), xget_windowdim(), and xset_pattern().
02956 { 02957 integer i,j,verbose=0,narg,fill[1],cpat,xz[2]; 02958 xget_pattern(&verbose,&cpat,&narg,vdouble); 02959 xget_windowdim(&verbose,xz,&narg,vdouble); 02960 for (i = 0 ; i < (n1)-1 ; i++) 02961 for (j = 0 ; j < (n2)-1 ; j++) 02962 { 02963 integer w,h; 02964 fill[0]= z[i+(n1-1)*j]; 02965 xset_pattern(fill,PI0,PI0,PI0); 02966 w=Abs(x[j+1]-x[j]); 02967 h=Abs(y[i+1]-y[i]); 02968 /* We don't trace rectangle which are totally out **/ 02969 if ( w != 0 && h != 0 && x[j] < xz[0] && y[i] < xz[1] && x[j]+w > 0 && y[i]+h > 0 ) 02970 if ( Abs(x[j]) < int16max && Abs(y[i+1]) < int16max && w < uns16max && h < uns16max) { 02971 if (ScilabXgc->Cdrawable != (Drawable) 0) 02972 XFillRectangle(dpy,ScilabXgc->Cdrawable,gc,x[j],y[i],w,h); 02973 if (ScilabXgc->CurPixmapStatus != 1) 02974 XFillRectangle(dpy,(Drawable) ScilabXgc->CWindow,gc,x[j],y[i],w,h); 02975 } 02976 } 02977 xset_pattern(&cpat,PI0,PI0,PI0); 02978 }
Here is the call graph for this function:
void C2F() fillarc | ( | char * | str, | |
integer * | x, | |||
integer * | y, | |||
integer * | width, | |||
integer * | height, | |||
integer * | angle1, | |||
integer * | angle2, | |||
double * | dv1, | |||
double * | dv2, | |||
double * | dv3, | |||
double * | dv4 | |||
) |
Fill a single elipsis or part of it with current pattern
Ellipse(hdc,(int) *x,(int) *y,(int)*width+*x ,(int)*height+*y );
180*64
Definition at line 3064 of file periX11.c.
References BCG::Cdrawable, BCG::CurPixmapStatus, BCG::CWindow, and ScilabXgc.
03065 { 03066 if (ScilabXgc->Cdrawable != (Drawable) 0) 03067 XFillArc(dpy, ScilabXgc->Cdrawable, gc, *x, *y, *width, *height, *angle1, *angle2); 03068 if (ScilabXgc->CurPixmapStatus != 1) 03069 XFillArc(dpy, (Drawable) ScilabXgc->CWindow, gc, *x, *y, *width, *height, *angle1, *angle2); 03070 XFlush(dpy);}
void C2F() fillarcs | ( | char * | str, | |
integer * | vects, | |||
integer * | fillvect, | |||
integer * | n, | |||
integer * | v5, | |||
integer * | v6, | |||
integer * | v7, | |||
double * | dv1, | |||
double * | dv2, | |||
double * | dv3, | |||
double * | dv4 | |||
) |
The drawing style is the current drawing
Definition at line 2999 of file periX11.c.
References C2F, drawarc(), fillarc(), i, BCG::IDLastPattern, PD0, PI0, ScilabXgc, xget_pattern(), and xset_pattern().
03000 { 03001 integer i,cpat,verb,num; 03002 verb=0; 03003 xget_pattern(&verb,&cpat,&num,vdouble); 03004 for (i=0 ; i< *n ; i++) 03005 { 03006 if (fillvect[i] > ScilabXgc->IDLastPattern + 1) 03007 { 03008 xset_pattern(&(cpat),PI0,PI0,PI0); 03009 C2F(drawarc)(str,vects+6*i,vects+6*i+1, 03010 vects+6*i+2,vects+6*i+3, 03011 vects+6*i+4,vects+6*i+5,PD0,PD0,PD0,PD0); 03012 } 03013 else 03014 { 03015 xset_pattern(&(fillvect[i]),PI0,PI0,PI0); 03016 C2F(fillarc)(str,vects+6*i,vects+6*i+1, 03017 vects+6*i+2,vects+6*i+3, 03018 vects+6*i+4,vects+6*i+5,PD0,PD0,PD0,PD0); 03019 } 03020 } 03021 xset_pattern(&(cpat),PI0,PI0,PI0); 03022 }
Here is the call graph for this function:
void C2F() fillpolyline | ( | char * | str, | |
integer * | n, | |||
integer * | vx, | |||
integer * | vy, | |||
integer * | closeflag, | |||
integer * | v6, | |||
integer * | v7, | |||
double * | dv1, | |||
double * | dv2, | |||
double * | dv3, | |||
double * | dv4 | |||
) |
according to *closeflag : the given vector is a polyline or a polygon
Definition at line 3235 of file periX11.c.
References C2F, BCG::Cdrawable, BCG::CurPixmapStatus, BCG::CurVectorStyle, BCG::CWindow, get_xpoints(), n1, ScilabXgc, and store_points().
03236 { 03237 integer n1; 03238 if (*closeflag == 1) n1 = *n+1;else n1= *n; 03239 if (C2F(store_points)(*n, vx, vy,*closeflag)){ 03240 if (ScilabXgc->Cdrawable != (Drawable) 0) 03241 XFillPolygon (dpy, ScilabXgc->Cdrawable, gc, get_xpoints(), n1, 03242 Complex, ScilabXgc->CurVectorStyle); 03243 if (ScilabXgc->CurPixmapStatus != 1) 03244 XFillPolygon (dpy, (Drawable) ScilabXgc->CWindow, gc, get_xpoints(), n1, 03245 Complex, ScilabXgc->CurVectorStyle); 03246 } 03247 XFlush(dpy); 03248 }
Here is the call graph for this function:
void C2F() fillpolylines | ( | char * | str, | |
integer * | vectsx, | |||
integer * | vectsy, | |||
integer * | fillvect, | |||
integer * | n, | |||
integer * | p, | |||
integer * | v7, | |||
double * | dv1, | |||
double * | dv2, | |||
double * | dv3, | |||
double * | dv4 | |||
) |
fill a set of polygons each of which is defined by (*p) points (*n) is the number of polygons the polygon is closed by the routine fillvect[*n] : fillvect[*n] : if fillvect[i] == 0 draw the boundaries with current color if fillvect[i] > 0 draw the boundaries with current color then fill with pattern fillvect[i] if fillvect[i] < 0 fill with pattern - fillvect[i]
fill + boundaries
boundaries ONLY
fill ONLY
Definition at line 3122 of file periX11.c.
References C2F, close(), drawClippedPolyline(), fillpolyline(), i, PD0, PI0, xget_dash_and_color(), xget_pattern(), xset_dash_and_color(), xset_line_style(), and xset_pattern().
03123 { 03124 integer Dnarg,Dvalue[10]; 03125 integer i,cpat,verbose=0,num,close=1,pattern; 03126 xget_pattern(&verbose,&cpat,&num,vdouble); 03127 xget_dash_and_color(&verbose,Dvalue,&Dnarg,vdouble); 03128 for (i = 0 ; i< *n ; i++) 03129 { 03130 if (fillvect[i] > 0 ) 03131 { 03133 xset_pattern(&(fillvect[i]),PI0,PI0,PI0); 03134 C2F(fillpolyline)(str,p,vectsx+(*p)*i,vectsy+(*p)*i,(close=1,&close), 03135 PI0,PI0,PD0,PD0,PD0,PD0); 03136 xset_line_style(Dvalue,PI0,PI0,PI0); 03137 xset_pattern(&cpat,PI0,PI0,PI0); 03138 C2F(drawClippedPolyline)(str,p,vectsx+(*p)*i,vectsy+(*p)*i,(close=1,&close) 03139 ,PI0,PI0,PD0,PD0,PD0,PD0); 03140 } 03141 else if (fillvect[i] == 0 ) 03142 { 03144 xset_line_style(Dvalue,PI0,PI0,PI0); 03145 xset_pattern(&cpat,PI0,PI0,PI0); 03146 C2F(drawClippedPolyline)(str,p,vectsx+(*p)*i,vectsy+(*p)*i,(close=1,&close) 03147 ,PI0,PI0,PD0,PD0,PD0,PD0); 03148 } 03149 else 03150 { 03152 pattern = -fillvect[i] ; 03153 xset_pattern(&pattern,PI0,PI0,PI0); 03154 C2F(fillpolyline)(str,p,vectsx+(*p)*i,vectsy+(*p)*i,(close=1,&close) 03155 ,PI0,PI0,PD0,PD0,PD0,PD0); 03156 xset_pattern(&(cpat),PI0,PI0,PI0); 03157 } 03158 } 03159 xset_dash_and_color(Dvalue,PI0,PI0,PI0); /* ajoute ss le 13/09/00 */ 03160 }
Here is the call graph for this function:
void C2F() fillrectangle | ( | char * | str, | |
integer * | x, | |||
integer * | y, | |||
integer * | width, | |||
integer * | height, | |||
integer * | v6, | |||
integer * | v7, | |||
double * | dv1, | |||
double * | dv2, | |||
double * | dv3, | |||
double * | dv4 | |||
) |
fill one rectangle, with current pattern
Rectangle with current pen and brush
Definition at line 2894 of file periX11.c.
References BCG::Cdrawable, BCG::CurPixmapStatus, BCG::CWindow, and ScilabXgc.
02895 { 02896 if (ScilabXgc->Cdrawable != (Drawable) 0) 02897 XFillRectangle(dpy, ScilabXgc->Cdrawable, gc,(int) *x,(int) *y,(unsigned) *width,(unsigned) *height); 02898 if (ScilabXgc->CurPixmapStatus != 1) 02899 XFillRectangle(dpy, (Drawable) ScilabXgc->CWindow, gc,(int) *x,(int) *y,(unsigned) *width,(unsigned) *height); 02900 XFlush(dpy); 02901 }
Window Find_BG_Window | ( | integer | i | ) |
Definition at line 3751 of file periX11.c.
References DbugInfo1, STR1, and Window_With_Name().
03752 { 03753 char wname[sizeof(STR1)+4]; 03754 Window w; 03755 sprintf(wname,STR1,(int) i); 03756 DbugInfo1("Searching %s\n",wname); 03757 w=Window_With_Name(RootWindow(dpy,DefaultScreen(dpy)),wname,0, 03758 ResList[1],ResList[2],ResList[2]); 03759 return(w); 03760 }
Here is the call graph for this function:
Window Find_ScilabGraphic_Window | ( | integer | i | ) |
Definition at line 3738 of file periX11.c.
References DbugInfo1, STR0, and Window_With_Name().
03739 { 03740 Window w; 03741 char wname[sizeof(STR0)+4]; 03742 sprintf(wname,STR0,(int) i); 03743 DbugInfo1("Searching %s\n",wname); 03744 w=Window_With_Name(RootWindow(dpy,DefaultScreen(dpy)),wname,0, 03745 ResList[2],ResList[2],ResList[2]); 03746 return(w); 03747 }
Here is the call graph for this function:
Window Find_X_Scilab | ( | void | ) |
Definition at line 3727 of file periX11.c.
References DbugInfo1, SCI_VERSION_STRING, and Window_With_Name().
03728 { 03729 Window w; 03730 DbugInfo1("Searching %s\n",SCI_VERSION_STRING); 03731 w=Window_With_Name(RootWindow(dpy,DefaultScreen(dpy)), 03732 SCI_VERSION_STRING,0,ResList[0],ResList[0],ResList[0]); 03733 return(w); 03734 }
Here is the call graph for this function:
Definition at line 4569 of file periX11.c.
References sciprint().
04570 { 04571 integer i; 04572 for (i=ideb ; i < n ; i++) 04573 { 04574 if (vx[i]>= xleft && vx[i] <= xright && vy[i] >= ybot && vy[i] <= ytop) 04575 { 04576 #ifdef DEBUG 04577 sciprint("first in %d->%d=(%d,%d)\r\n",ideb,i,vx[i],vy[i]); 04578 #endif 04579 return(i); 04580 } 04581 } 04582 return(-1); 04583 }
Here is the call graph for this function:
Definition at line 4591 of file periX11.c.
References sciprint().
04592 { 04593 integer i; 04594 for (i=ideb ; i < n ; i++) 04595 { 04596 if ( vx[i]< xleft || vx[i]> xright || vy[i] < ybot || vy[i] > ytop) 04597 { 04598 #ifdef DEBUG 04599 sciprint("first out %d->%d=(%d,%d)\r\n",ideb,i,vx[i],vy[i]); 04600 #endif 04601 return(i); 04602 } 04603 } 04604 return(-1); 04605 }
Here is the call graph for this function:
Definition at line 4081 of file periX11.c.
References BCG::CWindowHeight, BCG::CWindowWidth, FONTMAXSIZE, i, inint, isiz, Max, Min, NULL, and ScilabXgc.
04082 { 04083 int Nsiz; 04084 int i; 04085 int isiz = i_size_[fontsize]; 04086 double d = Min(ScilabXgc->CWindowHeight,ScilabXgc->CWindowWidth); 04087 04088 Nsiz = (ScilabXgc != NULL) ? inint((isiz*d/400.0)) : isiz; 04089 fprintf(stderr,"Scaling by -->%d %d \n",isiz,Nsiz); 04090 for ( i=0; i < FONTMAXSIZE ; i++) 04091 { 04092 if (i_size_[i] >= Nsiz ) return Max(i-1,0); 04093 } 04094 return FONTMAXSIZE -1; 04095 }
void get_b | ( | int | i, | |
float * | b | |||
) |
void get_g | ( | int | i, | |
float * | g | |||
) |
Definition at line 2457 of file periX11.c.
References BCG::Cmap, BCG::Colors, Max, Min, BCG::Numcolors, and ScilabXgc.
Referenced by create_choice().
02458 { 02459 if ( ScilabXgc != (struct BCG *) 0 && ScilabXgc->Cmap != (Colormap)0) 02460 return(ScilabXgc->Colors[Max(Min(i,ScilabXgc->Numcolors + 1),0)]); 02461 else 02462 return(0); 02463 }
Here is the caller graph for this function:
Pixmap get_pixmap | ( | int | i | ) |
Definition at line 2465 of file periX11.c.
References GREYNUMBER, Max, and Min.
02466 { 02467 return(Tabpix_[ Max(0,Min(i - 1,GREYNUMBER - 1))]); 02468 }
void get_r | ( | int | i, | |
float * | r | |||
) |
int get_xclick_client_message_flag | ( | void | ) |
Definition at line 437 of file periX11.c.
Referenced by Delete().
00437 { return client_message;}
Here is the caller graph for this function:
static XPoint* get_xpoints | ( | void | ) | [static] |
Definition at line 4368 of file periX11.c.
Referenced by drawpolymark(), fillpolyline(), and XDroutine().
04368 { return(points); }
Here is the caller graph for this function:
Window GetBGWindowNumber | ( | int | wincount | ) |
Definition at line 3419 of file periX11.c.
References BCG::CBGWindow, and getWindowXgcNumber().
Referenced by SGDeleteWindow().
03420 { 03421 struct BCG *bcg; 03422 bcg = getWindowXgcNumber(wincount); 03423 if ( bcg != (struct BCG *) 0) 03424 return( bcg->CBGWindow); 03425 else 03426 return( (Window) 0); 03427 }
Here is the call graph for this function:
Here is the caller graph for this function:
void getcolordef | ( | integer * | screenc | ) |
int GetEventWindow | ( | XEvent * | event | ) |
Definition at line 3429 of file periX11.c.
References BCG::CurWindow, BCG::CWindow, getScilabWindowList(), WindowList::next, and WindowList::winxgc.
Referenced by btn_pressed(), btn_released(), ctrl_key(), key_pressed(), key_released(), and mouse_moved().
03430 { 03431 WindowList *listptr = getScilabWindowList() ; 03432 03433 while ( listptr != (WindowList *) 0 ) { 03434 if (event->xbutton.window == listptr->winxgc.CWindow) 03435 return(listptr->winxgc.CurWindow); 03436 listptr = (WindowList *)listptr->next; 03437 } 03438 return(-1); 03439 03440 }
Here is the call graph for this function:
Here is the caller graph for this function:
void C2F() getFontMaxSize | ( | char * | str, | |
integer * | sizeMin, | |||
integer * | sizeMax, | |||
integer * | v1, | |||
integer * | v2, | |||
integer * | v3, | |||
integer * | v4, | |||
double * | dx1, | |||
double * | dx2, | |||
double * | dx3, | |||
double * | dx4 | |||
) |
get the minimal and maximal font size the driver can display
Definition at line 3998 of file periX11.c.
References FONTMAXSIZE.
03999 { 04000 *sizeMin = 0 ; 04001 *sizeMax = FONTMAXSIZE ; 04002 }
To get the drawbox window size : used by periGif
Definition at line 707 of file periX11.c.
References xget_windowdim().
00708 { 00709 xget_windowdim(verbose, x, narg,dummy); 00710 }
Here is the call graph for this function:
Window GetWindowNumber | ( | int | wincount | ) |
Definition at line 3379 of file periX11.c.
References BCG::CWindow, and getWindowXgcNumber().
03380 { 03381 struct BCG *bcg; 03382 bcg = getWindowXgcNumber(wincount); 03383 if ( bcg != (struct BCG *) 0) 03384 return( bcg->CWindow); 03385 else 03386 return( (Window) 0); 03387 }
Here is the call graph for this function:
static struct BCG* GetWinXgc | ( | WindowList * | listptr, | |
integer | i | |||
) | [static] |
Definition at line 3396 of file periX11.c.
References BCG::CurWindow, WindowList::next, NULL, and WindowList::winxgc.
03397 { 03398 if (listptr == (WindowList *) NULL) 03399 { 03400 return NULL ; 03401 } 03402 else 03403 { 03404 if ((listptr->winxgc.CurWindow) == i) 03405 { 03406 return( &(listptr->winxgc)); 03407 } 03408 else 03409 { 03410 return(GetWinXgc((WindowList *) listptr->next,i)); 03411 } 03412 } 03413 }
Definition at line 1631 of file periX11.c.
Referenced by RGB2pix().
01632 { 01633 char rlabel[10], glabel[10], blabel[10]; 01634 01635 /* Copy the rgb to char strings */ 01636 (void) sprintf(rlabel,"00%x",r); 01637 (void) sprintf(glabel,"00%x",g); 01638 (void) sprintf(blabel,"00%x",b); 01639 01640 /* The hex label is composed of last 2 chars from r,g,b */ 01641 (void) sprintf(hex_str,"#000000"); 01642 hex_str[1] = rlabel[strlen(rlabel)-2]; 01643 hex_str[2] = rlabel[strlen(rlabel)-1]; 01644 hex_str[3] = glabel[strlen(glabel)-2]; 01645 hex_str[4] = glabel[strlen(glabel)-1]; 01646 hex_str[5] = blabel[strlen(blabel)-2]; 01647 hex_str[6] = blabel[strlen(blabel)-1]; 01648 01649 return(hex_str); 01650 }
Here is the caller graph for this function:
static void idfromname | ( | char * | name1, | |
integer * | num | |||
) | [static] |
Definition at line 1034 of file periX11.c.
References AluStruc_, i, info, and sciprint().
01035 {int i; 01036 *num = -1; 01037 for ( i =0 ; i < 16;i++) 01038 if (strcmp(AluStruc_[i].name,name1)== 0) 01039 *num=AluStruc_[i].id; 01040 if (*num == -1 ) 01041 { 01042 sciprint("\n Use the following keys (integer in scilab"); 01043 for ( i=0 ; i < 16 ; i++) 01044 sciprint("\nkey %s -> %s\r\n",AluStruc_[i].name, 01045 AluStruc_[i].info); 01046 } 01047 }
Here is the call graph for this function:
static void Ignore_Err | ( | Display * | d, | |
XErrorEvent * | err_ev | |||
) | [static] |
void C2F() initgraphic | ( | char * | string, | |
integer * | v2, | |||
integer * | v3, | |||
integer * | v4, | |||
integer * | v5, | |||
integer * | v6, | |||
integer * | v7, | |||
double * | dv1, | |||
double * | dv2, | |||
double * | dv3, | |||
double * | dv4 | |||
) |
EntryCounter is used to check for first Entry + to now an available number
This is done only at the first entry
Initialize default Scilab Xgc
Default value is without Pixmap
Definition at line 3466 of file periX11.c.
References AddMenu(), AddNewWindowToList(), C2F, BCG::CBGWindow, CreatePatterns(), CreatePopupWindow(), BCG::CurPixmapStatus, BCG::CurResizeStatus, BCG::CurWindow, BCG::CWindow, BCG::CWindowHeight, BCG::CWindowWidth, DisplayInit(), GXcopy, ierr, InitMissileXgc(), LoadFonts(), Max, ne, NULL, PI0, BCG::popup, refreshMenus(), ScilabXgc, sciprint(), TCLinterp, TKmainWindow, and X_error_handler().
03467 { 03468 XWindowAttributes war; 03469 struct BCG *NewXgc ; 03470 static integer EntryCounter = 0; 03471 integer WinNum; 03472 03473 #ifdef WITH_TK 03474 integer ne=11, menutyp=2, ierr; 03475 char *EditMenusE[]={"Select figure as current","Redraw figure","Erase figure","Copy object","Paste object","Move object","Delete object","Figure properties","Current axes properties","Start entity picker","Stop entity picker"}; 03476 03477 03478 integer ni=/*7*/6; 03479 char *InsertMenusE[]={"Line","Polyline","Arrow",/*"Double Arrow",*/"Text","Rectangle","Circle"}; 03480 03481 #else 03482 integer ne=3, menutyp=2, ierr; 03483 char *EditMenusE[]={"Select as current","Redraw figure","Erase figure"}; 03484 #endif 03485 03486 GC XCreateGC(Display *, Drawable, long unsigned int, XGCValues *); 03487 static int screen; 03488 static XGCValues gcvalues; 03489 static Widget toplevel = (Widget) NULL; 03490 *v3=0; 03491 if ( v2 != (integer *) NULL && *v2 != -1 ) 03492 WinNum= *v2; 03493 else 03494 WinNum= EntryCounter; 03495 if (EntryCounter == 0) 03496 { 03498 DisplayInit(string,&dpy,&toplevel); 03499 screen =DefaultScreen(dpy); 03500 root = XRootWindow (dpy,screen); 03501 depth = XDefaultDepth (dpy,screen); 03502 maxcol = 1 << depth; 03503 visual = XDefaultVisual(dpy,screen); 03504 wpixel = WhitePixelOfScreen(DefaultScreenOfDisplay(dpy)); 03505 bpixel = BlackPixelOfScreen(DefaultScreenOfDisplay(dpy)); 03506 LoadFonts(); 03507 crosscursor = XCreateFontCursor(dpy, XC_crosshair); 03508 arrowcursor = XCreateFontCursor (dpy, (char)0x2e); 03509 normalcursor = XCreateFontCursor (dpy, XC_X_cursor); 03510 } 03511 03512 NewXgc = AddNewWindowToList(); 03513 if ( NewXgc == (struct BCG *) 0) 03514 { 03515 sciprint("initgraphics: unable to alloc\n"); 03516 return; 03517 } 03518 else 03519 { 03520 ScilabXgc= NewXgc; 03521 } 03522 03523 #ifdef WITH_TK 03524 if (IsTKGraphicalMode()) { 03525 Tk_Window win; 03526 03527 /* TKmainWindow est initialise dans tclsci.c Tk_CreateMainWindow */ 03528 if (TKmainWindow != (Tk_Window)0) { 03529 win = Tk_NameToWindow(TCLinterp, string, (Tk_Window) TKmainWindow); 03530 if (win != (Tk_Window)0) { 03531 ScilabXgc->CWindow=Tk_WindowId(win); 03532 ScilabXgc->CBGWindow=(Window)0; 03533 ScilabXgc->popup=(Widget)0; 03534 03535 /* Tk_CreateEventHandler(win, ExposureMask, (Tk_EventProc *) redrawProc,NULL);*/ 03536 03537 } 03538 } 03539 } 03540 else 03541 #endif 03542 CreatePopupWindow(WinNum,toplevel,ScilabXgc,&DefaultForeground,&DefaultBackground) ; 03543 03544 03545 /*** XXXX ScilabXgc->CWindow = Find_TK_Window(WinNum); **/ 03546 if (EntryCounter == 0) 03547 { 03549 C2F(CreatePatterns)(DefaultBackground,DefaultForeground); 03550 } 03551 XGetWindowAttributes(dpy,ScilabXgc->CWindow,&war); 03552 ScilabXgc->CWindowWidth = war.width; 03553 ScilabXgc->CWindowHeight = war.height; 03554 03555 03556 03558 ScilabXgc->CurPixmapStatus = 0; 03559 ScilabXgc->CurResizeStatus = 1; 03560 ScilabXgc->CurWindow = WinNum; 03561 if (EntryCounter == 0) 03562 { 03563 /* GC Set: for drawing */ 03564 gcvalues.foreground = DefaultForeground; 03565 gcvalues.background = DefaultBackground; 03566 gcvalues.function = GXcopy ; 03567 gcvalues.line_width = 1; 03568 gc = XCreateGC(dpy, ScilabXgc->CWindow, GCFunction | GCForeground 03569 | GCBackground | GCLineWidth, &gcvalues); 03570 XSetWindowColormap(dpy,ScilabXgc->CBGWindow, 03571 XDefaultColormap(dpy,XDefaultScreen(dpy))); 03572 XSetErrorHandler(X_error_handler); 03573 XSetIOErrorHandler((XIOErrorHandler) X_error_handler); 03574 } 03575 InitMissileXgc(PI0,PI0,PI0,PI0); 03576 /* to be sure that current values are recorded */ 03577 /* StoreXgc(WinNum);*/ 03578 EntryCounter=Max(EntryCounter,WinNum); 03579 EntryCounter++; 03580 #ifdef WITH_TK 03581 if (!IsTKGraphicalMode()) 03582 { 03583 /* add the Edit and Insert menus */ 03584 AddMenu(&WinNum,"Edit", EditMenusE, &ne, &menutyp, "ged", &ierr); 03585 AddMenu(&WinNum,"Insert", InsertMenusE, &ni, &menutyp, "ged_insert", &ierr); 03586 03587 /* put them in grey in old style */ 03588 refreshMenus( ScilabXgc ) ; 03589 } 03590 #endif 03591 XSync(dpy,0); 03592 03593 }
Here is the call graph for this function:
Definition at line 3823 of file periX11.c.
References BCG::ClipRegionSet, CoordModeOrigin, Cscale2default(), BCG::CurColorStatus, BCG::CurDashStyle, BCG::CurLineWidth, BCG::CurNumberDispFormat, BCG::CurResizeStatus, getcolordef(), GREYNUMBER, i, BCG::IDLastPattern, j, BCG::mafigure, NULL, BCG::NumForeground, PI0, ScilabXgc, set_default_colormap(), xset_absourel(), xset_alufunction1(), xset_background(), xset_dash(), xset_font(), xset_foreground(), xset_hidden3d(), xset_mark(), xset_pattern(), xset_pixmapOn(), xset_thickness(), xset_unclip(), and xset_usecolor().
03824 { 03825 integer i,j; 03826 ScilabXgc->IDLastPattern = GREYNUMBER - 1; 03827 ScilabXgc->CurLineWidth = 0 ; 03828 ScilabXgc->CurDashStyle = 0 ; 03829 i=1; 03830 xset_thickness(&i,PI0,PI0,PI0); 03832 i=j= -1; 03833 xset_unclip(PI0,PI0,PI0,PI0); 03834 ScilabXgc->ClipRegionSet= 0; 03835 xset_font((i=2,&i),(j=1,&j),PI0,PI0); 03836 xset_mark((i=0,&i),(j=0,&j),PI0,PI0); 03837 ScilabXgc->CurResizeStatus = 1 ; 03839 i= CoordModeOrigin; 03840 xset_absourel(&i,PI0,PI0,PI0); 03841 /* initialisation des pattern dash par defaut en n&b */ 03842 ScilabXgc->CurColorStatus = 0; 03843 xset_pattern((i=1,&i),PI0,PI0,PI0); 03844 xset_dash((i=1,&i),PI0,PI0,PI0); 03845 xset_hidden3d((i=1,&i),PI0,PI0,PI0); 03846 /* initialisation de la couleur par defaut */ 03847 ScilabXgc->CurColorStatus = 1; 03848 set_default_colormap(); 03849 xset_alufunction1((i=3,&i),PI0,PI0,PI0); 03850 xset_pixmapOn((i=0,&i),PI0,PI0,PI0); 03851 03852 xset_pattern((i=ScilabXgc->NumForeground+1,&i),PI0,PI0,PI0); 03853 /*** XXXXX a faire aussi pour le n&b plus haut ***/ 03854 xset_foreground((i=ScilabXgc->NumForeground+1,&i),PI0,PI0,PI0); 03855 xset_background((i=ScilabXgc->NumForeground+2,&i),PI0,PI0,PI0); 03856 xset_hidden3d((i=4,&i),PI0,PI0,PI0); 03857 /* Choix du mode par defaut (decide dans initgraphic) */ 03858 getcolordef(&i); 03862 ScilabXgc->mafigure = (sciPointObj *)NULL; 03863 03864 ScilabXgc->CurColorStatus = (i == 1) ? 0: 1; 03865 xset_usecolor(&i ,PI0,PI0,PI0); 03866 strcpy(ScilabXgc->CurNumberDispFormat,"%-5.2g"); 03868 Cscale2default(); 03869 }
Here is the call graph for this function:
int IsPrivateCmap | ( | void | ) |
checks if the current colormap is a private one
Definition at line 2340 of file periX11.c.
References BCG::Cmap, NULL, and ScilabXgc.
Referenced by SciChoiceI().
02341 { 02342 int screen; 02343 if (dpy == (Display *) NULL) return(0); 02344 screen = XDefaultScreen(dpy); 02345 if (ScilabXgc == (struct BCG *)0 ) return(0); 02346 if ( ScilabXgc->Cmap == XDefaultColormap(dpy,screen)) return(0); 02347 else return(1); 02348 }
Here is the caller graph for this function:
void C2F() loadfamily | ( | char * | name, | |
integer * | j, | |||
integer * | v3, | |||
integer * | v4, | |||
integer * | v5, | |||
integer * | v6, | |||
integer * | v7, | |||
double * | dv1, | |||
double * | dv2, | |||
double * | dv3, | |||
double * | dv4 | |||
) |
Definition at line 4173 of file periX11.c.
References C2F, fname, FontInfoTab_, FONTMAXSIZE, fonttab, i, loadfamily_n(), FontAlias::name, NULL, FontInfo::ok, sciprint(), and strchr().
04174 { 04175 integer i,flag=1 ; 04177 if ( strchr(name,'%') != (char *) NULL) 04178 { 04179 C2F(loadfamily_n)(name,j); 04180 return; 04181 } 04182 else 04183 { 04185 i=0; 04186 while ( fonttab[i].alias != (char *) NULL) 04187 { 04188 if (strcmp(fonttab[i].alias,name)==0) 04189 { 04190 C2F(loadfamily_n)(fonttab[i].name,j); 04191 return ; 04192 } 04193 i++; 04194 } 04196 for ( i = 0; i < FONTMAXSIZE ; i++) 04197 { 04198 char name1[200]; 04199 sprintf(name1,"%s%s",name,size_[i]); 04200 FontsList_[*j][i]=XLoadQueryFont(dpy,name1); 04201 if (FontsList_[*j][i]== NULL) 04202 { 04203 flag=0; 04204 sciprint("\n Unknown font : %s",name1); 04205 sciprint("\n I'll use font: fixed "); 04206 FontsList_[*j][i]=XLoadQueryFont(dpy,"fixed"); 04207 if (FontsList_[*j][i]== NULL) 04208 { 04209 sciprint("\n Unknown font : %s\r\n","fixed"); 04210 sciprint("Please call an X Wizard !"); 04211 } 04212 } 04213 } 04214 FontInfoTab_[*j].ok = 1; 04215 if (flag != 0) 04216 strcpy(FontInfoTab_[*j].fname,name); 04217 else 04218 strcpy(FontInfoTab_[*j].fname,"fixed"); 04219 } 04220 }
Here is the call graph for this function:
static void C2F() loadfamily_n | ( | char * | name, | |
integer * | j | |||
) | [static] |
static void LoadFonts | ( | void | ) |
static void LoadSymbFonts | ( | void | ) |
void C2F() MissileGCget | ( | char * | str, | |
integer * | verbose, | |||
integer * | x1, | |||
integer * | x2, | |||
integer * | x3, | |||
integer * | x4, | |||
integer * | x5, | |||
double * | dv1, | |||
double * | dv2, | |||
double * | dv3, | |||
double * | dv4 | |||
) |
Definition at line 2568 of file periX11.c.
References C2F, L, and MissileGCGetorSet().
02569 { 02570 int x6=0; 02571 C2F(MissileGCGetorSet)(str,(integer)1L,verbose,x1,x2,x3,x4,x5,&x6,dv1); 02572 }
Here is the call graph for this function:
void C2F() MissileGCGetorSet | ( | char * | str, | |
integer | flag, | |||
integer * | verbose, | |||
integer * | x1, | |||
integer * | x2, | |||
integer * | x3, | |||
integer * | x4, | |||
integer * | x5, | |||
integer * | x6, | |||
double * | dv1 | |||
) |
Definition at line 2580 of file periX11.c.
References bgc::getfonc, i, j, MissileGCTab_, NUMSETFONC, and sciprint().
02581 { 02582 integer i ; 02583 for (i=0; i < NUMSETFONC ; i++) 02584 { 02585 integer j; 02586 j = strcmp(str,MissileGCTab_[i].name); 02587 if ( j == 0 ) 02588 { 02589 /* if (*verbose == 1) */ 02590 /* sciprint("\nGetting Info on %s\r\n",str); */ 02591 if (flag == 1) 02592 (MissileGCTab_[i].getfonc)(verbose,x1,x2,dv1); 02593 else 02594 (MissileGCTab_[i].setfonc)(x1,x2,x3,x4,x5,x6,dv1); 02595 return;} 02596 else 02597 { if ( j <= 0) 02598 { 02599 sciprint("\nUnknow X operator <%s>\r\n",str); 02600 if ( flag == 1) 02601 { 02604 *x1=1;*x2=0; 02605 } 02606 return; 02607 } 02608 } 02609 } 02610 sciprint("\n Unknow X operator <%s>\r\n",str); 02611 *x1=1;*x2=0; 02612 }
Here is the call graph for this function:
Definition at line 345 of file periX11.c.
References BCG::Cdrawable, BCG::CurDrawFunction, GXclear, PI0, and xset_alufunction2().
Referenced by cleararea(), sci_pixmap_resize(), xset_pixmapclear(), and xset_pixmapOn().
00346 { 00347 /* switch to a clear gc */ 00348 int cur_alu = Xgc->CurDrawFunction; 00349 int clear = GXclear; 00350 xset_alufunction2(Xgc,&clear,PI0,PI0,PI0); 00351 if (Xgc->Cdrawable != (Drawable) 0) XFillRectangle(dpy, Xgc->Cdrawable, gc, x,y,w,h); 00352 /* back to standard value */ 00353 xset_alufunction2(Xgc,&cur_alu,PI0,PI0,PI0); 00354 }
Here is the call graph for this function:
Here is the caller graph for this function:
void C2F() queryfamily | ( | char * | name, | |
integer * | j, | |||
integer * | v3, | |||
integer * | v4, | |||
integer * | v5, | |||
integer * | v6, | |||
integer * | v7, | |||
double * | dv1, | |||
double * | dv2, | |||
double * | dv3, | |||
double * | dv4 | |||
) |
Definition at line 4252 of file periX11.c.
References fname, FontInfoTab_, FONTNUMBER, and fonttab.
04253 { 04254 integer i ; 04255 name[0]='\0'; 04256 for (i=0;i<FONTNUMBER;i++) { 04257 v3[i]=strlen(FontInfoTab_[i].fname); 04258 if (v3[i] > 0) 04259 strcat(name,FontInfoTab_[i].fname); 04260 else 04261 if (i < FONTNUMBER-1) { /* ici il y avait 6 ... */ 04262 v3[i]=strlen(fonttab[i].name); 04263 strcat(name,fonttab[i].name); 04264 } 04265 } 04266 *j=FONTNUMBER; 04267 }
Definition at line 4394 of file periX11.c.
References MALLOC, MESSAGE5, NULL, REALLOC, and sciprint().
04395 { 04396 if ( points == NULL ) 04397 { 04398 points = MALLOC( n * sizeof(XPoint) ) ; 04399 } 04400 else 04401 { 04402 points = REALLOC( points, n * sizeof(XPoint) ) ; 04403 } 04404 04405 if ( points == NULL ) 04406 { 04407 sciprint(MESSAGE5); 04408 return 0; 04409 } 04410 04411 return 1 ; 04412 04413 }
Here is the call graph for this function:
static void ResetScilabXgc | ( | void | ) | [static] |
Definition at line 3877 of file periX11.c.
References BCG::ClipRegionSet, BCG::CurClipRegion, BCG::CurColor, BCG::CurColorStatus, BCG::CurDashStyle, BCG::CurDrawFunction, BCG::CurHardSymb, BCG::CurHardSymbSize, BCG::CurLineWidth, BCG::CurPattern, BCG::CurVectorStyle, BCG::FontId, BCG::FontSize, i, j, BCG::NumBackground, BCG::NumForeground, BCG::NumHidden3d, PI0, ScilabXgc, xset_absourel(), xset_alufunction1(), xset_background(), xset_dash(), xset_font(), xset_foreground(), xset_hidden3d(), xset_mark(), xset_pattern(), xset_thickness(), and xset_unclip().
03878 { 03879 integer i,j, clip[4]; 03880 i= ScilabXgc->FontId; 03881 j= ScilabXgc->FontSize; 03882 xset_font(&i,&j,PI0,PI0); 03883 03884 i= ScilabXgc->CurHardSymb; 03885 j= ScilabXgc->CurHardSymbSize; 03886 xset_mark(&i,&j,PI0,PI0); 03887 03888 i= ScilabXgc->CurLineWidth; 03889 xset_thickness(&i,PI0,PI0,PI0); 03890 03891 i= ScilabXgc->CurVectorStyle; 03892 xset_absourel(&i,PI0,PI0,PI0); 03893 03894 i= ScilabXgc->CurDrawFunction; 03895 xset_alufunction1(&i,PI0,PI0,PI0); 03896 03897 if (ScilabXgc->ClipRegionSet == 1) 03898 { 03899 for ( i= 0 ; i < 4; i++) clip[i]=ScilabXgc->CurClipRegion[i]; 03900 xset_clip(clip,clip+1,clip+2,clip+3); 03901 } 03902 else 03903 xset_unclip(PI0,PI0,PI0,PI0); 03904 03905 if (ScilabXgc->CurColorStatus == 0) 03906 { 03907 /* remise des couleurs a vide */ 03908 ScilabXgc->CurColorStatus = 1; 03909 xset_pattern((i=DefaultForeground,&i),PI0,PI0,PI0); 03910 /* passage en n&b */ 03911 ScilabXgc->CurColorStatus = 0; 03912 i= ScilabXgc->CurPattern + 1; 03913 xset_pattern(&i,PI0,PI0,PI0); 03914 i= ScilabXgc->CurDashStyle + 1; 03915 xset_dash(&i,PI0,PI0,PI0); 03916 i= ScilabXgc->NumHidden3d+1; 03917 xset_hidden3d(&i,PI0,PI0,PI0); 03918 } 03919 else 03920 { 03921 /* remise a zero des patterns et dash */ 03922 /* remise des couleurs a vide */ 03923 ScilabXgc->CurColorStatus = 0; 03924 xset_pattern((i=1,&i),PI0,PI0,PI0); 03925 xset_dash((i=1,&i),PI0,PI0,PI0); 03926 /* passage en couleur */ 03927 ScilabXgc->CurColorStatus = 1; 03928 i= ScilabXgc->CurColor + 1; 03929 xset_pattern(&i,PI0,PI0,PI0); 03930 i= ScilabXgc->NumBackground+1; 03931 xset_background(&i,PI0,PI0,PI0); 03932 i= ScilabXgc->NumForeground+1; 03933 xset_foreground(&i,PI0,PI0,PI0); 03934 i= ScilabXgc->NumHidden3d+1; 03935 xset_hidden3d(&i,PI0,PI0,PI0); 03936 } 03937 }
Here is the call graph for this function:
Pixel RGB2pix | ( | unsigned int | r, | |
unsigned int | g, | |||
unsigned int | b, | |||
long unsigned int | r_mask, | |||
long unsigned int | g_mask, | |||
long unsigned int | b_mask | |||
) |
Definition at line 1652 of file periX11.c.
References hex_string().
Referenced by set_default_colormap1(), and setcolormap1().
01653 { 01654 Colormap cmap; 01655 XColor cdef; 01656 cdef.red = r *256 ; 01657 cdef.green = g *256 ; 01658 cdef.blue = b *256 ; 01659 cdef.flags = DoRed | DoGreen | DoBlue; 01660 cmap = XDefaultColormap(dpy,XDefaultScreen(dpy)); 01661 if (XAllocColor(dpy,cmap,&cdef)) 01662 return( cdef.pixel); 01663 else if (XParseColor(dpy,cmap,hex_string(r,g,b),&cdef) && 01664 XAllocColor(dpy,cmap,&cdef)) { 01665 return( cdef.pixel); 01666 } 01667 return (Pixel) 0; 01668 }
Here is the call graph for this function:
Here is the caller graph for this function:
Pixel RGB2pixO | ( | unsigned int | r, | |
unsigned int | g, | |||
unsigned int | b, | |||
long unsigned int | r_mask, | |||
long unsigned int | g_mask, | |||
long unsigned int | b_mask | |||
) |
Definition at line 1588 of file periX11.c.
References i.
01589 { 01590 static int r_bits,g_bits,b_bits,first_entry=0; 01591 unsigned long p2; 01592 int i; 01593 Pixel pix; 01594 01595 if (first_entry == 0) { 01596 p2 = 1; 01597 for (i = 1; i <= depth; i++) { 01598 if (p2 << i == b_mask + 1) { 01599 b_bits = i; 01600 break; 01601 } 01602 } 01603 g_mask = g_mask >> b_bits; 01604 p2 = 1; 01605 for (i = 1; i <= depth - b_bits; i++) { 01606 if (p2 << i == g_mask + 1) { 01607 g_bits = i; 01608 break; 01609 } 01610 } 01611 01612 r_bits = depth - g_bits - b_bits; 01613 first_entry = 1; 01614 } 01615 01616 pix = ((r >> (8 - r_bits)) << (g_bits + b_bits)) 01617 + ((g >> (8 - g_bits)) << b_bits) 01618 + (b >> (8 - b_bits)); 01619 return pix; 01620 }
Resize the pixmap associated to CurWindow and store it back in the window List
Definition at line 317 of file periX11.c.
References BCG::Cdrawable, BCG::CWindow, hdc1, Max, NULL, PixmapClear(), sci_pixmapclear(), sciprint(), and TryToGetDC().
00318 { 00319 /*if (Xgc->CurPixmapStatus != 0) { use pixmap as backing store if CurPixmapStatus==0 */ 00320 if (Xgc->Cdrawable != (Drawable) 0) 00321 XFreePixmap(dpy,(Pixmap)Xgc->Cdrawable); 00322 Xgc->Cdrawable = (Drawable) XCreatePixmap(dpy, root,Max(x,400),Max(y,300),depth); 00323 00324 if ( Xgc->Cdrawable == (Drawable) 0) 00325 sciprint("Not enough memory to allocate pixmap\r\n"); 00326 else 00327 { 00328 PixmapClear(Xgc,0,0,x,y); 00329 XSetWindowBackgroundPixmap(dpy, Xgc->CWindow,(Pixmap) Xgc->Cdrawable); 00330 } 00331 /*}*/ 00332 }
Here is the call graph for this function:
void SciClick | ( | integer * | ibutton, | |
integer * | x1, | |||
integer * | yy1, | |||
integer * | iflag, | |||
int | getmouse, | |||
int | getrelease, | |||
int | dyn_men, | |||
char * | str, | |||
integer * | lstr | |||
) |
Definition at line 462 of file periX11.c.
References C2F, CheckClickQueue(), ClearClickQueue(), BCG::CurWindow, BCG::CWindow, getmen(), ismenu(), ok, ScilabXgc, set_event_select(), and set_wait_click().
00463 { 00464 integer buttons = 0; 00465 integer win,ok,choice,motion,release; 00466 Window SCWindow; 00467 struct timeval delay; /* usec, to slow down event loop */ 00468 00469 choice=(dyn_men>1); /* depending on lhs */ 00470 00471 if ( ScilabXgc == (struct BCG *) 0 || ScilabXgc->CWindow == (Window) 0) 00472 { 00473 *x1 = -1; 00474 *yy1 = -1; 00475 *ibutton = -100; return; 00476 } 00477 win = ScilabXgc->CurWindow; 00478 SCWindow = ScilabXgc->CWindow; 00479 00480 if ( *iflag ==0 ) ClearClickQueue(ScilabXgc->CurWindow); 00481 XDefineCursor(dpy, ScilabXgc->CWindow ,crosscursor); 00482 00483 /*set wait_for_click=1 to diable event handler if any */ 00484 set_wait_click(1); 00485 set_event_select(1+2*getmouse+4*getrelease); 00486 00487 while (buttons == 0) 00488 { 00490 if (choice) win=-1; 00491 ok=0; 00492 if (CheckClickQueue(&win,x1,yy1,ibutton,&motion,&release) == 1) { 00493 if ((release&&getrelease) || (motion&&getmouse) || ((motion==0)&&(release==0))){ 00494 *iflag=win; 00495 ok=1; 00496 break; 00497 } 00498 if (choice) win=-1; 00499 } 00500 if(ok) break; 00501 /* make the X and tk event loop */ 00502 C2F(sxevents)(); 00503 00505 if ( ScilabXgc == (struct BCG *) 0 || ScilabXgc->CWindow != SCWindow) 00506 { 00507 *x1 = -1; 00508 *yy1 = -1; 00509 *ibutton = -100; 00510 set_event_select(1+4); 00511 set_wait_click(0); 00512 return; 00513 } 00515 if ( (dyn_men == 1||dyn_men==3) && C2F(ismenu)()==1 ) { 00516 int entry; 00517 C2F(getmen)(str,lstr,&entry); 00518 *ibutton = -2; 00519 *x1=0; 00520 *yy1=0; 00521 break; 00522 } 00523 00524 /* to slow down event loop not to use all cpu when nothing happen*/ 00525 delay.tv_sec = 0; delay.tv_usec = 10; 00526 select(0, 0, 0, 0, &delay); 00527 } 00528 set_event_select(1+4); 00529 set_wait_click(0); 00530 if ( ScilabXgc != (struct BCG *) 0 && ScilabXgc->CWindow != (Window) 0) 00531 XDefineCursor(dpy, ScilabXgc->CWindow ,arrowcursor); 00532 XSync (dpy, 0); 00533 }
Here is the call graph for this function:
Definition at line 1574 of file periX11.c.
01575 { 01576 set_default_colormap_flag = *flag; 01577 return(0); 01578 }
void SendScilab | ( | Window | local, | |
integer | winnum | |||
) |
Definition at line 3654 of file periX11.c.
References L.
03655 { 03656 XClientMessageEvent ev; 03657 ev.type = ClientMessage; 03658 ev.window = local ; 03659 ev.message_type =NewGraphWindowMessageAtom; 03660 ev.format = 32; 03661 ev.data.l[0] = winnum; 03662 XSendEvent (dpy, local, False, (integer)0L, (XEvent *) &ev); 03663 XFlush(dpy); 03664 }
void set_c | ( | integer | col | ) |
Definition at line 984 of file periX11.c.
References bk, BCG::Colors, BCG::CurColor, BCG::CurDrawFunction, GXclear, GXxor, i, Max, Min, NULL, BCG::NumBackground, BCG::Numcolors, and ScilabXgc.
00985 { 00986 int i,bk; 00987 /* colors from 1 to ScilabXgc->Numcolors */ 00988 i= Max(0,Min(col,ScilabXgc->Numcolors + 1)); 00989 ScilabXgc->CurColor = i; 00990 bk= Max(0,Min(ScilabXgc->NumBackground,ScilabXgc->Numcolors + 1)); 00991 if (ScilabXgc->Colors == NULL) return; 00992 switch ( ScilabXgc->CurDrawFunction ) 00993 { 00994 case GXclear : 00995 break ; 00996 case GXxor : 00997 XSetForeground(dpy, gc,(unsigned long) 00998 ScilabXgc->Colors[i] ^ ScilabXgc->Colors[bk]);break; 00999 default : 01000 XSetForeground(dpy, gc,(unsigned long) ScilabXgc->Colors[i] );break; 01001 } 01002 }
static void set_client_message_off | ( | void | ) | [static] |
Definition at line 436 of file periX11.c.
Referenced by xclick_any().
00436 { client_message=0;};
Here is the caller graph for this function:
static void set_client_message_on | ( | void | ) | [static] |
Definition at line 435 of file periX11.c.
Referenced by xclick_any().
00435 { client_message=1;};
Here is the caller graph for this function:
void set_cmap | ( | Window | w | ) |
void set_default_colormap | ( | void | ) |
Definition at line 1679 of file periX11.c.
References DEFAULTNUMCOLORS, m, sciprint(), set_default_colormap1(), and set_default_colormap2().
01680 { 01681 int m; 01682 01683 /* we don't want to set the default colormap at window creation 01684 if the scilab command was xset("colormap"); */ 01685 01686 if (set_default_colormap_flag == 0) return; 01687 01688 if (DEFAULTNUMCOLORS > maxcol) { 01689 sciprint("Not enough colors for default colormap. Maximum is %d\r\n", 01690 maxcol); 01691 return; 01692 } 01693 m = DEFAULTNUMCOLORS; 01694 01695 switch (visual->class) { 01696 case TrueColor: 01697 set_default_colormap1(m); 01698 break; 01699 case DirectColor: 01700 set_default_colormap2(m); 01701 break; 01702 default: 01703 set_default_colormap2(m); 01704 break; 01705 } 01706 }
Here is the call graph for this function:
void set_default_colormap1 | ( | int | m | ) |
Definition at line 1710 of file periX11.c.
References b, BCG::Blue, BCG::CBGWindow, BCG::Cmap, BCG::CmapFlag, BCG::Colors, DEFAULTBLACK, DEFAULTWHITE, FREE, g, BCG::Green, i, BCG::IDLastPattern, BCG::NumBackground, BCG::Numcolors, BCG::NumForeground, BCG::Red, RGB2pix(), ScilabXgc, and XgcAllocColors().
Referenced by set_default_colormap().
01711 { 01712 int i; 01713 Colormap cmap; 01714 Pixel pix; 01715 unsigned int red, green, blue; 01716 Pixel *c = ScilabXgc->Colors; /* Save old color vectors comp�nents */ 01717 float *r = ScilabXgc->Red; 01718 float *g = ScilabXgc->Green; 01719 float *b = ScilabXgc->Blue; 01720 01721 if (!XgcAllocColors(ScilabXgc,m)) { 01722 ScilabXgc->Colors = c; 01723 ScilabXgc->Red = r; 01724 ScilabXgc->Green = g; 01725 ScilabXgc->Blue = b; 01726 return; 01727 } 01728 01729 /* Getting RGB values */ 01730 for (i = 0; i < m; i++) { 01731 ScilabXgc->Red[i] = (float)default_colors[3*i]/255.0; 01732 ScilabXgc->Green[i] = (float)default_colors[3*i+1]/255.0; 01733 ScilabXgc->Blue[i] = (float)default_colors[3*i+2]/255.0; 01734 } 01735 01736 /* Black */ 01737 ScilabXgc->Red[m] = 0; 01738 ScilabXgc->Green[m] = 0; 01739 ScilabXgc->Blue[m] = 0; 01740 01741 /* White */ 01742 ScilabXgc->Red[m+1] = 1; 01743 ScilabXgc->Green[m+1] = 1; 01744 ScilabXgc->Blue[m+1] = 1; 01745 01746 cmap = XDefaultColormap(dpy,XDefaultScreen(dpy)); 01747 01748 for (i = 0; i < m; i++) { 01749 red = (unsigned int)default_colors[3*i]; 01750 green = (unsigned int)default_colors[3*i+1]; 01751 blue = (unsigned int)default_colors[3*i+2]; 01752 pix = RGB2pix(red,green,blue,visual->red_mask,visual->green_mask, 01753 visual->blue_mask); 01754 ScilabXgc->Colors[i] = pix; 01755 } 01756 01757 XSetWindowColormap(dpy,ScilabXgc->CBGWindow,cmap); 01758 ScilabXgc->Cmap = cmap; 01759 ScilabXgc->Numcolors = m; 01760 ScilabXgc->IDLastPattern = m - 1; 01761 ScilabXgc->CmapFlag = 1; 01762 /* Black and white pixels */ 01763 ScilabXgc->Colors[m] = ScilabXgc->Colors[DEFAULTBLACK]; 01764 ScilabXgc->Colors[m+1] = ScilabXgc->Colors[DEFAULTWHITE]; 01765 ScilabXgc->NumForeground = m; 01766 ScilabXgc->NumBackground = m + 1; 01767 XFlush(dpy); 01768 FREE(c); FREE(r); FREE(g); FREE(b); 01769 }
Here is the call graph for this function:
Here is the caller graph for this function:
void set_default_colormap2 | ( | int | m | ) |
Definition at line 1772 of file periX11.c.
References set_default_colormap3().
Referenced by set_default_colormap().
01773 { 01774 /* Use same code as Pseudo Color for the moment */ 01775 set_default_colormap3(m); 01776 }
Here is the call graph for this function:
Here is the caller graph for this function:
void set_default_colormap3 | ( | int | m | ) |
Definition at line 1779 of file periX11.c.
References b, BCG::Blue, BCG::CBGWindow, ChangeBandF(), BCG::Cmap, BCG::CmapFlag, BCG::Colors, BCG::CurWindow, DEFAULTBLACK, DEFAULTWHITE, FREE, g, BCG::Green, i, j, MALLOC, NULL, BCG::Numcolors, BCG::Red, ScilabXgc, sciprint(), XgcAllocColors(), and XgcFreeColors().
Referenced by set_default_colormap2().
01780 { 01781 int i,j; 01782 int missing_col_mess=-1; 01783 Colormap cmap,dcmap,ocmap; 01784 XColor color; 01785 Pixel *pixels = (Pixel *) NULL; 01786 Pixel *c = ScilabXgc->Colors; /* Save old colors components */ 01787 float *r = ScilabXgc->Red; 01788 float *g = ScilabXgc->Green; 01789 float *b = ScilabXgc->Blue; 01790 01791 int bp1,wp1; 01792 01793 if (!XgcAllocColors(ScilabXgc,m)) { 01794 ScilabXgc->Colors = c; 01795 ScilabXgc->Red = r; 01796 ScilabXgc->Green = g; 01797 ScilabXgc->Blue = b; 01798 return; 01799 } 01800 01801 if (!(pixels = (Pixel *) MALLOC(m*sizeof(Pixel)))) { 01802 sciprint("set_default_colormap: unable to alloc\n"); 01803 XgcFreeColors(ScilabXgc); 01804 ScilabXgc->Colors = c; 01805 ScilabXgc->Red = r; 01806 ScilabXgc->Green = g; 01807 ScilabXgc->Blue = b; 01808 return; 01809 } 01810 01811 /* Getting RGB values */ 01812 for (i = 0; i < m; i++) { 01813 ScilabXgc->Red[i] = (float)default_colors[3*i]/255.0; 01814 ScilabXgc->Green[i] = (float)default_colors[3*i+1]/255.0; 01815 ScilabXgc->Blue[i] = (float)default_colors[3*i+2]/255.0; 01816 } 01817 /* Black */ 01818 ScilabXgc->Red[m] = 0; 01819 ScilabXgc->Green[m] = 0; 01820 ScilabXgc->Blue[m] = 0; 01821 01822 /* White */ 01823 ScilabXgc->Red[m+1] = 1; 01824 ScilabXgc->Green[m+1] = 1; 01825 ScilabXgc->Blue[m+1] = 1; 01826 01827 dcmap = XDefaultColormap(dpy,XDefaultScreen(dpy)); 01828 ocmap = ScilabXgc->Cmap; 01829 01830 /* If old colormap is the default colormap, free already 01831 allocated colors */ 01832 if (ScilabXgc->Numcolors != 0 && ocmap == dcmap) { 01833 XFreeColors(dpy,dcmap,c,ScilabXgc->Numcolors,0); 01834 } 01835 01836 /* First try to alloc readonly colors from the default colormap */ 01837 for (i = 0; i < m; i++) { 01838 color.red = default_colors[3*i]<<8; 01839 color.green = default_colors[3*i+1]<<8; 01840 color.blue = default_colors[3*i+2]<<8; 01841 color.flags = DoRed|DoGreen|DoBlue; 01842 if (!XAllocColor(dpy,dcmap,&color)) { 01843 /* No enough room in default colormap, free allocated pixels */ 01844 if (i != 0) XFreeColors(dpy,dcmap,pixels,i,0); 01845 break; 01846 } 01847 pixels[i] = color.pixel; 01848 ScilabXgc->Colors[i] = color.pixel; 01849 } 01850 01851 cmap = dcmap; 01852 01853 if (i < m - 1) 01854 { 01855 /* Can't allocate all colors in default colormap; if old colormap was 01856 the default colormap, create a new one, otherwise use old one */ 01857 if (ocmap == 0 || ocmap == dcmap) 01858 { 01859 /* Create a new private colormap */ 01860 missing_col_mess=i; 01861 if ((cmap=XCreateColormap(dpy,ScilabXgc->CBGWindow,visual,AllocNone)) == 0) 01862 { 01863 XgcFreeColors(ScilabXgc); 01864 FREE(pixels); 01865 ScilabXgc->Colors = c; 01866 ScilabXgc->Red = r; 01867 ScilabXgc->Green = g; 01868 ScilabXgc->Blue = b; 01869 sciprint("%d colors missing, switch to private colormap\r\n",m - i); 01870 sciprint("Cannot allocate new colormap\r\n"); 01871 return; 01872 } 01873 } 01874 else 01875 { 01876 /* Use old private colormap */ 01877 cmap = ocmap; 01878 /* Free already allocated colors */ 01879 if (ScilabXgc->CmapFlag) 01880 XFreeColors(dpy,cmap,c,ScilabXgc->Numcolors,0); 01881 else XFreeColors(dpy,cmap,c,ScilabXgc->Numcolors+2,0); 01882 } 01883 /* Try to alloc readwrite colors from the private colormap */ 01884 for (i = 0; i < m; i++) 01885 { 01886 if (!XAllocColorCells(dpy,cmap,False,NULL,0,&pixels[i],1)) 01887 { 01888 XgcFreeColors(ScilabXgc); 01889 FREE(pixels); 01890 ScilabXgc->Colors = c; 01891 ScilabXgc->Red = r; 01892 ScilabXgc->Green = g; 01893 ScilabXgc->Blue = b; 01894 sciprint("%d colors missing, unable to allocate colormap\r\n",m - i); 01895 return; 01896 } 01897 } 01898 01899 color.flags = DoRed|DoGreen|DoBlue; 01900 01901 /* First store white(wpixel) and black(bpixel) 01902 wpixel and bpixel are usually 0 and 1 or 1 and 0 */ 01903 color.red = default_colors[3*DEFAULTWHITE]<<8; 01904 color.green = default_colors[3*DEFAULTWHITE+1]<<8; 01905 color.blue = default_colors[3*DEFAULTWHITE+2]<<8; 01906 if (wpixel == 1) wp1 = wpixel; 01907 else if (wpixel == 0) wp1 = wpixel; 01908 else if (bpixel == 0) wp1 = 1; 01909 else if (bpixel == 1) wp1 = 0; 01910 else wp1 =0; 01911 color.pixel = ScilabXgc->Colors[DEFAULTWHITE] = pixels[wp1]; 01912 XStoreColor(dpy,cmap,&color); 01913 color.red = default_colors[3*DEFAULTBLACK]<<8; 01914 color.green = default_colors[3*DEFAULTBLACK+1]<<8; 01915 color.blue = default_colors[3*DEFAULTBLACK+2]<<8; 01916 if (bpixel == 1) bp1 = bpixel; 01917 else if (bpixel == 0) bp1 = bpixel; 01918 else if (wpixel == 0) bp1 = 1; 01919 else if (wpixel == 1) bp1 = 0; 01920 else bp1 =1; 01921 color.pixel = ScilabXgc->Colors[DEFAULTBLACK] = pixels[bp1]; 01922 XStoreColor(dpy,cmap,&color); 01923 j = 2; 01924 for (i = 0; i < m; i++) { 01925 if (i == DEFAULTBLACK || i == DEFAULTWHITE) continue; 01926 color.red = default_colors[3*i]<<8; 01927 color.green = default_colors[3*i+1]<<8; 01928 color.blue = default_colors[3*i+2]<<8; 01929 color.pixel = ScilabXgc->Colors[i] = pixels[j++]; 01930 XStoreColor(dpy,cmap,&color); 01931 } 01932 /* Change decoration of graphics windows */ 01933 ChangeBandF(ScilabXgc->CurWindow,pixels[bp1],pixels[wp1]); 01934 } 01935 01936 if (ocmap != (Colormap)0 && ocmap != cmap && ocmap != dcmap) 01937 XFreeColormap(dpy,ocmap); 01938 XSetWindowColormap(dpy,ScilabXgc->CBGWindow,cmap); 01939 ScilabXgc->Cmap = cmap; 01940 ScilabXgc->Numcolors = m; 01941 ScilabXgc->IDLastPattern = m - 1; 01942 ScilabXgc->CmapFlag = 1; 01943 /* Black and white pixels */ 01944 ScilabXgc->Colors[m] = ScilabXgc->Colors[DEFAULTBLACK]; 01945 ScilabXgc->Colors[m+1] = ScilabXgc->Colors[DEFAULTWHITE]; 01946 ScilabXgc->NumForeground = m; 01947 ScilabXgc->NumBackground = m + 1; 01948 XFlush(dpy); 01949 FREE(c); FREE(r); FREE(g); FREE(b); 01950 FREE(pixels); 01955 if (missing_col_mess != -1 ) 01956 sciprint("%d colors missing, switch to private colormap\r\n",m - 01957 missing_col_mess); 01958 }
Here is the call graph for this function:
Here is the caller graph for this function:
void set_event_select | ( | int | val | ) |
Definition at line 247 of file Events.c.
References event_select.
00248 { 00249 event_select=val; 00250 }
void set_wait_click | ( | int | val | ) |
Definition at line 233 of file Events.c.
References wait_for_click.
00234 { 00235 if (val==1) { 00236 wait_for_click=val; 00237 }else 00238 wait_for_click=val; 00239 }
void setcolordef | ( | int | screenc | ) |
Definition at line 2019 of file periX11.c.
References b, BCG::Blue, BCG::CBGWindow, BCG::Cmap, BCG::CmapFlag, BCG::Colors, BCG::CurDrawFunction, FREE, g, BCG::Green, i, BCG::IDLastPattern, BCG::NumBackground, BCG::Numcolors, BCG::NumForeground, PI0, BCG::Red, RGB2pix(), ScilabXgc, sciprint(), XgcAllocColors(), xset_alufunction1(), xset_background(), xset_foreground(), xset_pattern(), and xset_usecolor().
02020 { 02021 int i; 02022 Colormap cmap; 02023 unsigned int red, green, blue; 02024 Pixel pix; 02025 02026 Pixel *c = Xgc->Colors; /* Save old color vectors components */ 02027 float *r = Xgc->Red; 02028 float *g = Xgc->Green; 02029 float *b = Xgc->Blue; 02030 02031 if (!XgcAllocColors(ScilabXgc,m)) { /* Why ScilabXgc and not Xgc ?? F.Leray 26.08.04 */ 02032 Xgc->Colors = c; 02033 Xgc->Red = r; 02034 Xgc->Green = g; 02035 Xgc->Blue = b; 02036 *v3 = 1; 02037 return; 02038 } 02039 02040 /* Checking RGB values */ 02041 for (i = 0; i < m; i++) { 02042 if (a[i] < 0 || a[i] > 1 || a[i+m] < 0 || a[i+m] > 1 || 02043 a[i+2*m] < 0 || a[i+2*m]> 1) { 02044 sciprint("RGB values must be between 0 and 1\n"); 02045 Xgc->Colors = c; 02046 Xgc->Red = r; 02047 Xgc->Green = g; 02048 Xgc->Blue = b; 02049 *v3 = 1; 02050 return; 02051 } 02052 Xgc->Red[i] = (float)a[i]; 02053 Xgc->Green[i] = (float)a[i+m]; 02054 Xgc->Blue[i] = (float)a[i+2*m]; 02055 } 02056 /* Black */ 02057 Xgc->Red[m] = 0; 02058 Xgc->Green[m] = 0; 02059 Xgc->Blue[m] = 0; 02060 Xgc->Colors[m] = RGB2pix(0,0,0,visual->red_mask, 02061 visual->green_mask,visual->blue_mask); 02062 02063 /* White */ 02064 Xgc->Red[m+1] = 1; 02065 Xgc->Green[m+1] = 1; 02066 Xgc->Blue[m+1] = 1; 02067 Xgc->Colors[m+1] = RGB2pix(255,255,255,visual->red_mask, 02068 visual->green_mask,visual->blue_mask); 02069 02070 for (i = 0; i < m; i++) { 02071 red = (unsigned short)(a[i]*255.0); 02072 green = (unsigned short)(a[i+m]*255.0); 02073 blue = (unsigned short)(a[i+2*m]*255.0); 02074 pix = RGB2pix(red,green,blue,visual->red_mask,visual->green_mask, 02075 visual->blue_mask); 02076 Xgc->Colors[i] = pix; 02077 } 02078 02079 cmap = XDefaultColormap(dpy,XDefaultScreen(dpy)); 02080 02081 XSetWindowColormap(dpy,Xgc->CBGWindow,cmap); 02082 Xgc->Cmap = cmap; 02083 Xgc->Numcolors = m; 02084 Xgc->IDLastPattern = m - 1; 02085 Xgc->CmapFlag = 0; 02086 Xgc->NumForeground = m; 02087 Xgc->NumBackground = m + 1; 02088 xset_usecolor((i=1,&i) ,PI0,PI0,PI0); 02089 xset_alufunction1(&Xgc->CurDrawFunction,PI0,PI0,PI0); 02090 xset_pattern((i=Xgc->NumForeground+1,&i),PI0,PI0,PI0); 02091 xset_foreground((i=Xgc->NumForeground+1,&i),PI0,PI0,PI0); 02092 xset_background((i=Xgc->NumForeground+2,&i),PI0,PI0,PI0); 02093 XFlush(dpy); 02094 FREE(c); FREE(r); FREE(g); FREE(b); 02095 }
Here is the call graph for this function:
Definition at line 2098 of file periX11.c.
References setcolormap3().
02099 { 02100 /* Use same code as Pseudo Color for the moment */ 02101 setcolormap3(Xgc,m,a,v3); 02102 }
Here is the call graph for this function:
Definition at line 2105 of file periX11.c.
References b, BCG::Blue, BCG::CBGWindow, ChangeBandF(), BCG::Cmap, BCG::CmapFlag, BCG::Colors, BCG::CurWindow, DEFAULTBLACK, DEFAULTWHITE, FREE, g, BCG::Green, i, MALLOC, NULL, BCG::Numcolors, BCG::Red, sciprint(), XgcAllocColors(), and XgcFreeColors().
Referenced by setcolormap2().
02106 { 02107 int missing_col_mess=-1; 02108 int i; 02109 Colormap cmap,dcmap,ocmap; 02110 XColor color; 02111 int bp1,wp1; 02112 Pixel *pixels = (Pixel *) NULL; 02113 02114 Pixel *c = Xgc->Colors; /* Save old color vectors comp�nents */ 02115 float *r = Xgc->Red; 02116 float *g = Xgc->Green; 02117 float *b = Xgc->Blue; 02118 02119 if (!XgcAllocColors(Xgc,m)) { 02120 Xgc->Colors = c; 02121 Xgc->Red = r; 02122 Xgc->Green = g; 02123 Xgc->Blue = b; 02124 *v3 = 1; 02125 return; 02126 } 02127 02128 if (!(pixels = (Pixel *) MALLOC((m+2)*sizeof(Pixel)))) { 02129 sciprint("setcolormap: unable to alloc\n"); 02130 XgcFreeColors(Xgc); 02131 Xgc->Colors = c; 02132 Xgc->Red = r; 02133 Xgc->Green = g; 02134 Xgc->Blue = b; 02135 *v3 = 1; 02136 return; 02137 } 02138 02139 /* Checking RGB values */ 02140 for (i = 0; i < m; i++) { 02141 if (a[i] < 0 || a[i] > 1 || a[i+m] < 0 || a[i+m] > 1 || 02142 a[i+2*m] < 0 || a[i+2*m]> 1) { 02143 sciprint("RGB values must be between 0 and 1\n"); 02144 Xgc->Colors = c; 02145 Xgc->Red = r; 02146 Xgc->Green = g; 02147 Xgc->Blue = b; 02148 *v3 = 1; 02149 return; 02150 } 02151 Xgc->Red[i] = (float)a[i]; 02152 Xgc->Green[i] = (float)a[i+m]; 02153 Xgc->Blue[i] = (float)a[i+2*m]; 02154 } 02155 /* Black */ 02156 Xgc->Red[m] = 0; 02157 Xgc->Green[m] = 0; 02158 Xgc->Blue[m] = 0; 02159 02160 /* White */ 02161 Xgc->Red[m+1] = 1; 02162 Xgc->Green[m+1] = 1; 02163 Xgc->Blue[m+1] = 1; 02164 02165 dcmap = XDefaultColormap(dpy,XDefaultScreen(dpy)); 02166 ocmap = Xgc->Cmap; 02167 02168 /* If old colormap is the default colormap, free already 02169 allocated colors */ 02170 if (Xgc->Numcolors!= 0 && ocmap == dcmap) { 02171 XFreeColors(dpy,dcmap,c,Xgc->Numcolors,0); 02172 } 02173 02174 color.flags = DoRed|DoGreen|DoBlue; 02175 02176 /* First try to alloc readonly colors from the default colormap 02177 We begin with white(wpixel) and black(bpixel) 02178 wpixel and bpixel are usually 0 and 1 or 1 and 0 */ 02179 if (wpixel == 1) wp1 = wpixel; 02180 else if (wpixel == 0) wp1 = wpixel; 02181 else if (bpixel == 0) wp1 = 1; 02182 else if (bpixel == 1) wp1 = 0; 02183 else wp1 =0; 02184 color.red = default_colors[3*DEFAULTWHITE]<<8; 02185 color.green = default_colors[3*DEFAULTWHITE+1]<<8; 02186 color.blue = default_colors[3*DEFAULTWHITE+2]<<8; 02187 XAllocColor(dpy,dcmap,&color); 02188 Xgc->Colors[m+1] = pixels[wp1] = color.pixel; 02189 02190 if (bpixel == 1) bp1 = bpixel; 02191 else if (bpixel == 0) bp1 = bpixel; 02192 else if (wpixel == 0) bp1 = 1; 02193 else if (wpixel == 1) bp1 = 0; 02194 else bp1 =1; 02195 color.red = default_colors[3*DEFAULTBLACK]<<8; 02196 color.green = default_colors[3*DEFAULTBLACK+1]<<8; 02197 color.blue = default_colors[3*DEFAULTBLACK+2]<<8; 02198 XAllocColor(dpy,dcmap,&color); 02199 Xgc->Colors[m] = pixels[bp1] = color.pixel; 02200 02201 for (i = 2; i < m+2; i++) { 02202 color.red = (unsigned short)(a[i-2]*65535.0); 02203 color.green = (unsigned short)(a[i-2+m]*65535.0); 02204 color.blue = (unsigned short)(a[i-2+2*m]*65535.0); 02205 if (!XAllocColor(dpy,dcmap,&color)) { 02206 /* No enough room in default colormap, free allocated pixels */ 02207 if (i != 0) XFreeColors(dpy,dcmap,pixels,i,0); 02208 break; 02209 } 02210 Xgc->Colors[i-2] = pixels[i] = color.pixel; 02211 } 02212 02213 cmap = dcmap; 02214 02215 if (i < (m+2) - 1) { 02216 /* Can't allocate all colors in default colormap; if old colormap was 02217 the default colormap, create a new one, otherwise use old one */ 02218 if (ocmap == 0 || ocmap == dcmap) { 02219 /* Create a new private colormap */ 02220 missing_col_mess=i; 02221 if ((cmap = XCreateColormap(dpy,Xgc->CBGWindow,visual,AllocNone)) == 0) { 02222 XgcFreeColors(Xgc); 02223 FREE(pixels); 02224 Xgc->Colors = c; 02225 Xgc->Red = r; 02226 Xgc->Green = g; 02227 Xgc->Blue = b; 02228 sciprint("%d colors missing, switch to private colormap\r\n",m+2 - i); 02229 sciprint("Cannot allocate new colormap\n"); 02230 return; 02231 } 02232 } else { 02233 /* Use old private colormap */ 02234 cmap = ocmap; 02235 /* Free already allocated colors */ 02236 if (Xgc->CmapFlag) 02237 XFreeColors(dpy,cmap,c,Xgc->Numcolors,0); 02238 else XFreeColors(dpy,cmap,c,Xgc->Numcolors+2,0); 02239 } 02240 /* Try to alloc readwrite colors from the private colormap */ 02241 for (i = 0; i < m+2; i++) { 02242 if (!XAllocColorCells(dpy,cmap,False,NULL,0,&pixels[i],1)) { 02243 /* sciprint is dangerous here we use wininfo : see the Warning bellow*/ 02244 XgcFreeColors(Xgc); 02245 FREE(pixels); 02246 Xgc->Colors = c; 02247 Xgc->Red = r; 02248 Xgc->Green = g; 02249 Xgc->Blue = b; 02250 sciprint("%d colors missing, unable to allocate colormap\r\n",m+2 - i); 02251 return; 02252 } 02253 } 02254 02255 color.flags = DoRed|DoGreen|DoBlue; 02256 /* First store white(wpixel) and black(bpixel) 02257 wpixel and bpixel are usually 0 and 1 or 1 and 0 */ 02258 if (wpixel == 1) wp1 = wpixel; 02259 else if (wpixel == 0) wp1 = wpixel; 02260 else if (bpixel == 0) wp1 = 1; 02261 else if (bpixel == 1) wp1 = 0; 02262 else wp1 =0; 02263 color.red = 65535; color.green = 65535; color.blue = 65535; 02264 color.pixel = Xgc->Colors[m+1] = pixels[wp1]; 02265 XStoreColor(dpy,cmap,&color); 02266 if (bpixel == 1) bp1 = bpixel; 02267 else if (bpixel == 0) bp1 = bpixel; 02268 else if (wpixel == 0) bp1 = 1; 02269 else if (wpixel == 1) bp1 = 0; 02270 else bp1 =1; 02271 color.red = 0; color.green = 0; color.blue = 0; 02272 color.pixel = Xgc->Colors[m] = pixels[bp1]; 02273 XStoreColor(dpy,cmap,&color); 02274 for (i = 0; i < m; i++) { 02275 color.red = (unsigned short)(a[i]*65535.0); 02276 color.green = (unsigned short)(a[i+m]*65535.0); 02277 color.blue = (unsigned short)(a[i+2*m]*65535.0); 02278 color.pixel = Xgc->Colors[i] = pixels[i+2]; 02279 XStoreColor(dpy,cmap,&color); 02280 } 02281 /* Change decoration of graphics windows */ 02282 ChangeBandF(Xgc->CurWindow,pixels[bp1],pixels[wp1]); 02283 } 02284 02285 if (ocmap != (Colormap)0 && ocmap != cmap && ocmap != dcmap) 02286 XFreeColormap(dpy,ocmap); 02287 XSetWindowColormap(dpy,Xgc->CBGWindow,cmap); 02288 Xgc->Cmap = cmap; 02289 Xgc->Numcolors = m; 02290 Xgc->IDLastPattern = m - 1; 02291 Xgc->CmapFlag = 0; 02292 Xgc->NumForeground = m; 02293 Xgc->NumBackground = m + 1; 02294 xset_usecolor((i=1,&i) ,PI0,PI0,PI0); 02295 xset_alufunction1(&Xgc->CurDrawFunction,PI0,PI0,PI0); 02296 xset_pattern((i=Xgc->NumForeground+1,&i),PI0,PI0,PI0); 02297 xset_foreground((i=Xgc->NumForeground+1,&i),PI0,PI0,PI0); 02298 xset_background((i=Xgc->NumForeground+2,&i),PI0,PI0,PI0); 02299 XFlush(dpy); 02300 FREE(c); FREE(r); FREE(g); FREE(b); 02301 FREE(pixels); 02302 if (missing_col_mess != -1) 02303 sciprint("%d colors missing, switch to private colormap\r\n",m+2 - missing_col_mess); 02304 }
Here is the call graph for this function:
Here is the caller graph for this function:
void C2F() setpopupname | ( | char * | x0, | |
integer * | v2, | |||
integer * | v3, | |||
integer * | v4, | |||
integer * | v5, | |||
integer * | v6, | |||
integer * | v7, | |||
double * | dv1, | |||
double * | dv2, | |||
double * | dv3, | |||
double * | dv4, | |||
integer | lx0 | |||
) |
Definition at line 429 of file periX11.c.
References Setpopupname().
00430 { 00431 Setpopupname(x0); 00432 }
Here is the call graph for this function:
void Setpopupname | ( | char * | string | ) |
Definition at line 416 of file periX11.c.
References args, iargs, BCG::popup, and ScilabXgc.
00417 { 00418 int iargs = 0; 00419 static Arg args[2] ; 00420 if (ScilabXgc->popup != (Widget)0 ){ 00421 XtSetArg(args[iargs],XtNtitle,string);iargs++; 00422 XtSetArg(args[iargs],XtNiconName,string);iargs++; 00423 XtSetValues(ScilabXgc->popup,args,iargs); 00424 } 00425 }
static void setRealDashStyle | ( | integer | lineThickness, | |
integer | dashStyle, | |||
integer | dashStyleSize | |||
) | [static] |
Definition at line 1144 of file periX11.c.
References Max, and xset_dashstyle().
Referenced by xset_dash(), and xset_thickness().
01145 { 01146 integer xDash[4] ; 01147 integer xDash0 ; 01148 double gapFactor ; 01149 double dLineThickness ; 01150 01151 /* increase the relative gap between each dash when the width is small */ 01152 /* otherwise, the points are too close, or too distant when the width is high */ 01153 /* I tried to find a compromise. Jb Silvy 03/2006 */ 01154 if ( lineThickness == 0 ) 01155 { 01156 dLineThickness = 0.8 ; 01157 gapFactor = 5.0 ; /* lineThickness = 0.8 */ 01158 } 01159 else 01160 { 01161 dLineThickness = lineThickness ; 01162 gapFactor = dLineThickness + ( 4.0 / ( sqrt(dLineThickness) ) ) ; 01163 } 01164 01165 /* printf("dashstyle = %d\n",dashStyle ) ; */ 01166 xDash0 = DashTab[dashStyle][0] ; 01167 01168 xDash[0] = Max( (integer) ( DashTab[dashStyle][0] * dLineThickness ), 1 ) ; 01169 xDash[1] = (integer) ( DashTab[dashStyle][1] * gapFactor ) ; 01170 xDash[2] = Max( (integer) ( DashTab[dashStyle][2] * dLineThickness ), 1 ) ; 01171 xDash[3] = (integer) ( DashTab[dashStyle][3] * gapFactor ) ; 01172 xset_dashstyle( &dashStyle, xDash, &dashStyleSize ) ; 01173 }
Here is the call graph for this function:
Here is the caller graph for this function:
Definition at line 4370 of file periX11.c.
References INT_2_16B, n1, and ReallocVector().
04371 { 04372 integer i,n1 = ( onemore == 1) ? n+1 : n; 04373 if ( ReallocVector(n1) ) 04374 { 04375 for ( i = 0; i < n; i++ ) 04376 { 04377 points[i].x = INT_2_16B( vx[i] ) ; 04378 /* points[i].x = (SCIINT16) vx[i]; */ 04379 04380 04381 points[i].y = INT_2_16B( vy[i] ) ; 04382 /* points[i].y = (SCIINT16) vy[i]; */ 04383 04384 } 04385 if ( onemore ) { 04386 points[n].x = points[0].x; 04387 points[n].y = points[0].y; 04388 } 04389 return(1); 04390 } 04391 else return(0); 04392 }
Here is the call graph for this function:
void SwitchWindow | ( | integer * | intnum | ) |
Definition at line 784 of file periX11.c.
References C2F, get_window_scale(), getWindowXgcNumber(), ierr, initgraphic(), NULL, PD0, PI0, ResetScilabXgc(), and ScilabXgc.
00785 { 00787 struct BCG *SXgc; 00788 integer ierr; 00789 SXgc = getWindowXgcNumber(*intnum); 00790 if ( SXgc != (struct BCG *) 0 ) 00791 { 00793 ScilabXgc = SXgc ; 00794 ResetScilabXgc (); 00795 get_window_scale(*intnum,NULL); 00796 } 00797 else 00798 { 00800 C2F(initgraphic)("",intnum,&ierr,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0); 00801 } 00802 }
Here is the call graph for this function:
typedef void | ( | xset_f | ) |
Definition at line 203 of file periX11.c.
References BCG::Blue, BCG::Colors, FREE, BCG::Green, MALLOC, BCG::Red, and sciprint().
00226 : storing font informations 00227 * the font i with size fsiz is stored at 00228 * FontsList_[i][fsiz]->fid 00229 */ 00230 00231 static XFontStruct *FontsList_[FONTNUMBER][FONTMAXSIZE]; 00232 00233 /* Allocating colors in BCG struct */ 00234 00235 int XgcAllocColors(struct BCG *xgc, int m) 00236 { 00237 int mm; 00238 /* don't forget black and white */ 00239 mm = m + 2; 00240 if (!(xgc->Red = (float *) MALLOC(mm*sizeof(float)))) { 00241 sciprint("XgcAllocColors: unable to alloc\n"); 00242 return 0; 00243 } 00244 if (!(xgc->Green = (float *) MALLOC(mm*sizeof(float)))) { 00245 sciprint("XgcAllocColors: unable to alloc\n"); 00246 FREE(xgc->Red); 00247 return 0; 00248 } 00249 if (!(xgc->Blue = (float *) MALLOC(mm*sizeof(float)))) { 00250 sciprint("XgcAllocColors: unable to alloc\n"); 00251 FREE(xgc->Red); 00252 FREE(xgc->Green); 00253 return 0; 00254 } 00255 if (!(xgc->Colors = (Pixel *) MALLOC(mm*sizeof(Pixel)))) { 00256 sciprint("XgcAllocColors: unable to alloc\n"); 00257 FREE(xgc->Red); 00258 FREE(xgc->Green); 00259 FREE(xgc->Blue); 00260 return 0; 00261 } 00262 return 1; 00263 }
Here is the call graph for this function:
Window Window_With_Name | ( | Window | top, | |
char * | name, | |||
int | j, | |||
char * | ResList0, | |||
char * | ResList1, | |||
char * | ResList2 | |||
) |
Definition at line 3675 of file periX11.c.
References CheckWin(), DbugInfo0, DbugInfo1, DbugInfo3, and i.
Referenced by Find_BG_Window(), Find_ScilabGraphic_Window(), and Find_X_Scilab().
03676 { 03677 Status status; 03678 Window *children,root1,parent1,w=0; 03679 unsigned int nchildren=0; 03680 integer i; 03681 char *window_name; 03682 if ( CheckWin(top)==0) return((Window) 0); 03683 status=XQueryTree(dpy, top, &root1, &parent1, &children, &nchildren); 03684 DbugInfo1(" Status %d\n",status); 03685 if ( status == 0) 03686 { 03687 DbugInfo0("XQuery Tree failed \n"); 03688 return((Window) 0); 03689 } 03690 if ( nchildren == 0 ) return((Window) 0); 03691 DbugInfo1("Number of children %d \n",nchildren); 03692 for (i= (int) nchildren-1; i >= 0 ; i--) 03693 { 03694 if ( CheckWin(children[i])!=0) 03695 { 03696 XFetchName(dpy, children[i], &window_name); 03697 DbugInfo3("Child [%d] %s %d\n",children[i],window_name,j); 03698 if ( window_name != 0 && strcmp(window_name, name)==0 ) 03699 { 03700 w=children[i]; 03701 DbugInfo1("Found %s \n",window_name); 03702 DbugInfo1("Level %d\n",j); 03703 XFree((char *) children); 03704 if (window_name) XFree(window_name); 03705 break; 03706 } 03707 else 03708 { 03709 w=Window_With_Name(children[i],name,j+1, 03710 ResList0,ResList1,ResList2); 03711 if ( w != 0 ) 03712 { 03713 XFree((char *) children); 03714 DbugInfo1("father was %s\n",window_name); 03715 if (window_name) XFree(window_name); 03716 break; 03717 } 03718 } 03719 if (window_name) XFree(window_name); 03720 } 03721 } 03722 return((Window) w); 03723 }
Here is the call graph for this function:
Here is the caller graph for this function:
void wininfo | ( | va_alist | ) |
Definition at line 3623 of file periX11.c.
References args, buf, BCG::CinfoW, MAXPRINTF, NULL, ScilabXgc, and XtNlabel.
03625 { 03626 /* Extended call for C calling */ 03627 Arg args[1]; 03628 va_list ap; 03629 char buf[MAXPRINTF]; 03630 #ifdef __STDC__ 03631 va_start(ap,format); 03632 #else 03633 char *format; 03634 va_start(ap); 03635 format = va_arg(ap, char *); 03636 #endif 03637 (void ) vsprintf(buf, format, ap ); 03638 va_end(ap); 03639 if ( ScilabXgc != (struct BCG *) 0 && ScilabXgc->CinfoW != (Widget) NULL) 03640 { 03641 Cardinal n = 0; 03642 XtSetArg(args[n], XtNlabel,buf);n++; 03643 XtSetValues(ScilabXgc->CinfoW, args, n); 03644 } 03645 }
int WithBackingStore | ( | void | ) |
Definition at line 294 of file periX11.c.
References BCG::Cdrawable, and ScilabXgc.
Referenced by scig_expose(), scig_replay(), and scig_resize().
Here is the caller graph for this function:
static int X_error_handler | ( | Display * | d, | |
XErrorEvent * | err_ev | |||
) | [static] |
Definition at line 3448 of file periX11.c.
References MAXERRMSGLEN.
Referenced by initgraphic().
03449 { 03450 char err_msg[MAXERRMSGLEN]; 03451 03452 XGetErrorText(dpy, (int) (err_ev->error_code), err_msg, MAXERRMSGLEN - 1); 03453 #ifndef NDEBUG 03454 printf("Scilab : X error trapped - error message follows:\r\n%s\r\n", err_msg); 03455 #endif 03456 return(0); 03457 }
Here is the caller graph for this function:
void C2F() xclick | ( | char * | str, | |
integer * | ibutton, | |||
integer * | x1, | |||
integer * | yy1, | |||
integer * | iflag, | |||
integer * | istr, | |||
integer * | v7, | |||
double * | dv1, | |||
double * | dv2, | |||
double * | dv3, | |||
double * | dv4 | |||
) |
Definition at line 638 of file periX11.c.
References lstr, and SciClick().
00639 { 00640 integer lstr ; 00641 SciClick(ibutton,x1, yy1,iflag,0,0,*istr,str,&lstr); 00642 if ( *istr == 1) 00643 { 00644 if (*ibutton == -2) 00645 { 00646 /* sciprint("Menu activated %s %d",str,lstr);*/ 00647 *istr = lstr; 00648 } 00649 else 00650 *istr = 0; 00651 } 00652 }
Here is the call graph for this function:
void C2F() xclick_any | ( | char * | str, | |
integer * | ibutton, | |||
integer * | x1, | |||
integer * | yy1, | |||
integer * | iwin, | |||
integer * | iflag, | |||
integer * | istr, | |||
double * | dv1, | |||
double * | dv2, | |||
double * | dv3, | |||
double * | dv4 | |||
) |
returns the graphic window number which owns the event
if we already have something on the queue
first check if an event has been store in the queue while wait_for_click was 0
Check menu activation
Cleanup
Definition at line 559 of file periX11.c.
References C2F, CheckClickQueue(), ClearClickQueue(), getmen(), GetWindowNumber(), getWinsMaxId(), i, ismenu(), lstr, NULL, ok, set_client_message_off(), set_client_message_on(), set_event_select(), and set_wait_click().
00560 { 00561 Window CW; 00562 int buttons = 0; 00563 integer i,win,ok; 00564 integer wincount; 00565 integer lstr ; 00566 int motion,release; 00567 struct timeval delay; /* usec, to slow down event loop */ 00568 00569 wincount = getWinsMaxId()+1; 00570 if (wincount == 0) 00571 { 00572 *x1=0; 00573 *yy1=0; 00574 *iwin=0; 00575 *ibutton = -100; 00576 *istr = 0; 00577 return; 00578 } 00579 for (i=0; i < wincount ; i++ ) 00580 { 00581 if (( CW=GetWindowNumber(i)) != (Window ) NULL) 00582 XDefineCursor(dpy, CW ,crosscursor); 00583 } 00585 if ( *iflag ==0 ) ClearClickQueue(-1); 00586 00587 /* ignore the first event if it is a ClientMessage */ 00588 set_client_message_on(); 00589 set_wait_click(1); /*disable event handler if any */ 00590 set_event_select(1+4);/*only record press and release events */ 00591 while (buttons == 0) { 00593 win=-1; 00594 ok=0; 00595 while (CheckClickQueue(&win,x1,yy1,ibutton,&motion,&release) == 1) { 00596 if ((motion==0) && (release==0)) { 00597 *iwin = win ; 00598 ok=1; 00599 break; 00600 } 00601 00602 win=-1; 00603 } 00604 if(ok) {*istr = 0;break;}; 00605 /* get next event */ 00606 00607 C2F(sxevents)(); 00608 00610 if ( *istr==1 && C2F(ismenu)()==1 ) { 00611 int entry; 00612 C2F(getmen)(str,&lstr,&entry); 00613 *ibutton = -2; 00614 *istr=lstr; 00615 *x1=0; 00616 *yy1=0; 00617 *iwin=-1; 00618 break; 00619 } 00620 /* to slow down event loop not to use all cpu when nothing happen*/ 00621 delay.tv_sec = 0; delay.tv_usec = 10; 00622 select(0, 0, 0, 0, &delay); 00623 } 00624 set_wait_click(0); 00625 set_client_message_off(); 00626 00628 wincount = getWinsMaxId()+1; 00629 for (i=0;i < wincount;i++) { 00630 CW=GetWindowNumber(i); 00631 if (CW!=(Window ) NULL) 00632 XDefineCursor(dpy, CW ,arrowcursor); 00633 } 00634 XSync (dpy, 0); 00635 }
Here is the call graph for this function:
void XDroutine | ( | int | npts | ) |
Definition at line 4428 of file periX11.c.
References BCG::Cdrawable, BCG::CurPixmapStatus, BCG::CurVectorStyle, BCG::CWindow, get_xpoints(), and ScilabXgc.
Referenced by drawpolyline().
04429 { 04430 if (ScilabXgc->Cdrawable != (Drawable) 0) 04431 XDrawLines (dpy, ScilabXgc->Cdrawable, gc, get_xpoints(),(int) npts, 04432 ScilabXgc->CurVectorStyle); 04433 if (ScilabXgc->CurPixmapStatus != 1) 04434 XDrawLines (dpy, (Drawable) ScilabXgc->CWindow, gc, get_xpoints(),(int) npts, 04435 ScilabXgc->CurVectorStyle); 04436 }
Here is the call graph for this function:
Here is the caller graph for this function:
void C2F() xendgraphic | ( | void | ) |
void XgcFreeColors | ( | struct BCG * | xgc | ) |
Definition at line 265 of file periX11.c.
References BCG::Blue, BCG::Colors, FREE, BCG::Green, and BCG::Red.
00266 { 00267 FREE(xgc->Red); xgc->Red = (float *) 0; 00268 FREE(xgc->Green);xgc->Green = (float *) 0; 00269 FREE(xgc->Blue); xgc->Blue = (float *) 0; 00270 FREE(xgc->Colors); xgc->Colors = (Pixel *) 0; 00271 }
static void xget_absourel | ( | integer * | verbose, | |
integer * | num, | |||
integer * | narg, | |||
double * | dummy | |||
) | [static] |
to get information on absolute or relative mode
Definition at line 971 of file periX11.c.
References CoordModeOrigin, BCG::CurVectorStyle, ScilabXgc, and sciprint().
00972 { 00973 *narg = 1; 00974 *num = ScilabXgc->CurVectorStyle ; 00975 if (*verbose == 1) 00976 { 00977 if (ScilabXgc->CurVectorStyle == CoordModeOrigin) 00978 sciprint("\nTrace Absolu"); 00979 else 00980 sciprint("\nTrace Relatif"); 00981 } 00982 }
Here is the call graph for this function:
static void xget_alufunction | ( | integer * | verbose, | |
integer * | value, | |||
integer * | narg, | |||
double * | dummy | |||
) | [static] |
Definition at line 1112 of file periX11.c.
References AluStruc_, BCG::CurDrawFunction, info, ScilabXgc, and sciprint().
01113 { 01114 *narg =1 ; 01115 *value = ScilabXgc->CurDrawFunction ; 01116 if (*verbose ==1 ) 01117 { 01118 sciprint("\nThe Alufunction is %s -> <%s>\r\n", 01119 AluStruc_[*value].name, 01120 AluStruc_[*value].info); 01121 } 01122 }
Here is the call graph for this function:
static void xget_background | ( | integer * | verbose, | |
integer * | num, | |||
integer * | narg, | |||
double * | dummy | |||
) | [static] |
Definition at line 2373 of file periX11.c.
References BCG::CurColorStatus, BCG::NumBackground, ScilabXgc, and sciprint().
02374 { 02375 *narg=1; 02376 if ( ScilabXgc->CurColorStatus == 1 ) 02377 { 02378 *num = ScilabXgc->NumBackground + 1; 02379 } 02380 else 02381 { 02382 *num = 1; 02383 } 02384 if (*verbose == 1) 02385 sciprint("\n Background : %d\r\n",*num); 02386 }
Here is the call graph for this function:
Get the boundaries of the current clip zone
Definition at line 925 of file periX11.c.
References BCG::ClipRegionSet, BCG::CurClipRegion, ScilabXgc, and sciprint().
00926 { 00927 x[0] = ScilabXgc->ClipRegionSet; 00928 if ( x[0] == 1) 00929 { 00930 *narg = 5; 00931 x[1] =ScilabXgc->CurClipRegion[0]; 00932 x[2] =ScilabXgc->CurClipRegion[1]; 00933 x[3] =ScilabXgc->CurClipRegion[2]; 00934 x[4] =ScilabXgc->CurClipRegion[3]; 00935 } 00936 else *narg = 1; 00937 if (*verbose == 1) 00938 { 00939 if (ScilabXgc->ClipRegionSet == 1) 00940 sciprint("\nThere's a Clip Region :x:%d,y:%d,w:%d,h:%d\r\n", 00941 ScilabXgc->CurClipRegion[0], 00942 ScilabXgc->CurClipRegion[1], 00943 ScilabXgc->CurClipRegion[2], 00944 ScilabXgc->CurClipRegion[3]); 00945 else 00946 sciprint("\nNo Clip Region"); 00947 } 00948 }
Here is the call graph for this function:
static void xget_colormap | ( | integer * | verbose, | |
integer * | num, | |||
integer * | narg, | |||
double * | val | |||
) | [static] |
Definition at line 2322 of file periX11.c.
References BCG::Blue, BCG::Green, i, BCG::Numcolors, BCG::Red, ScilabXgc, and sciprint().
02323 { 02324 int m = ScilabXgc->Numcolors; 02325 int i; 02326 *narg = 1; 02327 *num = m; 02328 for (i = 0; i < m; i++) { 02329 val[i] = (double)ScilabXgc->Red[i]; 02330 val[i+m] = (double)ScilabXgc->Green[i]; 02331 val[i+2*m] = (double)ScilabXgc->Blue[i]; 02332 } 02333 if (*verbose == 1) { 02334 sciprint("Size of colormap: %d colors\r\n",m); 02335 } 02336 }
Here is the call graph for this function:
static void xget_colormap_size | ( | integer * | verbose, | |
integer * | num, | |||
integer * | narg, | |||
double * | val | |||
) | [static] |
Definition at line 2308 of file periX11.c.
References NULL, BCG::Numcolors, ScilabXgc, and sciprint().
02309 { 02310 if(ScilabXgc != NULL) 02311 *num = ScilabXgc->Numcolors; 02312 else 02313 { 02314 sciprint("No ScilabXgc allocated\n"); 02315 *num = 0; 02316 return; 02317 } 02318 }
Here is the call graph for this function:
static void xget_curwin | ( | integer * | verbose, | |
integer * | intnum, | |||
integer * | narg, | |||
double * | dummy | |||
) | [static] |
Definition at line 887 of file periX11.c.
References BCG::CurWindow, ScilabXgc, and sciprint().
00888 { 00889 *narg =1 ; 00890 *intnum = (ScilabXgc != (struct BCG *) 0) ? ScilabXgc->CurWindow : 0; 00891 if (*verbose == 1) 00892 sciprint("\nCurrent Graphic Window :%d\r\n",(int) *intnum); 00893 00894 }
Here is the call graph for this function:
static void xget_dash | ( | integer * | verbose, | |
integer * | value, | |||
integer * | narg, | |||
double * | dummy | |||
) | [static] |
Definition at line 1392 of file periX11.c.
References BCG::CurDashStyle, i, ScilabXgc, and sciprint().
Referenced by xget_dash_and_color(), and xget_dash_or_color().
01393 { 01394 int i ; 01395 *narg =1 ; 01396 *value = ScilabXgc->CurDashStyle + 1; 01397 if (*value == 1) 01398 { if (*verbose == 1) sciprint("\nLine style = Line Solid");} 01399 else 01400 { 01401 value[1]=4; 01402 *narg = value[1]+2; 01403 for (i = 0 ; i < value[1]; i++) value[i+2]=DashTab[*value-2][i]; 01404 if (*verbose ==1) 01405 { 01406 sciprint("\nDash Style %d:<",(int)*value - 1); 01407 for (i = 0 ; i < value[1]; i++) 01408 sciprint("%d ",(int)value[i+2]); 01409 sciprint(">\n"); 01410 } 01411 } 01412 }
Here is the call graph for this function:
Here is the caller graph for this function:
static void xget_dash_and_color | ( | integer * | verbose, | |
integer * | value, | |||
integer * | narg, | |||
double * | dummy | |||
) | [static] |
Definition at line 1414 of file periX11.c.
References xget_dash(), and xget_pattern().
Referenced by drawarcs(), drawarrows(), drawpolylines(), drawrectangles(), drawsegments(), and fillpolylines().
01415 { 01416 /*may be improved replacing 6 by narg */ 01417 xget_dash(verbose, value, narg,dummy); 01418 xget_pattern(verbose, value+6, narg,dummy); 01419 *narg = 6; 01420 }
Here is the call graph for this function:
Here is the caller graph for this function:
static void xget_dash_or_color | ( | integer * | verbose, | |
integer * | value, | |||
integer * | narg, | |||
double * | dummy | |||
) | [static] |
to get the current dash-style
Definition at line 1380 of file periX11.c.
References BCG::CurColor, BCG::CurColorStatus, ScilabXgc, sciprint(), and xget_dash().
01381 { 01382 if ( ScilabXgc->CurColorStatus ==1) 01383 { 01384 *narg =1 ; 01385 *value = ScilabXgc->CurColor + 1; 01386 if (*verbose == 1) sciprint("Color %d",(int)*value); 01387 return; 01388 } 01389 xget_dash(verbose, value, narg,dummy); 01390 }
Here is the call graph for this function:
Definition at line 2520 of file periX11.c.
References sciprint().
02521 { 02522 if ( *verbose ==1 ) sciprint("\n No operation "); 02523 }
Here is the call graph for this function:
static void xget_font | ( | integer * | verbose, | |
integer * | font, | |||
integer * | nargs, | |||
double * | dummy | |||
) | [static] |
To get the id and size of the current font
Definition at line 4125 of file periX11.c.
References FontInfo::fname, BCG::FontId, FontInfoTab_, BCG::FontSize, ScilabXgc, sciprint(), and SCIPROMPT.
04126 { 04127 *nargs=2; 04128 font[0]= ScilabXgc->FontId ; 04129 font[1] =ScilabXgc->FontSize ; 04130 if (*verbose == 1) 04131 { 04132 sciprint("\nFontId : %d ", ScilabXgc->FontId ); 04133 sciprint("%s %s at size %s pts\r\n",SCIPROMPT, 04134 FontInfoTab_[ScilabXgc->FontId].fname, 04135 size_[ScilabXgc->FontSize]); 04136 } 04137 }
Here is the call graph for this function:
static void xget_foreground | ( | integer * | verbose, | |
integer * | num, | |||
integer * | narg, | |||
double * | dummy | |||
) | [static] |
Definition at line 2404 of file periX11.c.
References BCG::CurColorStatus, BCG::NumForeground, ScilabXgc, and sciprint().
02405 { 02406 *narg=1; 02407 if ( ScilabXgc->CurColorStatus == 1 ) 02408 { 02409 *num = ScilabXgc->NumForeground + 1; 02410 } 02411 else 02412 { 02413 *num = 1; 02414 } 02415 if (*verbose == 1) 02416 sciprint("\n Foreground : %d\r\n",*num); 02417 }
Here is the call graph for this function:
static void xget_hidden3d | ( | integer * | verbose, | |
integer * | num, | |||
integer * | narg, | |||
double * | dummy | |||
) | [static] |
Definition at line 2431 of file periX11.c.
References BCG::CurColorStatus, BCG::NumHidden3d, ScilabXgc, and sciprint().
02432 { 02433 *narg=1; 02434 if ( ScilabXgc->CurColorStatus == 1 ) 02435 { 02436 *num = ScilabXgc->NumHidden3d + 1; 02437 } 02438 else 02439 { 02440 *num = 1; 02441 } 02442 if (*verbose == 1) 02443 sciprint("\n Hidden3d : %d\r\n",*num); 02444 }
Here is the call graph for this function:
To get the id of the last pattern
Definition at line 1273 of file periX11.c.
References BCG::CurColorStatus, BCG::IDLastPattern, ScilabXgc, and sciprint().
Referenced by fill_grid_rectangles().
01274 { 01275 if ( ScilabXgc->CurColorStatus == 1 ) 01276 { 01277 *num = ScilabXgc->IDLastPattern + 1; 01278 if (*verbose == 1) 01279 sciprint("\n Id of Last Color %d\r\n",(int)*num); 01280 } 01281 01282 else 01283 { 01284 *num = ScilabXgc->IDLastPattern + 1; 01285 if (*verbose == 1) 01286 sciprint("\n Id of Last Pattern %d\r\n",(int)*num); 01287 } 01288 *narg=1; 01289 }
Here is the call graph for this function:
Here is the caller graph for this function:
static void xget_mark | ( | integer * | verbose, | |
integer * | symb, | |||
integer * | narg, | |||
double * | dummy | |||
) | [static] |
To get the current mark id
Definition at line 4149 of file periX11.c.
References BCG::CurHardSymb, BCG::CurHardSymbSize, ScilabXgc, and sciprint().
Referenced by drawpolylines().
04150 { 04151 *narg =2 ; 04152 symb[0] = ScilabXgc->CurHardSymb ; 04153 symb[1] = ScilabXgc->CurHardSymbSize ; 04154 if (*verbose == 1) 04155 { 04156 sciprint("\nMark : %d ",ScilabXgc->CurHardSymb); 04157 sciprint("at size %s pts\r\n", size_[ScilabXgc->CurHardSymbSize]); 04158 } 04159 }
Here is the call graph for this function:
Here is the caller graph for this function:
static void xget_pattern | ( | integer * | verbose, | |
integer * | num, | |||
integer * | narg, | |||
double * | dummy | |||
) | [static] |
To get the id of the current pattern
Definition at line 1260 of file periX11.c.
References BCG::CurColor, BCG::CurColorStatus, BCG::CurPattern, ScilabXgc, and sciprint().
Referenced by drawrectangles(), fill_grid_rectangles(), fill_grid_rectangles1(), fillarcs(), fillpolylines(), and xget_dash_and_color().
01261 { 01262 *narg=1; 01263 if ( ScilabXgc->CurColorStatus == 1 ) 01264 *num = ScilabXgc->CurColor + 1; 01265 else 01266 *num = ScilabXgc->CurPattern + 1; 01267 if (*verbose == 1) 01268 sciprint("\n Pattern : %d\r\n",ScilabXgc->CurPattern + 1); 01269 }
Here is the call graph for this function:
Here is the caller graph for this function:
static void xget_pixmapOn | ( | integer * | verbose, | |
integer * | value, | |||
integer * | narg, | |||
double * | dummy | |||
) | [static] |
Definition at line 1531 of file periX11.c.
References BCG::CurPixmapStatus, ScilabXgc, and sciprint().
01532 { 01533 *value=ScilabXgc->CurPixmapStatus; 01534 *narg =1 ; 01535 if (*verbose == 1) sciprint("Pixmap status %d",(int)*value); 01536 }
Here is the call graph for this function:
static void xget_popupdim | ( | integer * | verbose, | |
integer * | x, | |||
integer * | narg, | |||
double * | dummy | |||
) | [static] |
To get the popup window size
Definition at line 739 of file periX11.c.
References args, iargs, BCG::popup, ScilabXgc, and sciprint().
00740 { 00741 Dimension clwidth,clheight; 00742 static Arg args[2] ; 00743 int iargs = 0; 00744 XtSetArg (args[iargs], XtNwidth, &clwidth ); iargs++; 00745 XtSetArg (args[iargs], XtNheight, &clheight); iargs++; 00746 XtGetValues (ScilabXgc->popup, args, iargs); 00747 x[0]= clwidth; 00748 x[1]= clheight; 00749 *narg = 2; 00750 if (*verbose == 1) 00751 sciprint("\n ScilabXgc->CWindow dim :%d,%d\r\n",(int) x[0],(int) x[1]); 00752 }
Here is the call graph for this function:
static void xget_thickness | ( | integer * | verbose, | |
integer * | value, | |||
integer * | narg, | |||
double * | dummy | |||
) | [static] |
to get the thickness value
Definition at line 1199 of file periX11.c.
References BCG::CurLineWidth, ScilabXgc, and sciprint().
01200 { 01201 *narg =1 ; 01202 *value = ScilabXgc->CurLineWidth ; 01203 if (*verbose ==1 ) 01204 sciprint("\nLine Width:%d\r\n", ScilabXgc->CurLineWidth ) ; 01205 }
Here is the call graph for this function:
static void xget_usecolor | ( | integer * | verbose, | |
integer * | num, | |||
integer * | narg, | |||
double * | dummy | |||
) | [static] |
Definition at line 1465 of file periX11.c.
References BCG::CurColorStatus, ScilabXgc, and sciprint().
01466 { 01467 *num = ScilabXgc->CurColorStatus; 01468 if (*verbose == 1) 01469 sciprint("\n Use color %d\r\n",(int)*num); 01470 *narg=1; 01471 }
Here is the call graph for this function:
static void xget_viewport | ( | integer * | verbose, | |
integer * | x, | |||
integer * | narg, | |||
double * | dummy | |||
) | [static] |
To get the viewport Upper/Left point Position
Definition at line 764 of file periX11.c.
References BCG::mafigure, sciGetViewport(), and ScilabXgc.
00765 { 00766 *narg = 2; 00767 sciGetViewport( ScilabXgc->mafigure, &x[0], &x[1] ) ; 00768 }
Here is the call graph for this function:
static void xget_windowdim | ( | integer * | verbose, | |
integer * | x, | |||
integer * | narg, | |||
double * | dummy | |||
) | [static] |
To get the drawbox window size
Definition at line 714 of file periX11.c.
References BCG::CWindowHeight, BCG::CWindowWidth, ScilabXgc, and sciprint().
Referenced by fill_grid_rectangles(), fill_grid_rectangles1(), getwindowdim(), and xset_clip().
00715 { 00716 *narg = 2; 00717 x[0]= ScilabXgc->CWindowWidth; 00718 x[1]= ScilabXgc->CWindowHeight; 00719 if (*verbose == 1) 00720 sciprint("\n ScilabXgc->CWindow dim :%d,%d\r\n",(int) x[0],(int) x[1]); 00721 }
Here is the call graph for this function:
Here is the caller graph for this function:
static void xget_windowpos | ( | integer * | verbose, | |
integer * | x, | |||
integer * | narg, | |||
double * | dummy | |||
) | [static] |
to get the window upper-left point coordinates on the screen
Definition at line 680 of file periX11.c.
References BCG::CBGWindow, ScilabXgc, and sciprint().
00681 { 00682 int xx[2]; 00683 XWindowAttributes war; 00684 Window CHR; 00685 *narg = 2; 00686 XGetWindowAttributes(dpy,ScilabXgc->CBGWindow,&war); 00687 XTranslateCoordinates(dpy,ScilabXgc->CBGWindow,root,war.x,war.y,&(xx[0]),&(xx[1]),&CHR); 00688 x[0]=xx[0];x[1]=xx[1]; 00689 if (*verbose == 1) 00690 sciprint("\n ScilabXgc->CWindow position :%d,%d\r\n",xx[0],xx[1]); 00691 }
Here is the call graph for this function:
static void xget_wresize | ( | integer * | verbose, | |
integer * | value, | |||
integer * | narg, | |||
double * | dummy | |||
) | [static] |
Definition at line 1563 of file periX11.c.
References BCG::CurResizeStatus, ScilabXgc, and sciprint().
01564 { 01565 *value=ScilabXgc->CurResizeStatus; 01566 *narg =1 ; 01567 if (*verbose == 1) sciprint("Resize status %d",(int)*value); 01568 }
Here is the call graph for this function:
void C2F() xinfo | ( | char * | message, | |
integer * | v2, | |||
integer * | v3, | |||
integer * | v4, | |||
integer * | v5, | |||
integer * | v6, | |||
integer * | v7, | |||
double * | dv1, | |||
double * | dv2, | |||
double * | dv3, | |||
double * | dv4 | |||
) |
Definition at line 3597 of file periX11.c.
References args, BCG::CinfoW, NULL, ScilabXgc, and XtNlabel.
03598 { 03599 Arg args[1]; 03600 if ( ScilabXgc != (struct BCG *) 0 && ScilabXgc->CinfoW != (Widget) NULL) 03601 { 03602 Cardinal n = 0; 03603 XtSetArg(args[n], XtNlabel, message);n++; 03604 XtSetValues(ScilabXgc->CinfoW, args, n); 03605 } 03606 }
int XRotDrawString | ( | Display * | dpy, | |
XFontStruct * | font, | |||
float | angle, | |||
Drawable | drawable, | |||
GC | gc_, | |||
int | x, | |||
int | y, | |||
char * | str | |||
) |
Definition at line 312 of file w_rottext.c.
References NONE, and XRotPaintAlignedString().
00313 { 00314 return (XRotPaintAlignedString(dpy, font, angle, drawable, gc_, 00315 x, y, str, NONE, 0)); 00316 }
Here is the call graph for this function:
void C2F() xselgraphic | ( | char * | v1, | |
integer * | v2, | |||
integer * | v3, | |||
integer * | v4, | |||
integer * | v5, | |||
integer * | v6, | |||
integer * | v7, | |||
double * | dv1, | |||
double * | dv2, | |||
double * | dv3, | |||
double * | dv4 | |||
) |
If there's no graphic window then select creates one
Test not really usefull: see sciwin in matdes.f
Definition at line 380 of file periX11.c.
References C2F, BCG::CBGWindow, ierr, initgraphic(), NULL, PD0, PI0, and ScilabXgc.
00381 { 00383 integer ierr; 00384 if (ScilabXgc == (struct BCG *)0 || ScilabXgc->CBGWindow == (Window ) NULL) 00385 C2F(initgraphic)("",PI0,&ierr,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0); 00386 XMapWindow(dpy,ScilabXgc->CBGWindow); 00387 XRaiseWindow(dpy,ScilabXgc->CBGWindow); 00388 XFlush(dpy); 00389 }
Here is the call graph for this function:
to set absolute or relative mode
Definition at line 961 of file periX11.c.
References CoordModeOrigin, CoordModePrevious, BCG::CurVectorStyle, and ScilabXgc.
Referenced by InitMissileXgc(), and ResetScilabXgc().
00962 { 00963 if (*num == CoordModeOrigin) 00964 ScilabXgc->CurVectorStyle = CoordModeOrigin; 00965 else 00966 ScilabXgc->CurVectorStyle = CoordModePrevious ; 00967 }
Here is the caller graph for this function:
void xset_alufunction | ( | char * | string | ) |
Definition at line 1049 of file periX11.c.
References BCG::CurDrawFunction, idfromname(), and ScilabXgc.
01050 { 01051 integer value; 01052 XGCValues gcvalues; 01053 idfromname(string,&value); 01054 if ( value != -1) 01055 { 01056 ScilabXgc->CurDrawFunction = value; 01057 gcvalues.function = value; 01058 XChangeGC(dpy, gc, GCFunction, &gcvalues); 01059 } 01060 }
Here is the call graph for this function:
Definition at line 1063 of file periX11.c.
References ScilabXgc, and xset_alufunction2().
Referenced by InitMissileXgc(), ResetScilabXgc(), setcolormap1(), xset_background(), and xset_foreground().
01064 { 01065 xset_alufunction2(ScilabXgc,num,v2,v3,v4); 01066 }
Here is the call graph for this function:
Here is the caller graph for this function:
static void xset_alufunction2 | ( | struct BCG * | Xgc, | |
integer * | num, | |||
integer * | v2, | |||
integer * | v3, | |||
integer * | v4 | |||
) | [static] |
Definition at line 1069 of file periX11.c.
References AluStruc_, BCG::Colors, BCG::CurColor, BCG::CurColorStatus, BCG::CurDrawFunction, GXclear, GXcopy, GXxor, alinfo::id, Max, Min, NULL, BCG::NumBackground, BCG::NumForeground, and set_c().
Referenced by PixmapClear(), and xset_alufunction1().
01070 { 01071 integer value; 01072 XGCValues gcvalues; 01073 static Pixel pxb,pxf; 01074 pxb = (Xgc->Colors == NULL)? DefaultBackground 01075 : Xgc->Colors[Xgc->NumBackground]; 01076 pxf = (Xgc->Colors == NULL)? DefaultForeground 01077 : Xgc->Colors[Xgc->NumForeground]; 01078 value=AluStruc_[Min(15,Max(0,*num))].id; 01079 if ( value != -1) 01080 { 01081 Xgc->CurDrawFunction = value; 01082 /* XChangeGC(dpy, gc, GCFunction, &gcvalues); */ 01084 switch (value) 01085 { 01086 case GXclear : 01087 gcvalues.foreground = pxb; 01088 gcvalues.background = pxb; 01089 gcvalues.function = GXcopy; 01090 break; 01091 case GXxor : 01092 gcvalues.foreground = pxf ^ pxb ; 01093 gcvalues.background = pxb ; 01094 gcvalues.function = GXxor; 01095 break; 01096 default : 01097 gcvalues.foreground = pxf ; 01098 gcvalues.background = pxb; 01099 gcvalues.function = value; 01100 break; 01101 } 01102 XChangeGC(dpy,gc,(GCFunction|GCForeground|GCBackground), &gcvalues); 01103 if ( value == GXxor && Xgc->CurColorStatus == 1 ) 01104 { 01107 set_c(Xgc->CurColor); 01108 } 01109 } 01110 }
Here is the call graph for this function:
Here is the caller graph for this function:
set and get the number of the background or foreground
Definition at line 2353 of file periX11.c.
References BCG::Colors, BCG::CurColorStatus, BCG::CurDrawFunction, BCG::CWindow, Max, Min, NULL, BCG::NumBackground, BCG::Numcolors, PI0, ScilabXgc, and xset_alufunction1().
Referenced by InitMissileXgc(), ResetScilabXgc(), and setcolormap1().
02354 { 02355 if (ScilabXgc->CurColorStatus == 1) 02356 { 02357 /* 02358 * if we change the background of the window we must change 02359 * the gc ( with alufunction ) and the window background 02360 */ 02361 Pixel px; 02362 ScilabXgc->NumBackground = Max(0,Min(*num - 1,ScilabXgc->Numcolors + 1)); 02363 xset_alufunction1(&ScilabXgc->CurDrawFunction,PI0,PI0,PI0); 02364 px = (ScilabXgc->Colors == NULL) ? DefaultBackground 02365 : ScilabXgc->Colors[ScilabXgc->NumBackground]; 02366 02367 XSetWindowBackground(dpy, ScilabXgc->CWindow,px); 02368 /*if(ScilabXgc->Cdrawable != (Drawable) 0 ) 02369 XSetWindowBackground(dpy, ScilabXgc->Cdrawable,px);*/ 02370 } 02371 }
Here is the call graph for this function:
Here is the caller graph for this function:
Set a clip zone (rectangle )
Definition at line 898 of file periX11.c.
References BCG::ClipRegionSet, BCG::CurClipRegion, ScilabXgc, and xget_windowdim().
00899 { 00900 integer verbose=0,wd[2],narg; 00901 XRectangle rects[1]; 00902 ScilabXgc->ClipRegionSet = 1; 00903 xget_windowdim(&verbose,wd,&narg,vdouble); 00904 rects[0].x= *x; 00905 rects[0].y= *y; 00906 rects[0].width= *w; 00907 rects[0].height= *h; 00908 ScilabXgc->CurClipRegion[0]= rects[0].x; 00909 ScilabXgc->CurClipRegion[1]= rects[0].y; 00910 ScilabXgc->CurClipRegion[2]= rects[0].width; 00911 ScilabXgc->CurClipRegion[3]= rects[0].height; 00912 XSetClipRectangles(dpy,gc,0,0,rects,1,Unsorted); 00913 }
Here is the call graph for this function:
static void xset_colormap | ( | integer * | v1, | |
integer* | v2, | |||
integer * | v3, | |||
integer * | v4, | |||
integer* | v5, | |||
integer* | v6, | |||
double * | a | |||
) | [static] |
Definition at line 1974 of file periX11.c.
References ScilabXgc, and setcolormapg().
01979 { 01980 *v3 = 0; 01981 01982 setcolormapg(ScilabXgc,v1,v2,a,v3); 01983 }
Here is the call graph for this function:
Definition at line 810 of file periX11.c.
References C2F, BCG::CurWindow, BCG::CWindow, BCG::CWindowHeight, BCG::CWindowWidth, ierr, initgraphic(), MenuFixCurrentWin(), PD0, PI0, ScilabXgc, and SwitchWindow().
00811 { 00812 XWindowAttributes war; 00813 struct BCG *bcgk; 00814 integer ierr; 00815 bcgk = ScilabXgc ; 00817 if (v2 != (integer *) 0) MenuFixCurrentWin(*intnum); 00818 if ( ScilabXgc == (struct BCG *) 0 ) 00819 { 00821 C2F(initgraphic)("",intnum,&ierr,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0); 00822 } 00823 else 00824 { 00825 if ( ScilabXgc->CurWindow != *intnum ) 00826 { 00827 SwitchWindow(intnum); 00828 } 00829 } 00830 if ( ScilabXgc == (struct BCG *) 0 && bcgk != (struct BCG *) 0) 00831 { 00833 ScilabXgc = bcgk ; 00834 if (v2 != (integer *) 0) MenuFixCurrentWin(bcgk->CurWindow); 00835 } 00836 else 00837 { 00838 /* update the dimensions */ 00839 XGetWindowAttributes(dpy,ScilabXgc->CWindow,&war); 00840 ScilabXgc->CWindowWidth = war.width; 00841 ScilabXgc->CWindowHeight = war.height; 00842 } 00843 }
Here is the call graph for this function:
Definition at line 1292 of file periX11.c.
References BCG::CurDashStyle, BCG::CurLineWidth, DASH_TAB_SIZE, Max, MAXDASH, Min, ScilabXgc, and setRealDashStyle().
Referenced by InitMissileXgc(), ResetScilabXgc(), xset_dash_and_color(), xset_dash_or_color(), xset_line_style(), and xset_usecolor().
01293 { 01294 static integer l3 ; 01295 static integer l2 = DASH_TAB_SIZE ; 01296 01297 l3 = Max(0,Min(MAXDASH - 1,*value - 1)); 01298 01299 ScilabXgc->CurDashStyle = l3 ; 01300 01301 /* xset_dashstyle(&l3,DashTab[l3],&l2); */ 01302 /* jbSilvy 03/2006 */ 01303 /* create a dash style depending on the thickness of the curve */ 01304 setRealDashStyle( ScilabXgc->CurLineWidth, ScilabXgc->CurDashStyle, l2 ) ; 01305 01306 }
Here is the call graph for this function:
Here is the caller graph for this function:
static void xset_dash_and_color | ( | integer * | value, | |
integer * | v2, | |||
integer * | v3, | |||
integer * | v4 | |||
) | [static] |
Definition at line 1320 of file periX11.c.
References xset_dash(), and xset_pattern().
Referenced by drawarcs(), drawarrows(), drawpolylines(), drawrectangles(), drawsegments(), and fillpolylines().
01321 { 01322 xset_dash(value, v2, v3, v4); 01323 xset_pattern(value+6, v2, v3, v4); 01324 }
Here is the call graph for this function:
Here is the caller graph for this function:
static void xset_dash_or_color | ( | integer * | value, | |
integer * | v2, | |||
integer * | v3, | |||
integer * | v4 | |||
) | [static] |
Definition at line 1310 of file periX11.c.
References BCG::CurColorStatus, ScilabXgc, set_c(), and xset_dash().
01311 { 01312 if ( ScilabXgc->CurColorStatus == 1) 01313 { 01314 set_c(*value-1); 01315 } 01316 else 01317 xset_dash(value, v2, v3, v4); 01318 }
Here is the call graph for this function:
Definition at line 1347 of file periX11.c.
References BCG::CurLineWidth, FREE, i, INT_2_UCHAR, MALLOC, NULL, and ScilabXgc.
Referenced by setRealDashStyle().
01348 { 01349 int dashok= LineOnOffDash ; 01350 if ( *value == 0) 01351 { 01352 dashok = LineSolid ; 01353 } 01354 else 01355 { 01356 integer i; 01357 char * buffdash = NULL ; 01358 if ( ( buffdash = MALLOC( *n * sizeof(char) ) ) == NULL ) 01359 { 01360 return ; 01361 } 01362 for ( i = 0 ; i < *n ; i++ ) 01363 { 01364 /* we need to convert the length from integer to char */ 01365 /* XSetDashes take a char * as argument, however it seems */ 01366 /* that it treat it as unsigned char *. */ 01367 buffdash[i] = INT_2_UCHAR( xx[i] ) ; 01368 } 01369 XSetDashes(dpy,gc,0,buffdash,(int)*n); 01370 FREE( buffdash ) ; 01371 } 01372 XSetLineAttributes(dpy,gc,(unsigned) ScilabXgc->CurLineWidth,dashok, 01373 CapButt,JoinMiter); 01374 }
Here is the caller graph for this function:
Definition at line 2515 of file periX11.c.
References sciprint().
02516 { 02517 if ( *verbose ==1 ) sciprint("\n No operation "); 02518 }
Here is the call graph for this function:
Definition at line 4097 of file periX11.c.
References FontAlias::alias, C2F, BCG::FontId, FontInfoTab_, FONTMAXSIZE, FONTNUMBER, BCG::FontSize, fonttab, BCG::FontXID, i, loadfamily(), Max, Min, ok, PD0, PI0, ScilabXgc, and sciprint().
Referenced by drawpolymark(), InitMissileXgc(), and ResetScilabXgc().
04098 { 04099 integer i,fsiz,fsiz_sca; 04100 i = Min(FONTNUMBER-1,Max(*fontid,0)); 04101 fsiz = Min(FONTMAXSIZE-1,Max(*fontsize,0)); 04102 fsiz_sca = fsiz ;/* XXX fontidscale(fsiz); Scale fonts */ 04103 if ( FontInfoTab_[i].ok !=1 ) 04104 { 04105 if (i != FONTNUMBER-1 ) 04106 { 04107 C2F(loadfamily)(fonttab[i].alias,&i,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0); 04108 } 04109 else 04110 { 04111 sciprint(" The Font Id %d is not affected \r\n",(int)i); 04112 sciprint(" use xlfont to set it \n"); 04113 return; 04114 } 04115 } 04116 ScilabXgc->FontId = i; 04117 ScilabXgc->FontSize = fsiz; 04118 ScilabXgc->FontXID=FontsList_[i][fsiz_sca]->fid; 04119 XSetFont(dpy,gc,FontsList_[i][fsiz_sca]->fid); 04120 XFlush(dpy); 04121 }
Here is the call graph for this function:
Here is the caller graph for this function:
Definition at line 2390 of file periX11.c.
References BCG::Colors, BCG::CurColorStatus, BCG::CurDrawFunction, Max, Min, NULL, BCG::Numcolors, BCG::NumForeground, PI0, ScilabXgc, and xset_alufunction1().
Referenced by InitMissileXgc(), ResetScilabXgc(), and setcolormap1().
02391 { 02392 if (ScilabXgc->CurColorStatus == 1) 02393 { 02394 Pixel px; 02395 ScilabXgc->NumForeground = Max(0,Min(*num - 1,ScilabXgc->Numcolors + 1)); 02396 xset_alufunction1(&ScilabXgc->CurDrawFunction,PI0,PI0,PI0); 02397 px = (ScilabXgc->Colors == NULL) ? DefaultForeground 02398 : ScilabXgc->Colors[ScilabXgc->NumForeground]; 02399 /*** XXXXXXX attention regarder le mode pixmap ****/ 02401 } 02402 }
Here is the call graph for this function:
Here is the caller graph for this function:
static void xset_gccolormap | ( | integer * | v1, | |
integer* | v2, | |||
double * | a, | |||
struct BCG * | XGC, | |||
integer * | v3 | |||
) | [static] |
Definition at line 1984 of file periX11.c.
References setcolormapg().
01989 { 01990 01991 setcolormapg(XGC,v1,v2,a,v3); 01992 }
Here is the call graph for this function:
set and get the number of the hidden3d color
Definition at line 2421 of file periX11.c.
References BCG::CurColorStatus, Max, Min, BCG::Numcolors, BCG::NumHidden3d, and ScilabXgc.
Referenced by InitMissileXgc(), and ResetScilabXgc().
02422 { 02423 if (ScilabXgc->CurColorStatus == 1) 02424 { 02425 /* e Segre: Max(0,... -> Max(-1,... */ 02426 /* S Mottelet: Max(-1,... -> Max(-2,... to take into account the value -1 */ 02427 ScilabXgc->NumHidden3d = Max(-2,Min(*num - 1,ScilabXgc->Numcolors + 1)); 02428 } 02429 }
Here is the caller graph for this function:
Definition at line 1326 of file periX11.c.
References BCG::CurColorStatus, BCG::CurDashStyle, j, PI0, ScilabXgc, xset_dash(), and xset_pattern().
Referenced by drawarcs(), drawarrows(), drawpolylines(), drawrectangles(), drawsegments(), and fillpolylines().
01327 { 01328 integer j; 01329 if (ScilabXgc->CurColorStatus == 0) 01330 xset_dash(value,PI0,PI0,PI0); 01331 else { 01332 j= ScilabXgc->CurDashStyle + 1; 01333 xset_dash(&j,PI0,PI0,PI0); 01334 xset_pattern(value,PI0,PI0,PI0); 01335 } 01336 }
Here is the call graph for this function:
Here is the caller graph for this function:
To set the current mark
Definition at line 4141 of file periX11.c.
References BCG::CurHardSymb, BCG::CurHardSymbSize, FONTMAXSIZE, Max, Min, ScilabXgc, and SYMBOLNUMBER.
Referenced by drawpolylines(), InitMissileXgc(), and ResetScilabXgc().
04142 { 04143 ScilabXgc->CurHardSymb = Max(Min(SYMBOLNUMBER-1,*number),0); 04144 ScilabXgc->CurHardSymbSize = Max(Min(FONTMAXSIZE-1,*size),0); 04145 ;}
Here is the caller graph for this function:
Definition at line 1239 of file periX11.c.
References BCG::CurColorStatus, BCG::CurPattern, GREYNUMBER, i, Max, Min, ScilabXgc, and set_c().
Referenced by drawpolylines(), drawrectangles(), fill_grid_rectangles(), fill_grid_rectangles1(), fillarcs(), fillpolylines(), InitMissileXgc(), ResetScilabXgc(), setcolormap1(), xset_dash_and_color(), xset_line_style(), and xset_usecolor().
01240 { integer i ; 01241 01242 if (ScilabXgc->CurColorStatus == 1) 01243 { 01244 set_c(*num-1); 01245 } 01246 else 01247 { 01248 i= Max(0,Min(*num - 1,GREYNUMBER - 1)); 01249 ScilabXgc->CurPattern = i; 01250 XSetTile (dpy, gc, Tabpix_[i]); 01251 if (i ==0) 01252 XSetFillStyle(dpy,gc,FillSolid); 01253 else 01254 XSetFillStyle(dpy,gc,FillTiled); 01255 } 01256 }
Here is the call graph for this function:
Here is the caller graph for this function:
Pixmap routines
Un clip zone (rectangle )
Restore the clip zone (rectangle )
Definition at line 275 of file periX11.c.
References BCG::ClipRegionSet, BCG::CurClipRegion, BCG::CWindow, PixmapClear(), and ScilabXgc.
Referenced by clearwindow().
00276 { 00277 XWindowAttributes war; 00279 XSetClipMask(dpy,gc,None); 00280 XGetWindowAttributes(dpy,ScilabXgc->CWindow,&war); 00281 PixmapClear(ScilabXgc,0,0,war.width,war.height); 00283 if ( ScilabXgc->ClipRegionSet == 1) 00284 { 00285 XRectangle rects[1]; 00286 rects[0].x = ScilabXgc->CurClipRegion[0]; 00287 rects[0].y = ScilabXgc->CurClipRegion[1]; 00288 rects[0].width = ScilabXgc->CurClipRegion[2]; 00289 rects[0].height = ScilabXgc->CurClipRegion[3]; 00290 XSetClipRectangles(dpy,gc,0,0,rects,1,Unsorted); 00291 } 00292 }
Here is the call graph for this function:
Here is the caller graph for this function:
Definition at line 1488 of file periX11.c.
References C2F, BCG::Cdrawable, BCG::Colors, BCG::CurPixmapStatus, BCG::CWindow, Max, Min, NULL, BCG::NumBackground, PD0, PI0, PixmapClear(), ScilabXgc, and xinfo().
Referenced by InitMissileXgc().
01489 { 01490 integer num1= Min(Max(*num,0),1); 01491 Pixel px; 01492 01493 01494 /* create the pixmap if it does not exist */ 01495 if (ScilabXgc->Cdrawable == (Drawable) 0) { 01496 XWindowAttributes war; 01497 XGetWindowAttributes(dpy,ScilabXgc->CWindow,&war); 01498 ScilabXgc->Cdrawable = (Drawable) XCreatePixmap(dpy,root,war.width,war.height,depth); 01499 if (ScilabXgc->Cdrawable != (Drawable) 0) { 01500 PixmapClear(ScilabXgc,0,0,war.width,war.height); 01501 XSetWindowBackgroundPixmap(dpy, ScilabXgc->CWindow, (Pixmap) ScilabXgc->Cdrawable); 01502 } 01503 else { 01504 px = (ScilabXgc->Colors == NULL) ? DefaultBackground 01505 : ScilabXgc->Colors[ScilabXgc->NumBackground]; 01506 XSetWindowBackground(dpy, ScilabXgc->CWindow,px); 01507 } 01508 } 01509 01510 if ( num1 == 0 ) { 01511 C2F(xinfo)(" ",PI0,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0); 01512 ScilabXgc->CurPixmapStatus = 0; 01513 } 01514 else if ( num1 == 1 ) { 01515 if (ScilabXgc->Cdrawable != (Drawable) 0) { 01516 XWindowAttributes war; 01517 C2F(xinfo)("Animation mode is on,( xset('pixmap',0) to leave)", 01518 PI0,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0); 01519 XGetWindowAttributes(dpy,ScilabXgc->CWindow,&war); 01520 01521 ScilabXgc->CurPixmapStatus = 1; 01522 PixmapClear(ScilabXgc,0,0,war.width,war.height); 01523 } 01524 else /*no pixmap */ 01525 ScilabXgc->CurPixmapStatus = 0; 01526 01527 } 01528 01529 }
Here is the call graph for this function:
Here is the caller graph for this function:
To change the popup window size
Definition at line 757 of file periX11.c.
References GPopupResize(), and ScilabXgc.
00758 { 00759 GPopupResize(ScilabXgc,x,y); 00760 }
Here is the call graph for this function:
static void xset_scilabFigure | ( | integer * | v1, | |
integer * | v2, | |||
integer * | v3, | |||
integer * | v4, | |||
integer * | v5, | |||
integer * | v6, | |||
double * | figure | |||
) | [static] |
Definition at line 845 of file periX11.c.
References BCG::mafigure, and ScilabXgc.
00846 { 00847 ScilabXgc->mafigure=(sciPointObj *)figure; 00848 }
Definition at line 300 of file periX11.c.
References BCG::Cdrawable, BCG::CWindow, and ScilabXgc.
00301 { 00302 /*if (ScilabXgc->CurPixmapStatus == 0) return; */ 00303 /* if CurPixmapStatus ==0 the pixmap is used as a backing store memory*/ 00304 if (ScilabXgc->Cdrawable != (Drawable) 0) { 00305 XSetWindowBackgroundPixmap(dpy, ScilabXgc->CWindow, (Pixmap) ScilabXgc->Cdrawable); 00306 XClearWindow(dpy,ScilabXgc->CWindow); 00307 } 00308 XFlush(dpy); 00309 }
Definition at line 1182 of file periX11.c.
References BCG::CurDashStyle, BCG::CurLineWidth, DASH_TAB_SIZE, Max, ScilabXgc, and setRealDashStyle().
Referenced by InitMissileXgc(), and ResetScilabXgc().
01183 { 01184 integer l2 = DASH_TAB_SIZE ; 01185 XGCValues gcvalues; 01186 01187 ScilabXgc->CurLineWidth = Max(0, *value); 01188 01189 gcvalues.line_width = ScilabXgc->CurLineWidth ; 01190 XChangeGC(dpy, gc, GCLineWidth, &gcvalues); 01191 01192 /* modify the real dash style */ 01193 /* jb Silvy 03/2006 */ 01194 setRealDashStyle( ScilabXgc->CurLineWidth, ScilabXgc->CurDashStyle, l2 ) ; 01195 }
Here is the call graph for this function:
Here is the caller graph for this function:
unset clip zone
Definition at line 917 of file periX11.c.
References BCG::ClipRegionSet, and ScilabXgc.
Referenced by InitMissileXgc(), and ResetScilabXgc().
00918 { 00919 ScilabXgc->ClipRegionSet = 0; 00920 XSetClipMask(dpy,gc,None); 00921 }
Here is the caller graph for this function:
Definition at line 1425 of file periX11.c.
References BCG::CurColor, BCG::CurColorStatus, BCG::CurDashStyle, BCG::CurPattern, GREYNUMBER, i, BCG::IDLastPattern, Max, Min, BCG::Numcolors, PI0, ScilabXgc, xset_dash(), and xset_pattern().
Referenced by InitMissileXgc(), and setcolormap1().
01426 { 01427 integer i; 01428 i = Min(Max(*num,0),1); 01429 if ( ScilabXgc->CurColorStatus != (int) i) 01430 { 01431 if (ScilabXgc->CurColorStatus == 1) 01432 { 01433 /* from color to b&w */ 01434 ScilabXgc->CurColorStatus = 1; 01435 xset_pattern((i=1,&i),PI0,PI0,PI0); 01436 /* go to b&w */ 01437 ScilabXgc->CurColorStatus = 0; 01438 i= ScilabXgc->CurPattern + 1; 01439 xset_pattern(&i,PI0,PI0,PI0); 01440 i= ScilabXgc->CurDashStyle + 1; 01441 xset_dash(&i,PI0,PI0,PI0); 01442 01443 01444 ScilabXgc->IDLastPattern = GREYNUMBER - 1; 01445 } 01446 else 01447 { 01448 /* switching to color mode */ 01449 /* patterns and dashes reinitialization */ 01450 /* colors too */ 01451 ScilabXgc->CurColorStatus = 0; 01452 xset_pattern((i=1,&i),PI0,PI0,PI0); 01453 xset_dash((i=1,&i),PI0,PI0,PI0); 01454 /* switching to color mode */ 01455 ScilabXgc->CurColorStatus = 1; 01456 i= ScilabXgc->CurColor + 1; 01457 xset_pattern(&i,PI0,PI0,PI0); 01458 xset_pattern(&i,PI0,PI0,PI0); 01459 ScilabXgc->IDLastPattern = ScilabXgc->Numcolors - 1; 01460 01461 } 01462 } 01463 }
Here is the call graph for this function:
Here is the caller graph for this function:
To change the window size
Definition at line 772 of file periX11.c.
References BCG::mafigure, ScilabXgc, and sciSetViewport().
00773 { 00774 sciSetViewport( ScilabXgc->mafigure, *x, *y ) ; 00775 }
Here is the call graph for this function:
To change the drawbox window size
Definition at line 725 of file periX11.c.
References BCG::CBGWindow, BCG::CWindow, BCG::CWindowHeight, BCG::CWindowWidth, GViewportResize(), NULL, and ScilabXgc.
Referenced by xset_wresize().
00726 { 00727 XWindowAttributes war; 00728 if (ScilabXgc == (struct BCG *) NULL || ScilabXgc->CBGWindow == (Window) NULL) return ; 00729 GViewportResize(ScilabXgc,x,y) ; 00730 /* check dimensions : GViewportResize can set slighly different values */ 00731 XGetWindowAttributes(dpy,ScilabXgc->CWindow,&war); 00732 ScilabXgc->CWindowWidth = war.width; 00733 ScilabXgc->CWindowHeight = war.height; 00734 XFlush(dpy); 00735 }
Here is the call graph for this function:
Here is the caller graph for this function:
to set the window upper-left point position on the screen
test Normalement inutile XXXX
Definition at line 696 of file periX11.c.
References C2F, BCG::CBGWindow, ierr, initgraphic(), NULL, PD0, PI0, and ScilabXgc.
00697 { 00699 integer ierr; 00700 if (ScilabXgc == (struct BCG *)0 || ScilabXgc->CBGWindow == (Window) NULL) 00701 C2F(initgraphic)("",PI0,&ierr,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0); 00702 XMoveWindow(dpy,ScilabXgc->CBGWindow,(int) *x,(int) *y); 00703 }
Here is the call graph for this function:
Definition at line 1542 of file periX11.c.
References BCG::CurResizeStatus, Max, Min, NULL, ScilabXgc, SciViewportClipGetSize(), SciViewportMove(), and xset_windowdim().
01543 { 01544 integer num1= Min(Max(*num,0),1); 01545 if ( num1 != ScilabXgc->CurResizeStatus && num1 == 1) 01546 { 01547 /* we are switching back to wresize 1 we must adapt the drawbox size */ 01548 /* by asking the popup to change its size to the same ones !! **/ 01549 integer clwidth,clheight; 01550 /* first move the viewport to the upper left position */ 01551 SciViewportMove(ScilabXgc,0,0); 01552 /* get the clip box size */ 01553 SciViewportClipGetSize (ScilabXgc, &clwidth, &clheight); 01554 /* change the resize status */ 01555 ScilabXgc->CurResizeStatus = num1 ; 01556 /* force a redim for the drawbox to fit the popup */ 01557 xset_windowdim(&clwidth,&clheight,NULL,NULL); 01558 return ; 01559 } 01560 ScilabXgc->CurResizeStatus = num1 ; 01561 }
Here is the call graph for this function:
Cursor arrowcursor [static] |
int client_message = 0 [static] |
Cursor crosscursor [static] |
unsigned short default_colors[] |
Definition at line 146 of file periX11.c.
Referenced by ColorInit(), ColorInitGif(), and set_default_colormap().
Pixel DefaultBackground [static] |
Pixel DefaultForeground [static] |
Definition at line 139 of file periX11.c.
Referenced by CreateGC(), GetBitmapInfo(), set_bitmap_info(), SetTextWidthAndHeight(), and XmuScreenOfWindow().
Display* dpy = (Display *) NULL [static] |
Definition at line 136 of file periX11.c.
Referenced by _ShadowSurroundedBox(), _XawSme3dDrawShadows(), _XawTextSelectionList(), _XEditResCheckMessages(), AllocBotShadowPixel(), AllocBotShadowPixmap(), AllocTopShadowPixel(), AllocTopShadowPixmap(), ChangeBandF(), CreatePopupWindow(), ExposeChooseWindow(), ExposePrintdialogWindow(), GetChilds(), GetFileWindow(), InitXsession(), make_colored_cursor(), MatrixDialogWindow(), recolor_cursor(), Redisplay(), repaint_window(), sci_tk_activate(), SciChoiceI(), SelectSave(), ShapeEllipseOrRoundedRectangle(), ShapeOval(), XawSme3dComputeBottomShadowRGB(), XawSme3dComputeTopShadowRGB(), XmuCvtStringToBitmap(), and XmuLocatePixmapFile().
struct FontInfo FontInfoTab_[FONTNUMBER] |
Referenced by loadfamily(), queryfamily(), xget_font(), and xset_font().
Initial value:
{ {"CourR", "-adobe-courier-medium-r-normal--*-%s0-*-*-m-*-iso8859-1"}, {"Symb", "-adobe-symbol-medium-r-normal--*-%s0-*-*-p-*-adobe-fontspecific"}, {"TimR", "-adobe-times-medium-r-normal--*-%s0-*-*-p-*-iso8859-1"}, {"TimI", "-adobe-times-medium-i-normal--*-%s0-*-*-p-*-iso8859-1"}, {"TimB", "-adobe-times-bold-r-normal--*-%s0-*-*-p-*-iso8859-1"}, {"TimBI", "-adobe-times-bold-i-normal--*-%s0-*-*-p-*-iso8859-1"}, {"HelvR", "-adobe-helvetica-medium-r-normal--*-%s0-*-*-p-*-iso8859-1"}, {"HelvO", "-adobe-helvetica-medium-o-normal--*-%s0-*-*-p-*-iso8859-1"}, {"HelvB", "-adobe-helvetica-bold-r-normal--*-%s0-*-*-p-*-iso8859-1"}, {"HelvBO", "-adobe-helvetica-bold-o-normal--*-%s0-*-*-p-*-iso8859-1"}, {(char *) NULL,( char *) NULL} }
char grey0[GREYNUMBER][8] [static] |
Initial value:
{ {(char)0x00, (char)0x00, (char)0x00, (char)0x00, (char)0x00, (char)0x00, (char)0x00, (char)0x00}, {(char)0x00, (char)0x00, (char)0x44, (char)0x00, (char)0x00, (char)0x00, (char)0x44, (char)0x00}, {(char)0x00, (char)0x44, (char)0x00, (char)0x22, (char)0x08, (char)0x40, (char)0x01, (char)0x20}, {(char)0x00, (char)0x92, (char)0x00, (char)0x25, (char)0x00, (char)0x92, (char)0x00, (char)0xa4}, {(char)0x55, (char)0x00, (char)0xaa, (char)0x00, (char)0x55, (char)0x00, (char)0xaa, (char)0x00}, {(char)0xad, (char)0x00, (char)0x5b, (char)0x00, (char)0xda, (char)0x00, (char)0x6d, (char)0x00}, {(char)0x6d, (char)0x02, (char)0xda, (char)0x08, (char)0x6b, (char)0x10, (char)0xb6, (char)0x20}, {(char)0x6d, (char)0x22, (char)0xda, (char)0x0c, (char)0x6b, (char)0x18, (char)0xb6, (char)0x24}, {(char)0x55, (char)0xaa, (char)0x55, (char)0xaa, (char)0x55, (char)0xaa, (char)0x55, (char)0xaa}, {(char)0x92, (char)0xdd, (char)0x25, (char)0xf3, (char)0x94, (char)0xe7, (char)0x49, (char)0xdb}, {(char)0x92, (char)0xfd, (char)0x25, (char)0xf7, (char)0x94, (char)0xef, (char)0x49, (char)0xdf}, {(char)0x52, (char)0xff, (char)0xa4, (char)0xff, (char)0x25, (char)0xff, (char)0x92, (char)0xff}, {(char)0xaa, (char)0xff, (char)0x55, (char)0xff, (char)0xaa, (char)0xff, (char)0x55, (char)0xff}, {(char)0xff, (char)0x6d, (char)0xff, (char)0xda, (char)0xff, (char)0x6d, (char)0xff, (char)0x5b}, {(char)0xff, (char)0xbb, (char)0xff, (char)0xdd, (char)0xf7, (char)0xbf, (char)0xfe, (char)0xdf}, {(char)0xff, (char)0xff, (char)0xbb, (char)0xff, (char)0xff, (char)0xff, (char)0xbb, (char)0xff}, {(char)0xff, (char)0xff, (char)0xff, (char)0xff, (char)0xff, (char)0xff, (char)0xff, (char)0xff}, }
Offset ListOffset_[FONTMAXSIZE] [static] |
char Marks[] [static] |
Definition at line 140 of file periX11.c.
Referenced by pal_setcolormap(), ScrnRefresh(), set_default_colormap(), setcolormap(), and setcolormapg().
struct bgc
MissileGCTab_[] [static] |
Table in lexicographic order
Cursor normalcursor [static] |
char* ResList[] = { SCI_VERSION_STRING,"BG","ScilabGraphic"} [static] |
Window root = (Window) NULL [static] |
Definition at line 135 of file periX11.c.
Referenced by CreateGC(), GetBitmapInfo(), set_bitmap_info(), SetTextWidthAndHeight(), TryChildren(), XmuLocatePixmapFile(), and XmuScreenOfWindow().
int screencolor = 1 [static] |
int set_default_colormap_flag = 1 [static] |
char* size_[] = { "08" ,"10","12","14","18","24"} [static] |
char* size_n_[] = { "8" ,"10","12","14","18","24"} [static] |
double t = 0. |
Definition at line 54 of file periX11.c.
Referenced by argkludge(), argverify(), backlash(), bounce4(), bouncexy(), c_sqrt(), cdummy(), CheckGraphName(), cktype1(), cmscope(), commlen(), conv_10(), convci(), convic(), cossim(), cossimdaskr(), cscope(), dataname(), deriv(), do_uninit_equivs(), docommon(), doequiv(), doinclude(), dtime_(), etime_(), exarif(), f__bufadj(), Fibo_sim(), fixargs(), fmtname(), fres(), fresd(), fydot(), gencuprod(), gencusum(), genmprod(), genmsum(), getarg_(), h_indx(), i_indx(), i_tem(), Inline(), intbdiagr(), intdouble(), krput(), LexiColswapcodechar(), LexiColswapcodedouble(), LexiColswapcodeint(), LexiColswapcodeshort(), LexiColswapcodestring(), LexiRowswapcodechar(), LexiRowswapcodedouble(), LexiRowswapcodeint(), LexiRowswapcodeshort(), LexiRowswapcodestring(), main(), md5_process(), mkaddr(), mkname(), need_nancheck(), newarg(), out_call(), pad_common(), popinclude(), pow_zi(), print_ne(), putch1(), putcx1(), putentries(), ratelimiter(), rd_Z(), readf4(), readref(), realtime(), run(), save_argtypes(), sci_besseli(), sci_besselj(), sci_getarg(), set_tmp_names(), setfmt(), subcheck(), swapcodechar(), swapcodedouble(), swapcodeint(), swapcodeshort(), swapcodestring(), therm_sim(), time_delay(), to_upper(), tostring(), ULL2TIME(), unamstring(), vardcl(), variable_delay(), wfloat(), wr_globals(), writef4(), XRotMagnifyImage(), and z_log().
Pixmap Tabpix_[GREYNUMBER] |
Visual* visual |