1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
|
/*
* $Id$
*/
#ifndef __X_SCROLLBAR_H__
#define __X_SCROLLBAR_H__
#include <kiklib/kik_types.h> /* u_int */
#include <ml_term.h>
#include "x_window.h"
#include "x_sb_view.h"
#include "x_sb_mode.h"
#include "x_color_manager.h"
#include "x_picture.h"
typedef struct x_scrollbar_event_listener
{
void * self ;
int (*screen_scroll_to)( void * , int) ;
int (*screen_scroll_upward)( void * , u_int) ;
int (*screen_scroll_downward)( void * , u_int) ;
int (*screen_is_static)( void *) ;
} x_scrollbar_event_listener_t ;
typedef struct x_scrollbar
{
x_window_t window ;
char * view_name ;
x_sb_view_t * view ;
char * fg_color ;
char * bg_color ;
x_color_t fg_xcolor ;
x_color_t bg_xcolor ;
x_scrollbar_event_listener_t * sb_listener ;
u_int bar_height ; /* Scrollbar height */
u_int top_margin ; /* Button area */
u_int bottom_margin ; /* Button area */
u_int line_height ;
u_int num_of_scr_lines ;
u_int num_of_log_lines ;
u_int num_of_filled_log_lines ;
int bar_top_y ; /* Scrollbar position without button area */
int y_on_bar ; /* Used in button_motion event handler */
int current_row ;
int redraw_y ;
u_int redraw_height ;
int up_button_y ;
u_int up_button_height ;
int down_button_y ;
u_int down_button_height ;
int8_t is_pressing_up_button ;
int8_t is_pressing_down_button ;
int8_t is_motion ;
} x_scrollbar_t ;
int x_scrollbar_init( x_scrollbar_t * sb , x_scrollbar_event_listener_t * sb_listener ,
char * view_name , char * fg_color , char * bg_color ,
u_int height , u_int line_height , u_int num_of_log_lines ,
u_int num_of_filled_log_lines , int use_transbg , x_picture_modifier_t * pic_mod) ;
int x_scrollbar_final( x_scrollbar_t * sb) ;
int x_scrollbar_set_num_of_log_lines( x_scrollbar_t * sb , u_int num_of_log_lines) ;
int x_scrollbar_set_num_of_filled_log_lines( x_scrollbar_t * sb , u_int num_of_filled_log_lines) ;
int x_scrollbar_line_is_added( x_scrollbar_t * sb) ;
int x_scrollbar_reset( x_scrollbar_t * sb) ;
int x_scrollbar_move_upward( x_scrollbar_t * sb , u_int size) ;
int x_scrollbar_move_downward( x_scrollbar_t * sb , u_int size) ;
int x_scrollbar_move( x_scrollbar_t * sb , int row) ;
int x_scrollbar_set_line_height( x_scrollbar_t * sb , u_int line_height) ;
int x_scrollbar_set_fg_color( x_scrollbar_t * sb , char * fg_color) ;
int x_scrollbar_set_bg_color( x_scrollbar_t * sb , char * bg_color) ;
int x_scrollbar_change_view( x_scrollbar_t * sb , char * name) ;
int x_scrollbar_set_transparent( x_scrollbar_t * sb , x_picture_modifier_t * pic_mod ,
int force) ;
int x_scrollbar_unset_transparent( x_scrollbar_t * sb) ;
#endif
|