gitkrlayout.c File Reference

gitk renderer layout routines More...

#include "gitkrincludes.h"

Include dependency graph for gitk-renderer-text/gitkrlayout.c:

Include dependency graph

Go to the source code of this file.

Defines

#define giml_ctrl_text   N_("Next");
#define giml_ctrl_text   N_("Previous");
#define GITK_RENDERER_C
#define GITKR_LAYOUT_C

Functions

void gitkr_dialog_free_layout (GitkDialogPtr dialog)
 frees the layout data of a dialog

void gitkr_dialog_generate_dialog_widgets (GitkDialogPtr dialog)
 generate dialog meta widgets

void gitkr_dialog_generate_hierarchical_layout (GitkDialogPtr dialog, xmlNodePtr root)
 generate a layout with pure hierarchical order

void gitkr_dialog_generate_layout (GitkDialogPtr dialog)
 generate a layout for a given dialog

void gitkr_dialog_generate_sequential_layout (GitkDialogPtr dialog, xmlNodePtr root)
 generate a layout with pure sequential order

gint gitkr_dialog_generate_sequential_layout_build_page (GitkDialogPtr dialog, xmlNodePtr root, xmlXPathCompExprPtr xpath_get_widgets, gint pageIx)
 build a single page

gint gitkr_dialog_generate_sequential_layout_count_pages (GitkDialogPtr dialog, xmlNodePtr root, xmlNodeSetPtr pages, xmlXPathCompExprPtr xpath_get_widgets)
 helper function that calculates the number of page we will need

GitkrTextLayoutPtr gitkr_dialog_new_layout (GitkDialogPtr dialog)
 create a initialise a layout structure

void gitkr_dialog_output_layout (GitkDialogPtr dialog)
 display the layout of a dialog

GitkrTextWidgetPtr gitkr_layout_get_current_widget (GitkrTextLayoutPtr layout)
 get the current active widget

gint gitkr_layout_get_current_widget_line (GitkrTextLayoutPtr layout)
 get the line position of the current widget


Detailed Description

gitk renderer layout routines

Id
gitkrlayout.c,v 1.41 2004/07/01 14:39:47 ensonic Exp

Author:
Stefan Kost <ensonic@users.sf.net>
Date:
Fri Jan 25 09:48:16 2002

Definition in file gitk-renderer-text/gitkrlayout.c.


Define Documentation

#define giml_ctrl_text   N_("Next");
 

Todo:
this is a hack to make gettext aware of these

Definition at line 20 of file gitk-renderer-text/gitkrlayout.c.

#define giml_ctrl_text   N_("Previous");
 

Todo:
this is a hack to make gettext aware of these

Definition at line 20 of file gitk-renderer-text/gitkrlayout.c.


Function Documentation

void gitkr_dialog_free_layout GitkDialogPtr  dialog  ) 
 

frees the layout data of a dialog

Definition at line 482 of file gitk-renderer-text/gitkrlayout.c.

References GitkrTextLayout::ctrl, gitk_log, GitkDialogPtr, GitkrTextLayoutPtr, GitkrTextWidgetPtr, GitkrTextWidget::id, GitkrTextWidget::label, GitkDialog::layout, GitkrTextLayout::maxWidgetsPerPage, GitkrTextLayout::numberOfPages, GitkrTextLayout::pages, GitkrTextLayout::title, and GitkrTextLayoutPage::widgets.

Referenced by gitkr_dialog_generate_layout(), and gitkr_dialog_hide().

void gitkr_dialog_generate_dialog_widgets GitkDialogPtr  dialog  ) 
 

generate dialog meta widgets

Definition at line 109 of file gitk-renderer-text/gitkrlayout.c.

References GitkrTextLayout::ctrl, gitk_err, gitk_err1, gitk_log1, gitk_log3, GITK_NS_PREFIX, GitkDialogPtr, gitkr_widget_optionchoice_new(), GitkrTextLayoutPtr, GitkrTextWidgetPtr, GitkrTextWidget::id, GitkDialog::layout, GitkrTextLayoutPage::widgets, and GitkrTextLayoutPage::widgetsPerPage.

Referenced by gitkr_dialog_generate_layout().

Here is the call graph for this function:

void gitkr_dialog_generate_hierarchical_layout GitkDialogPtr  dialog,
xmlNodePtr  root
 

generate a layout with pure hierarchical order

Todo:
implement this part

Definition at line 357 of file gitk-renderer-text/gitkrlayout.c.

References gitk_log, GitkDialogPtr, GitkrTextLayoutPtr, and GitkDialog::layout.

void gitkr_dialog_generate_layout GitkDialogPtr  dialog  ) 
 

generate a layout for a given dialog

-- get dialog node and inspect focus and dialog type settings if((node=gitk_xpath_get_node(dialog,"/"GITK_NS_PREFIX":giml/"GITK_NS_PREFIX":dialog",NULL))) { gchar *focus;

if((focus=xmlGetProp(node,"focus"))) { if(!strncasecmp(focus,"main",4)) layout->focus=GITK_FOCUS_TYPE_MAIN; else if(!strncasecmp(focus,"ctrl",4)) layout->focus=GITK_FOCUS_TYPE_CTRL; else gitk_log1("unknown focus=\"s\"",focus); xmlFree(focus); } } else { gitk_err("failed to get dialog"); }

Todo:
do this for every page

decide which layouting algorithm to use (XSLT)

Definition at line 27 of file gitk-renderer-text/gitkrlayout.c.

References GitkrTextLayout::bg_color, color_name_to_attr(), color_name_to_code(), GitkrTextLayout::dim_bold, GitkrTextLayout::fg_color, gitk_err, gitk_log, gitk_log2, GITK_NS_PREFIX, GitkDialogPtr, GitkLayoutPtr, gitkr_dialog_free_layout(), gitkr_dialog_generate_dialog_widgets(), gitkr_dialog_generate_sequential_layout(), gitkr_dialog_new_layout(), GitkrTextLayoutPtr, GitkDialog::layout, and LINES.

Referenced by gitkr_render().

Here is the call graph for this function:

void gitkr_dialog_generate_sequential_layout GitkDialogPtr  dialog,
xmlNodePtr  root
 

generate a layout with pure sequential order

Todo:
Currently we do not yet handle arbitrary deep netsed widgetgroups (only level2). We need to flatten the whole hierarchy.

Definition at line 137 of file gitk-renderer-text/gitkrlayout.c.

References gitk_err, gitk_log, gitk_log1, GITK_NS_PREFIX, gitk_xpath_type_filter(), GitkDialogPtr, gitkr_dialog_generate_sequential_layout_build_page(), gitkr_dialog_generate_sequential_layout_count_pages(), GitkrTextLayoutPtr, GitkDialog::layout, GitkrTextLayout::maxWidgetsPerPage, GitkrTextLayout::numberOfPages, GitkrTextLayout::pages, GitkrTextLayout::title, and GitkrTextLayoutPage::widgets.

Referenced by gitkr_dialog_generate_layout().

Here is the call graph for this function:

gint gitkr_dialog_generate_sequential_layout_build_page GitkDialogPtr  dialog,
xmlNodePtr  root,
xmlXPathCompExprPtr  xpath_get_widgets,
gint  pageIx
 

build a single page

Todo:
set initial value

set initial value

implement widget

set initial value, choices

Definition at line 243 of file gitk-renderer-text/gitkrlayout.c.

References GitkrTextLayout::currentPage, GitkrTextLayout::currentWidget, GitkrTextLayout::focus, gitk_err, GITK_FOCUS_TYPE_MAIN, gitk_log, gitk_log1, gitk_log2, gitk_widget_get_type(), GITK_WIDGET_TYPE_ACTION, GITK_WIDGET_TYPE_CHARACTERINPUT, GITK_WIDGET_TYPE_CHARACTERINPUT_ALPHABETIC, GITK_WIDGET_TYPE_LABEL, GITK_WIDGET_TYPE_OPTIONCHOICE, GITK_WIDGET_TYPE_OPTIONCHOICE_BOOLEAN, GITK_WIDGET_TYPE_OPTIONCHOICE_SINGLE, GITK_WIDGET_TYPE_OPTIONCHOICE_SINGLE_COMPACT, GITK_WIDGET_TYPE_UNDEF, gitk_xpath_type_filter(), GitkDialogPtr, gitkr_cxpath_get_string(), gitkr_widget_action_new(), gitkr_widget_characterinput_alphabetic_new(), gitkr_widget_characterinput_new(), gitkr_widget_label_new(), gitkr_widget_new(), gitkr_widget_optionchoice_boolean_new(), gitkr_widget_optionchoice_new(), GitkrTextLayoutPtr, GitkrTextWidgetPtr, GitkDialog::layout, GitkrTextLayout::maxWidgetsPerPage, GitkrTextLayout::pages, GitkrTextLayoutPage::title, GitkrTextLayoutPage::widgets, GitkrTextLayoutPage::widgetsPerPage, and xpath_get_label.

Referenced by gitkr_dialog_generate_sequential_layout().

Here is the call graph for this function:

gint gitkr_dialog_generate_sequential_layout_count_pages GitkDialogPtr  dialog,
xmlNodePtr  root,
xmlNodeSetPtr  pages,
xmlXPathCompExprPtr  xpath_get_widgets
 

helper function that calculates the number of page we will need

Definition at line 194 of file gitk-renderer-text/gitkrlayout.c.

References gitk_log1, gitk_log2, gitk_log_intro, gitk_log_outro, gitk_xpath_type_filter(), GitkDialogPtr, GitkrTextLayoutPtr, GitkDialog::layout, and GitkrTextLayout::maxWidgetsPerPage.

Referenced by gitkr_dialog_generate_sequential_layout().

Here is the call graph for this function:

GitkrTextLayoutPtr gitkr_dialog_new_layout GitkDialogPtr  dialog  ) 
 

create a initialise a layout structure

Definition at line 90 of file gitk-renderer-text/gitkrlayout.c.

References GitkrTextLayout::ctrl, GitkrTextLayout::currentPage, GitkrTextLayout::currentWidget, GitkrTextLayout::focus, GITK_FOCUS_TYPE_CTRL, GitkDialogPtr, gitkr_cxpath_get_string(), GitkrTextLayoutPtr, LINES, GitkrTextLayout::maxWidgetsPerPage, GitkrTextLayout::pages, GitkrTextLayout::title, GitkrTextLayoutPage::widgets, and xpath_get_dialog_name.

Referenced by gitkr_dialog_generate_layout().

Here is the call graph for this function:

void gitkr_dialog_output_layout GitkDialogPtr  dialog  ) 
 

display the layout of a dialog

Todo:
set color stuff here or somewhere else?

set color stuff here or somewhere else?

set color stuff here or somewhere else?

Definition at line 375 of file gitk-renderer-text/gitkrlayout.c.

References GitkrTextWidget::bg_color, GitkrTextLayout::bg_color, GitkrTextLayout::ctrl, GitkrTextLayout::currentPage, GitkrTextLayout::currentWidget, GitkrTextWidget::dim_bold, GitkrTextLayout::dim_bold, GitkrTextWidget::display_attrs, GitkrTextWidget::fg_color, GitkrTextLayout::fg_color, gitk_log, gitk_log1, gitk_log2, GitkDialogPtr, GITKR_TEXT_NAVIGATION, GitkrTextLayoutPtr, GitkrTextWidgetPtr, GitkrTextWidget::id, GitkDialog::layout, LINES, GitkrTextLayout::numberOfPages, GitkrTextWidget::output, GitkrTextLayout::pages, GitkrTextLayoutPage::title, GitkrTextLayout::title, GitkrTextLayoutPage::widgets, and GitkrTextLayoutPage::widgetsPerPage.

Referenced by gitkr_render(), handle_dialog_ctrl_widgets(), handle_dialog_main_widgets(), next_page(), next_widget(), prev_page(), prev_widget(), and sighandler_on_sigwinch().

GitkrTextWidgetPtr gitkr_layout_get_current_widget GitkrTextLayoutPtr  layout  ) 
 

get the current active widget

Definition at line 521 of file gitk-renderer-text/gitkrlayout.c.

References GitkrTextLayout::currentPage, GitkrTextLayout::currentWidget, GitkrTextLayoutPtr, GitkrTextWidgetPtr, GitkrTextLayout::pages, and GitkrTextLayoutPage::widgets.

Referenced by handle_dialog_main_widgets().

gint gitkr_layout_get_current_widget_line GitkrTextLayoutPtr  layout  ) 
 

get the line position of the current widget

Definition at line 534 of file gitk-renderer-text/gitkrlayout.c.

References GitkrTextLayout::currentWidget, and GitkrTextLayoutPtr.

Referenced by handle_dialog_main_widgets().


Generated on Thu Oct 28 11:01:04 2004 for gitk by doxygen 1.3.6