このライブラリどうよ
■ このスレッドは過去ログ倉庫に格納されています
0001デフォルトの名無しさん
NGNG0002デフォルトの名無しさん
NGNG0003その1
NGNG#include <X11/Xutil.h>
#include <stdio.h>
#include <math.h>
/* 関数のプロトタイプ宣言 */
int inverty(int y);
unsigned long MyColor( Display * _dis, char * color_name );
int max_height(void);
int max_width(void);
void openwindow(int x,int y);
int set_color(int iro);
int line(int x1,int y1,int x2,int y2);
int set_back_color(int bgcolor);
int text(int x,int y,char *string,int iro);
int set_line_width(unsigned int line_width);
int set_line_style(int linestyle);
int rectangle_abs(int, int, int, int, int);
int circle_abs(int, int, int, int);
int mouse_click_wait(void);
int mouse_click(void);
int mouse_x(void);
int mouse_y(void);
int wait(void);
0004その2
NGNGDisplay* _dis;
Window _win;
XSetWindowAttributes att;
GC _gc;
Font _f1;
XEvent _ev;
int _maxheight,_maxwidth,_wheight,_wwidth;
int _current_linestyle,_current_linewidth;
unsigned long _wwhite,_wblack;
char *colorstr[18]={
"white","yellow","gold","orange","pink",
"violet","magenta","red","darkred","green",
"forestgreen","darkgreen","purple","darkviolet","cyan",
"blue","navy","black"};
int current_mouse_x,current_mouse_y;
/****** y座標を変換する関数 ******/
int inverty(int y)
{
return _wheight - y;
}
0005その3
NGNGunsigned long MyColor( Display* _dis, char* color_name )
{
Colormap cmap;
XColor near_color, true_color;
cmap = DefaultColormap( _dis, 0 );
XAllocNamedColor( _dis, cmap, color_name, &near_color, &true_color );
return( near_color.pixel );
}
/****** 現在使用しているマシンの最大幅を返す関数 ******/
int max_width(void)
{
_dis = XOpenDisplay(NULL);
_maxwidth = DisplayWidth(_dis,0);
return _maxwidth;
}
/****** 現在使用しているマシンの最大高さを返す関数 ******/
int max_height(void)
{
_dis = XOpenDisplay(NULL);
_maxheight = DisplayHeight(_dis,0);
return _maxheight ;
}
0006その4
NGNGvoid openwindow(int x,int y)
{
int i,j;
_wheight=y;
_wwidth=x;
_dis = XOpenDisplay( NULL );
_wwhite=WhitePixel(_dis,0);
_wblack=BlackPixel(_dis,0);
_win = XCreateSimpleWindow(
_dis,DefaultRootWindow(_dis),100,100,x,y,5,_wblack,_wwhite);
att.backing_store = WhenMapped;
XChangeWindowAttributes( _dis, _win, CWBackingStore, &att );
XSelectInput( _dis, _win, ExposureMask );
XMapWindow( _dis, _win );
do{
XNextEvent( _dis, &_ev);
}while( _ev.type != Expose );
_gc = XCreateGC( _dis, DefaultRootWindow(_dis), 0, 0 );
XSetForeground( _dis, _gc,MyColor( _dis, "black") );
_maxheight=max_height();
}
0007その5
NGNGint set_color(int iro)
{
char *color;
if(iro<18 && iro>=0){
color=colorstr[iro];
XSetForeground( _dis, _gc,MyColor( _dis, color) );
}
else return -1;
}
/****** 背景の色設定をする関数 ******/
int set_back_color(int bgcolor)
{
char *colorbg;
colorbg = colorstr[bgcolor];
XSetWindowBackground(_dis,_win,MyColor(_dis,colorbg));
XClearWindow(_dis,_win);
XFlush(_dis);
return 1;
}
0008その6
NGNGint line(int x1,int y1,int x2,int y2)
{
y1=inverty(y1);
y2=inverty(y2);
XDrawLine( _dis, _win, _gc, x1,y1,x2,y2);
XFlush( _dis );
}
/****** 英数字で構成された文字列を出力する関数 ******/
int text(int x,int y,char *string,int iro)
{
int i, chackcolor=0;
_gc=XCreateGC(_dis,_win,0,0);
_f1 = XLoadFont(_dis,"fixed");
XSetFont(_dis,_gc,_f1);
y=inverty(y);
set_color(iro);
XDrawString(_dis,_win,_gc,x,y,
string,strlen(string));
XFlush(_dis);
return 1;
}
0009その7
NGNGint set_line_width(unsigned int line_width)
{
_current_linewidth=line_width;
_gc = XCreateGC(_dis,_win,0,0);
XSetLineAttributes(_dis,_gc,line_width,
_current_linestyle ,CapButt,JoinMiter);
return 1;
}
/****** 直線のスタイルを設定する関数 ******/
int set_line_style(int linestyle)
{
int stylechack = 1;
_gc = XCreateGC(_dis,_win,0,0);
if(linestyle == 0) _current_linestyle = LineSolid;
else if(linestyle == 1) _current_linestyle = LineOnOffDash;
else printf("error line_style\n");
XSetLineAttributes(_dis,_gc,_current_linewidth,
_current_linestyle,CapButt,JoinMiter);
return stylechack;
}
0010その8
NGNGint rectangle_abs(int ltx, int lty, int width, int height, int fill)
{
int draw_ltx, draw_lty;
lty=inverty(lty + height);
draw_ltx = ltx;
draw_lty = lty;
if(fill == 0) XDrawRectangle(_dis,_win,_gc,draw_ltx,draw_lty,width,height);
else if(fill == 1) XFillRectangle(_dis,_win,_gc,draw_ltx,draw_lty,width,height);
else{
printf("fill error\n");
exit(1);
}
XFlush(_dis);
return 1;
}
0011その9
NGNGint circle_abs(int x, int y, int r, int fill)
{
int circle_x, circle_y, angle1=0*64, angle2=360*64;
unsigned int width, height;
circle_x = x - r;
circle_y = inverty(y + r);
width = height = r * 2;
if(fill == 0)
XDrawArc(_dis,_win,_gc,circle_x,circle_y,width,height, angle1,angle2);
else if(fill == 1)
XFillArc(_dis,_win,_gc,circle_x,circle_y,width,height, angle1,angle2);
else{
printf("fill error\n");
exit(1);
}
XFlush(_dis);
return 1;
}
0012その10
NGNGint mouse_click_wait(void)
{
int i ,mouse;
_gc=XCreateGC(_dis,_win,0,0);
_f1 = XLoadFont(_dis,"fixed");
XSetFont(_dis,_gc,_f1);
XSelectInput(_dis, _win, ButtonPressMask);
XNextEvent(_dis, &_ev);
switch(_ev.type){
case ButtonPress :
if(_ev.xbutton.button == 1){
current_mouse_x = _ev.xbutton.x;
current_mouse_y = _ev.xbutton.y;
current_mouse_y=inverty(current_mouse_y);
mouse = 1;
}
else if(_ev.xbutton.button == 3){
current_mouse_x = _ev.xbutton.x;
current_mouse_y = _ev.xbutton.y;
current_mouse_y=inverty(current_mouse_y);
mouse = 2;
}
else if(_ev.xbutton.button == 2){
current_mouse_x = _ev.xbutton.x;
current_mouse_y = _ev.xbutton.y;
current_mouse_y=inverty(current_mouse_y);
mouse = 3;
}
break;
}
return mouse;
}
0013その11
NGNGint mouse_click(void)
{
int i ,mouse;
_gc=XCreateGC(_dis,_win,0,0);
_f1 = XLoadFont(_dis,"fixed");
XSetFont(_dis,_gc,_f1);
XSelectInput(_dis, _win, ButtonPressMask);
if( XCheckMaskEvent(_dis, ButtonPressMask, &_ev)){
if(_ev.xbutton.button == 1){
current_mouse_x = _ev.xbutton.x;
current_mouse_y = _ev.xbutton.y;
current_mouse_y=inverty(current_mouse_y);
mouse = 1;
}
else if(_ev.xbutton.button == 3){
current_mouse_x = _ev.xbutton.x;
current_mouse_y = _ev.xbutton.y;
current_mouse_y=inverty(current_mouse_y);
mouse = 2;
}
}
else mouse = 0;
return mouse;
}
0014その12(これで終わり)
NGNGint mouse_x(void)
{
return current_mouse_x;
}
/****** マウスのY座標を返す関数 ******/
int mouse_y(void)
{
return current_mouse_y;
}
/****** キー入力を待ち、後処理をする関数 ******/
int wait(void)
{
printf("Push return key.");
getchar();
XDestroyWindow( _dis , _win );
XCloseDisplay( _dis );
}
0015デフォルトの名無しさん
NGNG0017デフォルトの名無しさん
NGNG0018デフォルトの名無しさん
NGNG0019デフォルトの名無しさん
NGNG/ヽ /ヽ
/ ヽ / ヽ
______ /U ヽ___/ ヽ
| ____ / U :::::::::::U:\
| | // ___ \ ::::::::::::::|
| | ライブラ | | | U :::::::::::::|
| | .|U | | ::::::U::::|
| | | ├―-┤ U.....:::::::::::::::::::/
| |____ ヽ .....:::::::::::::::::::::::<
└___/ ̄ ̄ :::::::::::::::::::::::::|
|\ | :::::::::::::::::::::::|
\ \ \___ ::::::::::::::::::::::::|
0020デフォルトの名無しさん
NGNG0021デフォルトの名無しさん
NGNG0022デフォルトの名無しさん
NGNG( ´Д`) とりあえず ) )
/ \ 焼いとく ノ
| | | \ (( ((
| | /⌒|⌒|ヽ二二つ ) ) 丿パチパチ
ヽ二二Ο./ \ (( ( ノノ
(_| |_| |_ \ ∴∵ ← >>1
.(__)__) //》||ヾミ\
0023デフォルトの名無しさん
NGNG0024デフォルトの名無しさん
NGNG> /****** 現在使用しているマシンの最大高さを返す関数 ******/
> int max_height(void)
PCを横置きにしても値が変わらないのはバグですか?仕様ですか?
0025デフォルトの名無しさん
NGNG0026デフォルトの名無しさん
NGNG*・゜゚・*:.。..。: | ノノノノハ) /
(((〃〜、 | ノソ ‘ 。‘ノ彡 ∧ ∧./ /´⌒`ヽ,
イエ〜イ (/´´ヽ彡ノ | / つ (´∀/ へ@______//
(‘。‘ ぅー" | .(〇___ノ ̄ ̄./ \(ノノノハ/ ?桃色片想い?
⊂ ハ_//゙)、 <)二) ∧∧∧∧ / ∩从’ 。’从∩
/ヽ/´ヽ) ノ / <. ぁ >/ |三三三三三三|
/ ̄ ̄ ̄くノ ̄ ̄` ヽ< 予 ゃ > | .MOMOKAN. |
<) ▽▲ ドキラブ号 ▼△ )< ゃ > | 〆`/'  ̄`ヽ |
――――――――――─< 感 ス >―――――――――――――――
γ⌒⌒ヽ <. ! ! レ > .ンー--、
ノノノノハ) <. の > ピ━━━, -J@___ハ ━━━チ
人‘ 。‘ 人 ∨∨∨∨ .\ n ヽ(ノノノノノソ
,O゙゙)=⊂二 ) プピピ./.`/=、/;:/ /\ 匹っ从 ’ー^从.θ
/ ノ(( ̄_ノニニフ /i''i!リ“"'ッ、,ノ ,//! /\ \_ソ` ='('ヽ/
'=-=、\>>_ノ/,.=-\/ | 、,、=ッ;,、"' ノノ' ,,i/‐''"\ ノi . ...,ノ^こ)
( ◎)゙ー――'(◎/ | ''ゝ=゚ィヽ:. ,.ゞfテ。;\ /`ー-(
ー=三三三三/ ,、''"~| .:.: '’''=‐''”`゛\L__@」 0(●‘◇‘)00(・◇・●)
0027デフォルトの名無しさん
NGNGいじわるゆーなよ
まあ、最近ぽつぽつと見かける 回転できる液晶ディスプレイ なんかを
使っているときに 果たして 動くのか、という疑問は残るな。 うごかねーよ
0028デフォルトの名無しさん
NGNG0029デフォルトの名無しさん
NGNG0030デフォルトの名無しさん
NGNGhttp://www68.dns.ne.jp/~bbs2/upload3/helen/OB00014094.jpg
0031デフォルトの名無しさん
NGNG00321
NGNG0033デフォルトの名無しさん
NGNG0034デフォルトの名無しさん
NGNG0035デフォルトの名無しさん
NGNG0036デフォルトの名無しさん
NGNG\ /
\ /
\ /
\ /
\ /
\∧∧∧∧/
< 何 >
< 予 も >
< 無 >
──────────< 感 い >───────────
< >
< !!!! >
/∨∨∨∨\
/ \
/ \
/ \
/ \
/ \
0037デフォルトの名無しさん
NGNG0038デフォルトの名無しさん
NGNG0039デフォルトの名無しさん
NGNGmain()
{
while(1) printf("逝ってよし!\n");
}
/* 誰か実行結果を… */
0040デフォルトの名無しさん
NGNG逝ってよし!
逝ってよし!
逝ってよし!
逝ってよし!
逝ってよし!
逝ってよし!
(以下略)
0041デフォルトの名無しさん
NGNG好き♪
0042デフォルトの名無しさん
NGNG0043デフォルトの名無しさん
NGNG# 記念カキコ
# もう何がなんだかわからん…
0045デフォルトの名無しさん
NGNGなーつかすぃ〜。
0046デフォルトの名無しさん
NGNG-------風俗の総合商社・MTTどこでも-------
〇デリバリーヘルス〇デートクラブ〇女性専用ホストクラブ〇
〇ハードSM奴隷クラブ〇レズビアン倶楽部〇ホモ・オカマ倶楽部
〇変態痴女と遊ぶ会〇痴漢・覗き趣味の会〇変態同好会・各種!
●楽しく遊べます! 090-8002-8356番
-----------美男・美女会員など多数在籍中-----------
http://www.mttdocomo.jp/
-----女性アルバイト随時募集・高収入(日払い)月100万円可能-----
-----レズビアン・スタッフ●ホモスタッフ●女性専用ホストスタッフ同募-----
http://www.mttdocomo.jp/
------------------------------------------------
0047デフォルトの名無しさん
NGNG今日は、はじめて1に殺意を抱きました。そして、1はぜんぜんおもしろくなかったです。それから、ぼくはカブト虫を取りに行きました。でも1ぴきもとれなかったです。おわり。
0048デフォルトの名無しさん
NGNG0049デフォルトの名無しさん
NGNGまたまたお前か。
0050デフォルトの名無しさん
NGNGA
(゚o゚)<ハッハッハ
(ー)ー
))
0051デフォルトの名無しさん
NGNG| | >>1さんハァハァ
| |
∧_∧ | | / ̄ ̄ ̄ ̄ ̄ ̄ ̄
/ ̄\ ´Д`)// < タイガーアパカ
.r ┤ ト、 / \_______
|. \_/ ヽ /
| __( ̄ | |
| __)_ノ ̄ ̄ ̄ ̄\
ヽ___) ノ \
||\|| ̄ ̄ ̄ ̄ ̄ ̄ ̄|| ̄
|| || ̄ ̄ ̄ ̄ ̄ ̄ ̄||
.|| ||
0052ハトむぎ茶
NGNG0053.
NGNG■ このスレッドは過去ログ倉庫に格納されています