Guitar
Classes | Public Types | Signals | Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes | Friends | List of all members
FileDiffWidget Class Reference

The FileDiffWidget class サイドバイサイドで2つのファイルのdiffを表示するウィジェット More...

#include <FileDiffWidget.h>

Inheritance diagram for FileDiffWidget:
Inheritance graph
[legend]
Collaboration diagram for FileDiffWidget:
Collaboration graph
[legend]

Classes

struct  DiffData
 
struct  InitParam_
 
struct  LineFragment
 
struct  Private
 

Public Types

enum  ViewStyle {
  None, SingleFile, LeftOnly, RightOnly,
  SideBySideText, SideBySideImage
}
 

Signals

void textcodecChanged ()
 

Public Member Functions

 FileDiffWidget (QWidget *parent=nullptr)
 
 ~FileDiffWidget () override
 
void bind (MainWindow *mw)
 スクロールバーのセットアップ More...
 
void clearDiffView ()
 
void setSingleFile (QByteArray const &ba, QString const &id, QString const &path)
 
void updateControls ()
 
void scrollToBottom ()
 
void updateDiffView (const Git::Diff &info, bool uncommited)
 差分ビューを更新 More...
 
void updateDiffView (const QString &id_left, const QString &id_right, QString const &path=QString())
 差分ビューを更新 More...
 
void setMaximizeButtonEnabled (bool f)
 
void setFocusAcceptable (Qt::FocusPolicy focuspolicy)
 
QPixmap makeDiffPixmap (DiffPane pane, int width, int height)
 
void setViewType (FileViewType type)
 
void setTextCodec (QTextCodec *codec)
 
void setTextCodec (char const *name)
 

Protected Member Functions

void resizeEvent (QResizeEvent *) override
 
void keyPressEvent (QKeyEvent *event) override
 

Private Slots

void onVerticalScrollValueChanged (int)
 縦スクロールバーが操作された More...
 
void onHorizontalScrollValueChanged (int)
 横スクロールバーが操作された More...
 
void onDiffWidgetWheelScroll (int lines)
 
void onScrollValueChanged2 (int value)
 
void onDiffWidgetResized ()
 
void on_toolButton_fullscreen_clicked ()
 
void scrollTo (int value)
 
void onMoved (int cur_row, int cur_col, int scr_row, int scr_col)
 スクロール位置の行と桁を設定 More...
 
void on_toolButton_menu_clicked ()
 

Private Member Functions

ViewStyle viewstyle () const
 
GitPtr git ()
 
Git::Object catFile (QString const &id)
 
int totalTextLines () const
 
void resetScrollBarValue ()
 
void updateSliderCursor ()
 
int fileviewHeight () const
 
void setDiffText (const Git::Diff &diff, TextDiffLineList const &left, TextDiffLineList const &right)
 
void setLeftOnly (const Git::Diff &diff, QByteArray const &ba)
 
void setRightOnly (const Git::Diff &diff, QByteArray const &ba)
 
void setSideBySide (const Git::Diff &diff, QByteArray const &ba, bool uncommited, QString const &workingdir)
 
void setSideBySide_ (const Git::Diff &diff, QByteArray const &ba_a, QByteArray const &ba_b, QString const &workingdir)
 
bool isValidID_ (QString const &id)
 コミットIDの検証 More...
 
FileViewType setupPreviewWidget ()
 テキストか画像かでビューを切り替える More...
 
void makeSideBySideDiffData (const Git::Diff &diff, const std::vector< std::string > &original_lines, TextDiffLineList *left_lines, TextDiffLineList *right_lines)
 
void onUpdateSliderBar ()
 
void refrectScrollBar ()
 スクロールバーの状態を反映 More...
 
void refrectScrollBarV ()
 縦スクロールバーの状態を反映 More...
 
void refrectScrollBarH ()
 横スクロールバーの状態を反映 More...
 
void setOriginalLines_ (QByteArray const &ba, const Git::SubmoduleItem *submodule, const Git::CommitItem *submodule_commit)
 
QString diffObjects (QString const &a_id, QString const &b_id)
 
MainWindowmainwindow ()
 
bool setSubmodule (const Git::Diff &diff)
 

Private Attributes

Ui::FileDiffWidget * ui
 
Privatem
 

Friends

class BigDiffWindow
 

Detailed Description

The FileDiffWidget class サイドバイサイドで2つのファイルのdiffを表示するウィジェット

Member Enumeration Documentation

◆ ViewStyle

Enumerator
None 
SingleFile 
LeftOnly 
RightOnly 
SideBySideText 
SideBySideImage 

Constructor & Destructor Documentation

◆ FileDiffWidget()

FileDiffWidget::FileDiffWidget ( QWidget *  parent = nullptr)
explicit
Here is the call graph for this function:

◆ ~FileDiffWidget()

FileDiffWidget::~FileDiffWidget ( )
override

Member Function Documentation

◆ bind()

void FileDiffWidget::bind ( MainWindow mw)

スクロールバーのセットアップ

Parameters
mw
Here is the call graph for this function:

◆ catFile()

Git::Object FileDiffWidget::catFile ( QString const &  id)
private
Here is the call graph for this function:

◆ clearDiffView()

void FileDiffWidget::clearDiffView ( )

◆ diffObjects()

QString FileDiffWidget::diffObjects ( QString const &  a_id,
QString const &  b_id 
)
private
Here is the call graph for this function:

◆ fileviewHeight()

int FileDiffWidget::fileviewHeight ( ) const
private

◆ git()

GitPtr FileDiffWidget::git ( )
private
Here is the call graph for this function:

◆ isValidID_()

bool FileDiffWidget::isValidID_ ( QString const &  id)
private

コミットIDの検証

Parameters
id
Returns
Here is the call graph for this function:

◆ keyPressEvent()

void FileDiffWidget::keyPressEvent ( QKeyEvent *  event)
overrideprotected

◆ mainwindow()

MainWindow * FileDiffWidget::mainwindow ( )
private

◆ makeDiffPixmap()

QPixmap FileDiffWidget::makeDiffPixmap ( DiffPane  pane,
int  width,
int  height 
)
Here is the call graph for this function:

◆ makeSideBySideDiffData()

void FileDiffWidget::makeSideBySideDiffData ( const Git::Diff diff,
const std::vector< std::string > &  original_lines,
TextDiffLineList left_lines,
TextDiffLineList right_lines 
)
private

◆ on_toolButton_fullscreen_clicked

void FileDiffWidget::on_toolButton_fullscreen_clicked ( )
privateslot
Here is the call graph for this function:

◆ on_toolButton_menu_clicked

void FileDiffWidget::on_toolButton_menu_clicked ( )
privateslot
Here is the call graph for this function:

◆ onDiffWidgetResized

void FileDiffWidget::onDiffWidgetResized ( )
privateslot
Here is the call graph for this function:

◆ onDiffWidgetWheelScroll

void FileDiffWidget::onDiffWidgetWheelScroll ( int  lines)
privateslot

◆ onHorizontalScrollValueChanged

void FileDiffWidget::onHorizontalScrollValueChanged ( int  )
privateslot

横スクロールバーが操作された

Here is the call graph for this function:

◆ onMoved

void FileDiffWidget::onMoved ( int  cur_row,
int  cur_col,
int  scr_row,
int  scr_col 
)
privateslot

スクロール位置の行と桁を設定

Parameters
cur_row
cur_col
scr_row
scr_col
Here is the call graph for this function:

◆ onScrollValueChanged2

void FileDiffWidget::onScrollValueChanged2 ( int  value)
privateslot

◆ onUpdateSliderBar()

void FileDiffWidget::onUpdateSliderBar ( )
private

◆ onVerticalScrollValueChanged

void FileDiffWidget::onVerticalScrollValueChanged ( int  )
privateslot

縦スクロールバーが操作された

Here is the call graph for this function:

◆ refrectScrollBar()

void FileDiffWidget::refrectScrollBar ( )
private

スクロールバーの状態を反映

Parameters
updateformat
Here is the call graph for this function:

◆ refrectScrollBarH()

void FileDiffWidget::refrectScrollBarH ( )
private

横スクロールバーの状態を反映

Here is the call graph for this function:

◆ refrectScrollBarV()

void FileDiffWidget::refrectScrollBarV ( )
private

縦スクロールバーの状態を反映

Here is the call graph for this function:

◆ resetScrollBarValue()

void FileDiffWidget::resetScrollBarValue ( )
private

◆ resizeEvent()

void FileDiffWidget::resizeEvent ( QResizeEvent *  )
overrideprotected
Here is the call graph for this function:

◆ scrollTo

void FileDiffWidget::scrollTo ( int  value)
privateslot

◆ scrollToBottom()

void FileDiffWidget::scrollToBottom ( )

◆ setDiffText()

void FileDiffWidget::setDiffText ( const Git::Diff diff,
TextDiffLineList const &  left,
TextDiffLineList const &  right 
)
private
Here is the call graph for this function:

◆ setFocusAcceptable()

void FileDiffWidget::setFocusAcceptable ( Qt::FocusPolicy  focuspolicy)

◆ setLeftOnly()

void FileDiffWidget::setLeftOnly ( const Git::Diff diff,
QByteArray const &  ba 
)
private
Here is the call graph for this function:

◆ setMaximizeButtonEnabled()

void FileDiffWidget::setMaximizeButtonEnabled ( bool  f)

◆ setOriginalLines_()

void FileDiffWidget::setOriginalLines_ ( QByteArray const &  ba,
const Git::SubmoduleItem submodule,
const Git::CommitItem submodule_commit 
)
private
Here is the call graph for this function:

◆ setRightOnly()

void FileDiffWidget::setRightOnly ( const Git::Diff diff,
QByteArray const &  ba 
)
private
Here is the call graph for this function:

◆ setSideBySide()

void FileDiffWidget::setSideBySide ( const Git::Diff diff,
QByteArray const &  ba,
bool  uncommited,
QString const &  workingdir 
)
private
Here is the call graph for this function:

◆ setSideBySide_()

void FileDiffWidget::setSideBySide_ ( const Git::Diff diff,
QByteArray const &  ba_a,
QByteArray const &  ba_b,
QString const &  workingdir 
)
private
Here is the call graph for this function:

◆ setSingleFile()

void FileDiffWidget::setSingleFile ( QByteArray const &  ba,
QString const &  id,
QString const &  path 
)

◆ setSubmodule()

bool FileDiffWidget::setSubmodule ( const Git::Diff diff)
private
Here is the call graph for this function:

◆ setTextCodec() [1/2]

void FileDiffWidget::setTextCodec ( char const *  name)
Here is the call graph for this function:

◆ setTextCodec() [2/2]

void FileDiffWidget::setTextCodec ( QTextCodec *  codec)

◆ setupPreviewWidget()

FileViewType FileDiffWidget::setupPreviewWidget ( )
private

テキストか画像かでビューを切り替える

Returns
Here is the call graph for this function:

◆ setViewType()

void FileDiffWidget::setViewType ( FileViewType  type)

◆ textcodecChanged

void FileDiffWidget::textcodecChanged ( )
signal

◆ totalTextLines()

int FileDiffWidget::totalTextLines ( ) const
private

◆ updateControls()

void FileDiffWidget::updateControls ( )
Here is the call graph for this function:

◆ updateDiffView() [1/2]

void FileDiffWidget::updateDiffView ( const Git::Diff info,
bool  uncommited 
)

差分ビューを更新

Parameters
info
uncommited
Here is the call graph for this function:

◆ updateDiffView() [2/2]

void FileDiffWidget::updateDiffView ( const QString &  id_left,
const QString &  id_right,
QString const &  path = QString() 
)

差分ビューを更新

Parameters
id_left
id_right
path
Here is the call graph for this function:

◆ updateSliderCursor()

void FileDiffWidget::updateSliderCursor ( )
private
Here is the call graph for this function:

◆ viewstyle()

FileDiffWidget::ViewStyle FileDiffWidget::viewstyle ( ) const
private

Friends And Related Function Documentation

◆ BigDiffWindow

friend class BigDiffWindow
friend

Member Data Documentation

◆ m

Private* FileDiffWidget::m
private

◆ ui

Ui::FileDiffWidget* FileDiffWidget::ui
private

The documentation for this class was generated from the following files: