Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
G
geany
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
geany
Commits
1611e3f9
Kaydet (Commit)
1611e3f9
authored
Nis 05, 2018
tarafından
Colomban Wendling
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge pull request #1748 from kugel-/msgwin-api
Add GI-compatible msgwin_*_add() Closes #1748.
üst
4d252c7a
bec38323
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
99 additions
and
42 deletions
+99
-42
msgwindow.c
src/msgwindow.c
+95
-37
msgwindow.h
src/msgwindow.h
+3
-4
plugindata.h
src/plugindata.h
+1
-1
No files found.
src/msgwindow.c
Dosyayı görüntüle @
1611e3f9
...
...
@@ -106,9 +106,11 @@ void msgwin_show_hide_tabs(void)
}
/** Sets the Messages path for opening any parsed filenames without absolute path
* from message lines.
* @param messages_dir The directory. **/
/**
* Sets the Messages path for opening any parsed filenames without absolute path from message lines.
*
* @param messages_dir The directory.
**/
GEANY_API_SYMBOL
void
msgwin_set_messages_dir
(
const
gchar
*
messages_dir
)
{
...
...
@@ -315,11 +317,15 @@ static const GdkColor *get_color(gint msg_color)
/**
* Adds a new message in the compiler tab treeview in the messages window.
* Adds a formatted message in the compiler tab treeview in the messages window.
*
* @param msg_color A color to be used for the text. It must be an element of #MsgColors.
* @param format @c printf()-style format string.
* @param ... Arguments for the @c format string.
*
*
@param msg_color A color to be used for the text. It must be an element of #MsgColors.
*
@param format @c printf()-style format string.
*
@param ... Arguments for the @c format string.
*
@see msgwin_compiler_add_string()
*
*
@since 0.16
**/
GEANY_API_SYMBOL
void
msgwin_compiler_add
(
gint
msg_color
,
const
gchar
*
format
,
...)
...
...
@@ -334,7 +340,17 @@ void msgwin_compiler_add(gint msg_color, const gchar *format, ...)
g_free
(
string
);
}
/**
* Adds a new message in the compiler tab treeview in the messages window.
*
* @param msg_color A color to be used for the text. It must be an element of #MsgColors.
* @param msg Compiler message to be added.
*
* @see msgwin_compiler_add()
*
* @since 1.34 (API 236)
**/
GEANY_API_SYMBOL
void
msgwin_compiler_add_string
(
gint
msg_color
,
const
gchar
*
msg
)
{
GtkTreeIter
iter
;
...
...
@@ -383,17 +399,20 @@ void msgwin_show_hide(gboolean show)
/**
* Adds a new message in the messages tab treeview in the messages window.
* If @a line and @a doc are set, clicking on this line jumps into the file which is specified
* by @a doc into the line specified with @a line.
* Adds a formatted message in the messages tab treeview in the messages window.
*
* @param msg_color A color to be used for the text. It must be an element of #MsgColors.
* @param line The document's line where the message belongs to. Set to @c -1 to ignore.
* @param doc The document. Set to @c NULL to ignore.
* @param format @c printf()-style format string.
* @param ... Arguments for the @c format string.
* If @a line and @a doc are set, clicking on this line jumps into the file
* which is specified by @a doc into the line specified with @a line.
*
* @since 0.15
* @param msg_color A color to be used for the text. It must be an element of #MsgColors.
* @param line The document's line where the message belongs to. Set to @c -1 to ignore.
* @param doc @nullable The document. Set to @c NULL to ignore.
* @param format @c printf()-style format string.
* @param ... Arguments for the @c format string.
*
* @see msgwin_msg_add_string()
*
* @since 0.16
**/
GEANY_API_SYMBOL
void
msgwin_msg_add
(
gint
msg_color
,
gint
line
,
GeanyDocument
*
doc
,
const
gchar
*
format
,
...)
...
...
@@ -410,7 +429,22 @@ void msgwin_msg_add(gint msg_color, gint line, GeanyDocument *doc, const gchar *
}
/* adds string to the msg treeview */
/**
* Adds a new message in the messages tab treeview in the messages window.
*
* If @a line and @a doc are set, clicking on this line jumps into the
* file which is specified by @a doc into the line specified with @a line.
*
* @param msg_color A color to be used for the text. It must be an element of #MsgColors.
* @param line The document's line where the message belongs to. Set to @c -1 to ignore.
* @param doc @nullable The document. Set to @c NULL to ignore.
* @param string Message to be added.
*
* @see msgwin_msg_add()
*
* @since 1.34 (API 236)
**/
GEANY_API_SYMBOL
void
msgwin_msg_add_string
(
gint
msg_color
,
gint
line
,
GeanyDocument
*
doc
,
const
gchar
*
string
)
{
GtkTreeIter
iter
;
...
...
@@ -448,29 +482,26 @@ void msgwin_msg_add_string(gint msg_color, gint line, GeanyDocument *doc, const
/**
* Logs a status message *without* setting the status bar.
* (Use ui_set_statusbar() to display text on the statusbar)
* Logs a new status message *without* setting the status bar.
*
* Use @ref ui_set_statusbar() to display text on the statusbar.
*
* @param string Status message to be logged.
*
* @param format @c printf()-style format string.
* @param ... Arguments for the @c format string.
* @see msgwin_status_add()
*
* @since 1.34 (API 236)
**/
GEANY_API_SYMBOL
void
msgwin_status_add
(
const
gchar
*
format
,
...
)
void
msgwin_status_add
_string
(
const
gchar
*
string
)
{
GtkTreeIter
iter
;
gchar
*
string
;
gchar
*
statusmsg
,
*
time_str
;
va_list
args
;
va_start
(
args
,
format
);
string
=
g_strdup_vprintf
(
format
,
args
);
va_end
(
args
);
/* add a timestamp to status messages */
time_str
=
utils_get_current_time_string
();
statusmsg
=
g_strconcat
(
time_str
,
": "
,
string
,
NULL
);
g_free
(
time_str
);
g_free
(
string
);
/* add message to Status window */
gtk_list_store_append
(
msgwindow
.
store_status
,
&
iter
);
...
...
@@ -488,6 +519,32 @@ void msgwin_status_add(const gchar *format, ...)
}
}
/**
* Logs a formatted status message *without* setting the status bar.
*
* Use @ref ui_set_statusbar() to display text on the statusbar.
*
* @param format @c printf()-style format string.
* @param ... Arguments for the @c format string.
*
* @see msgwin_status_add_string()
*
* @since 0.12
**/
GEANY_API_SYMBOL
void
msgwin_status_add
(
const
gchar
*
format
,
...)
{
gchar
*
string
;
va_list
args
;
va_start
(
args
,
format
);
string
=
g_strdup_vprintf
(
format
,
args
);
va_end
(
args
);
msgwin_status_add_string
(
string
);
g_free
(
string
);
}
static
void
on_message_treeview_clear_activate
(
GtkMenuItem
*
menuitem
,
gpointer
user_data
)
...
...
@@ -1237,12 +1294,13 @@ static gboolean on_msgwin_button_press_event(GtkWidget *widget, GdkEventButton *
/**
* Switches to the given notebook tab of the messages window and shows the messages window
* if it was previously hidden and @a show is set to @c TRUE.
* Switches to the given notebook tab of the messages window.
*
* The messages window is shown if it was previously hidden and @a show is set to @c TRUE.
*
*
@param tabnum An index of a tab in the messages window. Valid values are all elements of
* #MessageWindowTabNum.
*
@param show
Whether to show the messages window at all if it was hidden before.
*
@param tabnum An index of a tab in the messages window. Valid values are
*
all elements of
#MessageWindowTabNum.
*
@param show
Whether to show the messages window at all if it was hidden before.
*
* @since 0.15
**/
...
...
@@ -1274,9 +1332,9 @@ void msgwin_switch_tab(gint tabnum, gboolean show)
/**
*
Removes all messages from a tab specified by @a tabnum in the messages window.
* Removes all messages from a tab specified by @a tabnum in the messages window.
*
*
@param tabnum An index of a tab in the messages window which should be cleared.
* @param tabnum An index of a tab in the messages window which should be cleared.
* Valid values are @c MSG_STATUS, @c MSG_COMPILER and @c MSG_MESSAGE.
*
* @since 0.15
...
...
src/msgwindow.h
Dosyayı görüntüle @
1611e3f9
...
...
@@ -53,11 +53,14 @@ typedef enum
void
msgwin_status_add
(
const
gchar
*
format
,
...)
G_GNUC_PRINTF
(
1
,
2
);
void
msgwin_status_add_string
(
const
gchar
*
msg
);
void
msgwin_compiler_add
(
gint
msg_color
,
const
gchar
*
format
,
...)
G_GNUC_PRINTF
(
2
,
3
);
void
msgwin_compiler_add_string
(
gint
msg_color
,
const
gchar
*
msg
);
void
msgwin_msg_add
(
gint
msg_color
,
gint
line
,
GeanyDocument
*
doc
,
const
gchar
*
format
,
...)
G_GNUC_PRINTF
(
4
,
5
);
void
msgwin_msg_add_string
(
gint
msg_color
,
gint
line
,
GeanyDocument
*
doc
,
const
char
*
msg
);
void
msgwin_clear_tab
(
gint
tabnum
);
...
...
@@ -93,10 +96,6 @@ void msgwin_finalize(void);
void
msgwin_show_hide
(
gboolean
show
);
void
msgwin_msg_add_string
(
gint
msg_color
,
gint
line
,
GeanyDocument
*
doc
,
const
gchar
*
string
);
void
msgwin_compiler_add_string
(
gint
msg_color
,
const
gchar
*
msg
);
void
msgwin_show_hide_tabs
(
void
);
...
...
src/plugindata.h
Dosyayı görüntüle @
1611e3f9
...
...
@@ -59,7 +59,7 @@ G_BEGIN_DECLS
* @warning You should not test for values below 200 as previously
* @c GEANY_API_VERSION was defined as an enum value, not a macro.
*/
#define GEANY_API_VERSION 23
5
#define GEANY_API_VERSION 23
6
/* hack to have a different ABI when built with GTK3 because loading GTK2-linked plugins
* with GTK3-linked Geany leads to crash */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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