Skip to content
This repository has been archived by the owner on Sep 11, 2021. It is now read-only.

Implemented mouse wheel handling and fixed click handling #22

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
f993e2f
src/classes/presentation_controller.vala
mikerofone Jan 30, 2011
a443471
src/classes/presentation_controller.vala
mikerofone Jan 30, 2011
d3a7981
Implemented coutdown timer to start of presentation
jakobwesthoff Mar 11, 2011
5886db8
Implemented the countdown timer in a same way. No more hacks ;)
jakobwesthoff Mar 11, 2011
be6d58d
Added method for going back 10 slides
Nov 18, 2011
ccfbba1
Implemented the "go back 10 slides" on backspace
Nov 18, 2011
d613d75
Implemented jump10 calls
Nov 22, 2011
7f90e99
Fine tuning of jump and back for border cases
Nov 22, 2011
926b3df
Small optimization moving two function calls
Nov 22, 2011
77fdfc1
Added p as key to go back 10 slides
Nov 22, 2011
8f9a742
Adapted to poppler >= 0.17
Nov 23, 2011
f522b54
Updated the README with the new keybindings for 10 slides jumps
Nov 23, 2011
ae283a5
Added a text view for displaying notes
Dec 9, 2011
daf66ee
Reading of notes from external file
Dec 10, 2011
1294929
Added .gitignore
Dec 10, 2011
626a68a
Next view "disappears" on last slide
Dec 12, 2011
726715c
Added an option for having a black slide at the end of the presentation
Dec 12, 2011
e8464f7
Added a switch for single monitor presentation
Dec 14, 2011
e93445a
Merge branch 'master' into blackOnEnd
Dec 14, 2011
b4dccd9
Removed warnings when displaying black slide at end
Dec 14, 2011
b7b50e2
Fading to black enabled, but going out not yet
Dec 14, 2011
d573c15
Going in and out of fade_to_black
Dec 14, 2011
72879f4
Fade to black is also shown in the presenter window
Dec 14, 2011
f17d324
First steps towards note editing
Dec 15, 2011
cfc5f04
Merge branch 'notes', remote-tracking branch 'origin/notes' into notes
Dec 16, 2011
3f96b9c
Moved ignoring of key (& mouse) events to the presentation_controller
Dec 16, 2011
eec0664
Note saving supported
Dec 16, 2011
3952c9a
Changed the slide id for notes
Dec 16, 2011
2f74579
Trying to circumvent the issue with endlines at the end of file
Dec 16, 2011
1d63446
Merge branch 'notes'
Dec 16, 2011
399799d
Updated README
Dec 16, 2011
0bca8bf
Added a grab_focus when editing notes
Dec 16, 2011
5d6193a
Added possibility to jump to a slide by number
Dec 16, 2011
f1cb6b7
Merge branch 'gotoPage'
Dec 16, 2011
455c15a
Added a null-resetting for avoiding segfaults at end of presentation
Jan 13, 2012
ccef269
Merge git://github.com/davvil/Pdf-Presenter-Console
mikerofone Jan 28, 2012
f5ab9af
Changed README to include mouse wheel commands
mikerofone Jan 28, 2012
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ and interpreted:
- Go forward 10 slides
- Home
- Go back to the first slide and reset the timer
- g
- Input a slide number to jump to
- Escape / q /Alt+F4
- Quit the presentation viewer
- b
Expand Down
19 changes: 19 additions & 0 deletions src/classes/presentation_controller.vala
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ namespace org.westhoffswelt.pdfpresenter {
case 0x073: /* s */
this.notes.save_to_disk();
break;
case 0x067: /* g */
this.controllables_ask_goto_page();
break;
}
return true;
} else {
Expand Down Expand Up @@ -211,6 +214,13 @@ namespace org.westhoffswelt.pdfpresenter {
}
}

/**
* public interface for the above function
*/
public void goto_page( int page_number ) {
controllables_goto_page(page_number);
}

/**
* Fill the presentation display with black
*/
Expand All @@ -228,5 +238,14 @@ namespace org.westhoffswelt.pdfpresenter {
c.edit_note();
}
}

/**
* Ask for the page to jump to
*/
protected void controllables_ask_goto_page() {
foreach( Controllable c in this.controllables ) {
c.ask_goto_page();
}
}
}
}
6 changes: 6 additions & 0 deletions src/classes/window/presentation.vala
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@ namespace org.westhoffswelt.pdfpresenter.Window {
public void edit_note() {
}

/**
* Ask for the page to jump to. We don't do anything
*/
public void ask_goto_page() {
}

/**
* Set the cache observer for the Views on this window
*
Expand Down
66 changes: 64 additions & 2 deletions src/classes/window/presenter.vala
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ namespace org.westhoffswelt.pdfpresenter.Window {
* Slide progress label ( eg. "23/42" )
*/
protected Label slide_progress;

protected Entry slide_jump;

/**
* Indication that the slide is blanked (faded to black)
Expand Down Expand Up @@ -223,15 +225,33 @@ namespace org.westhoffswelt.pdfpresenter.Window {
this.slide_progress.set_justify( Justification.CENTER );
this.slide_progress.modify_fg( StateType.NORMAL, white );
this.slide_progress.modify_font( font );
this.slide_progress.set_size_request(
this.slide_progress.set_size_request(
(int)Math.floor( this.screen_geometry.width * 0.25 ),
bottom_height - 10
bottom_height - 10
);
this.fixedLayout.put(
this.slide_progress,
(int)Math.ceil( this.screen_geometry.width * 0.75 ),
bottom_position - 10
);

this.slide_jump = new Entry();
this.slide_jump.set_alignment(0.5f);
//this.slide_jump.modify_base(StateType.NORMAL, black);
//this.slide_jump.modify_text(StateType.NORMAL, white);
this.slide_jump.modify_font( font );
this.slide_jump.editable = false;
this.slide_jump.no_show_all = true;
this.slide_jump.key_press_event.connect( this.on_key_press_slide_jump );
this.slide_jump.set_size_request(
(int)Math.floor( this.screen_geometry.width * 0.25 ),
bottom_height - 10
);
this.fixedLayout.put(
this.slide_jump,
(int)Math.ceil( this.screen_geometry.width * 0.75 ),
bottom_position - 10
);

this.blank_label = new Label( "Blank" );
this.blank_label.set_justify( Justification.LEFT );
Expand Down Expand Up @@ -430,6 +450,39 @@ namespace org.westhoffswelt.pdfpresenter.Window {
this.timer.start();
}

/**
* Ask for the page to jump to
*/
public void ask_goto_page() {
this.slide_jump.set_text("/%u".printf(this.slide_count));
this.slide_jump.editable = true;
this.slide_jump.grab_focus();
this.slide_jump.set_position(0);
this.slide_jump.show();
this.slide_progress.hide();
this.presentation_controller.set_ignore_input_events( true );
}

/**
* Handle key events for the slide_jump entry field
*/
protected bool on_key_press_slide_jump( Gtk.Widget source, EventKey key ) {
if ( key.keyval == 0xff0d ) {
// Try to parse the input
string input_text = this.slide_jump.text;
int destination = int.parse(input_text.substring(0, input_text.index_of("/")));
this.slide_jump.editable = false;
this.slide_jump.hide();
this.slide_progress.show();
this.presentation_controller.set_ignore_input_events( false );
if ( destination != 0 )
this.presentation_controller.goto_page(destination-1);
return true;
} else {
return false;
}
}

/**
* We will notify the presenter that the screen is faded to black, but
* we will retain the slide view.
Expand All @@ -442,13 +495,19 @@ namespace org.westhoffswelt.pdfpresenter.Window {
this.faded_to_black = !this.faded_to_black;
}

/**
* Edit a note. Basically give focus to notes_view
*/
public void edit_note() {
this.notes_view.editable = true;
this.notes_view.cursor_visible = true;
this.notes_view.grab_focus();
this.presentation_controller.set_ignore_input_events( true );
}

/**
* Handle key presses when editing a note
*/
protected bool on_key_press_notes_view( Gtk.Widget source, EventKey key ) {
if ( key.keyval == 0xff1b) { /* Escape */
this.notes_view.editable = false;
Expand All @@ -461,6 +520,9 @@ namespace org.westhoffswelt.pdfpresenter.Window {
}
}

/**
* Update the text of the current note
*/
protected void update_note() {
string this_note = notes.get_note_for_slide(this.current_view.get_current_slide_number());
this.notes_view.buffer.text = this_note;
Expand Down
7 changes: 6 additions & 1 deletion src/interfaces/controllable.vala
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,13 @@ namespace org.westhoffswelt.pdfpresenter {
public abstract void goto_page( int page_number );

/**
* Edit note for current slide.
* Edit note for current slide
*/
public abstract void edit_note();

/**
* Ask for the page to jump to
*/
public abstract void ask_goto_page();
}
}