Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
xfce4-panel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xfce
xfce4-panel
Commits
99884b14
Commit
99884b14
authored
15 years ago
by
Nick Schermer
Browse files
Options
Downloads
Patches
Plain Diff
Make a standalone macro for the preinit function.
parent
bdb0a3b4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/references/libxfce4panel-sections.txt
+1
-0
1 addition, 0 deletions
docs/references/libxfce4panel-sections.txt
libxfce4panel/xfce-panel-macros.h
+38
-19
38 additions, 19 deletions
libxfce4panel/xfce-panel-macros.h
with
39 additions
and
19 deletions
docs/references/libxfce4panel-sections.txt
+
1
−
0
View file @
99884b14
...
...
@@ -91,6 +91,7 @@ xfce_panel_plugin_xfconf_channel_new
XFCE_PANEL_DEFINE_PLUGIN
XFCE_PANEL_DEFINE_PLUGIN_RESIDENT
XFCE_PANEL_DEFINE_TYPE
XFCE_PANEL_DEFINE_PREINIT_FUNC
XFCE_PANEL_PLUGIN_REGISTER
XFCE_PANEL_PLUGIN_REGISTER_WITH_CHECK
XFCE_PANEL_PLUGIN_REGISTER_FULL
...
...
This diff is collapsed.
Click to expand it.
libxfce4panel/xfce-panel-macros.h
+
38
−
19
View file @
99884b14
...
...
@@ -213,6 +213,37 @@ typedef GTypeModule XfcePanelTypeModule;
/**
* XFCE_PANEL_DEFINE_PREINIT_FUNC:
* @preinit_func: name of the function that points to an
* #XfcePanelPluginPreInit function.
*
* Registers a pre-init function in the plugin module. This function
* is called before gtk_init() and can be used to initialize
* special libaries.
* Downside of this that the plugin cannot run internal. Even if you
* set X-XFCE-Interal=TRUE in the desktop file, the panel will force
* the plugin to run inside a wrapper (this because the panel called
* gtk_init() long before it starts to load the plugins).
*
* Note that you can only use this once and it only works in
* combination with the plugins register/define functions added
* in 4.8.
*
* Since: 4.8.0
**/
#define XFCE_PANEL_DEFINE_PREINIT_FUNC(preinit_func) \
G_MODULE_EXPORT gboolean xfce_panel_module_preinit (gint argc, gchar **argv); \
\
G_MODULE_EXPORT gboolean \
xfce_panel_module_preinit (gint argc, \
gchar **argv) \
{ \
return (*preinit_func) (argc, argv); \
}
/**
* XFCE_PANEL_PLUGIN_REGISTER:
* @construct_func : name of the function that points to an
...
...
@@ -248,6 +279,8 @@ typedef GTypeModule XfcePanelTypeModule;
XFCE_PANEL_PLUGIN_REGISTER_EXTENDED (construct_func,
/* foo */
, \
if (G_LIKELY ((*check_func) (xpp_screen) == TRUE)))
/**
* XFCE_PANEL_PLUGIN_REGISTER_FULL:
* @construct_func : name of the function that points to an
...
...
@@ -257,29 +290,15 @@ typedef GTypeModule XfcePanelTypeModule;
* @check_func : name of the function that points to an
* #XfcePanelPluginCheck function.
*
* Same as #XFCE_PANEL_PLUGIN_REGISTER_WITH_CHECK, but with a preinit
* function. This function is called before all the other functions and
* also before gtk_init(), so you can use this to enable threads or
* initialize other libraries/functions.
*
* Downside of this that the plugin cannot run internal. Even if you set
* X-XFCE-Interal=TRUE in the desktop file, the panel will force the
* plugin to run inside a wrapper.
* Same as calling #XFCE_PANEL_DEFINE_PREINIT_FUNC and
* #XFCE_PANEL_PLUGIN_REGISTER_WITH_CHECK. See those macros
* for more information.
*
* Since: 4.8.0
**/
#define XFCE_PANEL_PLUGIN_REGISTER_FULL(construct_func, preinit_func, check_func) \
XFCE_PANEL_PLUGIN_REGISTER_EXTENDED (construct_func, \
G_MODULE_EXPORT gboolean xfce_panel_module_preinit (gint argc, gchar **argv); \
\
G_MODULE_EXPORT gboolean \
xfce_panel_module_preinit (gint argc, \
gchar **argv) \
{ \
return (*preinit_func) (argc, argv); \
}, \
\
if (G_LIKELY ((*check_func) (xpp_screen) == TRUE)))
XFCE_PANEL_DEFINE_PREINIT_FUNC (preinit_func) \
XFCE_PANEL_PLUGIN_REGISTER_WITH_CHECK (construct_func, check_func)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment