1 #ifndef Q8TK_H_INCLUDED 2 #define Q8TK_H_INCLUDED 3 4 #include "quasi88.h" 5 #include "keyboard.h" 6 7 /*-------------------------------------------------------------- 8 * ��˥塼ɽ���Ѥβ��� 9 *--------------------------------------------------------------*/ 10 11 #define Q8GR_SCREEN_X (80) 12 #define Q8GR_SCREEN_Y (25) 13 14 15 enum { /* ��¤�� T_Q8GR_SCREEN �Υ��� font_type ���� */ 16 FONT_UNUSED = 0, 17 FONT_1_BYTE, 18 FONT_ANK = FONT_1_BYTE, /* ASCII (Alphabet, Number, Kana etc) */ 19 FONT_QUART, /* 1/4��ʸ�� (ANK) */ 20 FONT_HALF, /* Ⱦ��ʸ�� (�ѿ������Ҳ�̾��ʿ��̾) */ 21 FONT_LOGO, /* ��˥塼�ѥ� */ 22 FONT_2_BYTE, 23 FONT_KNJ1L = FONT_2_BYTE, /* ���� ����� (��Ⱦʬ) */ 24 FONT_KNJ1R, /* ���� ����� (��Ⱦʬ) */ 25 FONT_KNJ2L, /* ���� ������ (��Ⱦʬ) */ 26 FONT_KNJ2R, /* ���� ������ (��Ⱦʬ) */ 27 FONT_KNJXL, /* ���� ���ߡ� (��Ⱦʬ) */ 28 FONT_KNJXR, /* ���� ���ߡ� (��Ⱦʬ) */ 29 30 /* �����16����(4bit)�ޤdz�ĥ��ǽ */ 31 }; 32 33 34 typedef struct { 35 Uint background: 4; /* �طʥѥ�åȥ����� (0��15) */ 36 Uint foreground: 4; /* ɽ���ѥ�åȥ����� (0��15) */ 37 Uint rsv: 1; 38 Uint mouse: 1; /* �ޥ����ݥ��� �ʤ�=0 ����=1 */ 39 Uint reverse: 1; /* ȿžɽ�� �̾�=0 ȿž=1 */ 40 Uint underline: 1; /* ��������饤�� �ʤ�=0 ����=1 */ 41 Uint font_type: 4; /* �ե���ȥ����� (������) */ 42 Uint addr: 16; /* ����ROM ���ɥ쥹 */ 43 } T_Q8GR_SCREEN; /* ��32bit == unsigned int �ȷ��Ĥ� (;_;) */ 44 45 46 extern int menu_screen_current; 47 extern T_Q8GR_SCREEN menu_screen[2][ Q8GR_SCREEN_Y ][ Q8GR_SCREEN_X ]; 48 49 50 /*-------------------------------------------------------------- 51 * ��˥塼�ˤ�ɽ�����륿���ȥ�� (�ǡ����ϡ�8x16�ɥå�ñ��) 52 *--------------------------------------------------------------*/ 53 54 #define Q8GR_LOGO_W (24) 55 #define Q8GR_LOGO_H (3) 56 57 extern byte q8gr_logo[ Q8GR_LOGO_W * Q8GR_LOGO_H * 16 ]; 58 59 60 /*-------------------------------------------------------------- 61 * ��˥塼���̤Υѥ�åȥ����� 62 *--------------------------------------------------------------*/ 63 64 #define Q8GR_PALETTE_FOREGROUND (0) 65 #define Q8GR_PALETTE_BACKGROUND (1) 66 #define Q8GR_PALETTE_LIGHT (2) 67 #define Q8GR_PALETTE_SHADOW (3) 68 #define Q8GR_PALETTE_FONT_FG (4) 69 #define Q8GR_PALETTE_FONT_BG (5) 70 #define Q8GR_PALETTE_LOGO_FG (6) 71 #define Q8GR_PALETTE_LOGO_BG (7) 72 #define Q8GR_PALETTE_BLACK (8) 73 #define Q8GR_PALETTE_SCALE_SLD (9) 74 #define Q8GR_PALETTE_SCALE_BAR (10) 75 #define Q8GR_PALETTE_SCALE_ACT (11) 76 #define Q8GR_PALETTE_RED (12) 77 #define Q8GR_PALETTE_GREEN (13) 78 #define Q8GR_PALETTE_BLUE (14) 79 #define Q8GR_PALETTE_WHITE (15) 80 81 82 /*-------------------------------------------------------------- 83 * ��˥塼�ǻ��Ѥ��륭�������� (Q8TK ���Ѥ��ü쥭��) 84 *--------------------------------------------------------------*/ 85 86 #define Q8TK_KEY_BS KEY88_BS 87 #define Q8TK_KEY_DEL KEY88_DEL 88 #define Q8TK_KEY_TAB KEY88_TAB 89 #define Q8TK_KEY_RET KEY88_RETURN 90 #define Q8TK_KEY_ESC KEY88_ESC 91 #define Q8TK_KEY_RIGHT KEY88_RIGHT 92 #define Q8TK_KEY_LEFT KEY88_LEFT 93 #define Q8TK_KEY_UP KEY88_UP 94 #define Q8TK_KEY_DOWN KEY88_DOWN 95 #define Q8TK_KEY_PAGE_UP KEY88_ROLLDOWN 96 #define Q8TK_KEY_PAGE_DOWN KEY88_ROLLUP 97 #define Q8TK_KEY_SPACE KEY88_SPACE 98 #define Q8TK_KEY_SHIFT KEY88_SHIFT 99 #define Q8TK_KEY_HOME KEY88_HOME 100 #define Q8TK_KEY_END KEY88_HELP 101 102 #define Q8TK_KEY_F1 KEY88_F1 103 #define Q8TK_KEY_F2 KEY88_F2 104 #define Q8TK_KEY_F3 KEY88_F3 105 #define Q8TK_KEY_F4 KEY88_F4 106 #define Q8TK_KEY_F5 KEY88_F5 107 #define Q8TK_KEY_F6 KEY88_F6 108 #define Q8TK_KEY_F7 KEY88_F7 109 #define Q8TK_KEY_F8 KEY88_F8 110 #define Q8TK_KEY_F9 KEY88_F9 111 #define Q8TK_KEY_F10 KEY88_F10 112 #define Q8TK_KEY_F11 KEY88_F11 113 #define Q8TK_KEY_F12 KEY88_F12 114 115 116 #define Q8TK_BUTTON_L KEY88_MOUSE_L 117 #define Q8TK_BUTTON_R KEY88_MOUSE_R 118 #define Q8TK_BUTTON_U KEY88_MOUSE_WUP 119 #define Q8TK_BUTTON_D KEY88_MOUSE_WDN 120 121 #define Q8TK_BUTTON_OFF (0) 122 #define Q8TK_BUTTON_ON (1) 123 124 125 /*-------------------------------------------------------------- 126 * �������åȤι�¤�� 127 *--------------------------------------------------------------*/ 128 129 /*-------------------------------------- 130 * �����㥹�ȥ��� 131 *--------------------------------------*/ 132 133 typedef struct _Q8Adjust Q8Adjust; 134 struct _Q8Adjust { 135 int value; /* ������ */ 136 int lower; /* �Ǿ��� */ 137 int upper; /* ������ */ 138 int step_increment; /* ��ʬ(��) */ 139 int page_increment; /* (��) */ 140 int max_length; /* �С�������(�����)��0�Ǽ�ư */ 141 int x, y; /* ɽ���� : ��ɸ */ 142 int length; /* : �������륵���� */ 143 int pos; /* : ���饤�������� */ 144 int horizontal; /* : TRUE�ǿ�ʿ���� */ 145 int arrow; /* : TRUE��������� */ 146 float scale; /* : ɽ����Ψ */ 147 148 int listbox_changed;/* LISTBOX���ѹ����㳰���� */ 149 }; 150 151 /*-------------------------------------- 152 * �������åȶ��� 153 *--------------------------------------*/ 154 155 typedef struct _Q8tkWidget Q8tkWidget; 156 typedef struct _Q8List Q8List; 157 158 typedef void (*Q8tkSignalFunc) (); 159 160 struct _Q8tkWidget { 161 162 int type; /* �������åȤμ��� Q8TK_TYPE_ */ 163 int attr; /* ����ƥ�°�� Q8TK_ATTR_ */ 164 int visible; /* ɽ����̵ͭ */ 165 int sensitive; /* ͭ����̵�� */ 166 167 int placement_x; /* ɽ������(ŷ�Ϻ�����) Q8TK_PLACEMENT_ */ 168 int placement_y; 169 170 int x, y, sx, sy; /* ɽ����ɸ��ɽ�������� */ 171 172 Q8tkWidget *parent; /* �������å�Ϣ�빽¤ */ 173 Q8tkWidget *child; /* (ɽ���λ��ˤ��Υ�ɤ�) */ 174 Q8tkWidget *prev; 175 Q8tkWidget *next; 176 177 char key_up_used; /* �������륭����ư� */ 178 char key_down_used; /* ͽ��Ƥ����硢�� */ 179 char key_left_used; 180 char key_right_used; 181 182 char *name; /* malloc���줿�ΰ�Τإݥ��� */ 183 /* ����٥��ʸ���� */ 184 /* ���ե졼���ʸ���� */ 185 /* ���Ρ��ȥڡ�����ʸ���� */ 186 /* ������ȥ��ʸ���� */ 187 /* ���ꥹ�ȥ����ƥ�ξ���(ʸ����) */ 188 189 int code; /* name ��ʸ�������� */ 190 191 int with_label; /* XXX_new_with_label() �ˤ� */ 192 /* ��٥��ư����������硢�� */ 193 194 195 union { /* �������å��̥�� */ 196 197 struct { /* ---- ������ɥ� ---- */ 198 int no_frame; 199 int shadow_type; 200 int set_position; 201 int x, y; 202 int type; 203 Q8tkWidget *work; 204 Q8tkWidget *accel; 205 } window; 206 207 struct { /* ---- �ե졼�� ---- */ 208 int shadow_type; 209 } frame; 210 211 struct { /* ---- ��٥� ---- */ 212 int foreground; 213 int background; 214 int reverse; 215 } label; 216 217 struct { /* ---- �Ƽ�ܥ��� ---- */ 218 int active; 219 Q8List *list; 220 } button; 221 222 struct { /* ---- �Ρ��ȥ֥å� ---- */ 223 Q8tkWidget *page; /* ����������� PAGE */ 224 struct notebook_draw { /* ������Υ�� */ 225 int drawing; 226 int x, y; 227 int x0, x1; 228 int selected; 229 } draw; 230 int lost_focus; 231 } notebook; 232 233 struct { /* ---- ����� ---- */ 234 Q8tkWidget *entry; /* �۲��ˤ��륨��ȥ� */ 235 Q8List *list; /* LIST ITEM �Υꥹ�� */ 236 int nr_items; /* LIST ITEM �ο� */ 237 int length; /* LIST ITEM ����ʸ��Ĺ */ 238 int width; /* ɽ���Х��ȿ� */ 239 Q8tkWidget *popup_window; /* POPUP�Υ�����ɥ� */ 240 Q8tkWidget *popup_scrolled_window; /* POPUP�� �� */ 241 Q8tkWidget *popup_list; /* POPUP�Υꥹ�� */ 242 Q8tkWidget *popup_accel_group; /* POPUP��ESC���� */ 243 Q8tkWidget *popup_fake; /* POPUP�Υ��ߡ����� */ 244 } combo; 245 246 struct { /* ---- �ꥹ�ȥܥå��� ---- */ 247 Q8tkWidget *selected; 248 Q8tkWidget *active; 249 int width; 250 int scrollin_top; 251 int scrollin_left; 252 } listbox; /* SELECTION TYPE �� BROWSE �Τ� */ 253 254 Q8Adjust adj; /* ---- �����㥹�ȥ��� ---- */ 255 256 struct { /* ---- �������� ---- */ 257 Q8tkWidget *adj; 258 int draw_value; 259 int value_pos; 260 } scale; 261 262 struct { /* ---- ��������ɥ�����ɥ� ---- */ 263 Q8tkWidget *hadj; 264 Q8tkWidget *vadj; 265 int hpolicy; 266 int vpolicy; 267 int width; 268 int height; 269 int hscrollbar; 270 int vscrollbar; 271 int child_x0, child_y0; 272 int child_sx, child_sy; 273 int vadj_value; 274 } scrolled; 275 276 struct { /* ---- ����ȥ ---- */ 277 int max_length; /* ���ϲ�ǽ��� 0��̵�� */ 278 int malloc_length; /* malloc���������� */ 279 int cursor_pos; /* ��������Х��Ȱ��� */ 280 int disp_pos; /* ɽ�����ϥХ��Ȱ��� */ 281 int width; /* ɽ�����륵���� */ 282 int editable; /* ����ȥ��Խ����� */ 283 Q8tkWidget *combo; /* ��̤Υ���ܥܥå��� */ 284 } entry; 285 286 struct { /* ---- ��������졼�������� ---- */ 287 Q8tkWidget *widget; 288 int key; 289 } accel; 290 291 struct { /* ---- �������� ---- */ 292 Q8tkWidget *vbox; 293 Q8tkWidget *action_area; 294 } dialog; 295 296 struct { /* ---- �ե����륻�쥯����� ---- */ 297 Q8tkWidget *file_list; 298 Q8tkWidget *selection_entry; 299 Q8tkWidget *ro_button; 300 Q8tkWidget *ok_button; 301 Q8tkWidget *cancel_button; 302 Q8tkWidget *view_button; 303 Q8tkWidget *dir_name; 304 Q8tkWidget *nr_files; 305 Q8tkWidget *scrolled_window; 306 int selection_changed; 307 char *pathname; 308 char *filename; 309 int width; 310 } fselect; 311 312 struct { /* --- ����¾������ --- */ 313 int data[4]; 314 } any; 315 316 } stat; 317 318 /* ���٥�Ƚ����ؿ� */ 319 320 void (*event_button_on)(Q8tkWidget *); 321 void (*event_key_on) (Q8tkWidget *, int); 322 void (*event_dragging) (Q8tkWidget *); 323 void (*event_drag_off) (Q8tkWidget *); 324 325 /* ���٥�Ƚ����桼���ؿ� */ 326 327 void (*user_event_0)(Q8tkWidget *, void *); 328 void *user_event_0_parm; 329 void (*user_event_1)(Q8tkWidget *, void *); 330 void *user_event_1_parm; 331 332 }; 333 334 enum { /* (Q8tkWidget*)->type */ 335 Q8TK_TYPE_WINDOW, /* ������ɥ� */ 336 Q8TK_TYPE_BUTTON, /* �ܥ��� */ 337 Q8TK_TYPE_TOGGLE_BUTTON, /* �ȥ���ܥ��� */ 338 Q8TK_TYPE_CHECK_BUTTON, /* �����å��ܥ��� */ 339 Q8TK_TYPE_RADIO_BUTTON, /* �饸���ܥ��� */ 340 Q8TK_TYPE_FRAME, /* �ե졼�� */ 341 Q8TK_TYPE_LABEL, /* ��٥� */ 342 Q8TK_TYPE_LOGO, /* �� */ 343 Q8TK_TYPE_NOTEBOOK, /* �Ρ��ȥ֥å� */ 344 Q8TK_TYPE_NOTEPAGE, /* �Ρ��ȥ֥å��Υڡ��� */ 345 Q8TK_TYPE_VBOX, /* �ĥܥå��� */ 346 Q8TK_TYPE_HBOX, /* ���ܥå��� */ 347 Q8TK_TYPE_VSEPARATOR, /* �Ķ��ڤ��� */ 348 Q8TK_TYPE_HSEPARATOR, /* �����ڤ��� */ 349 Q8TK_TYPE_COMBO, /* ����ܥܥå��� */ 350 Q8TK_TYPE_LISTBOX, /* �ꥹ�� */ 351 Q8TK_TYPE_LIST_ITEM, /* �ꥹ�ȥ����ƥ� */ 352 Q8TK_TYPE_ADJUSTMENT, /* �����㥹�ȥ��� */ 353 Q8TK_TYPE_HSCALE, /* ���������� */ 354 Q8TK_TYPE_VSCALE, /* �ĥ������� */ 355 Q8TK_TYPE_SCROLLED_WINDOW, /* �������륦����ɥ� */ 356 Q8TK_TYPE_ENTRY, /* ����ȥ */ 357 358 Q8TK_TYPE_ACCEL_GROUP, /* ��������졼������ */ 359 Q8TK_TYPE_ACCEL_KEY, /* �� */ 360 361 Q8TK_TYPE_DIALOG, /* �������� */ 362 Q8TK_TYPE_FILE_SELECTION, /* �ե����륻�쥯����� */ 363 364 Q8TK_TYPE_END 365 }; 366 enum { /* (Q8tkWidget*)->attr */ 367 Q8TK_ATTR_CONTAINER = (1<<0), /* ����ƥ� */ 368 Q8TK_ATTR_LABEL_CONTAINER = (1<<1), /* ����ƥ�(LABEL����) */ 369 Q8TK_ATTR_MENU_CONTAINER = (1<<2), /* ����ƥ�(MENU����) */ 370 Q8TK_ATTR_END 371 }; 372 enum { /* (Q8tkWidget*)->placement_x */ 373 Q8TK_PLACEMENT_X_LEFT, 374 Q8TK_PLACEMENT_X_CENTER, 375 Q8TK_PLACEMENT_X_RIGHT, 376 Q8TK_PLACEMENT_X_END 377 }; 378 enum { /* (Q8tkWidget*)->placement_y */ 379 Q8TK_PLACEMENT_Y_TOP, 380 Q8TK_PLACEMENT_Y_CENTER, 381 Q8TK_PLACEMENT_Y_BOTTOM, 382 Q8TK_PLACEMENT_Y_END 383 }; 384 385 386 enum { /* window_new() �ΰ��� */ 387 Q8TK_WINDOW_TOPLEVEL, /* �ȥåפΥ�����ɥ� */ 388 Q8TK_WINDOW_DIALOG, 389 Q8TK_WINDOW_POPUP, 390 Q8TK_WINDOW_END 391 }; 392 enum { /* �ե졼��Υ����� */ 393 Q8TK_SHADOW_NONE, 394 Q8TK_SHADOW_IN, 395 Q8TK_SHADOW_OUT, 396 Q8TK_SHADOW_ETCHED_IN, 397 Q8TK_SHADOW_ETCHED_OUT, 398 Q8TK_SHADOW_END 399 }; 400 enum { /* �������륦����ɥ���°�� */ 401 Q8TK_POLICY_ALWAYS, 402 Q8TK_POLICY_AUTOMATIC, 403 Q8TK_POLICY_NEVER, 404 Q8TK_POLICY_END 405 }; 406 407 408 enum { /* ���Ѱ��ֻ��� */ 409 Q8TK_POS_LEFT, 410 Q8TK_POS_RIGHT, 411 Q8TK_POS_TOP, 412 Q8TK_POS_BOTTOM, 413 Q8TK_POS_END 414 }; 415 416 417 enum { /* ɽ����ǽ�ʴ��������� */ 418 Q8TK_KANJI_ANK, 419 Q8TK_KANJI_EUC, 420 Q8TK_KANJI_SJIS, 421 Q8TK_KANJI_UTF8, 422 Q8TK_KANJI_END 423 }; 424 425 426 /*-------------------------------------------------------------- 427 * �ꥹ�ȹ�¤ 428 *--------------------------------------------------------------*/ 429 struct _Q8List { 430 void *data; 431 Q8List *prev; 432 Q8List *next; 433 }; 434 435 Q8List *q8_list_append(Q8List *list, void *data); 436 Q8List *q8_list_insert(Q8List *list, void *data, int position); 437 Q8List *q8_list_remove(Q8List *list, void *data); 438 void q8_list_free(Q8List *list); 439 Q8List *q8_list_first(Q8List *list); 440 Q8List *q8_list_last(Q8List *list); 441 Q8List *q8_list_find(Q8List *list, void *data); 442 443 444 445 /*-------------------------------------------------------------- 446 * API�ʤ� 447 *--------------------------------------------------------------*/ 448 449 #define Q8TKMAX(a, b) ((a)>(b)?(a):(b)) 450 451 452 int q8tk_set_kanjicode(int code); 453 void q8tk_set_cursor(int enable); 454 455 void q8tk_init(void); 456 int q8tk_main_loop(void); 457 void q8tk_main_quit(void); 458 459 460 461 void q8tk_grab_add(Q8tkWidget *widget); 462 void q8tk_grab_remove(Q8tkWidget *widget); 463 464 Q8tkWidget *q8tk_window_new(int window_type); 465 466 467 /* TOGGLE/CHECK/RADIO BUTTON �� active ��ˤϡ�ɬ�����Υޥ�����̤� */ 468 /* ��� */ 469 /* Q8tkWidget *toggle = q8tk_tobble_button_new(); */ 470 /* if (Q8TK_TOBBLE_BUTTON(toggle)->active) { */ 471 /* : */ 472 /* : */ 473 /* } */ 474 475 #define Q8TK_TOGGLE_BUTTON(w) (&((w)->stat.button)) 476 477 Q8tkWidget *q8tk_button_new(void); 478 Q8tkWidget *q8tk_button_new_with_label(const char *label); 479 480 Q8tkWidget *q8tk_toggle_button_new(void); 481 Q8tkWidget *q8tk_toggle_button_new_with_label(const char *label); 482 void q8tk_toggle_button_set_state(Q8tkWidget *widget, int status); 483 484 Q8tkWidget *q8tk_check_button_new(void); 485 Q8tkWidget *q8tk_check_button_new_with_label(const char *label); 486 487 Q8tkWidget *q8tk_radio_button_new(Q8tkWidget *group); 488 Q8tkWidget *q8tk_radio_button_new_with_label(Q8tkWidget *group, 489 const char *label); 490 Q8List *q8tk_radio_button_get_list(Q8tkWidget *group); 491 492 Q8tkWidget *q8tk_combo_new(void); 493 void q8tk_combo_append_popdown_strings(Q8tkWidget *combo, 494 const char *entry_str, 495 const char *disp_str); 496 const char *q8tk_combo_get_text(Q8tkWidget *combo); 497 void q8tk_combo_set_text(Q8tkWidget *combo, const char *text); 498 void q8tk_combo_set_editable(Q8tkWidget *combo, int editable); 499 500 Q8tkWidget *q8tk_listbox_new(void); 501 void q8tk_listbox_clear_items(Q8tkWidget *wlist, 502 int start, int end); 503 void q8tk_listbox_select_item(Q8tkWidget *wlist, int item); 504 void q8tk_listbox_select_child(Q8tkWidget *wlist, 505 Q8tkWidget *child); 506 void q8tk_listbox_set_placement(Q8tkWidget *widget, 507 int top_pos, int left_pos); 508 509 Q8tkWidget *q8tk_list_item_new(void); 510 Q8tkWidget *q8tk_list_item_new_with_label(const char *label); 511 void q8tk_list_item_set_string(Q8tkWidget *w, const char *str); 512 513 Q8tkWidget *q8tk_label_new(const char *label); 514 void q8tk_label_set(Q8tkWidget *w, const char *label); 515 void q8tk_label_set_reverse(Q8tkWidget *w, int reverse); 516 void q8tk_label_set_color(Q8tkWidget *w, int foreground); 517 518 Q8tkWidget *q8tk_logo_new(void); 519 520 Q8tkWidget *q8tk_frame_new(const char *label); 521 void q8tk_frame_set_shadow_type(Q8tkWidget *frame, int shadow_type); 522 523 Q8tkWidget *q8tk_hbox_new(void); 524 525 Q8tkWidget *q8tk_vbox_new(void); 526 527 Q8tkWidget *q8tk_notebook_new(void); 528 void q8tk_notebook_append(Q8tkWidget *notebook, 529 Q8tkWidget *widget, const char *label); 530 int q8tk_notebook_current_page(Q8tkWidget *notebook); 531 void q8tk_notebook_set_page(Q8tkWidget *notebook, int page_num); 532 void q8tk_notebook_next_page(Q8tkWidget *notebook); 533 void q8tk_notebook_prev_page(Q8tkWidget *notebook); 534 void q8tk_notebook_hook_focus_lost(Q8tkWidget *notebook, 535 int focus_lost); 536 537 Q8tkWidget *q8tk_vseparator_new(void); 538 539 Q8tkWidget *q8tk_hseparator_new(void); 540 541 542 /* ADJUSTMENT �� value �ʤɤ�ˤϡ�ɬ�����Υޥ�����̤� */ 543 /* ��� */ 544 /* Q8tkWidget *adj = q8tk_adjustment_new(); */ 545 /* val = Q8TK_ADJUSTMENT(adj)->value; */ 546 547 #define Q8TK_ADJUSTMENT(w) (&((w)->stat.adj)) 548 Q8tkWidget *q8tk_adjustment_new(int value, int lower, int upper, 549 int step_increment, int page_increment); 550 void q8tk_adjustment_clamp_page(Q8tkWidget *adj, 551 int lower, int upper); 552 void q8tk_adjustment_set_value(Q8tkWidget *adj, int value); 553 void q8tk_adjustment_set_arrow(Q8tkWidget *adj, int arrow); 554 void q8tk_adjustment_set_length(Q8tkWidget *adj, int length); 555 void q8tk_adjustment_set_increment(Q8tkWidget *adj, 556 int step_increment, 557 int page_increment); 558 559 Q8tkWidget *q8tk_hscale_new(Q8tkWidget *adjustment); 560 Q8tkWidget *q8tk_vscale_new(Q8tkWidget *adjustment); 561 void q8tk_scale_set_value_pos(Q8tkWidget *scale, int pos); 562 void q8tk_scale_set_draw_value(Q8tkWidget *scale, int draw_value); 563 564 Q8tkWidget *q8tk_scrolled_window_new(Q8tkWidget *hadjustment, 565 Q8tkWidget *vadjustment); 566 void q8tk_scrolled_window_set_policy(Q8tkWidget *scrolledw, 567 int hscrollbar_policy, 568 int vscrollbar_policy); 569 570 Q8tkWidget *q8tk_entry_new(void); 571 Q8tkWidget *q8tk_entry_new_with_max_length(int max); 572 const char *q8tk_entry_get_text(Q8tkWidget *entry); 573 void q8tk_entry_set_text(Q8tkWidget *entry, const char *text); 574 void q8tk_entry_set_position(Q8tkWidget *entry, int position); 575 void q8tk_entry_set_max_length(Q8tkWidget *entry, int max); 576 void q8tk_entry_set_editable(Q8tkWidget *entry, int editable); 577 578 Q8tkWidget *q8tk_accel_group_new(void); 579 void q8tk_accel_group_attach(Q8tkWidget *accel_group, 580 Q8tkWidget *window); 581 void q8tk_accel_group_detach(Q8tkWidget *accel_group, 582 Q8tkWidget *window); 583 void q8tk_accel_group_add(Q8tkWidget *accel_group, int accel_key, 584 Q8tkWidget *widget, const char *signal); 585 586 587 /* DIALOG �� vhox, action_area ��ˤϡ�ɬ�����Υޥ�����̤� */ 588 /* ��� */ 589 /* Q8tkWidget *dialog = q8tk_dialog_new(); */ 590 /* q8tk_box_pack_start(Q8TK_DIALOGE(dialog)->vbox, button); */ 591 592 #define Q8TK_DIALOG(w) (&((w)->stat.window.work->stat.dialog)) 593 Q8tkWidget *q8tk_dialog_new(void); 594 595 596 /* FILE SELECTION �� ok_button �ʤɤ�ˤϡ�ɬ�����Υޥ�����̤� */ 597 /* ��� */ 598 /* Q8tkWidget *fselect = q8tk_file_selection_new("LOAD", FALSE); */ 599 /* q8tk_signal_connect(Q8TK_FILE_SELECTION(fselect)->ok_button, */ 600 /* func, fselect); */ 601 602 #define Q8TK_FILE_SELECTION(w) (&((w)->stat.window.work->stat.fselect)) 603 604 605 /* FILE_SELECTION �ǰ�����ѥ����ߤΥե�����̾�Х��ȿ� (NUL�ޤ�) */ 606 607 #define Q8TK_MAX_FILENAME (QUASI88_MAX_FILENAME) 608 /* #define Q8TK_MAX_FILENAME (OSD_MAX_FILENAME) */ 609 610 611 Q8tkWidget *q8tk_file_selection_new(const char *title, int select_ro); 612 const char *q8tk_file_selection_get_filename(Q8tkWidget *fselect); 613 void q8tk_file_selection_set_filename(Q8tkWidget *fselect, 614 const char *filename); 615 int q8tk_file_selection_get_readonly(Q8tkWidget *fselect); 616 617 int q8tk_utility_view(const char *filename); 618 619 620 621 622 void q8tk_misc_set_placement(Q8tkWidget *widget, 623 int placement_x, int placement_y); 624 void q8tk_misc_set_size(Q8tkWidget *widget, int width, int height); 625 626 void q8tk_misc_redraw(void); 627 628 629 void q8tk_container_add(Q8tkWidget *container, Q8tkWidget *widget); 630 void q8tk_box_pack_start(Q8tkWidget *box, Q8tkWidget *widget); 631 void q8tk_box_pack_end(Q8tkWidget *box, Q8tkWidget *widget); 632 void q8tk_container_remove(Q8tkWidget *container, Q8tkWidget *widget); 633 634 void q8tk_widget_show(Q8tkWidget *widget); 635 void q8tk_widget_hide(Q8tkWidget *widget); 636 637 void q8tk_widget_set_sensitive(Q8tkWidget *widget, int sensitive); 638 639 void q8tk_widget_destroy(Q8tkWidget *widget); 640 641 void q8tk_widget_set_focus(Q8tkWidget *widget); 642 643 644 /* �� �֤��ͤϡ�̵�� (ɬ�� 0) */ 645 int q8tk_signal_connect(Q8tkWidget *widget, const char *name, 646 Q8tkSignalFunc func, void *func_data); 647 void q8tk_signal_handlers_destroy(Q8tkWidget *widget); 648 649 650 651 652 653 #endif /* Q8TK_H_INCLUDED */ 654