Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Archive
gnome-latex
Commits
c97ba2ef
Commit
c97ba2ef
authored
Feb 26, 2018
by
Robert Griesel
Committed by
swilmet
Feb 26, 2018
Browse files
LaTeX commands: port Math left delimiter commands to GAction
parent
62f46d0d
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/latex_menu.vala
View file @
c97ba2ef
...
...
@@ -364,24 +364,15 @@ public class LatexMenu : Gtk.ActionGroup
// Math: Left Delimiters
{
"MathLeftDelimiters"
,
"delimiters-left"
,
N_
(
"_Left Delimiters"
)
},
{
"MathLeftDelimiter1"
,
null
,
N_
(
"left ("
),
null
,
null
,
on_math_left_delimiter_1
},
{
"MathLeftDelimiter2"
,
null
,
N_
(
"left ["
),
null
,
null
,
on_math_left_delimiter_2
},
{
"MathLeftDelimiter3"
,
null
,
N_
(
"left { "
),
null
,
null
,
on_math_left_delimiter_3
},
{
"MathLeftDelimiter4"
,
null
,
N_
(
"left <"
),
null
,
null
,
on_math_left_delimiter_4
},
{
"MathLeftDelimiter5"
,
null
,
N_
(
"left )"
),
null
,
null
,
on_math_left_delimiter_5
},
{
"MathLeftDelimiter6"
,
null
,
N_
(
"left ]"
),
null
,
null
,
on_math_left_delimiter_6
},
{
"MathLeftDelimiter7"
,
null
,
N_
(
"left }"
),
null
,
null
,
on_math_left_delimiter_7
},
{
"MathLeftDelimiter8"
,
null
,
N_
(
"left >"
),
null
,
null
,
on_math_left_delimiter_8
},
{
"MathLeftDelimiter9"
,
null
,
N_
(
"left ."
),
null
,
null
,
on_math_left_delimiter_9
},
{
"MathLeftDelimiter1"
,
null
,
N_
(
"left ("
),
null
,
null
},
{
"MathLeftDelimiter2"
,
null
,
N_
(
"left ["
),
null
,
null
},
{
"MathLeftDelimiter3"
,
null
,
N_
(
"left { "
),
null
,
null
},
{
"MathLeftDelimiter4"
,
null
,
N_
(
"left <"
),
null
,
null
},
{
"MathLeftDelimiter5"
,
null
,
N_
(
"left )"
),
null
,
null
},
{
"MathLeftDelimiter6"
,
null
,
N_
(
"left ]"
),
null
,
null
},
{
"MathLeftDelimiter7"
,
null
,
N_
(
"left }"
),
null
,
null
},
{
"MathLeftDelimiter8"
,
null
,
N_
(
"left >"
),
null
,
null
},
{
"MathLeftDelimiter9"
,
null
,
N_
(
"left ."
),
null
,
null
},
// Math: Right Delimiters
...
...
@@ -808,6 +799,26 @@ public class LatexMenu : Gtk.ActionGroup
this
,
"MathSpaceQuad"
);
Amtk
.
utils_bind_g_action_to_gtk_action
(
main_window
,
"latex-command-with-space::qquad"
,
this
,
"MathSpaceQquad"
);
// Math Left Delimiters
Amtk
.
utils_bind_g_action_to_gtk_action
(
main_window
,
"math-command-delimiter-left1"
,
this
,
"MathLeftDelimiter1"
);
Amtk
.
utils_bind_g_action_to_gtk_action
(
main_window
,
"math-command-delimiter-left2"
,
this
,
"MathLeftDelimiter2"
);
Amtk
.
utils_bind_g_action_to_gtk_action
(
main_window
,
"math-command-delimiter-left3"
,
this
,
"MathLeftDelimiter3"
);
Amtk
.
utils_bind_g_action_to_gtk_action
(
main_window
,
"math-command-delimiter-left4"
,
this
,
"MathLeftDelimiter4"
);
Amtk
.
utils_bind_g_action_to_gtk_action
(
main_window
,
"math-command-delimiter-left5"
,
this
,
"MathLeftDelimiter5"
);
Amtk
.
utils_bind_g_action_to_gtk_action
(
main_window
,
"math-command-delimiter-left6"
,
this
,
"MathLeftDelimiter6"
);
Amtk
.
utils_bind_g_action_to_gtk_action
(
main_window
,
"math-command-delimiter-left7"
,
this
,
"MathLeftDelimiter7"
);
Amtk
.
utils_bind_g_action_to_gtk_action
(
main_window
,
"math-command-delimiter-left8"
,
this
,
"MathLeftDelimiter8"
);
Amtk
.
utils_bind_g_action_to_gtk_action
(
main_window
,
"math-command-delimiter-left9"
,
this
,
"MathLeftDelimiter9"
);
}
private
Gtk
.
Action
get_menu_tool_action
(
string
name
,
string
?
label
,
string
?
icon_name
)
...
...
@@ -828,52 +839,7 @@ public class LatexMenu : Gtk.ActionGroup
text_if_no_selection
);
}
/* Left Delimiters */
public
void
on_math_left_delimiter_1
()
{
text_buffer_insert
(
"\\left( "
,
""
);
}
public
void
on_math_left_delimiter_2
()
{
text_buffer_insert
(
"\\left[ "
,
""
);
}
public
void
on_math_left_delimiter_3
()
{
text_buffer_insert
(
"\\left\\lbrace "
,
""
);
}
public
void
on_math_left_delimiter_4
()
{
text_buffer_insert
(
"\\left\\langle "
,
""
);
}
public
void
on_math_left_delimiter_5
()
{
text_buffer_insert
(
"\\left) "
,
""
);
}
public
void
on_math_left_delimiter_6
()
{
text_buffer_insert
(
"\\left] "
,
""
);
}
public
void
on_math_left_delimiter_7
()
{
text_buffer_insert
(
"\\left\\rbrace "
,
""
);
}
public
void
on_math_left_delimiter_8
()
{
text_buffer_insert
(
"\\left\\rangle "
,
""
);
}
public
void
on_math_left_delimiter_9
()
{
text_buffer_insert
(
"\\left. "
,
""
);
}
/* Right Delimiters */
public
void
on_math_right_delimiter_1
()
{
...
...
src/liblatexila/latexila-latex-commands.c
View file @
c97ba2ef
...
...
@@ -730,6 +730,96 @@ math_command_spaces_large_cb (GSimpleAction *action,
latexila_latex_commands_insert_text
(
tepl_window
,
"
\\
; "
,
""
,
NULL
);
}
static
void
math_command_delimiter_left1_cb
(
GSimpleAction
*
action
,
GVariant
*
parameter
,
gpointer
user_data
)
{
TeplApplicationWindow
*
tepl_window
=
TEPL_APPLICATION_WINDOW
(
user_data
);
latexila_latex_commands_insert_text
(
tepl_window
,
"
\\
left( "
,
""
,
NULL
);
}
static
void
math_command_delimiter_left2_cb
(
GSimpleAction
*
action
,
GVariant
*
parameter
,
gpointer
user_data
)
{
TeplApplicationWindow
*
tepl_window
=
TEPL_APPLICATION_WINDOW
(
user_data
);
latexila_latex_commands_insert_text
(
tepl_window
,
"
\\
left[ "
,
""
,
NULL
);
}
static
void
math_command_delimiter_left3_cb
(
GSimpleAction
*
action
,
GVariant
*
parameter
,
gpointer
user_data
)
{
TeplApplicationWindow
*
tepl_window
=
TEPL_APPLICATION_WINDOW
(
user_data
);
latexila_latex_commands_insert_text
(
tepl_window
,
"
\\
left
\\
lbrace "
,
""
,
NULL
);
}
static
void
math_command_delimiter_left4_cb
(
GSimpleAction
*
action
,
GVariant
*
parameter
,
gpointer
user_data
)
{
TeplApplicationWindow
*
tepl_window
=
TEPL_APPLICATION_WINDOW
(
user_data
);
latexila_latex_commands_insert_text
(
tepl_window
,
"
\\
left
\\
langle "
,
""
,
NULL
);
}
static
void
math_command_delimiter_left5_cb
(
GSimpleAction
*
action
,
GVariant
*
parameter
,
gpointer
user_data
)
{
TeplApplicationWindow
*
tepl_window
=
TEPL_APPLICATION_WINDOW
(
user_data
);
latexila_latex_commands_insert_text
(
tepl_window
,
"
\\
left) "
,
""
,
NULL
);
}
static
void
math_command_delimiter_left6_cb
(
GSimpleAction
*
action
,
GVariant
*
parameter
,
gpointer
user_data
)
{
TeplApplicationWindow
*
tepl_window
=
TEPL_APPLICATION_WINDOW
(
user_data
);
latexila_latex_commands_insert_text
(
tepl_window
,
"
\\
left] "
,
""
,
NULL
);
}
static
void
math_command_delimiter_left7_cb
(
GSimpleAction
*
action
,
GVariant
*
parameter
,
gpointer
user_data
)
{
TeplApplicationWindow
*
tepl_window
=
TEPL_APPLICATION_WINDOW
(
user_data
);
latexila_latex_commands_insert_text
(
tepl_window
,
"
\\
left
\\
rbrace "
,
""
,
NULL
);
}
static
void
math_command_delimiter_left8_cb
(
GSimpleAction
*
action
,
GVariant
*
parameter
,
gpointer
user_data
)
{
TeplApplicationWindow
*
tepl_window
=
TEPL_APPLICATION_WINDOW
(
user_data
);
latexila_latex_commands_insert_text
(
tepl_window
,
"
\\
left
\\
rangle "
,
""
,
NULL
);
}
static
void
math_command_delimiter_left9_cb
(
GSimpleAction
*
action
,
GVariant
*
parameter
,
gpointer
user_data
)
{
TeplApplicationWindow
*
tepl_window
=
TEPL_APPLICATION_WINDOW
(
user_data
);
latexila_latex_commands_insert_text
(
tepl_window
,
"
\\
left. "
,
""
,
NULL
);
}
/**
* latexila_latex_commands_add_actions:
* @gtk_window: a #GtkApplicationWindow.
...
...
@@ -772,6 +862,15 @@ latexila_latex_commands_add_actions (GtkApplicationWindow *gtk_window)
{
"math-command-spaces-small"
,
math_command_spaces_small_cb
},
{
"math-command-spaces-medium"
,
math_command_spaces_medium_cb
},
{
"math-command-spaces-large"
,
math_command_spaces_large_cb
},
{
"math-command-delimiter-left1"
,
math_command_delimiter_left1_cb
},
{
"math-command-delimiter-left2"
,
math_command_delimiter_left2_cb
},
{
"math-command-delimiter-left3"
,
math_command_delimiter_left3_cb
},
{
"math-command-delimiter-left4"
,
math_command_delimiter_left4_cb
},
{
"math-command-delimiter-left5"
,
math_command_delimiter_left5_cb
},
{
"math-command-delimiter-left6"
,
math_command_delimiter_left6_cb
},
{
"math-command-delimiter-left7"
,
math_command_delimiter_left7_cb
},
{
"math-command-delimiter-left8"
,
math_command_delimiter_left8_cb
},
{
"math-command-delimiter-left9"
,
math_command_delimiter_left9_cb
},
};
g_return_if_fail
(
GTK_IS_APPLICATION_WINDOW
(
gtk_window
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment