gattrib

gtksheet_2_2.h

Go to the documentation of this file.
00001 /* GtkSheet widget for Gtk+.
00002  * Copyright (C) 1999-2001 Adrian E. Feiguin <adrian@ifir.ifir.edu.ar>
00003  *
00004  * Based on GtkClist widget by Jay Painter, but major changes.
00005  * Memory allocation routines inspired on SC (Spreadsheet Calculator)
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Library General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2 of the License, or (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Library General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Library General Public
00018  * License along with this library; if not, write to the
00019  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020  * Boston, MA 02110-1301 USA
00021  */
00022 
00023 #ifndef __GTK_SHEET_H__
00024 #define __GTK_SHEET_H__
00025 
00026 
00027 #ifdef __cplusplus
00028 extern "C" {
00029 #endif /* __cplusplus */
00030 
00031 
00032 typedef enum
00033 {
00034   GTK_SHEET_FOREGROUND,
00035   GTK_SHEET_BACKGROUND,
00036   GTK_SHEET_FONT,
00037   GTK_SHEET_JUSTIFICATION,
00038   GTK_SHEET_BORDER,
00039   GTK_SHEET_BORDER_COLOR,
00040   GTK_SHEET_IS_EDITABLE,
00041   GTK_SHEET_IS_VISIBLE
00042 } GtkSheetAttrType;
00043 
00044 /* sheet->state */
00045 
00046 enum 
00047 {
00048   GTK_SHEET_NORMAL,
00049   GTK_SHEET_ROW_SELECTED,
00050   GTK_SHEET_COLUMN_SELECTED,
00051   GTK_SHEET_RANGE_SELECTED
00052 };
00053      
00054 enum
00055 {
00056   GTK_SHEET_LEFT_BORDER     = 1 << 0, 
00057   GTK_SHEET_RIGHT_BORDER    = 1 << 1, 
00058   GTK_SHEET_TOP_BORDER      = 1 << 2, 
00059   GTK_SHEET_BOTTOM_BORDER   = 1 << 3 
00060 }; 
00061 
00062 #define GTK_TYPE_SHEET_RANGE (gtk_sheet_range_get_type ())
00063 #define GTK_TYPE_SHEET (gtk_sheet_get_type ())
00064 
00065 #define GTK_SHEET(obj)          GTK_CHECK_CAST (obj, gtk_sheet_get_type (), GtkSheet)
00066 #define GTK_SHEET_CLASS(klass)  GTK_CHECK_CLASS_CAST (klass, gtk_sheet_get_type (), GtkSheetClass)
00067 #define GTK_IS_SHEET(obj)       GTK_CHECK_TYPE (obj, gtk_sheet_get_type ())
00068 
00069 /* Public flags, for compatibility */
00070 
00071 #define GTK_SHEET_IS_LOCKED(sheet)       gtk_sheet_locked(sheet)
00072 #define GTK_SHEET_ROW_FROZEN(sheet)      !gtk_sheet_rows_resizable(sheet)
00073 #define GTK_SHEET_COLUMN_FROZEN(sheet)   !gtk_sheet_columns_resizable(sheet)
00074 #define GTK_SHEET_AUTORESIZE(sheet)      gtk_sheet_autoresize(sheet)
00075 #define GTK_SHEET_CLIP_TEXT(sheet)       gtk_sheet_clip_text(sheet)
00076 #define GTK_SHEET_ROW_TITLES_VISIBLE(sheet)   gtk_sheet_row_titles_visible(sheet)
00077 #define GTK_SHEET_COL_TITLES_VISIBLE(sheet)   gtk_sheet_column_titles_visible(sheet) 
00078 #define GTK_SHEET_AUTO_SCROLL(sheet)     gtk_sheet_autoscroll(sheet)
00079 #define GTK_SHEET_JUSTIFY_ENTRY(sheet)   gtk_sheet_justify_entry(sheet)
00080 
00081 typedef struct _GtkSheet GtkSheet;
00082 typedef struct _GtkSheetClass GtkSheetClass;
00083 typedef struct _GtkSheetChild GtkSheetChild;
00084 typedef struct _GtkSheetRow GtkSheetRow;
00085 typedef struct _GtkSheetColumn GtkSheetColumn;
00086 typedef struct _GtkSheetCell GtkSheetCell;
00087 typedef struct _GtkSheetRange GtkSheetRange;
00088 typedef struct _GtkSheetButton       GtkSheetButton;
00089 typedef struct _GtkSheetCellAttr     GtkSheetCellAttr;
00090 typedef struct _GtkSheetCellBorder     GtkSheetCellBorder;
00091 
00092 struct _GtkSheetChild
00093 {
00094   GtkWidget *widget;
00095   gint x,y ;
00096   gboolean attached_to_cell;
00097   gboolean floating;
00098   gint row, col;
00099   guint16 xpadding;
00100   guint16 ypadding;
00101   gboolean xexpand;
00102   gboolean yexpand;
00103   gboolean xshrink;
00104   gboolean yshrink;
00105   gboolean xfill;
00106   gboolean yfill;
00107 };
00108 
00109 struct _GtkSheetButton
00110 {
00111   GtkStateType state;
00112   gchar *label;
00113 
00114   gboolean label_visible;
00115   GtkSheetChild *child;
00116 
00117   GtkJustification justification;
00118 };
00119 
00120 struct _GtkSheetCellBorder
00121 {
00122   gint8 mask;
00123   guint width;
00124   GdkLineStyle line_style;
00125   GdkCapStyle cap_style;
00126   GdkJoinStyle join_style;
00127   GdkColor color;
00128 };
00129 
00130 struct _GtkSheetCellAttr
00131 {
00132   GtkJustification justification;
00133   GdkFont *font;
00134   PangoFontDescription *font_desc;
00135   GdkColor foreground;
00136   GdkColor background;
00137   GtkSheetCellBorder border;
00138   gboolean is_editable;
00139   gboolean is_visible;
00140 };
00141 
00142 struct _GtkSheetCell
00143 {
00144   GdkRectangle area;
00145   gint row;
00146   gint col;
00147 
00148   GtkSheetCellAttr *attributes;
00149 
00150   gchar *text;
00151   gpointer link;
00152 };
00153 
00154 struct _GtkSheetRange
00155 {
00156   gint row0,col0; /* upper-left cell */
00157   gint rowi,coli; /* lower-right cell */
00158 };
00159 
00160 
00161 struct _GtkSheetRow
00162 {
00163  gchar *name;
00164  gint height;
00165  gint top_ypixel;
00166  guint16 requisition;
00167 
00168  GtkSheetButton button;
00169  gboolean is_sensitive;
00170  gboolean is_visible;
00171 };
00172 
00173 struct _GtkSheetColumn
00174 {
00175  gchar *name;
00176  gint width;
00177  gint left_xpixel;
00178  guint16 requisition;
00179 
00180  GtkSheetButton button;
00181 
00182  gint left_text_column; /* min left column displaying text on this column */
00183  gint right_text_column; /* max right column displaying text on this column */
00184 
00185  GtkJustification justification;
00186  gboolean is_sensitive;
00187  gboolean is_visible;
00188 };
00189 
00190 
00191 struct _GtkSheet{
00192   GtkContainer container;
00193 
00194   guint16 flags;
00195 
00196   GtkSelectionMode selection_mode;
00197   gboolean autoresize;
00198   gboolean autoscroll;
00199   gboolean clip_text;
00200   gboolean justify_entry;
00201   gboolean locked;
00202 
00203   guint freeze_count;
00204 
00205   /* Background colors */
00206   GdkColor bg_color;
00207   GdkColor grid_color;
00208   gboolean show_grid;
00209 
00210   /* sheet children */
00211   GList *children;
00212 
00213   /* allocation rectangle after the container_border_width
00214      and the width of the shadow border */
00215   GdkRectangle internal_allocation;
00216 
00217   gchar *name;
00218 
00219   GtkSheetRow *row;
00220   GtkSheetColumn *column;
00221 
00222   gboolean rows_resizable;
00223   gboolean columns_resizable;
00224 
00225   /* max number of diplayed cells */
00226   gint maxrow;
00227   gint maxcol;
00228 
00229   /* Displayed range */
00230 
00231   GtkSheetRange view; 
00232 
00233   /* sheet data: dynamically allocated array of cell pointers */
00234   GtkSheetCell ***data;
00235 
00236   /* max number of allocated cells */
00237   gint maxallocrow;
00238   gint maxalloccol;
00239 
00240   /* active cell */
00241   GtkSheetCell active_cell;
00242   GtkWidget *sheet_entry;
00243 
00244   GtkType entry_type;
00245 
00246   /* expanding selection */
00247   GtkSheetCell selection_cell;
00248 
00249   /* timer for automatic scroll during selection */  
00250   gint32 timer;
00251   /* timer for flashing clipped range */
00252   gint32 clip_timer;
00253   gint interval;
00254 
00255   /* global selection button */
00256   GtkWidget *button;
00257 
00258   /* sheet state */
00259   gint state;
00260 
00261   /* selected range */
00262   GtkSheetRange range;
00263 
00264   /*the scrolling window and it's height and width to
00265    * make things a little speedier */
00266   GdkWindow *sheet_window;
00267   guint sheet_window_width;
00268   guint sheet_window_height;
00269 
00270   /* sheet backing pixmap */  
00271   GdkWindow *pixmap;    
00272 
00273   /* offsets for scrolling */
00274   gint hoffset;
00275   gint voffset;
00276   gfloat old_hadjustment;
00277   gfloat old_vadjustment;
00278   
00279   /* border shadow style */
00280   GtkShadowType shadow_type;
00281   
00282   /* Column Titles */
00283   GdkRectangle column_title_area;
00284   GdkWindow *column_title_window;
00285   gboolean column_titles_visible;
00286 
00287   /* Row Titles */
00288   GdkRectangle row_title_area;
00289   GdkWindow *row_title_window;
00290   gboolean row_titles_visible;
00291 
00292   /*scrollbars*/
00293   GtkAdjustment *hadjustment;
00294   GtkAdjustment *vadjustment;
00295 
00296   /* xor GC for the verticle drag line */
00297   GdkGC *xor_gc;
00298 
00299   /* gc for drawing unselected cells */
00300   GdkGC *fg_gc;
00301   GdkGC *bg_gc;
00302 
00303   /* cursor used to indicate dragging */
00304   GdkCursor *cursor_drag;
00305 
00306   /* the current x-pixel location of the xor-drag vline */
00307   gint x_drag;
00308 
00309   /* the current y-pixel location of the xor-drag hline */
00310   gint y_drag;
00311 
00312   /* current cell being dragged */
00313   GtkSheetCell drag_cell;
00314   /* current range being dragged */
00315   GtkSheetRange drag_range;
00316 
00317   /* clipped range */
00318   GtkSheetRange clip_range;
00319 };
00320 
00321 struct _GtkSheetClass
00322 {
00323  GtkContainerClass parent_class;
00324  
00325  void (*set_scroll_adjustments) (GtkSheet *sheet,
00326                  GtkAdjustment *hadjustment,
00327                  GtkAdjustment *vadjustment);
00328 
00329  void (*select_row)         (GtkSheet *sheet, gint row);
00330 
00331  void (*select_column)      (GtkSheet *sheet, gint column);
00332 
00333  void (*select_range)       (GtkSheet *sheet, GtkSheetRange *range);
00334 
00335  void (*clip_range)         (GtkSheet *sheet, GtkSheetRange *clip_range);
00336 
00337  void (*resize_range)       (GtkSheet *sheet,
00338                         GtkSheetRange *old_range,
00339                             GtkSheetRange *new_range);
00340 
00341  void (*move_range)         (GtkSheet *sheet,
00342                         GtkSheetRange *old_range,
00343                             GtkSheetRange *new_range);
00344 
00345  gboolean (*traverse)           (GtkSheet *sheet,
00346                             gint row, gint column,
00347                             gint *new_row, gint *new_column);
00348 
00349  gboolean (*deactivate)     (GtkSheet *sheet,
00350                         gint row, gint column);
00351 
00352  gboolean (*activate)       (GtkSheet *sheet,
00353                         gint row, gint column);
00354 
00355  void (*set_cell)       (GtkSheet *sheet,
00356                     gint row, gint column);
00357 
00358  void (*clear_cell)         (GtkSheet *sheet,
00359                     gint row, gint column);
00360 
00361  void (*changed)        (GtkSheet *sheet,
00362                     gint row, gint column);
00363 
00364  void (*new_column_width)       (GtkSheet *sheet,
00365                                  gint col,
00366                                  guint width);
00367 
00368  void (*new_row_height)         (GtkSheet *sheet,
00369                                  gint row,
00370                                  guint height);
00371 
00372 };
00373   
00374 GType gtk_sheet_get_type (void);
00375 GtkType gtk_sheet_range_get_type (void);
00376 
00377 /* create a new sheet */
00378 GtkWidget *
00379 gtk_sheet_new               (guint rows, guint columns, const gchar *title);
00380 
00381 void
00382 gtk_sheet_construct         (GtkSheet *sheet,
00383                          guint rows, guint columns, const gchar *title);
00384 
00385 /* create a new browser sheet. It cells can not be edited */
00386 GtkWidget *
00387 gtk_sheet_new_browser           (guint rows, guint columns, const gchar *title);
00388 
00389 void
00390 gtk_sheet_construct_browser     (GtkSheet *sheet,
00391                          guint rows, guint columns, const gchar *title);
00392 
00393 /* create a new sheet with custom entry */
00394 GtkWidget *
00395 gtk_sheet_new_with_custom_entry     (guint rows, guint columns, 
00396                                          const gchar *title,
00397                                      GtkType entry_type);
00398 void
00399 gtk_sheet_construct_with_custom_entry   (GtkSheet *sheet,
00400                          guint rows, guint columns, 
00401                                          const gchar *title,
00402                      GtkType entry_type);
00403 /* change scroll adjustments */
00404 void
00405 gtk_sheet_set_hadjustment       (GtkSheet *sheet,
00406                      GtkAdjustment *adjustment); 
00407 void
00408 gtk_sheet_set_vadjustment       (GtkSheet *sheet,
00409                      GtkAdjustment *adjustment); 
00410 /* Change entry */
00411 void
00412 gtk_sheet_change_entry          (GtkSheet *sheet, GtkType entry_type);
00413 
00414 /* Returns sheet's entry widget */
00415 GtkWidget *
00416 gtk_sheet_get_entry         (GtkSheet *sheet);
00417 GtkWidget *
00418 gtk_sheet_get_entry_widget      (GtkSheet *sheet);
00419 
00420 /* Returns sheet->state 
00421  * Added by Steven Rostedt <steven.rostedt@lmco.com> */
00422 gint
00423 gtk_sheet_get_state             (GtkSheet *sheet);
00424 
00425 /* Returns sheet's ranges 
00426  * Added by Murray Cumming */
00427 guint
00428 gtk_sheet_get_columns_count         (GtkSheet *sheet);
00429 
00430 guint
00431 gtk_sheet_get_rows_count        (GtkSheet *sheet);
00432 
00433 void
00434 gtk_sheet_get_visible_range     (GtkSheet *sheet,
00435                      GtkSheetRange *range);
00436 void
00437 gtk_sheet_set_selection_mode        (GtkSheet *sheet, gint mode);
00438 
00439 void
00440 gtk_sheet_set_autoresize        (GtkSheet *sheet, gboolean autoresize);
00441 
00442 gboolean
00443 gtk_sheet_autoresize            (GtkSheet *sheet);
00444 
00445 void
00446 gtk_sheet_set_autoscroll        (GtkSheet *sheet, gboolean autoscroll);
00447 
00448 gboolean
00449 gtk_sheet_autoscroll            (GtkSheet *sheet);
00450 
00451 void
00452 gtk_sheet_set_clip_text         (GtkSheet *sheet, gboolean clip_text);
00453 
00454 gboolean
00455 gtk_sheet_clip_text         (GtkSheet *sheet);
00456 
00457 void
00458 gtk_sheet_set_justify_entry     (GtkSheet *sheet, gboolean justify);
00459 
00460 gboolean
00461 gtk_sheet_justify_entry         (GtkSheet *sheet);
00462 
00463 void
00464 gtk_sheet_set_locked            (GtkSheet *sheet, gboolean lock);
00465 
00466 gboolean
00467 gtk_sheet_locked            (GtkSheet *sheet);
00468 
00469 /* set sheet title */
00470 void
00471 gtk_sheet_set_title             (GtkSheet *sheet, const gchar *title);
00472 
00473 /* freeze all visual updates of the sheet.
00474  * Then thaw the sheet after you have made a number of changes.
00475  * The updates will occure in a more efficent way than if
00476  * you made them on a unfrozen sheet */
00477 void
00478 gtk_sheet_freeze            (GtkSheet *sheet);
00479 void
00480 gtk_sheet_thaw              (GtkSheet *sheet);
00481 /* Background colors */
00482 void
00483 gtk_sheet_set_background        (GtkSheet *sheet,
00484                      GdkColor *bg_color);
00485 void
00486 gtk_sheet_set_grid          (GtkSheet *sheet,
00487                      GdkColor *grid_color);
00488 void
00489 gtk_sheet_show_grid         (GtkSheet *sheet,
00490                      gboolean show);
00491 gboolean
00492 gtk_sheet_grid_visible          (GtkSheet *sheet);
00493 
00494 /* set/get column title */ 
00495 void
00496 gtk_sheet_set_column_title      (GtkSheet * sheet,
00497                         gint column,
00498                         const gchar * title);
00499 
00500 const gchar *
00501 gtk_sheet_get_column_title      (GtkSheet * sheet,
00502                         gint column);
00503 
00504 /* set/get row title */
00505 void
00506 gtk_sheet_set_row_title         (GtkSheet * sheet,
00507                         gint row,
00508                         const gchar * title);
00509 const gchar *
00510 gtk_sheet_get_row_title         (GtkSheet * sheet,
00511                         gint row);
00512 
00513 /* set/get button label */
00514 void
00515 gtk_sheet_row_button_add_label      (GtkSheet *sheet, 
00516                     gint row, const gchar *label);
00517 void
00518 gtk_sheet_column_button_add_label   (GtkSheet *sheet, 
00519                     gint column, const gchar *label);
00520 const gchar *
00521 gtk_sheet_row_button_get_label      (GtkSheet *sheet, 
00522                     gint row);
00523 const gchar *
00524 gtk_sheet_column_button_get_label   (GtkSheet *sheet, 
00525                     gint column);
00526 void
00527 gtk_sheet_row_button_justify        (GtkSheet *sheet, 
00528                     gint row, GtkJustification justification);
00529 void
00530 gtk_sheet_column_button_justify     (GtkSheet *sheet, 
00531                     gint column, GtkJustification justification);
00532 
00533 /* scroll the viewing area of the sheet to the given column
00534  * and row; row_align and col_align are between 0-1 representing the
00535  * location the row should appear on the screnn, 0.0 being top or left,
00536  * 1.0 being bottom or right; if row or column is negative then there
00537  * is no change */
00538 void
00539 gtk_sheet_moveto (GtkSheet * sheet,
00540           gint row,
00541           gint column,
00542               gfloat row_align,
00543                   gfloat col_align);
00544 
00545 /* resize column/row titles window */
00546 void 
00547 gtk_sheet_set_row_titles_width(GtkSheet *sheet, guint width);
00548 void 
00549 gtk_sheet_set_column_titles_height(GtkSheet *sheet, guint height);
00550 
00551 /* show/hide column/row titles window */
00552 void
00553 gtk_sheet_show_column_titles        (GtkSheet *sheet);
00554 void
00555 gtk_sheet_show_row_titles       (GtkSheet *sheet);
00556 void
00557 gtk_sheet_hide_column_titles        (GtkSheet *sheet);
00558 void
00559 gtk_sheet_hide_row_titles       (GtkSheet *sheet);
00560 gboolean
00561 gtk_sheet_column_titles_visible     (GtkSheet *sheet);
00562 gboolean
00563 gtk_sheet_row_titles_visible        (GtkSheet *sheet);
00564 
00565 /* set column button sensitivity. If sensitivity is TRUE it can be toggled,  
00566  *  otherwise it acts as a title */
00567 void 
00568 gtk_sheet_column_set_sensitivity    (GtkSheet *sheet, 
00569                     gint column, gboolean sensitive);
00570 
00571 /* set sensitivity for all column buttons */
00572 void
00573 gtk_sheet_columns_set_sensitivity   (GtkSheet *sheet, gboolean sensitive);
00574 void
00575 gtk_sheet_columns_set_resizable     (GtkSheet *sheet, gboolean resizable);
00576 gboolean
00577 gtk_sheet_columns_resizable     (GtkSheet *sheet);
00578 
00579 /* set row button sensitivity. If sensitivity is TRUE can be toggled, 
00580  * otherwise it acts as a title */
00581 void 
00582 gtk_sheet_row_set_sensitivity       (GtkSheet *sheet, 
00583                     gint row,  gboolean sensitive);
00584 
00585 /* set sensitivity for all row buttons */
00586 void
00587 gtk_sheet_rows_set_sensitivity      (GtkSheet *sheet, gboolean sensitive);
00588 void
00589 gtk_sheet_rows_set_resizable        (GtkSheet *sheet, gboolean resizable);
00590 gboolean
00591 gtk_sheet_rows_resizable        (GtkSheet *sheet);
00592 
00593 /* set column visibility. The default value is TRUE. If FALSE, the 
00594  * column is hidden */
00595 void
00596 gtk_sheet_column_set_visibility     (GtkSheet *sheet, 
00597                     gint column, gboolean visible);
00598 void
00599 gtk_sheet_column_label_set_visibility   (GtkSheet *sheet, 
00600                     gint column, gboolean visible);
00601 void
00602 gtk_sheet_columns_labels_set_visibility (GtkSheet *sheet, gboolean visible);
00603 
00604 /* set row visibility. The default value is TRUE. If FALSE, the 
00605  * row is hidden */
00606 void
00607 gtk_sheet_row_set_visibility        (GtkSheet *sheet, 
00608                      gint row, gboolean visible);
00609 void
00610 gtk_sheet_row_label_set_visibility  (GtkSheet *sheet, 
00611                      gint row, gboolean visible);
00612 void
00613 gtk_sheet_rows_labels_set_visibility    (GtkSheet *sheet, gboolean visible);
00614 
00615 
00616 /* select the row. The range is then highlighted, and the bounds are stored
00617  * in sheet->range  */
00618 void
00619 gtk_sheet_select_row            (GtkSheet * sheet,
00620                         gint row);
00621 
00622 /* select the column. The range is then highlighted, and the bounds are stored
00623  * in sheet->range  */
00624 void
00625 gtk_sheet_select_column         (GtkSheet * sheet,
00626                         gint column);
00627 
00628 /* save selected range to "clipboard" */
00629 void
00630 gtk_sheet_clip_range            (GtkSheet *sheet, const GtkSheetRange *range);
00631 /* free clipboard */
00632 void
00633 gtk_sheet_unclip_range          (GtkSheet *sheet);
00634 
00635 gboolean
00636 gtk_sheet_in_clip           (GtkSheet *sheet);
00637 
00638 /* get scrollbars adjustment */
00639 GtkAdjustment *
00640 gtk_sheet_get_vadjustment       (GtkSheet * sheet);
00641 GtkAdjustment *
00642 gtk_sheet_get_hadjustment       (GtkSheet * sheet);
00643 
00644 /* highlight the selected range and store bounds in sheet->range */
00645 void gtk_sheet_select_range     (GtkSheet *sheet, 
00646                      const GtkSheetRange *range); 
00647 
00648 /* obvious */
00649 void gtk_sheet_unselect_range       (GtkSheet *sheet); 
00650 
00651 /* set active cell where the entry will be displayed 
00652  * returns FALSE if current cell can't be deactivated or
00653  * requested cell can't be activated */
00654 gboolean
00655 gtk_sheet_set_active_cell       (GtkSheet *sheet, 
00656                     gint row, gint column);
00657 void
00658 gtk_sheet_get_active_cell       (GtkSheet *sheet, 
00659                     gint *row, gint *column);
00660 
00661 /* set cell contents and allocate memory if needed */
00662 void 
00663 gtk_sheet_set_cell          (GtkSheet *sheet, 
00664                     gint row, gint col, 
00665                                         GtkJustification justification,
00666                             const gchar *text);
00667 void 
00668 gtk_sheet_set_cell_text         (GtkSheet *sheet, 
00669                     gint row, gint col,
00670                             const gchar *text);
00671 
00672 /* get cell contents */
00673 gchar *     
00674 gtk_sheet_cell_get_text         (GtkSheet *sheet, gint row, gint col);
00675 
00676 
00677 /* clear cell contents */
00678 void 
00679 gtk_sheet_cell_clear            (GtkSheet *sheet, gint row, gint col);
00680 /* clear cell contents and remove links */
00681 void 
00682 gtk_sheet_cell_delete           (GtkSheet *sheet, gint row, gint col);
00683 
00684 /* clear range contents. If range==NULL the whole sheet will be cleared */
00685 void 
00686 gtk_sheet_range_clear           (GtkSheet *sheet, 
00687                      const GtkSheetRange *range);
00688 /* clear range contents and remove links */
00689 void 
00690 gtk_sheet_range_delete          (GtkSheet *sheet, 
00691                      const GtkSheetRange *range);
00692 
00693 /* get cell state: GTK_STATE_NORMAL, GTK_STATE_SELECTED */
00694 GtkStateType
00695 gtk_sheet_cell_get_state        (GtkSheet *sheet, gint row, gint col);
00696 
00697 /* Handles cell links */
00698 void
00699 gtk_sheet_link_cell         (GtkSheet *sheet, gint row, gint col,
00700                      gpointer link);
00701 
00702 gpointer
00703 gtk_sheet_get_link          (GtkSheet *sheet, gint row, gint col);
00704 void
00705 gtk_sheet_remove_link           (GtkSheet *sheet, gint row, gint col);
00706 
00707 /* get row and column correspondig to the given position in the screen */
00708 gboolean
00709 gtk_sheet_get_pixel_info (GtkSheet * sheet,
00710               gint x,
00711               gint y,
00712               gint * row,
00713               gint * column);
00714 
00715 /* get area of a given cell */
00716 gboolean
00717 gtk_sheet_get_cell_area (GtkSheet *sheet,
00718                          gint row,
00719                          gint column,
00720                          GdkRectangle *area);
00721 
00722 /* set column width */
00723 void
00724 gtk_sheet_set_column_width (GtkSheet * sheet,
00725                 gint column,
00726                 guint width);
00727 
00728 /* set row height */
00729 void
00730 gtk_sheet_set_row_height (GtkSheet * sheet,
00731               gint row,
00732               guint height);
00733 
00734 /* append ncols columns to the end of the sheet */
00735 void
00736 gtk_sheet_add_column            (GtkSheet *sheet, guint ncols);
00737 
00738 /* append nrows row to the end of the sheet */
00739 void
00740 gtk_sheet_add_row           (GtkSheet *sheet, guint nrows);
00741 
00742 /* insert nrows rows before the given row and pull right */
00743 void
00744 gtk_sheet_insert_rows           (GtkSheet *sheet, guint row, guint nrows);
00745 
00746 /* insert ncols columns before the given col and pull down */
00747  void
00748 gtk_sheet_insert_columns        (GtkSheet *sheet, guint col, guint ncols);
00749 
00750 /* delete nrows rows starting in row */
00751 void
00752 gtk_sheet_delete_rows           (GtkSheet *sheet, guint row, guint nrows);
00753 
00754 /* delete ncols columns starting in col */
00755 void
00756 gtk_sheet_delete_columns        (GtkSheet *sheet, guint col, guint ncols);
00757 
00758 /* set abckground color of the given range */
00759 void
00760 gtk_sheet_range_set_background      (GtkSheet *sheet, 
00761                     const GtkSheetRange *range, 
00762                     const GdkColor *color);
00763 
00764 /* set foreground color (text color) of the given range */
00765 void
00766 gtk_sheet_range_set_foreground      (GtkSheet *sheet, 
00767                     const GtkSheetRange *range, 
00768                     const GdkColor *color);
00769 
00770 /* set text justification (GTK_JUSTIFY_LEFT, RIGHT, CENTER) of the given range.
00771  * The default value is GTK_JUSTIFY_LEFT. If autoformat is on, the
00772  * default justification for numbers is GTK_JUSTIFY_RIGHT */
00773 void
00774 gtk_sheet_range_set_justification   (GtkSheet *sheet, 
00775                     const GtkSheetRange *range, 
00776                     GtkJustification justification);
00777 void
00778 gtk_sheet_column_set_justification      (GtkSheet *sheet,
00779                                         gint column,
00780                                         GtkJustification justification);
00781 /* set if cell contents can be edited or not in the given range:
00782  * accepted values are TRUE or FALSE. */
00783 void
00784 gtk_sheet_range_set_editable        (GtkSheet *sheet, 
00785                     const GtkSheetRange *range, 
00786                     gint editable);
00787 
00788 /* set if cell contents are visible or not in the given range:
00789  * accepted values are TRUE or FALSE.*/
00790 void
00791 gtk_sheet_range_set_visible     (GtkSheet *sheet, 
00792                     const GtkSheetRange *range, 
00793                     gboolean visible);
00794 
00795 /* set cell border style in the given range.
00796  * mask values are CELL_LEFT_BORDER, CELL_RIGHT_BORDER, CELL_TOP_BORDER,
00797  * CELL_BOTTOM_BORDER
00798  * width is the width of the border line in pixels 
00799  * line_style is the line_style for the border line */
00800 void
00801 gtk_sheet_range_set_border      (GtkSheet *sheet, 
00802                     const GtkSheetRange *range, 
00803                     gint mask, 
00804                     guint width, 
00805                     gint line_style);
00806 
00807 /* set border color for the given range */
00808 void
00809 gtk_sheet_range_set_border_color    (GtkSheet *sheet, 
00810                     const GtkSheetRange *range, 
00811                     const GdkColor *color);
00812 
00813 /* set font for the given range */
00814 void
00815 gtk_sheet_range_set_font        (GtkSheet *sheet, 
00816                     const GtkSheetRange *range, 
00817                     PangoFontDescription *font);
00818 
00819 /* get cell attributes of the given cell */
00820 /* TRUE means that the cell is currently allocated */
00821 gboolean
00822 gtk_sheet_get_attributes        (GtkSheet *sheet, 
00823                     gint row, gint col, 
00824                     GtkSheetCellAttr *attributes);
00825 
00826 
00827 GtkSheetChild *
00828 gtk_sheet_put               (GtkSheet *sheet, 
00829                      GtkWidget *widget, 
00830                      gint x, gint y);
00831 void
00832 gtk_sheet_attach_floating               (GtkSheet *sheet,
00833                                          GtkWidget *widget,
00834                                          gint row, gint col);
00835 void
00836 gtk_sheet_attach_default                (GtkSheet *sheet,
00837                                          GtkWidget *widget,
00838                                          gint row, gint col);
00839 void
00840 gtk_sheet_attach                        (GtkSheet *sheet,
00841                                          GtkWidget *widget,
00842                                          gint row, gint col,
00843                                          gint xoptions,
00844                                          gint yoptions,
00845                                          gint xpadding,
00846                                          gint ypadding);
00847 
00848 
00849 void
00850 gtk_sheet_move_child            (GtkSheet *sheet, 
00851                      GtkWidget *widget, 
00852                      gint x, gint y);
00853 
00854 GtkSheetChild *
00855 gtk_sheet_get_child_at          (GtkSheet *sheet, 
00856                      gint row, gint col);
00857 
00858 void
00859 gtk_sheet_button_attach         (GtkSheet *sheet,
00860                      GtkWidget *widget,
00861                      gint row, gint col);
00862                        
00863 
00864 #ifdef __cplusplus
00865 }
00866 #endif /* __cplusplus */
00867 
00868 
00869 #endif /* __GTK_SHEET_H__ */
00870 
00871 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines