[geany/geany-plugins] 55a4c0: PrettyPrinter: Fix GTK+3 support
Quentin Glidic
git-noreply at xxxxx
Sat Apr 6 16:46:19 UTC 2013
Branch: refs/heads/master
Author: Quentin Glidic <sardemff7+git at sardemff7.net>
Committer: Frank Lanitz <frank at frank.uvena.de>
Date: Sat, 06 Apr 2013 16:46:19 UTC
Commit: 55a4c0e9eceea03c4948373ca3119989d3e0bf67
https://github.com/geany/geany-plugins/commit/55a4c0e9eceea03c4948373ca3119989d3e0bf67
Log Message:
-----------
PrettyPrinter: Fix GTK+3 support
Signed-off-by: Quentin Glidic <sardemff7+git at sardemff7.net>
Modified Paths:
--------------
build/pretty-printer.m4
pretty-printer/src/ConfigUI.c
Modified: build/pretty-printer.m4
1 files changed, 0 insertions(+), 1 deletions(-)
===================================================================
@@ -3,7 +3,6 @@ AC_DEFUN([GP_CHECK_PRETTYPRINTER],
LIBXML_VERSION=2.6.27
GP_ARG_DISABLE([pretty-printer], [auto])
- GP_CHECK_PLUGIN_GTK2_ONLY([pretty-printer])
GP_CHECK_PLUGIN_DEPS([pretty-printer], [LIBXML],
[libxml-2.0 >= ${LIBXML_VERSION}])
GP_COMMIT_PLUGIN_STATUS([Pretty Printer])
Modified: pretty-printer/src/ConfigUI.c
132 files changed, 66 insertions(+), 66 deletions(-)
===================================================================
@@ -50,7 +50,7 @@
PrettyPrintingOptions* prettyPrintingOptions;
/* Will never be used, just here for example */
-GtkWidget* createPrettyPrinterConfigUI(GtkDialog * dialog)
+GtkWidget* createPrettyPrinterConfigUI(GtkDialog * dialog)
{
PrettyPrintingOptions* ppo;
GtkWidget* container;
@@ -62,13 +62,13 @@ GtkWidget* createPrettyPrinterConfigUI(GtkDialog * dialog)
GtkWidget* emptyOptions;
GtkWidget* indentationOptions;
GtkWidget* lineReturnOptions;
-
+
/* default printing options */
if (prettyPrintingOptions == NULL) { prettyPrintingOptions = createDefaultPrettyPrintingOptions(); }
ppo = prettyPrintingOptions;
container = gtk_hbox_new(FALSE, 10);
-
+
leftBox = gtk_vbox_new(FALSE, 6);
commentOptions = createThreeOptionsBox(_("Comments"), _("Put on one line"), _("Inline if possible"), _("Alignment"), ppo->oneLineComment, ppo->inlineComment, ppo->alignComment, &commentOneLine, &commentInline, &commentAlign);
textOptions = createThreeOptionsBox(_("Text nodes"), _("Put on one line"), _("Inline if possible"), _("Alignment"), ppo->oneLineText, ppo->inlineText, ppo->alignText, &textOneLine, &textInline, &textAlign);
@@ -80,7 +80,7 @@ GtkWidget* createPrettyPrinterConfigUI(GtkDialog * dialog)
gtk_box_pack_start(GTK_BOX(leftBox), commentOptions, FALSE, FALSE, 3);
gtk_box_pack_start(GTK_BOX(leftBox), textOptions, FALSE, FALSE, 3);
gtk_box_pack_start(GTK_BOX(leftBox), cdataOptions, FALSE, FALSE, 3);
-
+
rightBox = gtk_vbox_new(FALSE, 6);
gtk_box_pack_start(GTK_BOX(rightBox), emptyOptions, FALSE, FALSE, 3);
gtk_box_pack_start(GTK_BOX(rightBox), indentationOptions, FALSE, FALSE, 3);
@@ -97,26 +97,26 @@ void saveSettings(void)
{
int breakStyle;
PrettyPrintingOptions* ppo = prettyPrintingOptions;
-
+
ppo->oneLineComment = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(commentOneLine));
ppo->inlineComment = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(commentInline));
ppo->alignComment = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(commentAlign));
-
+
ppo->oneLineText = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(textOneLine));
ppo->inlineText = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(textInline));
ppo->alignText = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(textAlign));
-
+
ppo->oneLineCdata = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(cdataOneLine));
ppo->inlineCdata = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(cdataInline));
ppo->alignCdata = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(cdataAlign));
-
+
ppo->emptyNodeStripping = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(emptyNodeStripping));
ppo->emptyNodeStrippingSpace = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(emptyNodeStrippingSpace));
ppo->forceEmptyNodeSplit = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(emptyNodeSplit));
-
+
ppo->indentLength = gtk_spin_button_get_value(GTK_SPIN_BUTTON(indentationCount));
ppo->indentChar = gtk_combo_box_get_active(GTK_COMBO_BOX(indentationChar))==0 ? '\t' : ' ';
-
+
breakStyle = gtk_combo_box_get_active(GTK_COMBO_BOX(lineBreak));
if (breakStyle == 0) ppo->newLineChars = "\r";
else if (breakStyle == 1) ppo->newLineChars = "\n";
@@ -125,74 +125,74 @@ void saveSettings(void)
/*============================================= PRIVATE FUNCTIONS =======================================*/
-/*GtkWidget* createTwoOptionsBox(const char* label,
- const char* checkBox1,
- const char* checkBox2,
- gboolean cb1Active,
- gboolean cb2Active,
- GtkWidget** option1,
+/*GtkWidget* createTwoOptionsBox(const char* label,
+ const char* checkBox1,
+ const char* checkBox2,
+ gboolean cb1Active,
+ gboolean cb2Active,
+ GtkWidget** option1,
GtkWidget** option2)
{
GtkWidget* container = gtk_hbox_new(TRUE, 2);
GtkWidget* rightBox = gtk_vbox_new(FALSE, 6);
GtkWidget* leftBox = gtk_vbox_new(FALSE, 6);
-
+
GtkWidget* lbl = gtk_label_new(label);
GtkWidget* chb1 = gtk_check_button_new_with_label(checkBox1);
GtkWidget* chb2 = gtk_check_button_new_with_label(checkBox2);
-
+
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chb1), cb1Active);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chb2), cb2Active);
-
+
gtk_box_pack_start(GTK_BOX(container), leftBox, FALSE, FALSE, 3);
gtk_box_pack_start(GTK_BOX(container), rightBox, FALSE, FALSE, 3);
-
+
gtk_box_pack_start(GTK_BOX(leftBox), lbl, FALSE, FALSE, 3);
gtk_box_pack_start(GTK_BOX(rightBox), chb1, FALSE, FALSE, 3);
gtk_box_pack_start(GTK_BOX(rightBox), chb2, FALSE, FALSE, 3);
-
+
*option1 = chb1;
*option2 = chb2;
-
+
return container;
}*/
-static GtkWidget* createThreeOptionsBox(const char* label,
- const char* checkBox1,
- const char* checkBox2,
- const char* checkBox3,
- gboolean cb1Active,
- gboolean cb2Active,
- gboolean cb3Active,
- GtkWidget** option1,
- GtkWidget** option2,
+static GtkWidget* createThreeOptionsBox(const char* label,
+ const char* checkBox1,
+ const char* checkBox2,
+ const char* checkBox3,
+ gboolean cb1Active,
+ gboolean cb2Active,
+ gboolean cb3Active,
+ GtkWidget** option1,
+ GtkWidget** option2,
GtkWidget** option3)
{
GtkWidget* container = gtk_hbox_new(TRUE, 2);
GtkWidget* rightBox = gtk_vbox_new(FALSE, 6);
GtkWidget* leftBox = gtk_vbox_new(FALSE, 6);
-
+
GtkWidget* lbl = gtk_label_new(label);
GtkWidget* chb1 = gtk_check_button_new_with_label(checkBox1);
GtkWidget* chb2 = gtk_check_button_new_with_label(checkBox2);
GtkWidget* chb3 = gtk_check_button_new_with_label(checkBox3);
-
+
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chb1), cb1Active);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chb2), cb2Active);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chb3), cb3Active);
-
+
gtk_box_pack_start(GTK_BOX(container), leftBox, FALSE, FALSE, 3);
gtk_box_pack_start(GTK_BOX(container), rightBox, FALSE, FALSE, 3);
-
+
gtk_box_pack_start(GTK_BOX(leftBox), lbl, FALSE, FALSE, 3);
gtk_box_pack_start(GTK_BOX(rightBox), chb1, FALSE, FALSE, 3);
gtk_box_pack_start(GTK_BOX(rightBox), chb2, FALSE, FALSE, 3);
gtk_box_pack_start(GTK_BOX(rightBox), chb3, FALSE, FALSE, 3);
-
+
*option1 = chb1;
*option2 = chb2;
*option3 = chb3;
-
+
return container;
}
@@ -201,28 +201,28 @@ GtkWidget* createEmptyTextOptions(gboolean optEmptyNodeStripping, gboolean optEm
GtkWidget* container = gtk_hbox_new(FALSE, 2);
GtkWidget* rightBox = gtk_vbox_new(FALSE, 6);
GtkWidget* leftBox = gtk_vbox_new(FALSE, 6);
-
+
GtkWidget* lbl = gtk_label_new(_("Empty nodes"));
GtkWidget* chb1 = gtk_check_button_new_with_label(_("Concatenation (<x></x> to <x/>)"));
GtkWidget* chb2 = gtk_check_button_new_with_label(_("Spacing (<x/> to <x />)"));
GtkWidget* chb3 = gtk_check_button_new_with_label(_("Expansion (<x/> to <x></x>)"));
-
+
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chb1), optEmptyNodeStripping);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chb2), optEmptyNodeStrippingSpace);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chb3), optForceEmptyNodeSplit);
-
+
gtk_box_pack_start(GTK_BOX(container), leftBox, FALSE, FALSE, 3);
gtk_box_pack_start(GTK_BOX(container), rightBox, FALSE, FALSE, 3);
-
+
gtk_box_pack_start(GTK_BOX(leftBox), lbl, FALSE, FALSE, 3);
gtk_box_pack_start(GTK_BOX(rightBox), chb1, FALSE, FALSE, 3);
gtk_box_pack_start(GTK_BOX(rightBox), chb2, FALSE, FALSE, 3);
gtk_box_pack_start(GTK_BOX(rightBox), chb3, FALSE, FALSE, 3);
-
+
emptyNodeStripping = chb1;
emptyNodeStrippingSpace = chb2;
emptyNodeSplit = chb3;
-
+
return container;
}
@@ -231,27 +231,27 @@ GtkWidget* createIndentationOptions(char indentation, int count)
GtkWidget* container = gtk_hbox_new(FALSE, 20);
GtkWidget* rightBox = gtk_hbox_new(FALSE, 6);
GtkWidget* leftBox = gtk_vbox_new(FALSE, 6);
-
+
GtkWidget* lbl = gtk_label_new(_("Indentation"));
- GtkWidget* comboChar = gtk_combo_box_new_text();
+ GtkWidget* comboChar = gtk_combo_box_text_new();
GtkWidget* spinIndent = gtk_spin_button_new_with_range(0, 100, 1);
-
- gtk_combo_box_append_text(GTK_COMBO_BOX(comboChar), _("Tab"));
- gtk_combo_box_append_text(GTK_COMBO_BOX(comboChar), _("Space"));
+
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(comboChar), _("Tab"));
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(comboChar), _("Space"));
gtk_combo_box_set_active(GTK_COMBO_BOX(comboChar), (indentation == ' ') ? 1 : 0);
-
+
gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinIndent), count);
-
+
gtk_box_pack_start(GTK_BOX(leftBox), lbl, FALSE, FALSE, 3);
gtk_box_pack_start(GTK_BOX(rightBox), comboChar, FALSE, FALSE, 3);
gtk_box_pack_start(GTK_BOX(rightBox), spinIndent, FALSE, FALSE, 3);
-
+
gtk_box_pack_start(GTK_BOX(container), leftBox, FALSE, FALSE, 3);
gtk_box_pack_start(GTK_BOX(container), rightBox, FALSE, FALSE, 3);
-
+
indentationChar = comboChar;
indentationCount = spinIndent;
-
+
return container;
}
@@ -260,28 +260,28 @@ static GtkWidget* createLineReturnOptions(const char* lineReturn)
GtkWidget* container = gtk_hbox_new(FALSE, 25);
GtkWidget* rightBox = gtk_hbox_new(FALSE, 6);
GtkWidget* leftBox = gtk_vbox_new(FALSE, 6);
-
+
GtkWidget* lbl = gtk_label_new(_("Line break"));
- GtkWidget* comboChar = gtk_combo_box_new_text();
-
+ GtkWidget* comboChar = gtk_combo_box_text_new();
+
int active = 0;
-
- gtk_combo_box_append_text(GTK_COMBO_BOX(comboChar), "\\r");
- gtk_combo_box_append_text(GTK_COMBO_BOX(comboChar), "\\n");
- gtk_combo_box_append_text(GTK_COMBO_BOX(comboChar), "\\r\\n");
-
+
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(comboChar), "\\r");
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(comboChar), "\\n");
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(comboChar), "\\r\\n");
+
if (strlen(lineReturn) == 2) active = 2;
else if (lineReturn[0] == '\n') active = 1;
-
+
gtk_combo_box_set_active(GTK_COMBO_BOX(comboChar), active);
-
+
gtk_box_pack_start(GTK_BOX(leftBox), lbl, FALSE, FALSE, 3);
gtk_box_pack_start(GTK_BOX(rightBox), comboChar, FALSE, FALSE, 3);
-
+
gtk_box_pack_start(GTK_BOX(container), leftBox, FALSE, FALSE, 3);
gtk_box_pack_start(GTK_BOX(container), rightBox, FALSE, FALSE, 3);
-
+
lineBreak = comboChar;
-
+
return container;
}
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
More information about the Plugins-Commits
mailing list