ebabab8c26
which included commits to RCS files with non-trunk default branches. git-svn-id: svn://10.65.10.50/trunk@5762 c028cbd2-c16b-5b4b-a496-9718f37d4682
680 lines
20 KiB
C
Executable File
680 lines
20 KiB
C
Executable File
|
|
/*******************************************************************************
|
|
* Copyright 1991-1996 by ORCA Software, Inc. *
|
|
* *
|
|
* All rights reserved. May not be reproduced or distributed, in printed or *
|
|
* electronic form, without permission of ORCA Software, Inc. May not be *
|
|
* distributed as object code, separately or linked with other object modules, *
|
|
* without permission. *
|
|
*******************************************************************************/
|
|
|
|
/******************************************************************
|
|
LM module
|
|
******************************************************************/
|
|
#define LM_ATR_ENABLED XI_ATR_ENABLED
|
|
|
|
#define LM_ATR_VISIBLE XI_ATR_VISIBLE
|
|
#define LM_ATR_NAVIGATE XI_ATR_NAVIGATE
|
|
#define LM_ATR_TABWRAP XI_ATR_TABWRAP
|
|
/*-------------------------------------------------------------------------
|
|
function: lm_adj_v
|
|
lmp: current lmp
|
|
v: to vertical coord to convert
|
|
-------------------------------------------------------------------------*/
|
|
#define lm_adj_v(lmp, v) (v = v + lmp->mlr.top + lmp->rrr_offset)
|
|
|
|
typedef enum _lm_cb_type
|
|
{
|
|
LM_CB_CHAR,
|
|
LM_CB_CHANGE,
|
|
LM_CB_DBL,
|
|
LM_CB_FOCUS,
|
|
LM_CB_TEXT,
|
|
LM_CB_SELECT,
|
|
LM_CB_CELL_BTN,
|
|
LM_CB_GET_FIRST,
|
|
LM_CB_GET_NEXT,
|
|
LM_CB_GET_PREV,
|
|
LM_CB_GET_LAST,
|
|
LM_CB_GET_PERCENT,
|
|
LM_CB_REC_ALLOCATE,
|
|
LM_CB_REC_FREE,
|
|
LM_CB_ROW_SIZE,
|
|
LM_CB_COL_DELETE,
|
|
LM_CB_COL_MOVE,
|
|
LM_CB_COL_SIZE,
|
|
LM_CB_DROP_ROW
|
|
}
|
|
|
|
LM_CB_TYPE;
|
|
|
|
typedef struct _lm_cb_data
|
|
{
|
|
LM lm;
|
|
LM_CB_TYPE cb_type;
|
|
int cid;
|
|
XinWindow win;
|
|
int row;
|
|
int column;
|
|
long rec;
|
|
union
|
|
{
|
|
struct
|
|
{
|
|
long spec_rec;
|
|
long data_rec;
|
|
int percent;
|
|
unsigned long attrib;
|
|
XinColor color;
|
|
BOOLEAN refused;
|
|
int row_height;
|
|
BOOLEAN has_focus;
|
|
} rec_request;
|
|
struct
|
|
{
|
|
int new_row_height;
|
|
BOOLEAN refused;
|
|
} row_size;
|
|
struct
|
|
{
|
|
long record;
|
|
} rec_allocate;
|
|
struct
|
|
{
|
|
long record;
|
|
} rec_free;
|
|
struct
|
|
{
|
|
long record;
|
|
int percent;
|
|
} get_percent;
|
|
struct
|
|
{
|
|
char *text;
|
|
int len;
|
|
int icon_rid;
|
|
XI_BITMAP* bitmap;
|
|
unsigned long attrib;
|
|
XinColor color;
|
|
XinColor back_color;
|
|
XinFont *font;
|
|
BOOLEAN button;
|
|
BOOLEAN button_on_left;
|
|
BOOLEAN button_on_focus;
|
|
BOOLEAN button_full_cell;
|
|
int button_icon_rid;
|
|
XI_BITMAP* button_bitmap;
|
|
void *font_id;
|
|
} text;
|
|
BOOLEAN refused;
|
|
struct
|
|
{
|
|
int ch;
|
|
BOOLEAN shift;
|
|
BOOLEAN control;
|
|
BOOLEAN alt;
|
|
BOOLEAN is_paste;
|
|
BOOLEAN refused;
|
|
} chr;
|
|
struct
|
|
{
|
|
BOOLEAN dbl_click;
|
|
BOOLEAN selected;
|
|
BOOLEAN refused;
|
|
BOOLEAN shift;
|
|
BOOLEAN control;
|
|
int column;
|
|
} select;
|
|
struct
|
|
{
|
|
BOOLEAN shift;
|
|
BOOLEAN control;
|
|
} cell_btn;
|
|
struct
|
|
{
|
|
int new_col_nbr;
|
|
BOOLEAN in_fixed;
|
|
int new_col_width;
|
|
int new_col_pixel_width;
|
|
BOOLEAN refused;
|
|
} column;
|
|
struct
|
|
{
|
|
XI_OBJ* src_list;
|
|
long src_rec;
|
|
BOOLEAN after_all_rows;
|
|
BOOLEAN delete_row;
|
|
BOOLEAN shift;
|
|
BOOLEAN control;
|
|
} drop_row;
|
|
/* nothing for LM_CB_CHANGE */
|
|
} v;
|
|
} LM_CB_DATA;
|
|
|
|
typedef void ( *LM_CB ) ( LM_CB_DATA * lm_cb_data );
|
|
|
|
#define LM_COL_ATR_ENABLED XI_ATR_ENABLED
|
|
#define LM_COL_ATR_EDITMENU XI_ATR_EDITMENU
|
|
#define LM_COL_ATR_AUTOSELECT XI_ATR_AUTOSELECT
|
|
#define LM_COL_ATR_AUTOSCROLL XI_ATR_AUTOSCROLL
|
|
#define LM_COL_ATR_RJUST XI_ATR_RJUST
|
|
#define LM_COL_ATR_READONLY XI_ATR_READONLY
|
|
#define LM_COL_ATR_PASSWORD XI_ATR_PASSWORD
|
|
#define LM_COL_ATR_SELECTED XI_ATR_SELECTED
|
|
#define LM_COL_ATR_SELECTABLE XI_ATR_SELECTABLE
|
|
#define LM_COL_ATR_COL_SELECTABLE XI_ATR_COL_SELECTABLE
|
|
#define LM_COL_ATR_VISIBLE XI_ATR_VISIBLE
|
|
|
|
#define LM_ROW_ATR_ENABLED XI_ATR_ENABLED
|
|
#define LM_ROW_ATR_SELECTED XI_ATR_SELECTED
|
|
|
|
#define LM_CELL_ATR_SELECTED XI_ATR_SELECTED
|
|
#define LM_CELL_ATR_RJUST XI_ATR_RJUST
|
|
#define LM_CELL_ATR_HCENTER XI_ATR_HCENTER
|
|
|
|
typedef struct _lm_column_data
|
|
{
|
|
unsigned long attrib;
|
|
short pix_width;
|
|
short x_pix_pos;
|
|
short text_size;
|
|
char *heading_text;
|
|
short width;
|
|
BOOLEAN center_heading;
|
|
BOOLEAN heading_well;
|
|
BOOLEAN heading_platform;
|
|
BOOLEAN column_well;
|
|
BOOLEAN column_platform;
|
|
XinFont *font;
|
|
int icon_rid;
|
|
short icon_x;
|
|
short icon_y;
|
|
XI_BITMAP* bitmap;
|
|
BOOLEAN size_rows;
|
|
BOOLEAN suppress_update_heading;
|
|
BOOLEAN suppress_update_cells;
|
|
BOOLEAN vertical_align_center;
|
|
BOOLEAN vertical_align_bottom;
|
|
BOOLEAN wrap_text;
|
|
BOOLEAN wrap_text_scrollbar;
|
|
BOOLEAN cr_ok;
|
|
BOOLEAN var_len_text;
|
|
BOOLEAN auto_tab;
|
|
XI_ICON_MODE_TYPE icon_mode;
|
|
BOOLEAN pushed;
|
|
|
|
/* temporary variables - don't assume this is good */
|
|
XinRect column_rct; /* used for caching column rectangles to speed
|
|
* drawing */
|
|
XinRect prct; /* physical rect */
|
|
BOOLEAN XinWindowPaintNeeds;
|
|
} LM_COLUMN_DATA;
|
|
|
|
typedef struct _lm_column_def
|
|
{
|
|
unsigned long attrib;
|
|
short position;
|
|
short pix_width; /* pixels */
|
|
short text_size;
|
|
char *heading_text;
|
|
BOOLEAN center_heading;
|
|
BOOLEAN heading_well;
|
|
BOOLEAN heading_platform;
|
|
BOOLEAN column_well;
|
|
BOOLEAN column_platform;
|
|
XinFont *font;
|
|
int icon_rid;
|
|
short icon_x;
|
|
short icon_y;
|
|
XI_BITMAP* bitmap;
|
|
BOOLEAN size_rows;
|
|
BOOLEAN suppress_update_heading;
|
|
BOOLEAN suppress_update_cells;
|
|
BOOLEAN vertical_align_center;
|
|
BOOLEAN vertical_align_bottom;
|
|
BOOLEAN wrap_text;
|
|
BOOLEAN wrap_text_scrollbar;
|
|
BOOLEAN cr_ok;
|
|
BOOLEAN var_len_text;
|
|
BOOLEAN auto_tab;
|
|
XI_ICON_MODE_TYPE icon_mode;
|
|
} LM_COLUMN_DEF;
|
|
|
|
typedef struct _lm_def
|
|
{
|
|
int cid;
|
|
XI_OBJ *list_obj;
|
|
XI_OBJ *itf_obj;
|
|
|
|
/* XI may specify this */
|
|
XinPoint pnt;
|
|
short pixel_height;
|
|
/* If absolute height is set, then the height of the list will be exactly
|
|
* height pixels high */
|
|
BOOLEAN absolute_height;
|
|
short pixel_width;
|
|
|
|
short pix_char_width;
|
|
unsigned long attrib;
|
|
LM_CB lm_cb;
|
|
XinFont *font;
|
|
BOOLEAN is_list_font; /* False, if "font" is from the interface or system */
|
|
XinColor enabled_color; /* but inactive */
|
|
XinColor back_color;
|
|
XinColor disabled_color;
|
|
XinColor disabled_back_color;
|
|
XinColor active_color;
|
|
XinColor active_back_color;
|
|
XinColor white_space_color;
|
|
XinColor rule_color;
|
|
char *parent;
|
|
BOOLEAN no_heading;
|
|
BOOLEAN one_row_list;
|
|
int nbr_rows;
|
|
int realized_rows_array_len;
|
|
BOOLEAN sizable_columns;
|
|
BOOLEAN movable_columns;
|
|
short fixed_columns;
|
|
short min_cell_height;
|
|
short min_heading_height;
|
|
BOOLEAN no_horz_lines;
|
|
BOOLEAN no_vert_lines;
|
|
int first_vis_column;
|
|
BOOLEAN drop_and_delete;
|
|
BOOLEAN select_cells;
|
|
BOOLEAN fixed_row_height;
|
|
BOOLEAN sizable_rows;
|
|
BOOLEAN get_all_records;
|
|
BOOLEAN resize_with_window;
|
|
int horz_sync_list;
|
|
int vert_sync_list;
|
|
BOOLEAN row_focus_border;
|
|
XinColor row_focus_border_color;
|
|
int max_lines_in_cell;
|
|
BOOLEAN single_select;
|
|
BOOLEAN retain_back_color_on_select;
|
|
BOOLEAN drag_and_drop_rows;
|
|
BOOLEAN drag_rows_autoscroll;
|
|
BOOLEAN button_on_cell_focus;
|
|
int position_by_typing_cid;
|
|
} LM_DEF;
|
|
|
|
#define LM_HEADING_TEXT 1001
|
|
|
|
typedef enum
|
|
{
|
|
LM_LIST,
|
|
LM_ROW,
|
|
LM_COLUMN,
|
|
LM_CELL
|
|
}
|
|
|
|
LM_PART;
|
|
|
|
typedef struct _lm_cell_data
|
|
{
|
|
unsigned long attrib;
|
|
XinFont *font;
|
|
XinColor color;
|
|
XinColor back_color;
|
|
int icon_rid;
|
|
XI_BITMAP* bitmap;
|
|
BOOLEAN button;
|
|
BOOLEAN button_on_left;
|
|
BOOLEAN button_on_focus;
|
|
BOOLEAN button_full_cell;
|
|
int button_icon_rid;
|
|
XI_BITMAP* button_bitmap;
|
|
BOOLEAN valid_data;
|
|
int font_height;
|
|
XI_TEXT *xi_text;
|
|
} LM_CELL_DATA;
|
|
|
|
typedef struct _lm_data
|
|
{
|
|
int cid;
|
|
XinWindow win;
|
|
XinRect rct;
|
|
short pix_top;
|
|
short pix_hdr_bottom;
|
|
short pix_row1_top;
|
|
short pix_char_width;
|
|
short pix_cell_height;
|
|
short pix_row_spacing;
|
|
unsigned long attrib;
|
|
short nbr_columns;
|
|
LM_COLUMN_DATA **lm_column_data;
|
|
XinColor back_color;
|
|
XinColor enabled_color; /* but inactive */
|
|
XinColor disabled_color;
|
|
XinColor disabled_back_color;
|
|
XinColor active_color;
|
|
XinColor active_back_color;
|
|
XinColor white_space_color;
|
|
XinColor rule_color;
|
|
BOOLEAN no_heading;
|
|
BOOLEAN sizable_columns;
|
|
BOOLEAN movable_columns;
|
|
short fixed_columns;
|
|
short pixel_width;
|
|
short pixel_height;
|
|
BOOLEAN moving_column;
|
|
BOOLEAN sizing_column;
|
|
int column_being_sized;
|
|
short min_cell_height;
|
|
short min_heading_height;
|
|
BOOLEAN no_horz_lines;
|
|
BOOLEAN no_vert_lines;
|
|
BOOLEAN drop_and_delete;
|
|
BOOLEAN select_cells;
|
|
BOOLEAN selecting_text;
|
|
BOOLEAN sizing_row;
|
|
BOOLEAN resize_with_window;
|
|
int row_being_sized;
|
|
int horz_sync_list;
|
|
int vert_sync_list;
|
|
BOOLEAN row_focus_border;
|
|
XinColor row_focus_border_color;
|
|
int max_lines_in_cell;
|
|
BOOLEAN single_select;
|
|
BOOLEAN retain_back_color_on_select;
|
|
BOOLEAN drag_and_drop_rows;
|
|
BOOLEAN drag_rows_autoscroll;
|
|
BOOLEAN button_on_cell_focus;
|
|
int position_by_typing_cid;
|
|
|
|
/* run time data */
|
|
LM_CB lm_cb;
|
|
XI_OBJ *list_obj;
|
|
XI_OBJ *itf_obj;
|
|
XinFont *font;
|
|
BOOLEAN is_list_font; /* False, if "font" is from the interface or system */
|
|
BOOLEAN have_mouse;
|
|
int column_being_moved;
|
|
int last_x;
|
|
int last_y;
|
|
BOOLEAN down_in_hscrolling;
|
|
BOOLEAN in_hscrolling;
|
|
BOOLEAN last_in_hscrolling;
|
|
XI_OBJ* last_itf;
|
|
int org_x;
|
|
int org_y;
|
|
int ascent;
|
|
int descent;
|
|
int leading;
|
|
BOOLEAN selecting_cells;
|
|
int down_row;
|
|
int down_column;
|
|
int cur_row;
|
|
int cur_column;
|
|
BOOLEAN down_on_disabled;
|
|
int delta_x;
|
|
int first_vis;
|
|
int last_vis;
|
|
int vir_left;
|
|
int vir_right;
|
|
BOOLEAN btn_down; /* or up */
|
|
BOOLEAN down_in_btn;
|
|
int btn_down_row;
|
|
int btn_down_col;
|
|
int update_rows_at_top;
|
|
int update_rows_at_bottom;
|
|
BOOLEAN update_cells_only;
|
|
BOOLEAN text_scrolling;
|
|
int old_row_height;
|
|
BOOLEAN horizontally_scrolling_list;
|
|
struct _lm_focus_state *focus_state;
|
|
XinFont *cur_font;
|
|
BOOLEAN have_last_rec;
|
|
long last_rec;
|
|
BOOLEAN down_in_heading;
|
|
|
|
/* vertical scrolling information */
|
|
XinRect mlr;
|
|
int mlr_height;
|
|
int rrr_offset; /* offset of mlr */
|
|
int rrr_bottom; /* total number of vertical pixels in realized
|
|
* row rect */
|
|
int nbr_rows; /* visible, specified by XI */
|
|
int realized_rows_array_len; /* also specified by XI */
|
|
int nbr_realized_rows; /* number of rows actually used in realized row
|
|
* array */
|
|
int first_fully_vis;
|
|
int last_fully_vis;
|
|
BOOLEAN fixed_row_height;
|
|
BOOLEAN sizable_rows;
|
|
BOOLEAN get_all_records;
|
|
BOOLEAN in_cell_request; /* Hold on to text for a cell, in case application wants */
|
|
int cell_request_row; /* to know what we had last. */
|
|
int cell_request_col;
|
|
char *cell_request_text;
|
|
|
|
/* the following arrays are all allocated to the length of
|
|
* realized_rows_array_len */
|
|
long *recs;
|
|
int *pix_offsets; /* pixel offsets of each row */
|
|
int *pix_heights; /* pixel heights of each row */
|
|
BOOLEAN *set_heights;
|
|
unsigned long *row_attribs;
|
|
XinColor *row_colors;
|
|
LM_CELL_DATA **cell_data;
|
|
|
|
/* Drag and Drop Rows information */
|
|
XinPoint down_pt;
|
|
BOOLEAN down_in_row;
|
|
BOOLEAN dragging_row;
|
|
long rec_being_moved;
|
|
int drag_row_height;
|
|
BOOLEAN delay_select;
|
|
int delay_row;
|
|
int delay_column;
|
|
BOOLEAN delay_dbl;
|
|
char *position_by_typing_buf;
|
|
} LM_DATA;
|
|
|
|
#define NULL_LM (LM)0
|
|
|
|
|
|
/*
|
|
Activities to test
|
|
1. Resize list
|
|
2. Resize column
|
|
3. Move columns around
|
|
4. Add columns
|
|
5. Delete columns
|
|
6. xi_cell_request
|
|
7. Tab around
|
|
8. Horizontal scroll
|
|
9. Vertical scroll
|
|
10. Drop horizontal thumb
|
|
11. Drop vertical thumb
|
|
12. Select range of cells
|
|
13. Set font on range of cells
|
|
14. Click on partially vis column
|
|
15. Size row
|
|
16. Change wrapping of text in cell
|
|
*/
|
|
|
|
typedef struct _lm_scroll_arg
|
|
{
|
|
LM lm;
|
|
int nbr_lines;
|
|
int percent;
|
|
BOOLEAN same_cell;
|
|
long rec;
|
|
BOOLEAN have_rec;
|
|
XinColor color;
|
|
unsigned long attrib;
|
|
int row_height;
|
|
BOOLEAN rec_at_top;
|
|
int pixels_scrolled; /* this is a return value from lm_scroll */
|
|
} LM_SCROLL_ARG;
|
|
|
|
|
|
void calculate_pix_offsets( LM_DATA * lmp, BOOLEAN draw_changes );
|
|
void calculate_visibles( LM_DATA * lmp );
|
|
void calc_x_pix_pos( LM lm, LM_COLUMN_DATA * lcdata, int position );
|
|
BOOLEAN
|
|
do_lm_cb( LM lm, LM_CB_TYPE cb_reason, int row, int column,
|
|
XinEvent * ep, int *percent, int pixels );
|
|
BOOLEAN
|
|
do_lm_cb_get( LM lm, LM_CB_TYPE cb_reason, long *spec_rec,
|
|
long *data_rec, int percent, XinColor * color,
|
|
unsigned long *attrib, int *row_height );
|
|
void do_lm_cb_text( LM_DATA * lmp, int row, int col, BOOLEAN preserve_focus );
|
|
void do_scroll_bar( XI_LIST_DATA * listdata );
|
|
BOOLEAN lm_adj_h( LM_DATA * lmp, short *h );
|
|
void lm_allocate_rec_info( LM_DATA * lmp, int realized_rows_array_len );
|
|
void lm_calc_last_vis( LM_DATA * lmp );
|
|
int lm_calculate_row_height( LM_DATA * lmp, int row );
|
|
void lm_cell_request( LM lm, LM_PART lm_part, int idx1, int idx2 );
|
|
void lm_column_set_pixel_width( LM lm, int idx, int width );
|
|
LM lm_create( XinWindow win, LM_DEF * lm_def, void *parent );
|
|
void
|
|
lm_create_column( LM lm, LM_COLUMN_DEF * lm_column_def,
|
|
BOOLEAN do_cell_requests, BOOLEAN in_hscrolling );
|
|
void lm_cleanup( LM lm );
|
|
void lm_delete( LM lm );
|
|
void lm_delete_column( LM lm, int column_nbr, BOOLEAN adjust_hscrolling );
|
|
BOOLEAN lm_delete_row( LM lm, int row );
|
|
void lm_draw_line( LM_DATA * lmp, XinPoint p, BOOLEAN adj_v, BOOLEAN adj_h );
|
|
int lm_event( XI_OBJ* itf, LM lm, XinEvent * ep );
|
|
void
|
|
lm_focus_cb( long lm, int row, int column, BOOLEAN invisible,
|
|
BOOLEAN set );
|
|
unsigned long
|
|
lm_get_attrib( LM lm, LM_PART lm_part, int idx, int idx2,
|
|
BOOLEAN invisible );
|
|
int lm_get_buf_size( LM lm, LM_PART part, int idx );
|
|
int lm_get_cid( LM lm );
|
|
XinRect *
|
|
lm_get_cell_rect( XinRect * rctp, LM lm, int row, int col, BOOLEAN inner,
|
|
BOOLEAN physical_rct );
|
|
int lm_get_col_spacing( void );
|
|
int lm_get_fixed_columns( LM lm );
|
|
int lm_get_left_most_far_right_col( LM_DATA * lmp, int nbr_columns );
|
|
long *lm_get_list_info( LM lm, int *nbr_recs );
|
|
XI_OBJ *lm_get_list_obj( LM lm );
|
|
XinRect *lm_get_list_rct( LM_DATA * lmp, XinRect * r );
|
|
void
|
|
lm_get_metrics( XI_OBJ_DEF * obj_def, int *hborder, int *column_div,
|
|
int *list_bottom );
|
|
XinRect *lm_get_rect( LM lm, LM_PART part, int idx, XinRect * rct );
|
|
XinRect *lm_get_row_rect( XinRect * rctp, LM lm, int row );
|
|
void lm_get_sel( LM lm, int *c1, int *c2 );
|
|
char *
|
|
lm_get_text( LM lm, char *s, int len, int row, int column,
|
|
BOOLEAN invisible );
|
|
void
|
|
lm_get_vertical_metrics( XI_OBJ_DEF * obj_def, int *first_row_y,
|
|
int *row_spacing, int *client_height,
|
|
int *title_height );
|
|
void lm_get_visible_columns( LM lm, int *first_vis, int *last_vis );
|
|
int lm_get_visible_rows( LM lm, int *first_vis, int *last_vis );
|
|
int lm_hit_test( LM lm, XinEvent* ep, XinEvent* oevt, int* rowp, int* columnp,
|
|
BOOLEAN* is_vis, BOOLEAN* is_hit, BOOLEAN* is_part_vis );
|
|
void lm_hscroll( LM lm, int nbr_columns, int pos );
|
|
BOOLEAN lm_insert_row( LM lm, int row );
|
|
|
|
void lm_invalidate_rect( LM_DATA * lmp, XinRect * rctp, BOOLEAN adj_h );
|
|
void
|
|
lm_invalidate_rect2( LM_DATA * lmp, XinRect * rct_to_invalidate,
|
|
BOOLEAN adj_left );
|
|
void
|
|
lm_invalidate_rows( LM lm, int row_start, int row_end,
|
|
BOOLEAN invalidate );
|
|
void
|
|
lm_invalidate_rows_internal( LM lm, int row_start, int row_end,
|
|
BOOLEAN redraw, int column,
|
|
BOOLEAN preserve_focus_text );
|
|
void lm_local_hscroll( LM lm, int nbr_columns );
|
|
void lm_move_event( LM_DATA * lmp, XinEvent * ep );
|
|
void lm_drag_row_event( XI_OBJ* itf, LM_DATA* lmp, XinEvent* ep, XinEvent* oevp );
|
|
void lm_move_to( LM_DATA * lmp, XinPoint p, BOOLEAN adj_v, BOOLEAN adj_h );
|
|
void lm_recalc_metrics( LM lm );
|
|
void lm_redraw_row( LM_DATA * lmp, int row, BOOLEAN update );
|
|
void lm_remove_all_rows( LM_DATA * lm, BOOLEAN delete_focus );
|
|
BOOLEAN lm_row_has_focus( LM_DATA * lmp, int row, BOOLEAN is_vert_scrolled );
|
|
int lm_scroll( LM_SCROLL_ARG * arg );
|
|
void lm_scroll_rect( LM_DATA * lmp, XinRect * rctp, int dh, int dv );
|
|
void lm_set_fixed_columns( LM lm, int new_fixed_count );
|
|
void
|
|
lm_set_attrib( LM lm, LM_PART lm_part, int idx, int idx2,
|
|
BOOLEAN invisible, unsigned long attrib,
|
|
int half_baked );
|
|
void lm_set_buf_size( LM lm, LM_PART part, int idx, int size );
|
|
void lm_set_column_bitmap( LM lm, XI_BITMAP* bitmap, int cid );
|
|
void lm_set_column_icon( LM lm, int icon_rid, int cid );
|
|
void lm_set_column_width( LM lm, int idx, int width );
|
|
void
|
|
lm_set_color( LM lm, LM_PART part, int row, int column,
|
|
BOOLEAN invisible, XinColor color, BOOLEAN half_baked );
|
|
void lm_set_fixed_columns( LM lm, int new_fixed_count );
|
|
void lm_set_hscroll_bar( LM lm );
|
|
void lm_set_hscroll_range( LM lm );
|
|
void lm_set_bitmap( LM lm, XI_BITMAP* bitmap, int row, int column );
|
|
void lm_set_icon( LM lm, int icon_rid, int row, int column );
|
|
void lm_set_focus( LM lm, int row, int column );
|
|
void lm_set_font( LM lm, LM_PART part, int idx, int idx2, XinFont * font );
|
|
void lm_set_list_size( LM lm, int height, int width );
|
|
void lm_set_rect( LM lm, XinRect *rect );
|
|
void
|
|
lm_set_row_height( LM lm, int row, int height, BOOLEAN set_height,
|
|
int old_height, BOOLEAN only_update );
|
|
void
|
|
lm_set_sel( LM lm, int row, int column, BOOLEAN invisible, int c1,
|
|
int c2 );
|
|
void lm_set_text( LM lm, char *s, int row, int column, BOOLEAN invisible );
|
|
void lm_size_event( LM_DATA * lmp, XinEvent * ep );
|
|
void lm_text_scrolling( XI_OBJ * xi_obj );
|
|
void lm_wrap_text( LM_DATA * lmp, int row, int col, BOOLEAN set_font );
|
|
int lm_make_rrr_room_pix( LM_DATA * lmp, int pixels, BOOLEAN do_redraw );
|
|
BOOLEAN navigate_char_event( LM lm, XinEvent * ep );
|
|
void redraw_cell( LM lm, int row, int col, BOOLEAN update );
|
|
void
|
|
draw_cell_range( LM_DATA * lmp, int first_row, int last_row,
|
|
int first_col, int last_col,
|
|
BOOLEAN in_event_update );
|
|
XinRect *lm_get_scroll_rct( LM_DATA * lmp, XinRect * r );
|
|
void lm_do_rec_event( LM_DATA * lmp, int row, XI_EVENT_TYPE type );
|
|
void lm_row_copy( LM_DATA * lmp, int source_row, int dest_row );
|
|
void lm_adjust_rows( LM_DATA * lmp, int delta );
|
|
void set_focus_cell_rct( LM_DATA * lmp, int row, int col, BOOLEAN in_update_event );
|
|
XI_TEXT *lm_xi_text_focus_get( LM lm );
|
|
void lm_calculate_pix_offsets( LM lm );
|
|
void lm_xi_text_prect_get( LM_DATA * lmp, LM_COLUMN_DATA * column_data,
|
|
LM_CELL_DATA * cell_data, int row, int col, int col_offset,
|
|
int leading, int ascent, int descent, XinRect * rctp );
|
|
BOOLEAN lm_cr_is_ok( LM lm, int row, int col, BOOLEAN v_scrolled );
|
|
BOOLEAN lm_is_button_full_cell( LM lm, int row, int col );
|
|
void lm_xi_text_construct( LM_DATA * lmp, int row, int column );
|
|
|
|
#define LMP(l) ((LM_DATA *)(l))
|
|
|
|
#if XIWS == XIWS_WM
|
|
#define RULE_Y_OFFSET_TOP 0
|
|
#define RULE_Y_OFFSET_BOTTOM 0
|
|
#define BORDER_WIDTH 8
|
|
#define RULE_WIDTH_V 8 /* width of vertical lines */
|
|
#define RULE_WIDTH_H 0 /* width of horz lines */
|
|
#define HPIX_PER_CH 8
|
|
#define VPIX_PER_CH 8
|
|
#else
|
|
#define RULE_Y_OFFSET_TOP 1
|
|
#define RULE_Y_OFFSET_BOTTOM 1
|
|
#define BORDER_WIDTH 2
|
|
#define RULE_WIDTH_V 1
|
|
#define RULE_WIDTH_H 1
|
|
#define WIDTHLOOP(idx, wid) for (idx = 0; idx < wid; idx++)
|
|
#endif
|
|
|
|
#define CELL_IS_ENABLED(lm, row, col) (LIST_IS_ENABLED(lm) && COLUMN_IS_ENABLED(lm, col))
|
|
#define CELL_IS_SELECTED(lm, row, col) ((LMP(lm)->row_attribs[row] & LM_ROW_ATR_SELECTED) || (LMP(lm)->lm_column_data[col]->attrib & LM_COL_ATR_SELECTED) || \
|
|
(LMP(lm)->cell_data[row][col].attrib & LM_CELL_ATR_SELECTED))
|
|
#define CELL_IS_SELECTABLE(lm, row, col) (LMP(lm)->lm_column_data[col]->attrib & LM_COL_ATR_SELECTABLE)
|
|
#define LIST_IS_ENABLED(lm) ((LMP(lm)->attrib & (LM_ATR_ENABLED | LM_ATR_VISIBLE)) == (LM_ATR_ENABLED | LM_ATR_VISIBLE))
|
|
#define COLUMN_IS_ENABLED(lm, col) (LMP(lm)->lm_column_data[col]->attrib & LM_COL_ATR_ENABLED)
|
|
#define COLUMN_IS_SELECTABLE(lm, col) (LMP(lm)->lm_column_data[col]->attrib & LM_COL_ATR_COL_SELECTABLE)
|
|
#define COLUMN_IS_SELECTED(lm, col) (LMP(lm)->lm_column_data[col]->attrib & LM_COL_ATR_SELECTED)
|
|
#define COLUMN_IS_PUSHED(lm, col) (LMP(lm)->lm_column_data[col]->pushed)
|