342 Commits

Author SHA1 Message Date
0f6148c892 backport whitespace rendering to LM 19.3 Tricia 2021-07-17 03:05:39 -05:00
Clement Lefebvre
5fae2771c8 2.4.2 2019-12-11 14:49:51 +00:00
Clement Lefebvre
c912a44774 l10n: Update translations 2019-12-11 14:49:23 +00:00
Clement Lefebvre
0d006777fc 2.4.1 2019-11-26 17:14:41 +00:00
Clement Lefebvre
2e074fd0ed l10n: Update translations 2019-11-26 17:14:17 +00:00
Clement Lefebvre
8a0c1f6e08 2.4.0 2019-11-22 12:12:34 +00:00
Clement Lefebvre
3e37213b5e Print preview: Reuse existing msgid 2019-11-22 12:11:17 +00:00
Clement Lefebvre
b7ee3bf83b open-uri: Simplify and fix translations
- Remove niche feature to download source code.
- Reuse existing msgid "Open '%s'"
- Fix gettext domain
2019-11-22 12:06:37 +00:00
Clement Lefebvre
359fcb87c5 open-uri: Make the plugin built-in 2019-11-22 11:52:16 +00:00
Leigh Scott
a549184217 add open uri plugin (#317) 2019-11-22 11:47:56 +00:00
Pavel Shlyak
eda7a9a23c Cleanup (#321)
The left side of the expression was always true
2019-11-14 17:56:44 +01:00
nardholio
4dff6fa7e1 Packaging: remove dependency on libpeas-1.0-0-python3loader (#325)
This is now provided as a virtual package
2019-11-14 17:55:49 +01:00
Michael Webster
8763fbf5df print-preview: add a print button to the preview toolbar, to immediately
print the previewed document.
2019-11-05 20:07:35 -05:00
Clement Lefebvre
9d3d2acfd9 2.2.3 2019-07-28 15:03:56 +02:00
Clement Lefebvre
96d6a9c0fb l10n: Update translations 2019-07-28 15:03:22 +02:00
Clement Lefebvre
7cc3d5967b 2.2.2 2019-07-25 11:00:12 +02:00
Clement Lefebvre
54978e6e8f Preferences: Make dialog slightly taller 2019-07-23 12:11:14 +02:00
Clement Lefebvre
69895bd026 2.2.1 2019-07-10 11:26:30 +02:00
Clement Lefebvre
3066879089 l10n: Update translations 2019-07-10 11:26:03 +02:00
Alexander Drozdov
f4c882e3b5 Automatically open new Xed window on current workspace... (#319)
...if it wasn't already opened. Otherwise, open new tab
in Xed window on current Workspace.

Fix regression #318
2019-07-10 11:24:52 +02:00
Clement Lefebvre
cd94beb376 2.2.0 2019-06-29 17:24:07 +02:00
Clement Lefebvre
350e3ffc29 l10n: Update POT 2019-06-23 14:24:25 +02:00
Stephen Collins
52ee1591f7 Prevent a warning when closing the window while print preview is open (#315)
The warning was caused by the preview trying to save print settings
after the settings object was cleared. Clearing the settings object
in *_finalize instead of *_dispose fixes the issue.
2019-06-23 14:23:08 +02:00
Leigh Scott
db60af5efb Add minimum required version for xapp (#313)
closes #312
2019-06-23 14:22:46 +02:00
Stephen Collins
dde92eecbf Simplify an if statement. The logic is identical, but easier to read (#314) 2019-06-20 09:29:36 -07:00
Stephen Collins
7bdc217e8c Tab width popup: only select a menu item when the menu is open (#311)
This fixes a gdk window assertion error that occurs every time xed
is opened, as well as causes the correct menu item to actually be
selected as expected (it currently isn't).
2019-06-15 01:21:57 -07:00
Stephen Collins
2520d1c087 Remove deprecated call to gtk_widget_override_background_color (#299)
This was an override that no longer seems necessary and is causing
deprecation warnings.
2019-05-13 00:32:52 -07:00
Stephen Collins
116bfc2ac1 Remove references to deprecated GTK_STOCK_* (#298) 2019-05-13 00:32:34 -07:00
Stephen Collins
1820d0db69 Switch deprecated gtk_icon_info_free to g_object_unref (#301) 2019-05-13 00:23:40 -07:00
Stephen Collins
17062aaa18 Fix stuttering and disappearing of the toolbar when fullscreen (#300)
This fixes an issue where moving the mouse along the top edge of the
screen while fullscreened will cause a leave event to be triggered,
even though the mouse pointer is still inside the event box. This
caused the toolbar to disappear and/or stutter while moving the mouse
along the top edge.
2019-05-13 00:23:03 -07:00
Stephen Collins
aa7dabad39 Search: replace a few functions that were deprecated in Gtk 3.22 (#297)
gtk_source_search_context_forward_finish,
gtk_source_search_context_backward_finish, and
gtk_source_search_context_replace
were replaced with
gtk_source_search_context_forward_finish2,
gtk_source_search_context_backward_finish2, and
gtk_source_search_context_replace2
respectively.
2019-05-08 02:34:06 -07:00
Stephen Collins
15ec9b4e65 Print preview: remove a couple calls to gtk_adjustment_value_changed (#296)
This function is no longer needed as the "value-changed" signal is
automatically emitted whenever the value changes (since Gtk 3.18).
2019-05-08 02:29:29 -07:00
Stephen Collins
612f36cea9 Replace deprecated gdk_cursor_new with gdk_cursor_new_for_display (#295)
Also fix a potential memory leak/segfault in the filebrowser plugin.
2019-05-08 02:17:45 -07:00
Stephen Collins
e7328ad12e print job: replace some deprecated font button functions (#294)
Replaces gtk_font_button_*et_font_name with gtk_font_chooser_*et_font
2019-05-08 02:08:22 -07:00
Clement Lefebvre
172f323b4b l10n: Update POT 2019-05-05 17:33:18 +01:00
Stephen Collins
4044529191 Add toggle comment and toggle comment block actions w/ keybindings (#290) 2019-05-05 10:27:11 +01:00
Stephen Collins
992ca7a3ec print preview: fix logic for forward button sensitivity (#292)
Previously, the logic used to set the sensitivity of the forward
navigation button failed to consider when multiple pages are shown.
This resulted in the forward button being sensitive in some cases,
even if all pages, or the last page were shown. With this commit, it
is now updated properly.

Also, when the rows and columns are changed, the current page is now
changed to the nearest multiple of rows*cols so that the current page
is still shown, but navigating back to the beginning and then forward
again will be consistent.
2019-05-05 10:26:58 +01:00
Stephen Collins
67892da099 Fix some deprecation warnings (#289)
* xed-app.c: replace get_active_window with gtk_application version

This allows us to remove quite a bit of code, some of which uses
deprecated functions, so it also has the benefit of cleaning up the
deprecation warnings a bit.

* Switch a couple uses of gtk_show_uri with gtk_show_uri_on_window

gtk_show_uri is deprecated.

* Taglist plugin: remove call to gtk_tree_view_set_rules_hint

This function is deprecated, and it already defaults to false in
any case, so it wasn't doing anything anyway.

* Deprecations: move all instances of gtk_menu_popup to newer methods

In a couple cases this simplifies the code quite a bit

* Replace deprecated gdk_window_at_pointer with newer method
2019-05-05 10:25:37 +01:00
JosephMcc
2ebff67c9c xed-notebook: Always show the main notebook tabs (#285)
We were only showing the tabs when more than one file was open. When
fullscreen this leaves no indication of the current file having been modified
if there is only one. Instead just set them to show at all times.

Closes: https://github.com/linuxmint/xed/issues/152
2019-05-05 10:21:18 +01:00
JosephMcc
43ee0436d8 xed-window: Fix the tabs/spaces label in the statusbar (#283)
This was broken in the commit that added the new highlight mode selection
dialog. Get it working again.
2019-05-05 10:20:53 +01:00
Stephen Collins
fb0002bdcd Filebrowser: Kill the click policy property with fire (#293)
This is left over code from the gedit days, which we don't use, and
don't use. This also has the added benifit of removing at least 1
deprecation warning.
2019-05-05 10:20:18 +01:00
Stephen Collins
2e3f337e84 print preview: fix layout drawing for 1X2 and 2X1 layouts (#291)
The indices were backwards, which was causing incorrect layout, and
scrolling issues at larger zoom levels.
2019-05-03 16:19:49 +01:00
JosephMcc
d208cae3bc cleanup: Remove an unused Makefile.am (#280)
We build with Meson now so don't need this
2019-03-25 15:35:46 +00:00
JosephMcc
05b68fb5f5 statusbar: Fix the menu button styling (#281)
This was broken in 7ce2a750db (diff-d114482c8758b92b9c56c95d18efe926)
2019-03-25 15:35:26 +00:00
Eli Schwartz
42da8bc289 meson: require itstool command to be available (#266)
This is needed in order to run meson's gnome.yelp() helper when
installing the help data.
2019-02-08 10:19:11 +00:00
Clement Lefebvre
fe1c4f1e38 2.0.2 2018-12-11 14:10:28 +00:00
Clement Lefebvre
c57ad618a1 l10n: Update translations 2018-12-11 14:10:00 +00:00
chingyinwan123
39e08bd3b8 Fix warnings when building xed 2.0.1 (#264)
* Remove unused variables

Fixes the following warnings when building xed:

../plugins/filebrowser/xed-file-browser-plugin.c: In function ‘xed_file_browser_plugin_activate’:
../plugins/filebrowser/xed-file-browser-plugin.c:532:22: warning: unused variable ‘schema’ [-Wunused-variable]
     GSettingsSchema *schema;
                      ^~~~~~
../plugins/filebrowser/xed-file-browser-plugin.c:531:28: warning: unused variable ‘schema_source’ [-Wunused-variable]
     GSettingsSchemaSource *schema_source;
                            ^~~~~~~~~~~~~

* Remove an unused variable

Fixes the following warning when building xed:

../plugins/sort/xed-sort-plugin.c: In function ‘buffer_sort_lines’:
../plugins/sort/xed-sort-plugin.c:168:12: warning: variable ‘last_line’ set but not used [-Wunused-but-set-variable]
     gchar *last_line = NULL;
            ^~~~~~~~~

* Remove an unused variable

Fixes the following warning when building xed:

../plugins/wordcompletion/xed-wordcompletion-plugin.c: In function ‘xed_wordcompletion_view_deactivate’:
../plugins/wordcompletion/xed-wordcompletion-plugin.c:306:34: warning: unused variable ‘provider’ [-Wunused-variable]
     GtkSourceCompletionProvider *provider;
                                  ^~~~~~~~

* Remove an unused variable

Fixes the following warning when building xed:

../plugins/spell/xed-spell-plugin.c: In function ‘update_ui’:
../plugins/spell/xed-spell-plugin.c:495:24: warning: unused variable ‘buffer’ [-Wunused-variable]
         GtkTextBuffer *buffer;
                        ^~~~~~
2018-12-11 11:38:12 +00:00
Michael Webster
b868ebde1c highlight mode window: Make activatable via shortcut (ctrl-shift-H),
focus the search entry by default, and allow Escape to cancel the
dialog from the search entry.

Fixes linuxmint/mint-19.1-beta#18
Fixes linuxmint/mint-19.1-beta#19
Fixes linuxmint/mint-19.1-beta#20
2018-12-09 00:07:15 -05:00
Clement Lefebvre
dc1104c93b Fix non-translated desktop file 2018-12-05 15:18:42 +00:00
Clement Lefebvre
c30f2a988d 2.0.1 2018-11-27 18:33:43 +00:00
Clement Lefebvre
465226e185 l10n: Update translations 2018-11-27 18:33:10 +00:00
Leigh Scott
7220975463 Switch build instructions for meson port. (#263) 2018-11-22 09:39:52 +00:00
Clement Lefebvre
088ec7b031 2.0.0 2018-11-19 11:35:09 +00:00
Clement Lefebvre
f6bc8206ed l10n: Update POT 2018-11-19 11:34:13 +00:00
Clement Lefebvre
0ec63fc00e Fix merge issues
POTFILES.in and xed-window.c required a couple of changes
after the status selector PR was merged.
2018-11-19 11:30:51 +00:00
Clement Lefebvre
7ce2a750db Merge branch 'highlight-selector' of git://github.com/TomaszGasior/xed into TomaszGasior-highlight-selector 2018-11-19 11:16:20 +00:00
Stephen Collins
6e36dc4a5f Port to meson (#258)
* Port to meson

* plugin generation script: swtich to meson, update to python3, switch to libpeas, add some extra options, and cleanup

* clean up some build warnings

* kill xed-bugreport.sh with fire: it isn't used anymore, and probably doesn't even work

* update gzip command to avoid warnings on some systems and move appdata.xml to /usr/share/metainfo/ as that's where it's supposed to go now

* POTFILES.in: fix path that changed in the meson port, which was causing makepot to fail
2018-11-19 11:09:52 +00:00
NikoKrause
39cadaa36e close dialog: use "suggested-action" style class (#261)
... for the default actions (save as, save)
2018-11-15 10:10:25 +00:00
NikoKrause
834266682c Rearrange help entries (xapp consistency) (#256)
also delete duplicate entry
2018-10-10 10:51:56 +01:00
NikoKrause
3523968707 Use icon for keyboard shortcuts help entry (#255) 2018-10-09 11:04:20 +01:00
JosephMcc
494a2e7ce3 xed-window: Indicate if we are currently using spaces or tabs in statusbar (#246)
Other editors like Sublime do this and it's more obvious to the user what they
are currently using. The current label "Tab Width" can be misleading.
Especially since we default to using spaces.
2018-09-24 09:59:07 +01:00
Tomasz Gąsior
0b1133ac44 Kill XedStatusComboBox. It's not used now. 2018-07-22 22:30:19 +02:00
Tomasz Gąsior
986655d6aa Use XedStatusMenuButton instead -ComboBox in statusbar, for consistency. 2018-07-22 20:13:26 +02:00
Tomasz Gąsior
06a20265ea Use popover with highlight selector instead loooong menu in statusbar. 2018-07-22 16:49:55 +02:00
Tomasz Gąsior
66c155a386 Fix compilation warning. 2018-07-22 16:24:59 +02:00
Tomasz Gąsior
fe3fa259fb Import GeditStatusMenuButton. 2018-07-22 16:23:29 +02:00
Tomasz Gąsior
ac9d0a9343 XedWindow cleanup. 2018-07-21 22:56:14 +02:00
Tomasz Gąsior
bc381189c7 Use highlight dialog instead submenu in "View" menu. 2018-07-21 22:34:26 +02:00
Tomasz Gąsior
d4de361efb Import GeditHighlightModeDialog and -Selector from Gedit to Xed.
Just copy&paste and change Gedit -> Xed.
2018-07-21 22:26:37 +02:00
Clement Lefebvre
d99074ec5e 1.8.3 2018-07-17 09:33:19 +02:00
Michael Webster
dfcf007a44 search bar/xed-history-entry: Set a 'width-chars' on the GtkEntry
widgets of the search and replace entry widgets, and allow their
labels to ellipsize upon resizing.

This allows the entry widgets to have a smaller minimum size, which
was having an impact on window tiling for certain locales and display
resolutions (muffin and other wm's won't allow tiling of a window
if the resulting window size is less than the minimum size hints
reported by gtk and other toolkits.)

Ellipsizing the labels has the same benefit of enabling xed to be
resized smaller to tile on smaller displays.  This ellipsizing only
occurs once the entries hit their minimum size.

Fixes #73
2018-07-06 14:40:07 -04:00
Clement Lefebvre
4f43977c59 1.8.2 2018-06-26 13:22:17 +02:00
Clement Lefebvre
7bebfc9b97 l10n: Update translations 2018-06-26 13:16:41 +02:00
Clement Lefebvre
8c6125e8fa l10n: Update POT file 2018-06-08 12:08:54 +01:00
NikoKrause
e7c4d897dd missing l10n: Help -> Shortcuts (#229) 2018-06-08 12:07:53 +01:00
Clement Lefebvre
44ec63074e 1.8.1 2018-05-22 12:53:56 +01:00
Clement Lefebvre
fdd6c18a51 l10n: Update files 2018-05-22 12:53:27 +01:00
Clement Lefebvre
51383ae711 l10n: Update translations 2018-05-22 12:51:07 +01:00
Clement Lefebvre
7951868e92 1.8.0 2018-05-06 16:43:43 +01:00
Clement Lefebvre
9788914d86 l10n: Update POT file 2018-05-06 16:42:09 +01:00
Clement Lefebvre
0409e91288 Wordcompletion: Fix a few mgsids 2018-03-16 11:10:22 +00:00
Mickael Albertus
8a32b92c33 Creation of plugin Word completion (#199)
* Creation of plugin

* Correction of shortcut

* Update translations+fix code

* Add Makefile.in and tab/space fix

* Add makefile.am remove makefile.in
2018-03-16 10:50:39 +00:00
JosephMcc
3999de8f59 xed-window: Fix a potential crash 2018-03-11 04:38:24 -07:00
Clement Lefebvre
37338603dc CI: Don't build for Mint 18
GTK 3.22 is now required.
2018-03-09 15:12:22 +00:00
Clement Lefebvre
87cd264acf Merge pull request #196 from JosephMcc/1.8-dev1
1.8 dev1
2018-03-09 15:11:24 +00:00
Nic
cc493b9b9b Add C tags to the taglist plugin (#188)
Added tags for:
 - Including stdio.h
 - `include` statements
 - The `main` function
 - Comments and multi-line comments
 - `printf` statements
2018-02-19 11:52:10 +00:00
JosephMcc
a86c482308 spell-plugin: Fix a link to the help file 2018-02-14 10:37:36 -08:00
JosephMcc
bd32e81f13 spell-plugin: Port to gspell 2018-02-10 12:22:37 -08:00
JosephMcc
19354f86c1 Clean up a few build warnings
Mostly just missing casts and removing a couple now unused functions and
variables.
2018-02-05 01:48:10 -08:00
JosephMcc
39dcfcab0b Fix a couple of issues turned up by Codacy 2018-02-05 01:03:13 -08:00
JosephMcc
6c7e40c3ba xed-notebook: Allow changing tabs with mouse back/forward buttons
While at it, fix the direction for switching tabs when scrolling with the
mouse wheel.

Closes https://github.com/linuxmint/xed/issues/115
2018-02-05 01:03:13 -08:00
JosephMcc
0a25600883 spell-plugin: Update for removal of some deprecated functionality
enchant_dict_add_to_pwl () was removed from libenchant. Use it's replacement,
enchant_dict_add () instead and bump our required version of libenchant.

Closes https://github.com/linuxmint/xed/issues/198
2018-02-05 01:03:13 -08:00
JosephMcc
a5af28a95d xed-spell-checker.c: Clean up the code formatting 2018-02-05 01:03:13 -08:00
JosephMcc
a13a573228 xed-searchbar: Fix the size of the searchbar close button
The theming for this changed in gtk3.20+. Get it back to the proper size and
theme it in xed-style.css instead of hard coding it.
2018-02-05 01:03:13 -08:00
JosephMcc
100428eaf9 css: Add support for Adwaita 2018-02-05 01:03:13 -08:00
JosephMcc
d86c906848 debian: Add --enable-silent-rules to debian/rules 2018-02-05 01:03:13 -08:00
JosephMcc
ddaf70747c xed-view: Add shortcuts for change case
Closes https://github.com/linuxmint/xed/issues/154
2018-02-05 01:03:13 -08:00
JosephMcc
6159ad5be2 Add a shortcuts window 2018-02-05 01:03:13 -08:00
JosephMcc
6383f71fa0 xed-notebook: Clean up some gtk3.20+ conditionals
Since we are moving to gtk3.22 we can clean these up.
2018-02-05 01:03:13 -08:00
JosephMcc
c269c57777 xed-view-frame: Fix the css for the minimap frame
This makes it work in gtk3.20+
2018-02-05 01:03:13 -08:00
JosephMcc
561c94e71a xed-status-combo-box: Remove some deprecated css functionality
This stuff is deprecated and just spams warnings so clean it up.
2018-02-05 01:03:12 -08:00
JosephMcc
78ca6d13e0 xed-window: Rework the fullscreen toolbar
The animation used for hiding/showing the fullscreen toolbar is totally broken
under HiDPI. Port to GtkRevealer and GtkEventBox to get the proper behaviour.
2018-02-05 01:03:12 -08:00
JosephMcc
bc18f166a3 preferences-dialog: Complete revamp
Use the new XApps preferences window as the base for a total redesign of the
new dialog. While at it port to GtkSourceStyleSchemeChooserWidget.
2018-02-05 01:03:12 -08:00
JosephMcc
ef9294aae2 Pull upstream fixes for gtk and gtksourceview changes
* fix errors in xed-metadata-manager
* upstream changes for file loading and saving
* modernize some code in xed-document

Closes https://github.com/linuxmint/xed/issues/146
2018-02-05 01:03:12 -08:00
Leigh Scott
4c813f2c7f Fix Py*DeprecationWarning (#202) 2018-02-03 10:26:28 +00:00
Leigh Scott
50b01551ac Fix clang compile issue (#209) 2018-01-30 10:09:43 +00:00
Clement Lefebvre
d5ccae34be Add CI configuration 2018-01-23 10:37:51 +00:00
Clement Lefebvre
4fe403dd63 1.6.3 2017-11-23 12:24:59 +00:00
Clement Lefebvre
b4d9a09870 l10n: Update translations 2017-11-23 12:24:24 +00:00
Clement Lefebvre
bdfdd2c840 1.6.2 2017-11-17 10:42:50 +00:00
JosephMcc
cbdd4d3197 xed-status-combo-box: Simplify the widget heirarchy (#185)
Remove an unneeded frame widget. This cause padding issues in gtk3.22 that
requires overly convoluted theming to get around. This still leaves a few
warnings from the hard coded theming but those can be removed later when we
no longer need to support gtk3.18.
2017-11-17 10:40:37 +00:00
Clement Lefebvre
93b9c31f15 1.6.1 2017-11-15 13:11:47 +00:00
Clement Lefebvre
ab581c166b l10n: Fix localization in TextSize plugin 2017-11-15 13:08:58 +00:00
Clement Lefebvre
b9422cd437 1.6.0 2017-11-03 21:14:25 +00:00
Clement Lefebvre
b497904cc7 l10n: Update translations 2017-11-03 21:13:36 +00:00
Clement Lefebvre
aa72e7e232 l10n: Update POT file 2017-09-25 15:02:02 +01:00
JosephMcc
ce59112fd1 Minimap (#175)
* Add a minimap

Add support for GtkSourceViews SourceMap object. Add both a default setting for
new files to the preferences dialog and a menu item to allow temporarily
disabling it in any view.

* Require gtk and gtksourceview 3.18

* load custom css

We can use this to make small tweaks to the interface so every theme doesn't
need to add specific support.

Make use of this new css to clean up the styling of the new overview map frame
a bit.
2017-09-25 16:01:27 +02:00
JosephMcc
97e1b0a9ec xed-view: Fix a crash when right clicking the left gutter (#166)
Two values were swapped in the g_settings_bind() function causing it to look
for a key that didn't exist.
2017-09-05 08:21:40 +01:00
JosephMcc
54a8c6c616 Don't present users with the hidden highlight languages (#167)
Fixes a crash when choosing 'Defaults' as the the highlight language.

Adapted from 0434e2f918

Closes https://github.com/linuxmint/xed/issues/160
2017-09-05 08:21:09 +01:00
Gavin D. Howard
1f85332906 Make the trailsave plugin also strip trailing lines (#135)
Make the trailsave plugin also strip trailing lines
2017-08-30 11:17:08 +01:00
JosephMcc
9376dc72da text zoom: Put a limit on the min and max zoom (#137)
Text zoom: Put a limit on the min and max zoom
2017-08-30 11:14:43 +01:00
Clement Lefebvre
87eb14e9dc l10n: Update POT file 2017-08-30 11:13:44 +01:00
JosephMcc
6338c3e6af translations: Add the textsize plugin to POTFILES.in (#151)
We want the menu entries it provides to be translated but I forgot to add these
when the new plugin was added.
2017-08-30 11:13:05 +01:00
Clement Lefebvre
b55ddb2fd2 1.4.6 2017-07-15 21:38:03 +02:00
githpr
dbc8b3468b Use correct value to save the window state in gsettings. (#147)
* Use correct value to save the window state in gsettings.
This ensures that the window will be maximized if it was closed in this state.

* Use correct value in xed_window_configure_event function
2017-07-13 15:09:06 +02:00
Clement Lefebvre
b0e72aafa6 1.4.5 2017-07-04 13:12:23 +02:00
Clement Lefebvre
a48eb78835 Packaging: Remove dependency on libpeas-1.0-0-python3loader in LMDE 2017-07-04 13:11:03 +02:00
JosephMcc
96bebb994f Create ISSUE_TEMPLATE.md 2017-07-04 02:43:52 -07:00
Clement Lefebvre
784bdd4dd4 1.4.4 2017-06-28 10:11:59 +02:00
Clement Lefebvre
bacd06034f l10n: Update translations 2017-06-28 10:11:22 +02:00
Clement Lefebvre
94d68bfca5 1.4.3 2017-06-20 15:22:59 +02:00
JosephMcc
c306c1b527 filebrowser: Change an icon name (#132)
Change the icon name for the filebrowser from system-file-manager to folder.
This prevents you from getting a weird unexpected icon under some themes
like Mint-Y
2017-06-02 11:05:37 +01:00
Mike Krüger
f004e93547 bugfix: ugly white border (gtk 3.20>) (#128) 2017-06-01 10:41:50 +01:00
Clement Lefebvre
efcaac200a 1.4.2 2017-05-23 13:35:58 +01:00
Clement Lefebvre
940ff3c7f3 l10n: Update translations 2017-05-23 13:35:13 +01:00
leigh123linux
2a1372cac3 fix gtksourceprintcompositor.h includes warning (#117) 2017-05-23 13:33:29 +01:00
Clement Lefebvre
b77f332c7a 1.4.1 2017-05-06 14:57:58 +01:00
Clement Lefebvre
33da18bda3 l10n: Update translations 2017-05-06 14:56:36 +01:00
Clement Lefebvre
cca4b0b5c1 Packaging: Change description 2017-05-05 15:49:41 +01:00
Clement Lefebvre
5a9cce674b Only use gtk_text_view_set_top_margin() with GTK 3.18+
It didn't exist before that version of GTK.
2017-05-05 12:27:38 +01:00
Clement Lefebvre
7291231cea Depend on gtksourceview-3.0 >= 3.14.0
3.14.3 only introduces bug fixes and translation updates on top of that.

Betsy ships with 3.14.1.
2017-05-05 11:38:27 +01:00
Clement Lefebvre
524b66e059 1.4.0 2017-05-05 08:39:37 +01:00
Clement Lefebvre
98dfbf6980 Fix "gedit" occurence 2017-05-04 18:32:30 +01:00
Clement Lefebvre
257740d6b7 Fix po/POTFILES.in and generate POT file 2017-04-26 12:51:45 +01:00
Clement Lefebvre
ed6eb520b6 Merge pull request #112 from JosephMcc/inhibit-fix1
Use GtkApplication inhibit API
2017-04-26 11:35:42 +01:00
JosephMcc
4add4da97a Use GtkApplication inhibit API
This will help prevent users from inadvertently loosing data when logging out
with unsaved files.

Based on: 05918e07ce
2017-04-23 18:22:54 -07:00
Clement Lefebvre
e9510c99f3 Merge pull request #111 from leigh123linux/fsf_address
Fix FSF address
2017-04-10 11:27:02 +01:00
leigh123linux
e6d1f2e495 Fix FSF address 2017-04-10 08:24:10 +01:00
Clement Lefebvre
21e46cc751 Merge pull request #107 from JosephMcc/time-fix1
time-plugin: Use GDateTime
2017-04-02 11:32:46 +01:00
Clement Lefebvre
29c744694c Merge pull request #108 from JosephMcc/wayland-fix1
xed-utils: Add runtime checks for x11 specific functions
2017-04-02 11:31:32 +01:00
JosephMcc
c6ca2a03da xed-utils: Add runtime checks for x11 specific functions
This should prevent some crashes under wayland.
2017-04-02 03:04:09 -07:00
JosephMcc
96a50bc803 time-plugin: Use GDateTime
121f02a3ea
2017-04-01 12:06:22 -07:00
Clement Lefebvre
3341c0a260 Merge pull request #102 from JosephMcc/animated-panes1
Animated panes1
2017-03-17 10:34:23 +00:00
JosephMcc
932cc3758e xed-commands-view: Clean up code style 2017-03-17 00:22:04 -07:00
JosephMcc
c16232ee20 Add a new animated xed-paned
This replaces the GtkPaned we currently use and opens and closes the panes using
an animation.
2017-03-17 00:15:38 -07:00
Clement Lefebvre
331e0e5824 Merge pull request #100 from JosephMcc/close-focus
Focus a tab when attempting to close it with unsaved changes
2017-03-14 11:44:36 +00:00
JosephMcc
9c2d06761b Focus a tab when attempting to close it with unsaved changes
In most cases you want to see the contents of the tab before deciding what to
respond to the dialog that pops up. This is typical behavior in other editors
such as Sublime.

Closes https://github.com/linuxmint/xed/issues/95
2017-03-13 23:37:43 -07:00
Clement Lefebvre
99a730fa9c Merge pull request #89 from JosephMcc/filebrowser-3
Filebrowser 3
2017-02-22 10:40:17 +00:00
Clement Lefebvre
65afa345d4 Merge pull request #92 from JosephMcc/app-startup
Fix calling set_command_line_wait()
2017-02-22 10:29:57 +00:00
JosephMcc
12ecdf380d Merge pull request #93 from JosephMcc/build-vars
Allow building with --disable-spell
2017-02-20 13:30:45 -08:00
JosephMcc
ce92a1a316 debian: Add dependency on libpeas-1.0-0-python3loader
We need this for the python3 plugin loader to work

Closes: https://github.com/linuxmint/xed/issues/94
2017-02-20 13:27:25 -08:00
JosephMcc
57a3daf2d5 Allow building with --disable-spell
It helps if we actually respect our conditionals.
2017-02-20 04:13:09 -08:00
JosephMcc
9b704374c7 Fix calling set_command_line_wait()
We were passing the wrong arguments

Based on 2e3b5aea0e

Fixes: https://github.com/linuxmint/xed/issues/90
2017-02-20 03:40:07 -08:00
JosephMcc
ce936c567e Actually fix the python dependency 2017-02-17 16:13:54 -08:00
JosephMcc
d2892eda2d build: Fix the python3 dependency 2017-02-17 13:59:40 -08:00
Clement Lefebvre
6287fc9614 Merge pull request #81 from JosephMcc/dep-fix1
debian: Add a dependency on xapps-common
2017-02-16 11:59:49 +00:00
JosephMcc
ebb32ff114 filebrowser: Set the combobox insensitive when the bookmarks are showing
The combo doesn't show anything useful when treeview is showing the bookmarks
so just set it insensitive.
2017-02-15 19:51:29 -08:00
JosephMcc
245991c22c filebrowser: Make the "Open terminal here" command work again
Add a gsettings key to set the terminal used for the command in the menu. By
default this is set to 'x-terminal-emulator' but it can be easily overridden
by packagers or changed by users who choose to.
2017-02-15 19:32:40 -08:00
JosephMcc
6801233bd8 filebrowser: Do not parse .hidden in the file browser
f0454abbec
2017-02-15 18:25:54 -08:00
JosephMcc
5c08882ba6 filebrowser: Don't use deprecated GtkStock 2017-02-15 18:25:54 -08:00
JosephMcc
ee1448d73f filebrowser: Activate selected item when search is complete
0701c9c463
2017-02-15 18:25:54 -08:00
JosephMcc
bf1133231b filebrowser: Redesign the toolbar in filebrowser 2017-02-15 18:25:54 -08:00
JosephMcc
87238194c3 filebrowser: don't use deprecated GIOScheduler
2d1eb80d3d
2017-02-15 18:25:54 -08:00
JosephMcc
9637840886 filebrowser: use Untitled File/Folder for new file/folders
e7e404a32a
2017-02-15 18:25:54 -08:00
JosephMcc
80509d36a3 filebrowser: "Rename" menu entry should have an ellipsis 2017-02-15 18:25:54 -08:00
JosephMcc
14cc619751 xed-file-browser-utils.c: Clean up code style 2017-02-15 18:25:54 -08:00
JosephMcc
44f60af7a7 filebrowser: Support new location of gtk bookmarks file
Also remove an old bit of code that was left over when some of the ifdef's for
windows and mac specific code was removed.

54d69eb93c
2017-02-15 18:25:54 -08:00
JosephMcc
1e2e106d70 filebrowser: Remove the back and forward toolbar dropdowns 2017-02-15 18:25:54 -08:00
JosephMcc
c27e781132 filebrowser: Fix crash on open_terminal action
0836fd05ac
2017-02-15 18:25:54 -08:00
JosephMcc
fa31c65c2f filebrowser: Don't leak GFiles
e2f792359a
2017-02-15 18:25:54 -08:00
JosephMcc
fe9e6ac91c file-browser-messages: Clean up formatting 2017-02-15 18:25:54 -08:00
JosephMcc
372399891d filebrowser: Unref the enumerator in the filebrowser plugin
8bb1b9555f
2017-02-15 18:25:54 -08:00
JosephMcc
4c45b083e1 Do not leak file info for . and .. dirs
fa5fa82ce0
2017-02-15 18:25:54 -08:00
JosephMcc
f20b3bdcf5 filebrowser-view: Removed the unused "busy" cursor 2017-02-15 18:25:54 -08:00
JosephMcc
61bca3cc0f xed-file-browser-widget: Clean up code styling 2017-02-15 18:25:54 -08:00
JosephMcc
a1e94f2777 Use slice allocator instead of g_new when appropriate
a0b15be6fd
2017-02-15 18:25:54 -08:00
JosephMcc
ca9321f599 Fix g_free which should be g_object_unref in file browser
331af4bdda
2017-02-15 18:25:54 -08:00
JosephMcc
e1a7919ebd Merge pull request #86 from JosephMcc/focus-1
Focus view when opening files from the filebrowser or documents panel
2017-02-15 16:05:44 -08:00
JosephMcc
5b34780cfe Merge pull request #83 from JosephMcc/docs-2
docs: Start cleaning up the docs
2017-02-15 16:05:02 -08:00
JosephMcc
5498344d82 Merge pull request #82 from JosephMcc/prefs-fix1
prefs-dialog: Fix a crash when removing style schemes
2017-02-15 16:03:25 -08:00
Clement Lefebvre
fa93941933 Merge pull request #84 from JosephMcc/textsize
Convert some functionality to builtin plugins
2017-02-13 15:26:36 +00:00
JosephMcc
c253d9feaa Focus view when opening files from the filebrowser or documents panel
139db33451
2017-02-13 01:56:33 -08:00
JosephMcc
ad8fa295f2 Sort: Turn sort into a simpler and undoable action
Convert to a builtin plugin and remove the use of the dialog. Sort can now be
triggered from the edit menu or by the F10 hot key.
2017-02-12 15:42:32 -08:00
JosephMcc
01bada3e7e Implement font zooming in the editor
Give controls for zoom in, zoom out, and reset zoom in the menu and via hotkey.
Also add a new placeholder in the view menu to allow positioning the menuitems
properly. Still want to keep the highlighting menu item at the  bottom.

This is implemented by using a builtin libpeas python plugin. Add support for
loading these plugins at startup. They cannot be enabled or disabled through the
UI. They can still be disabled in gsettings but will be automatically reloaded
when xed is restarted.

Closes: https://github.com/linuxmint/xed/issues/45
2017-02-12 01:24:02 -08:00
JosephMcc
c8c3f4696f docs: Start cleaning up the docs
The code has chaged quite a bit. Start updating the docs to match and to quiet
some warnings during build.
2017-02-11 18:28:38 -08:00
JosephMcc
e4745e72b7 prefs-dialog: Fix a crash when removing style schemes
This looks like another old leftover from the move to gtk3

Based on: 11fbe0fe14
Closes: https://github.com/linuxmint/xed/issues/25
2017-02-10 17:11:47 -08:00
JosephMcc
a7382db60e debian: Add a dependency on xapps-common
We need this for some of the icons being used in the search and status bar.
2017-02-10 15:56:26 -08:00
JosephMcc
98c983f144 Merge pull request #80 from JosephMcc/makefile-fix1
Makefile: Forgot to git add changes
2017-02-10 04:09:44 -08:00
JosephMcc
090ba0dc92 Makefile: Forgot to git add changes 2017-02-10 04:07:39 -08:00
JosephMcc
8cece49ab6 Merge pull request #68 from JosephMcc/1.4-dev-1
1.4 dev
2017-02-10 02:33:38 -08:00
JosephMcc
c620e48c96 xed-view: Add some margin to the top and left of the text view 2017-02-10 00:18:17 -08:00
JosephMcc
ad31cd9e36 Debian: Bring back the xed-doc package 2017-02-09 14:15:21 -08:00
JosephMcc
3a83594498 Add a preference to allow using the dark variant of a theme if available 2017-02-09 13:58:08 -08:00
JosephMcc
69f71de2de xed-window: Fix getting the wrong window size when cloning a window
This was mostly caused by a missing set of parens resulting in the wrong logic
being used. Go ahead a clean things up just a bit while I'm here.
2017-02-09 10:30:52 -08:00
JosephMcc
399fc81a41 xed-app: Fix a typo 2017-02-09 04:04:03 -08:00
JosephMcc
17837139ac xed-app: Shutdown metadata-manager after GTK+ 2017-02-09 03:47:08 -08:00
JosephMcc
3567a8e4c9 xed-app: Handle also application::open 2017-02-09 03:34:02 -08:00
JosephMcc
3b9d03837b Don't use global vars for command line parsing 2017-02-09 03:30:01 -08:00
JosephMcc
42f78a6980 Set textdomain as soon as possible 2017-02-09 03:04:04 -08:00
JosephMcc
e3e316ea8a Start using GResource
This converts our existing ui files for the main programs to resources and adds
a template for xed-view-frame
2017-02-09 02:37:10 -08:00
JosephMcc
3cfd0f3d5f Remove the dialog utility library 2017-02-06 17:56:51 -08:00
JosephMcc
bf69e64718 Don't use deprecated gtk_widget_set margin_left/right 2017-02-05 03:54:09 -08:00
JosephMcc
ab8bf81cc3 xed-progress-info-bar: Properly expand the progress bar 2017-02-05 03:20:35 -08:00
JosephMcc
3496c88947 info-bar: Don't use icons in buttons 2017-02-05 02:20:27 -08:00
JosephMcc
30e996eaea info-bars: Don't use deprecated GtkStock 2017-02-05 02:10:26 -08:00
JosephMcc
9a4f7e55fe info-bars: Don't use deprecated gtk_misc 2017-02-05 02:04:14 -08:00
JosephMcc
42bb35d41f message-area: Rename message area to info bar
Lets call it what it is
2017-02-05 01:41:46 -08:00
JosephMcc
2aa009cb76 Port xed to dbus and GtkApplication
This further improves on the port to GtkSource API's and cleans up a ton of
legacy code in xed based on upstream changes in Gedit.
2017-02-04 22:17:58 -08:00
JosephMcc
f05ddd7b63 Port to GtkSource* API
There are still bugs but this gets it started
2017-01-30 14:52:12 -08:00
JosephMcc
6888501019 xed-document: Do some cleanup
This is a bit more work in preparation for porting to more of the GtkSource*
API's
2017-01-29 12:59:13 -08:00
JosephMcc
32200f4b7e Plugins: Remove the changecase plugin
Change case is provided by part of the GtkSourceView context menu. If we want
this available in the main application menu we can bring it back as built in
functionality. There is no real reason to keep a plugin around just for that
2017-01-29 04:19:04 -08:00
JosephMcc
5071bfe065 Add _xed_document_needs_saving
Based on acbf4d4f0c
2017-01-29 03:36:27 -08:00
JosephMcc
511fc3dfec Port to the GtkSourceView search functionality
This also gives us support for regex search
2017-01-28 19:12:36 -08:00
JosephMcc
0a9588ef63 Clean up our GSettings use a bit more 2017-01-21 18:44:15 -08:00
JosephMcc
f546598d83 Remove xed_utils_location_has_file_scheme 2017-01-21 14:44:55 -08:00
JosephMcc
ed03c490d1 xed-document: Rework externally modified/deleted check
7c5e872ad6
2017-01-21 14:08:11 -08:00
JosephMcc
6b8c07d90e Kill xed-language-manager and use gtksourcelanguagemanager directly 2017-01-21 13:51:08 -08:00
JosephMcc
4a6f1d02b8 xed-document: Fix a couple of possible memory leaks 2017-01-21 01:36:15 -08:00
JosephMcc
4f277063f0 Remove the xed style scheme manager instance
f5d46ef3cc
2017-01-21 01:31:05 -08:00
JosephMcc
1d6f119b04 Pull some upstream changes from Gedit in prep for using more of the
GtkSource* backend
2017-01-20 12:24:07 -08:00
JosephMcc
176dac188b xed-document-output-stream: Factor out validate_and_insert method 2017-01-19 03:45:06 -08:00
JosephMcc
e3e9566570 Merge smart converter in the document output stream
Based on 85279adad6 (diff-c243a4d5a7789c35057282ee780df3d5)
2017-01-19 03:29:38 -08:00
JosephMcc
2fb3813793 xed-document-output-stream: Clean up code style 2017-01-19 01:48:54 -08:00
JosephMcc
28ef771d15 xed-document-output-stream: Clean up code style 2017-01-19 01:38:13 -08:00
JosephMcc
dfa7714cc5 tests: Fix to use GFile instead of uris 2017-01-19 00:35:42 -08:00
JosephMcc
ca08220560 xed-preferences-dialog: Fix a setting having the wrong sensitiviy
The font chooser sensitivity was backwards
2017-01-19 00:13:56 -08:00
JosephMcc
5d62c0c452 Redesign the goto line popup dialog 2017-01-19 00:00:59 -08:00
JosephMcc
7a06a119b5 Clean up the docs a bit 2017-01-16 16:43:46 -08:00
JosephMcc
490303557a Revamp our handling of settings
The current handling of settings is a very roundabout leftover from the days of
gconf. Simplify and handle the setting more directly. At the same time move
handling of saving the window state to gsettings instead of saving it to a
config file.
2017-01-16 15:41:07 -08:00
JosephMcc
f21c6e9361 Port to the use of GFile instead of URIs and merge gio document loader and saver
into document loader and saver
2017-01-14 11:48:19 -08:00
JosephMcc
6a997b1b79 xed-searchbar.c/h: Clean up styling a bit 2017-01-13 03:49:38 -08:00
JosephMcc
5267b52c70 xed-searchbar: Add a couple missing casts and remove an unused variable 2017-01-13 03:33:53 -08:00
JosephMcc
d38b1cd953 xed-statusbar: Fix a missing cast 2017-01-13 03:24:27 -08:00
JosephMcc
c5d8a4378a xed-statusbar.c/h: Clean up code styling 2017-01-13 03:21:50 -08:00
JosephMcc
9dc61e0df5 xed-file-dialog.c/h: Clean up code styling 2017-01-13 03:10:01 -08:00
JosephMcc
66800ca9a3 xed-tab-label.c/h: Clean up code styling 2017-01-13 02:53:46 -08:00
JosephMcc
422dc034f4 Clean up uses of deprecated GtkMisc 2017-01-13 02:44:53 -08:00
JosephMcc
c65c6f2a3e spell-plugin: Clean up a few things
Clean up a couple files, remove deprecated widgets from the UI files and clean
up the styling of a couple dialogs a bit
2017-01-12 23:59:23 -08:00
JosephMcc
c03a0a3e7d time-plugin: Clean up a bit from libpeas port 2017-01-11 23:47:49 -08:00
JosephMcc
77ae5a4048 trailsave-plugin: Port to WindowActivatable 2017-01-11 23:21:23 -08:00
JosephMcc
cd3ab1695d taglist-plugin: Port to WindowActivatable 2017-01-11 22:52:37 -08:00
JosephMcc
769f1baaaa changecase-plugin: Port to WindowActivatable 2017-01-11 12:33:03 -08:00
JosephMcc
33cb6f4b32 time-plugin: Port to WindowActivatable 2017-01-11 03:00:03 -08:00
JosephMcc
30a61a9fd8 spell-plugin: Update to the new WindowActivatable interface 2017-01-10 03:08:44 -08:00
JosephMcc
f65ce8f7ca sort-plugin: Port the sort plugin to WindowActivatable 2017-01-09 15:54:57 -08:00
JosephMcc
e1fad74898 docinfo-plugin: Update for WindowActivatable changes 2017-01-09 14:38:32 -08:00
JosephMcc
b9e5097250 Add new (App/Window/View)Activatable interfaces for plugins
Currently only the modelines and filebrowser plugins are updated to these new
interfaces
2017-01-09 11:57:48 -08:00
JosephMcc
d45e07b7a1 Install introspection data and lib into a private dir 2017-01-08 04:00:44 -08:00
JosephMcc
32fd96e327 xed-progress-message-area: Clean up more uses of GtkStock 2017-01-07 12:58:32 -08:00
JosephMcc
a1671a6227 xed-progress-message-area.c: Clean up code style 2017-01-07 04:13:12 -08:00
JosephMcc
01ace1d02f xed-print-preview.c: Don't you deprecated gtk_layout_get_*adjustment 2017-01-07 03:24:46 -08:00
JosephMcc
5a9258087a xed-print-preview.c: Restyle the toolbar
Make it look nicer and at the same time clean up some more uses of GtkStock
2017-01-07 02:52:00 -08:00
JosephMcc
663511c1d1 xed-print-preview.c: Clean up code styling 2017-01-07 01:14:21 -08:00
JosephMcc
c2eab264a3 xed-window: Use a better icon for the documents panel tab 2017-01-02 16:14:42 -08:00
JosephMcc
d77659fdcd xed-tab: Clean up some uses of GtkStock 2017-01-01 21:41:09 -08:00
JosephMcc
baea0e93b9 xed-tab.c: Clean up code style 2017-01-01 18:20:19 -08:00
JosephMcc
b082e73a61 xed-status-combo-box.c: Clean up some code styling 2017-01-01 16:12:36 -08:00
JosephMcc
8ebb54b824 xed-status-combo-box: Don't use deprecated GtkArrow 2017-01-01 16:02:46 -08:00
JosephMcc
412ce3e228 xed-panel.c: Add a couple of missing casts 2017-01-01 15:45:02 -08:00
JosephMcc
ded60fbe20 xed-panel: Clean up more uses of GtkStock
Also update a couple of the plugins that call this functionality
2017-01-01 15:41:06 -08:00
JosephMcc
8ab7e902bb xed-utils: Remove a couple functions
We want to move away from use of deprecated GtkStock so remove a couple of
functions that rely on it. They aren't being used anywhere anyway.
2017-01-01 13:57:28 -08:00
JosephMcc
ea1f2055e7 xed-utils.h: Clean up code styling 2017-01-01 13:53:19 -08:00
JosephMcc
4ef02d4837 xed-utils: Clean up code styling 2017-01-01 13:31:02 -08:00
JosephMcc
55317e21b0 xed-window.c: Fix a few missing casts 2017-01-01 12:25:44 -08:00
JosephMcc
d79bc79dbc notebooks: Don't show tabs when the notebook only has one page 2017-01-01 12:03:45 -08:00
JosephMcc
6e7586c654 xed-prefs-manager-app.c: Clean up an unused variable 2016-12-31 21:21:49 -08:00
JosephMcc
63f4658807 xed-pref-manager-app.c: Clean up code style 2016-12-31 21:21:06 -08:00
JosephMcc
d80329db5c xed-notebook.c: Clean up the code formatting 2016-12-31 16:33:21 -08:00
JosephMcc
33f6b71eda xed-prefs-manager-app: Remove some leftover logging 2016-12-31 15:00:49 -08:00
JosephMcc
50c216b17b Allow scrolling on notebook tabs to change the active page
This is enabled by default but has a setting in the preferences so it can be
disabled.
2016-12-31 14:18:31 -08:00
JosephMcc
95a302a46f preferences-dialog: Clean up uses of GtkStock 2016-12-30 12:21:47 -08:00
JosephMcc
05738f44bb preferences-dialog: Clean up code styling 2016-12-30 11:54:48 -08:00
JosephMcc
f3791ef8d2 Add view menu entry for word wrap
Adds an entry to the "View" menu that allows temporarily overriding the word
wrap settings in the preferences.
2016-12-30 03:17:05 -08:00
JosephMcc
94188504ab xed-statusbar: Clean up the styling a bit
Make sure the statusbar expands the full width of the window. Do a better job
of lining up buttons in the search and status bar as well.
2016-12-28 12:26:17 -08:00
JosephMcc
9c9e564ec1 Add a few style classes
This will allow themes a bit more control over the styling. Since you can no
longer select objects by class name in gtk version > 3.20 there is no other
easy way to theme these elements.

Added classes for "xed-window", "xed-searchbar", "xed-statusbar", and
"xed-panel" with additional classes of "side" and "bottom" for the panels
2016-12-28 11:44:35 -08:00
JosephMcc
5058c69288 xed-panel: Move the notebook tabs to the top 2016-12-27 11:44:05 -08:00
JosephMcc
4635766fc7 xed-panel: Simplify panel building a bit
Now that the panel headers are removed, we no longer need separate functions for
creating panels of different orientations
2016-12-27 01:30:36 -08:00
JosephMcc
6bc12a2be0 xed-panel: Remove the header and close button
Now that we have the buttons on the statusbar for opening and closing the side
and bottom panels, we don't really need these anymore
2016-12-27 01:11:19 -08:00
JosephMcc
5d258f1e67 xed-window: Stop using deprecated (v/h)box 2016-12-27 00:17:15 -08:00
JosephMcc
c78bf46d38 Add buttons to the statusbar to show/hide the panels 2016-12-26 23:43:42 -08:00
JosephMcc
3a6de664e1 xed-sort-plugin.c: Clean up code styling 2016-12-26 20:26:21 -08:00
JosephMcc
26f8139317 xed-panel: Clean up the layout of the panels
Make sure the bottom panel lays out properly when we actually have a plugin that
lives there
2016-12-26 19:32:38 -08:00
JosephMcc
f9a658f823 taglist plugin: don't look for taglist in non-existing legacy dirs 2016-12-26 19:04:39 -08:00
JosephMcc
64be9e8ecd enable dh_girepository helper to fill ${gir:Depends} properly
Adapted from:
08f71335b2
2016-12-26 18:57:15 -08:00
JosephMcc
f314622cf0 Remove old plugin system and docs for it
Adapted from:
3860e7b99f (diff-c949f93d03f44a4217d7a138f9e2e54a)
2016-12-26 18:49:12 -08:00
JosephMcc
89758101cc plugins: Make them actually recognized and loaded by Xed
Adapted from:
e1fbe56adf
2016-12-26 16:12:05 -08:00
JosephMcc
9b3313efa7 trailsave-plugin: Port to libpeas
Adapted from:
ce25be2320
2016-12-26 13:58:16 -08:00
JosephMcc
b7ecc43dfc time-plugin: Port to libpeas
Adapted from:
564ca51a25
2016-12-26 13:54:48 -08:00
JosephMcc
804259fe1f taglist-plugin: Port to libpeas
Adapted from:
2aafaabdaa
2016-12-26 13:50:48 -08:00
JosephMcc
e389368a91 spell-plugin: Port to libpeas
Adapted from:
67a0f36183
2016-12-26 13:44:07 -08:00
JosephMcc
7e6b54b760 sort-plugin: Port to libpeas
Adapted from:
55dfd7836e
2016-12-26 13:39:52 -08:00
JosephMcc
decfeff888 modelines-plugin: Port to libpeas
Adapted from:
b43579beda
2016-12-26 13:29:33 -08:00
JosephMcc
4cad8ffa7f filebrowser-plugin: Port to libpeas
Adapted from:
3e00f9094c
2016-12-26 13:25:50 -08:00
JosephMcc
fdc2da63a9 docinfo-plugin: Port to libpeas
Adapted from:
9ca3dda491
2016-12-26 13:13:01 -08:00
JosephMcc
7220312ac6 changecase-plugin: Port to libpeas
Adapted from:
c475e25a50
2016-12-26 13:08:36 -08:00
JosephMcc
b52cc3f037 Port plugin system to libpeas
Adapted from:
52fd78ddfc
2016-12-26 12:53:23 -08:00
JosephMcc
29f0acc0d6 Drop some leftover 2.xx comments from gnome/pluma 2016-12-26 11:53:22 -08:00
JosephMcc
ae4b648a79 xed-window: Remove an unused function 2016-12-26 11:49:28 -08:00
JosephMcc
8cb1a6dad8 Remove a couple of invalid annotations 2016-12-26 11:44:21 -08:00
JosephMcc
7a6db1f8c5 Fix some introspection warnings
Adapted from:
b9a3360ee8
2016-12-26 11:41:29 -08:00
JosephMcc
c6f5fd5e1d build GObject introspection data
Adapted from:
a4dcd9177a
0488ffe5d2
2016-12-26 10:56:42 -08:00
JosephMcc
2ddd92171c build: Clean up a bit more of the gtk2 and --enable-python leftovers 2016-12-26 10:08:11 -08:00
JosephMcc
cab79801ca plugins: Drop support for old style python plugins
All the the old python plugins have already been removed. Remove a bunch of the
other related cruft since we want to port the plugin system to libpeas

Taken from 65371f53db (diff-2bbd410468516599f21e84fecb500348)
2016-12-25 14:24:00 -08:00
JosephMcc
6893642b16 xed-panel: Clean up code formatting 2016-12-25 12:42:36 -08:00
JosephMcc
d091965175 xed-io-error-message-area: Fix up some deprecations 2016-12-25 12:42:36 -08:00
JosephMcc
a5c62d2380 xed-io-error-message-area: Clean up code styling 2016-12-25 12:42:36 -08:00
JosephMcc
e9834c0883 xed-message-bus: Clean up an unused variables 2016-12-25 12:42:36 -08:00
JosephMcc
2bf076e7c5 xed-message-bus: Clean up code styling 2016-12-25 12:42:36 -08:00
JosephMcc
909ea55a7c xed-documents-panel: Remove an unused variable 2016-12-25 12:42:36 -08:00
JosephMcc
76ce469bfa xed-documents-panel: Cleanup code styling 2016-12-25 12:42:36 -08:00
JosephMcc
21f524a7b3 xed-document: Remove use of deprecated gdk_color_parse 2016-12-25 12:42:36 -08:00
JosephMcc
3aa6f847d9 xed-document: Clean up code style 2016-12-25 12:42:36 -08:00
JosephMcc
ee841c1015 xed-commands-search: Fix some missing casts 2016-12-25 12:42:36 -08:00
JosephMcc
2a93bcbb6d xed-app: Remove an unused variable 2016-12-25 12:42:36 -08:00
JosephMcc
fb84d4bfc7 xed-app: Clean up code styling 2016-12-25 12:42:36 -08:00
JosephMcc
7417c54a94 xed-commands-file: Clean up deprecations 2016-12-25 12:42:36 -08:00
JosephMcc
c50299ec32 xed-commands-file: Clean up code styling 2016-12-25 12:42:36 -08:00
JosephMcc
71306fa224 xed-encodings-combo-box: Clean up code styling 2016-12-25 12:42:36 -08:00
JosephMcc
f1c1e6c689 xed-encodings-dialog: Clean up some deprecations 2016-12-25 12:42:36 -08:00
JosephMcc
c801604a2c xed-encodings-dialog: Clean up code styling 2016-12-25 12:42:36 -08:00
JosephMcc
41162911b2 close-confirmation-dialog: Clean up some deprecations
We're stuck with a couple uses of gtk_misc_* for now until we can move to a
newer minimum version of gtk3.
2016-12-25 12:42:36 -08:00
JosephMcc
2ab142b094 close-confirmation-dialog: Clean up code styling 2016-12-25 12:42:36 -08:00
Clement Lefebvre
708d79dbf8 Search: Don't jump to the next result when toggling search options 2016-12-16 21:35:41 +00:00
Clement Lefebvre
e3bddd9e80 1.2.2 2016-12-12 12:44:11 +00:00
Clement Lefebvre
73705d6734 l10n: Update translations 2016-12-12 12:42:56 +00:00
Clement Lefebvre
3b5c578e00 l10n: Add missing pot file
It was removed by accident in previous commits.
2016-12-05 11:34:59 +00:00
Clement Lefebvre
d890aaf565 Search: Perform a search when case-sensitive or entire-word buttons are clicked 2016-12-05 11:25:59 +00:00
Clement Lefebvre
615ae47272 Search: Fix search jumping to next result while typing 2016-12-05 11:17:24 +00:00
Clement Lefebvre
4028e617fb Merge pull request #57 from JosephMcc/searchbar-close
searchbar: Make some improvements
2016-12-02 19:43:12 +00:00
JosephMcc
0f1de23d7f searchbar: Make sure we clear highlighting when the last character is removed
We need to call do_find() even if we just backspaced the last character out of
the search entry. This ensures all highlighting gets removed from the document.
2016-11-28 15:07:57 -08:00
JosephMcc
aa31c09fc7 searchbar: Add a close button
Currently there is no clear way to close the searchbar. Add a simple small close
button to make this easier.
2016-11-28 14:23:27 -08:00
437 changed files with 192872 additions and 207301 deletions

64
.circleci/config.yml Normal file
View File

@@ -0,0 +1,64 @@
version: 2.0
shared: &shared
steps:
- checkout
- run:
name: Prepare environment
command: apt-get update
- run:
name: Install dependencies
command: |
wget https://github.com/linuxmint/xapps/releases/download/master.${CIRCLE_JOB}/packages.tar.gz -O xapps.tar.gz
ls *.tar.gz | xargs -i tar zxvf {}
apt install --yes --allow-downgrades ./packages/*.deb
rm -rf packages
- run:
name: Build project
command: mint-build -i
- run:
name: Prepare packages
command: |
if [ -z $CI_PULL_REQUEST ]; then
mkdir /packages
mv /root/*.deb /packages/
git log > /packages/git.log
cd /
tar zcvf packages.tar.gz packages
fi
- run:
name: Deploy packages to Github
command: |
if [ -z $CI_PULL_REQUEST ]; then
wget https://github.com/tcnksm/ghr/releases/download/v0.5.4/ghr_v0.5.4_linux_amd64.zip
apt-get install --yes unzip
unzip ghr_v0.5.4_linux_amd64.zip
TAG="master".$CIRCLE_JOB
./ghr -t $GITHUB_TOKEN -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME -replace $TAG /packages.tar.gz
./ghr -t $GITHUB_TOKEN -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME -recreate -b "Latest unstable packages" $TAG /packages.tar.gz
fi
jobs:
"mint19":
<<: *shared
docker:
- image: linuxmintd/mint19-amd64
"lmde3":
<<: *shared
docker:
- image: linuxmintd/lmde3-amd64
workflows:
version: 2
build:
jobs:
- "mint19"
- "lmde3"

19
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,19 @@
```
* Xed version (xed --version)
* Distribution - (Mint 17.2, Arch, Fedora 25, etc...)
```
**Issue**
**Steps to reproduce**
**Expected behaviour**
**Other information**

13
.gitignore vendored Normal file
View File

@@ -0,0 +1,13 @@
# Specify filepatterns you want git to ignore.
debian/tmp/
debian/build/
debian/.debhelper/
debian/xed/
debian/xed-common/
debian/xed-dbg/
debian/xed-dev/
debian/xed-doc/
debian/files
debian/*.log
debian/*.substvars
build

View File

@@ -1,74 +0,0 @@
## Process this file with automake to produce Makefile.in
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
SUBDIRS = xed pixmaps po data plugin-loaders plugins docs help
if ENABLE_TESTS
SUBDIRS += tests
endif
distuninstallcheck_listfiles = find . -type f -print
EXTRA_DIST = \
autogen.sh \
ChangeLog \
HACKING \
NEWS \
NEWS.GNOME \
README \
xmldocs.make \
omf.make \
intltool-extract.in \
intltool-merge.in \
intltool-update.in
DISTCLEANFILES = \
intltool-extract \
intltool-merge \
intltool-update
MAINTAINERCLEANFILES = \
aclocal.m4 \
config.guess \
config.h.in \
config.sub \
depcomp \
intltool-extract.in \
intltool-merge.in \
intltool-update.in \
configure \
INSTALL \
gtk-doc.make \
install-sh \
ltmain.sh \
missing \
mkinstalldirs \
omf.make \
py-compile \
xmldocs.make \
m4/gtk-doc.m4 \
m4/intltool.m4 \
m4/libtool.m4 \
m4/ltoptions.m4 \
m4/ltsugar.m4 \
m4/ltversion.m4 \
m4/lt~obsolete.m4 \
`find "$(srcdir)" -type f -name Makefile.in -print`
DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --disable-tests
dist-hook:
@if test -d "$(srcdir)/.git"; \
then \
echo Creating ChangeLog && \
(GIT_DIR=$(top_srcdir)/.git \
./missing --run git log --stat -M -C --name-status --date=short --no-color) | \
fmt --split-only > ChangeLog.tmp \
&& mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \
|| ( rm -f ChangeLog.tmp ; \
echo Failed to generate ChangeLog >&2 ); \
else \
echo A git clone is required to generate a ChangeLog >&2; \
fi
-include $(top_srcdir)/git.mk

8
README
View File

@@ -35,7 +35,9 @@ Installation
Simple install procedure:
% ./autogen.sh # run the `configure' script
% make # build xed
% meson --prefix=/usr/local build # run the `configure' script
% ninja -v -C build # build xed
[ Become root if necessary ]
% make install # install xed
% sudo ninja install -v -C build # install xed
see linuxmint/xed#265 if you see GLib-GIO-ERROR

View File

@@ -1,32 +0,0 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
PKG_NAME="xed"
(test -f $srcdir/configure.ac) || {
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
echo " top-level $PKG_NAME directory"
exit 1
}
which gnome-autogen.sh || {
echo "You need to install gnome-common"
exit 1
}
which yelp-build || {
echo "You need to install yelp-tools"
exit 1
}
REQUIRED_AUTOMAKE_VERSION=1.9
REQUIRED_MACROS=python.m4
GNOME_DATADIR="$gnome_datadir"
USE_COMMON_DOC_BUILD=yes
. gnome-autogen.sh

View File

@@ -1,389 +0,0 @@
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.63.2)
m4_define(xed_major_version, 1)
m4_define(xed_minor_version, 2)
m4_define(xed_micro_version, 1)
m4_define(xed_version, xed_major_version.xed_minor_version.xed_micro_version)
AC_INIT([xed], [xed_version],
[https://github.com/linuxmint/xed/issues],
[xed], [http://github.com/linuxmint/xed])
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_SRCDIR(xed/xed.c)
AC_CONFIG_MACRO_DIR([m4])
AC_DEFINE(XED_MAJOR_VERSION, xed_major_version, [Xed major version])
AC_SUBST(XED_MAJOR_VERSION, xed_major_version)
AC_DEFINE(XED_MINOR_VERSION, xed_minor_version, [Xed minor version])
AC_SUBST(XED_MINOR_VERSION, xed_minor_version)
AC_DEFINE(XED_MICRO_VERSION, xed_micro_version, [Xed micro version])
AC_SUBST(XED_MICRO_VERSION, xed_micro_version)
AM_INIT_AUTOMAKE([1.10 dist-xz no-dist-gzip -Wno-portability check-news])
AM_MAINTAINER_MODE
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
# Checks for programs
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_SYS_LARGEFILE
PKG_PROG_PKG_CONFIG
# Initialize libtool
LT_PREREQ([2.2.6])
LT_INIT(disable-static)
GTK_DOC_CHECK([1.0],[--flavour=no-tmpl])
AC_CHECK_FUNC(sigaction)
AC_CHECK_LIB(m, floor)
dnl make sure we keep ACLOCAL_FLAGS around for maintainer builds to work
AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS -I m4")
dnl toolbar style for GSettings schemas
TOOLBAR_STYLE="XED_TOOLBAR_SYSTEM"
AC_SUBST(TOOLBAR_STYLE)
# GLib min/max required versions
AC_DEFINE([GLIB_VERSION_MAX_ALLOWED], [GLIB_VERSION_2_36],
[Warn on use of APIs added after GLib 2.36])
AC_DEFINE([GLIB_VERSION_MIN_REQUIRED], [GLIB_VERSION_2_36],
[Warn on use of APIs deprecated before GLib 2.36])
dnl ===============================================================
dnl Expanded dirs
dnl ===============================================================
# This macro expands DIR and assigns it to RET.
# If DIR is NONE, then it's replaced by DEFAULT.
# Based on AC_DEFINE_DIR
AC_DEFUN([XED_FULLPATH], [
test "x$prefix" = xNONE && prefix="$ac_default_prefix"
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
ac_expand=[$]$1
test "x$ac_expand" = xNONE && ac_expand="[$]$2"
ac_expand=`eval echo [$]ac_expand`
$3=`eval echo [$]ac_expand`
])
dnl ================================================================
dnl Gettext stuff.
dnl ================================================================
IT_PROG_INTLTOOL([0.50.1])
GETTEXT_PACKAGE=xed
AC_SUBST([GETTEXT_PACKAGE])
AM_GLIB_GNU_GETTEXT
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Define to the Gettext package name])
dnl ================================================================
dnl Use gvfs metadata or the old xml file store.
dnl ================================================================
AC_ARG_ENABLE([gvfs-metadata],
AS_HELP_STRING([--enable-gvfs-metadata], [Enable using gvfs to store metadata]),
[enable_gvfs_metadata=$enableval],
[enable_gvfs_metadata=yes])
AM_CONDITIONAL(ENABLE_GVFS_METADATA, test "x$enable_gvfs_metadata" != "xno")
if test "x$enable_gvfs_metadata" != "xno"; then
AC_DEFINE([ENABLE_GVFS_METADATA], [1], [Define to enable using gvfs metadata])
fi
dnl ================================================================
dnl spell plugins checks: enchant and iso-codes
dnl ================================================================
ENCHANT_REQUIRED=1.2.0
ISO_CODES_REQUIRED=0.35
AC_ARG_ENABLE([spell],
AS_HELP_STRING([--disable-spell],[Disable spell plugin (default: enabled)]),
[enable_enchant=$enableval],
[enable_enchant=yes])
if test "x$enable_enchant" = "xyes" ; then
PKG_CHECK_MODULES(ENCHANT, enchant >= $ENCHANT_REQUIRED, \
have_enchant=yes, have_enchant=no)
if test "x$have_enchant" = "xyes"; then
PKG_CHECK_EXISTS([iso-codes >= $ISO_CODES_REQUIRED],
[have_iso_codes=yes],[have_iso_codes=no])
if test "x$have_iso_codes" = "xyes"; then
AC_MSG_CHECKING([whether iso-codes has iso-639 and iso-3166 domains])
if $PKG_CONFIG --variable=domains iso-codes | grep 639 > /dev/null && \
$PKG_CONFIG --variable=domains iso-codes | grep 3166 > /dev/null ; then
result=yes
else
result=no
have_iso_codes=no
fi
AC_MSG_RESULT([$result])
fi
if test "x$have_iso_codes" = "xyes"; then
AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX],["`$PKG_CONFIG --variable=prefix iso-codes`"],[ISO codes prefix])
AC_DEFINE([HAVE_ISO_CODES],[1],[Define if you have the iso-codes package])
else
AC_MSG_ERROR([iso-codes is required to build the spell plugin. Use --disable-spell to build without spell plugin.])
fi
else
enable_enchant=no
AC_MSG_ERROR([Enchant library not found or too old. Use --disable-spell to build without spell plugin.])
fi
fi
AM_CONDITIONAL(ENABLE_ENCHANT, test x"$enable_enchant" = "xyes")
dnl ================================================================
dnl Start of pkg-config checks
dnl ================================================================
PKG_CHECK_MODULES(GMODULE,gmodule-2.0,[GMODULE_ADD="gmodule-2.0"],[GMODULE_ADD=""])
PKG_CHECK_MODULES(XED, [
libxml-2.0 >= 2.5.0
glib-2.0 >= 2.36.0
$GMODULE_ADD
gthread-2.0 >= 2.13.0
gio-2.0 >= 2.26.0
gtk+-3.0 >= 3.10.0
gtksourceview-3.0 >= 2.9.7
])
PKG_CHECK_MODULES(X11, [x11])
XED_CFLAGS="$XED_CFLAGS $X11_CFLAGS"
XED_LIBS="$XED_LIBS $X11_LIBS"
AC_SUBST(XED_CFLAGS)
AC_SUBST(XED_LIBS)
PKG_CHECK_MODULES(EGG_SMCLIENT, [sm >= 1.0.0])
AC_SUBST(EGG_SMCLIENT_CFLAGS)
AC_SUBST(EGG_SMCLIENT_LIBS)
dnl ================================================================
dnl GSettings related settings
dnl ================================================================
GLIB_GSETTINGS
dnl ================================================================
dnl Python
dnl ================================================================
AC_MSG_CHECKING([whether Python support is requested])
AC_ARG_ENABLE([python],
AS_HELP_STRING([--enable-python],[Enable python support]),
[enable_python=$enableval have_python=$enableval],
[enable_python=autodetect have_python=yes])
AC_MSG_RESULT([$enable_python])
if test "x$have_python" != "xno"; then
AM_PATH_PYTHON([2.5],[],[no])
if test "x$PYTHON" = "x:"; then
have_python=no
fi
fi
if test "x$have_python" != "xno"; then
AM_CHECK_PYTHON_HEADERS([],[have_python=no])
fi
if test "x$have_python" != "xno"; then
PY_EXEC_PREFIX=`$PYTHON -c 'import sys ; print sys.exec_prefix'`
PYTHON_LIBS="-lpython$PYTHON_VERSION"
PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'`
PYTHON_LIB_LOC="-L$libdir/python$PYTHON_VERSION/config"
PYTHON_CFLAGS="-I$PY_PREFIX/include/python$PYTHON_VERSION"
PYTHON_MAKEFILE="$libdir/python$PYTHON_VERSION/config/Makefile"
PYTHON_BASEMODLIBS=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
PYTHON_OTHER_LIBS=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
PYTHON_EXTRA_LIBS="$PYTHON_BASEMODLIBS $PYTHON_OTHER_LIBS"
AC_SUBST([PYTHON_LIBS])
AC_SUBST([PYTHON_LIB_LOC])
AC_SUBST([PYTHON_CFLAGS])
AC_SUBST([PYTHON_EXTRA_LIBS])
fi
if test "x$have_python" != "xyes"; then
if test "x$enable_python" = "xyes"; then
AC_MSG_ERROR([Python not found])
elif test "x$enable_python" = "xautodetect"; then
enable_python=no
AC_MSG_WARN([Python not found, disabling python support])
fi
fi
if test "x$have_python" != "xno"; then
PYGOBJECT_REQUIRED=2.15.4
PYGTK_REQUIRED=2.12.0
PYGTKSOURCEVIEW_REQUIRED=2.9.2
PKG_CHECK_MODULES([PYGTK], [
pygobject-2.0 >= $PYGOBJECT_REQUIRED
pygtk-2.0 >= $PYGTK_REQUIRED
pygtksourceview-2.0 >= $PYGTKSOURCEVIEW_REQUIRED],
[],
[
have_python=no
if test "x$enable_python" = "xyes"; then
AC_MSG_ERROR([$PYGTK_PKG_ERRORS])
elif test "x$enable_python" = "xautodetect"; then
enable_python=no
AC_MSG_WARN([$PYGTK_PKG_ERRORS])
AC_MSG_WARN([Disabling python support])
fi
])
fi
if test "x$have_python" != "xno"; then
AC_MSG_CHECKING([for pygtk defs])
PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
AC_MSG_RESULT([$PYGTK_DEFSDIR])
AC_MSG_CHECKING([for pygobject defs])
PYGOBJECT_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygobject-2.0`
AC_MSG_RESULT([$PYGOBJECT_DEFSDIR])
AC_MSG_CHECKING([for pygtk codegen])
PYGTK_CODEGEN="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/codegen.py"
AC_MSG_RESULT([$PYGTK_CODEGEN])
AC_MSG_CHECKING([for pygtk h2def])
PYGTK_H2DEF="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/h2def.py"
AC_MSG_RESULT([$PYGTK_H2DEF])
AC_SUBST([PYGTK_DEFSDIR])
AC_SUBST([PYGOBJECT_DEFSDIR])
AC_SUBST([PYGTK_CODEGEN])
AC_SUBST([PYGTK_H2DEF])
dnl Check for -fno-strict-aliasing
FLAGS="-fno-strict-aliasing"
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $FLAGS"
AC_MSG_CHECKING([whether [$]CC understands $FLAGS])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[compiler_has_option=yes],[compiler_has_option=no])
CFLAGS="$save_CFLAGS"
AC_MSG_RESULT($compiler_has_option)
if test $compiler_has_option = yes; then
NO_STRICT_ALIASING_CFLAGS="$FLAGS"
fi
AC_SUBST([NO_STRICT_ALIASING_CFLAGS])
fi
if test "x$have_python" != "xno" -a "x$enable_python" != "xno"; then
enable_python=yes
AC_DEFINE([ENABLE_PYTHON],[1],[Define to compile with python support])
fi
AM_CONDITIONAL([ENABLE_PYTHON],[test "x$enable_python" = "xyes"])
dnl This allows the bug-report script to know whether python has been enabled
AC_SUBST(enable_python)
dnl ================================================================
dnl Misc
dnl ================================================================
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
GNOME_COMPILE_WARNINGS(yes)
AC_ARG_ENABLE(deprecations,
[AS_HELP_STRING([--enable-deprecations],
[warn about deprecated usages [default=no]])],,
[enable_deprecations=no])
if test "x$enable_deprecations" = "xyes"; then
DISABLE_DEPRECATED_CFLAGS="\
-DG_DISABLE_DEPRECATED \
-DGDK_DISABLE_DEPRECATED \
-DGTK_DISABLE_DEPRECATED \
-DGDK_PIXBUF_DISABLE_DEPRECATED \
-DGNOME_DISABLE_DEPRECATED"
AC_SUBST(DISABLE_DEPRECATED_CFLAGS)
fi
AC_ARG_ENABLE([tests],
AS_HELP_STRING([--enable-tests], [Enable the tests]),
[enable_tests=$enableval],
[enable_tests=yes])
AM_CONDITIONAL(ENABLE_TESTS, test x$enable_tests = xyes)
PLUGIN_LIBTOOL_FLAGS="-module -avoid-version"
LOADER_LIBTOOL_FLAGS="-module -avoid-version"
AC_SUBST(PLUGIN_LIBTOOL_FLAGS)
AC_SUBST(LOADER_LIBTOOL_FLAGS)
XED_PLUGINS_DATA_DIR="$datadir/xed/plugins"
AC_SUBST(XED_PLUGINS_DATA_DIR)
XED_PLUGINS_LIBS_DIR="$libdir/xed/plugins"
AC_SUBST(XED_PLUGINS_LIBS_DIR)
YELP_HELP_INIT
AC_CONFIG_FILES([
Makefile
data/xed.desktop.in
data/xed-bugreport.sh
data/xed.pc
data/org.x.editor.gschema.xml
data/Makefile
docs/Makefile
docs/reference/Makefile
xed/dialogs/Makefile
xed/smclient/Makefile
xed/Makefile
help/Makefile
pixmaps/Makefile
plugin-loaders/Makefile
plugin-loaders/c/Makefile
plugin-loaders/python/Makefile
plugin-loaders/python/bindings/Makefile
plugins/Makefile
plugins/changecase/Makefile
plugins/docinfo/Makefile
plugins/filebrowser/Makefile
plugins/filebrowser/org.x.editor.plugins.filebrowser.gschema.xml
plugins/modelines/Makefile
plugins/sort/Makefile
plugins/spell/Makefile
plugins/spell/org.x.editor.plugins.spell.gschema.xml
plugins/taglist/Makefile
plugins/time/Makefile
plugins/time/org.x.editor.plugins.time.gschema.xml
plugins/trailsave/Makefile
po/Makefile.in
tests/Makefile
])
AC_OUTPUT
echo "
Configuration:
Source code location: ${srcdir}
Compiler: ${CC}
Python Plugins Support: $enable_python
Spell Plugin enabled: $enable_enchant
Gvfs metadata enabled: $enable_gvfs_metadata
Tests enabled: $enable_tests
"

View File

@@ -1,38 +0,0 @@
desktopdir = $(datadir)/applications
desktop_in_files = xed.desktop.in
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
@INTLTOOL_DESKTOP_RULE@
@INTLTOOL_XML_RULE@
appdatadir = $(datadir)/appdata
appdata_in_files = xed.appdata.xml.in
appdata_DATA = $(appdata_in_files:.xml.in=.xml)
gsettings_SCHEMAS = org.x.editor.gschema.xml
@GSETTINGS_RULES@
man_MANS = xed.1
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = xed.pc
bugreportdir = $(libexecdir)/xed
bugreport_SCRIPTS = xed-bugreport.sh
EXTRA_DIST = \
$(appdata_in_files) \
$(desktop_in_files) \
$(man_MANS) \
xed.pc.in \
xed-bugreport.sh.in
CLEANFILES = \
$(desktop_DATA) \
$(gsettings_SCHEMAS) \
$(pkgconfig_DATA) \
$(appdata_DATA)
-include $(top_srcdir)/git.mk

42
data/meson.build Normal file
View File

@@ -0,0 +1,42 @@
desktop = custom_target(
'desktop',
input: 'xed.desktop.in.in',
output: 'xed.desktop',
command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'],
install: true,
install_dir: desktopdir,
)
appdata = custom_target(
'appdata',
input: 'xed.appdata.xml.in',
output: 'xed.appdata.xml',
command: [intltool_merge, '-x', '-u', po_dir, '@INPUT@', '@OUTPUT@'],
install: true,
install_dir: join_paths(datadir, 'metainfo'),
)
schema_conf = configuration_data()
schema_conf.set('GETTEXT_PACKAGE', 'xed')
schema_file = configure_file(
input: 'org.x.editor.gschema.xml.in',
output: 'org.x.editor.gschema.xml',
configuration: schema_conf,
install_dir: join_paths(datadir, 'glib-2.0', 'schemas')
)
service_conf = configuration_data()
service_conf.set('bindir', join_paths(prefix, bindir))
configure_file(
input: 'org.x.editor.service.in',
output: 'org.x.editor.service',
configuration: service_conf,
install_dir: join_paths(datadir, 'dbus-1', 'services')
)
install_data(
'xed.1',
install_dir : join_paths(get_option('prefix'), get_option('mandir'), 'man1')
)

View File

@@ -1,195 +1,378 @@
<?xml version="1.0"?>
<schemalist gettext-domain="@GETTEXT_PACKAGE@">
<schema id="org.x.editor" path="/org/x/editor/">
<schemalist>
<enum id="org.x.editor.WrapMode">
<value nick="none" value="0"/>
<value nick="char" value="1"/>
<value nick="word" value="2"/>
<value nick="word-char" value="3"/>
</enum>
<enum id="org.x.editor.SmartHomeEnd">
<value nick="disabled" value="0"/>
<value nick="before" value="1"/>
<value nick="after" value="2"/>
<value nick="always" value="3"/>
</enum>
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org.x.editor" path="/org/x/editor/">
<child name="preferences" schema="org.x.editor.preferences"/>
<child name="state" schema="org.x.editor.state"/>
<child name="plugins" schema="org.x.editor.plugins"/>
</schema>
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org.x.editor.preferences" path="/org/x/editor/preferences/">
<child name="editor" schema="org.x.editor.preferences.editor"/>
<child name="ui" schema="org.x.editor.preferences.ui"/>
<child name="print" schema="org.x.editor.preferences.print"/>
<child name="encodings" schema="org.x.editor.preferences.encodings"/>
</schema>
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org.x.editor.preferences.editor" path="/org/x/editor/preferences/editor/">
<key name="use-default-font" type="b">
<default>true</default>
<summary>Use Default Font</summary>
<description>Whether to use the system's default fixed width font for editing text instead of a font specific to xed. If this option is turned off, then the font named in the "Editor Font" option will be used instead of the system font.</description>
</key>
<key name="editor-font" type="s">
<default context="editor-font" l10n="messages">'Monospace 12'</default>
<summary>Editor Font</summary>
<description>A custom font that will be used for the editing area. This will only take effect if the "Use Default Font" option is turned off.</description>
</key>
<key name="color-scheme" type="s">
<key name="prefer-dark-theme" type="b">
<default>false</default>
<summary>Prefer Dark Theme</summary>
<description>Whether xed should prefer the dark variation of the current Gtk theme if available.</description>
</key>
<key name="scheme" type="s">
<default>'tango'</default>
<summary>Style Scheme</summary>
<description>The ID of a GtkSourceView Style Scheme used to color the text.</description>
</key>
<key name="create-backup-copy" type="b">
<default>false</default>
<summary>Create Backup Copies</summary>
<description>Whether xed should create backup copies for the files it saves. You can set the backup file extension with the "Backup Copy Extension" option.</description>
</key>
<key name="auto-save" type="b">
<default>false</default>
<summary>Autosave</summary>
<description>Whether xed should automatically save modified files after a time interval. You can set the time interval with the "Autosave Interval" option.</description>
</key>
<key name="auto-save-interval" type="i">
<key name="auto-save-interval" type="u">
<default>10</default>
<summary>Autosave Interval</summary>
<description>Number of minutes after which xed will automatically save modified files. This will only take effect if the "Autosave" option is turned on.</description>
</key>
<key name="writable-vfs-schemes" type="as">
<default>[ 'dav', 'davs', 'ftp', 'sftp', 'smb', 'ssh' ]</default>
<summary>Writable VFS schemes</summary>
<description>List of VFS schemes xed supports in write mode. The 'file' scheme is writable by default.</description>
</key>
<key name="max-undo-actions" type="i">
<default>2000</default>
<summary>Maximum Number of Undo Actions</summary>
<description>Maximum number of actions that xed will be able to undo or redo. Use "-1" for unlimited number of actions.</description>
</key>
<key name="wrap-mode" type="s">
<default>'GTK_WRAP_WORD'</default>
<key name="wrap-mode" enum="org.x.editor.WrapMode">
<default>'word'</default>
<summary>Line Wrapping Mode</summary>
<description>Specifies how to wrap long lines in the editing area. Use "GTK_WRAP_NONE" for no wrapping, "GTK_WRAP_WORD" for wrapping at word boundaries, and "GTK_WRAP_CHAR" for wrapping at individual character boundaries. Note that the values are case-sensitive, so make sure they appear exactly as mentioned here.</description>
<description>Specifies how to wrap long lines in the editing area. Use "none" for no wrapping, "word" for wrapping at word boundaries, and "char" for wrapping at individual character boundaries. Note that the values are case-sensitive, so make sure they appear exactly as mentioned here.</description>
</key>
<key name="tabs-size" type="i">
<key name="tabs-size" type="u">
<default>4</default>
<summary>Tab Size</summary>
<description>Specifies the number of spaces that should be displayed instead of Tab characters.</description>
</key>
<key name="insert-spaces" type="b">
<default>true</default>
<summary>Insert spaces</summary>
<description>Whether xed should insert spaces instead of tabs.</description>
</key>
<key name="auto-indent" type="b">
<default>false</default>
<summary>Automatic indent</summary>
<description>Whether xed should enable automatic indentation.</description>
</key>
<key name="display-line-numbers" type="b">
<default>false</default>
<summary>Display Line Numbers</summary>
<description>Whether xed should display line numbers in the editing area.</description>
</key>
<key name="highlight-current-line" type="b">
<default>false</default>
<summary>Highlight Current Line</summary>
<description>Whether xed should highlight the current line.</description>
</key>
<key name="bracket-matching" type="b">
<default>false</default>
<summary>Highlight Matching Bracket</summary>
<description>Whether xed should highlight the bracket matching the selected one.</description>
</key>
<key name="display-right-margin" type="b">
<default>false</default>
<summary>Display Right Margin</summary>
<description>Whether xed should display the right margin in the editing area.</description>
</key>
<key name="right-margin-position" type="i">
<key name="right-margin-position" type="u">
<default>120</default>
<summary>Right Margin Position</summary>
<description>Specifies the position of the right margin.</description>
</key>
<key name="smart-home-end" type="s">
<key name="smart-home-end" enum="org.x.editor.SmartHomeEnd">
<default>'after'</default>
<summary>Smart Home End</summary>
<description>Specifies how the cursor moves when the HOME and END keys are pressed. Use "DISABLED" to always move at the start/end of the line, "AFTER" to move to the start/end of the line the first time the keys are pressed and to the start/end of the text ignoring whitespaces the second time the keys are pressed, "BEFORE" to move to the start/end of the text before moving to the start/end of the line and "ALWAYS" to always move to the start/end of the text instead of the start/end of the line.</description>
<description>Specifies how the cursor moves when the HOME and END keys are pressed. Use "disabled" to always move at the start/end of the line, "after" to move to the start/end of the line the first time the keys are pressed and to the start/end of the text ignoring whitespaces the second time the keys are pressed, "before" to move to the start/end of the text before moving to the start/end of the line and "always" to always move to the start/end of the text instead of the start/end of the line.</description>
</key>
<key name="restore-cursor-position" type="b">
<default>true</default>
<summary>Restore Previous Cursor Position</summary>
<description>Whether xed should restore the previous cursor position when a file is loaded.</description>
</key>
<key name="enable-search-highlighting" type="b">
<key name="search-highlighting" type="b">
<default>true</default>
<summary>Enable Search Highlighting</summary>
<description>Whether xed should highlight all the occurrences of the searched text.</description>
</key>
<key name="enable-syntax-highlighting" type="b">
<key name="syntax-highlighting" type="b">
<default>true</default>
<summary>Enable Syntax Highlighting</summary>
<description>Whether xed should enable syntax highlighting.</description>
</key>
<key name="ensure-trailing-newline" type="b">
<default>true</default>
<summary>Ensure Trailing Newline</summary>
<description>Whether xed will ensure that documents always end with a trailing newline.</description>
</key>
<key name="draw-whitespace" type="b">
<default>false</default>
<summary>Draw whitespace</summary>
<description>Whether xed should render whitespace</description>
</key>
<key name="draw-whitespace-leading" type="b">
<default>false</default>
<summary>Draw leading whitespace</summary>
<description>Whether xed should render leading whitespace</description>
</key>
<key name="draw-whitespace-inside" type="b">
<default>false</default>
<summary>Draw whitespace within text</summary>
<description>Whether xed should render whitespace between words and characters</description>
</key>
<key name="draw-whitespace-trailing" type="b">
<default>false</default>
<summary>Draw trailing whitespace</summary>
<description>Whether xed should render trailing whitespace</description>
</key>
<key name="draw-whitespace-newline" type="b">
<default>false</default>
<summary>Draw newline characters</summary>
<description>Whether xed should render newline characters</description>
</key>
</schema>
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org.x.editor.preferences.ui" path="/org/x/editor/preferences/ui/">
<key name="toolbar-visible" type="b">
<default>true</default>
<summary>Toolbar is Visible</summary>
<description>Whether the toolbar should be visible in editing windows.</description>
</key>
<key name="statusbar-visible" type="b">
<default>true</default>
<summary>Status Bar is Visible</summary>
<description>Whether the status bar at the bottom of editing windows should be visible.</description>
</key>
<key name="side-pane-visible" type="b">
<key name="side-panel-visible" type="b">
<default>false</default>
<summary>Side Pane is Visible</summary>
<description>Whether the side pane at the left of editing windows should be visible.</description>
</key>
<key name="bottom-panel-visible" type="b">
<default>false</default>
<summary>Bottom Panel is Visible</summary>
<description>Whether the bottom panel at the bottom of editing windows should be visible.</description>
</key>
<key name="max-recents" type="i">
<key name="enable-tab-scrolling" type="b">
<default>true</default>
<summary>Allow changing active tabs by scrolling</summary>
<description>Whether you can change active tabs by scrolling.</description>
</key>
<key name="minimap-visible" type="b">
<default>false</default>
<summary>Minimap is visible</summary>
<description>Whether the minimap for the document should be visible.</description>
</key>
<key name="max-recents" type="u">
<default>5</default>
<summary>Maximum Recent Files</summary>
<description>Specifies the maximum number of recently opened files that will be displayed in the "Recent Files" submenu.</description>
</key>
</schema>
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org.x.editor.preferences.print" path="/org/x/editor/preferences/print/">
<key name="print-syntax-highlighting" type="b">
<default>true</default>
<summary>Print Syntax Highlighting</summary>
<description>Whether xed should print syntax highlighting when printing documents.</description>
</key>
<key name="print-header" type="b">
<default>true</default>
<summary>Print Header</summary>
<description>Whether xed should include a document header when printing documents.</description>
</key>
<key name="print-wrap-mode" type="s">
<default>'GTK_WRAP_WORD'</default>
<key name="print-wrap-mode" enum="org.x.editor.WrapMode">
<default>'word'</default>
<summary>Printing Line Wrapping Mode</summary>
<description>Specifies how to wrap long lines for printing. Use "GTK_WRAP_NONE" for no wrapping, "GTK_WRAP_WORD" for wrapping at word boundaries, and "GTK_WRAP_CHAR" for wrapping at individual character boundaries. Note that the values are case-sensitive, so make sure they appear exactly as mentioned here.</description>
<description>Specifies how to wrap long lines for printing. Use "none" for no wrapping, "word" for wrapping at word boundaries, and "char" for wrapping at individual character boundaries. Note that the values are case-sensitive, so make sure they appear exactly as mentioned here.</description>
</key>
<key name="print-line-numbers" type="i">
<key name="print-line-numbers" type="u">
<default>0</default>
<summary>Print Line Numbers</summary>
<description>If this value is 0, then no line numbers will be inserted when printing a document. Otherwise, xed will print line numbers every such number of lines.</description>
</key>
<key name="print-font-body-pango" type="s">
<default context="print-font-body-pango" l10n="messages">'Monospace 9'</default>
<summary>Body Font for Printing</summary>
<description>Specifies the font to use for a document's body when printing documents.</description>
</key>
<key name="print-font-header-pango" type="s">
<default context="print-font-header-pango" l10n="messages">'Sans 11'</default>
<summary>Header Font for Printing</summary>
<description>Specifies the font to use for page headers when printing a document. This will only take effect if the "Print Header" option is turned on.</description>
</key>
<key name="print-font-numbers-pango" type="s">
<default context="print-font-numbers-pango" l10n="messages">'Sans 8'</default>
<summary>Line Number Font for Printing</summary>
<description>Specifies the font to use for line numbers when printing. This will only take effect if the "Print Line Numbers" option is non-zero.</description>
</key>
<key name="auto-detected-encodings" type="as">
</schema>
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org.x.editor.preferences.encodings" path="/org/x/editor/preferences/encodings/">
<key name="auto-detected" type="as">
<default context="auto-detected" l10n="messages">[ 'UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16' ]</default>
<summary>Automatically Detected Encodings</summary>
<description>Sorted list of encodings used by xed for automatically detecting the encoding of a file. "CURRENT" represents the current locale encoding. Only recognized encodings are used.</description>
</key>
<key name="shown-in-menu-encodings" type="as">
<key name="shown-in-menu" type="as">
<default context="shown-in-menu" l10n="messages">[ 'ISO-8859-15' ]</default>
<summary>Encodings shown in menu</summary>
<description>List of encodings shown in the Character Encoding menu in open/save file selector. Only recognized encodings are used.</description>
</key>
</schema>
<schema id="org.x.editor.state" path="/org/x/editor/state/">
<child name="window" schema="org.x.editor.state.window"/>
<child name="file-filter" schema="org.x.editor.state.file-filter"/>
<child name="history-entry" schema="org.x.editor.state.history-entry"/>
</schema>
<schema id="org.x.editor.state.window" path="/org/x/editor/state/window/">
<key name="state" type="i">
<default>0</default>
</key>
<key name="size" type="(ii)">
<default>(650,500)</default>
</key>
<key name="side-panel-size" type="i">
<default>200</default>
</key>
<key name="side-panel-active-page" type="i">
<default>0</default>
</key>
<key name="bottom-panel-size" type="i">
<default>140</default>
</key>
<key name="bottom-panel-active-page" type="i">
<default>0</default>
</key>
</schema>
<schema id="org.x.editor.state.file-filter" path="/org/x/editor/state/file-filter/">
<key name="filter-id" type="i">
<default>0</default>
</key>
</schema>
<schema id="org.x.editor.state.history-entry" path="/org/x/editor/state/history-entry/">
<key name="history-search-for" type="as">
<default>[]</default>
<summary>History for "search for" entries</summary>
<description>List of entries in "search for" textbox.</description>
</key>
<key name="history-replace-with" type="as">
<default>[]</default>
<summary>History for "replace with" entries</summary>
<description>List of entries in "replace with" textbox.</description>
</key>
</schema>
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org.x.editor.plugins" path="/org/x/editor/plugins/">
<key name="active-plugins" type="as">
<default>[ 'docinfo', 'modelines', 'filebrowser', 'spell', 'time' ]</default>
<summary>Active plugins</summary>
<description>List of active plugins. It contains the "Location" of the active plugins. See the .xed-plugin file for obtaining the "Location" of a given plugin.</description>
</key>
</schema>
</schemalist>

View File

@@ -0,0 +1,3 @@
[D-BUS Service]
Name=org.x.editor
Exec=@bindir@/xed

View File

@@ -1,73 +0,0 @@
#!/bin/sh
ENABLE_PYTHON=@enable_python@
PKG_CONFIG_MODULES="glib-2.0 gtk+-2.0 gtksourceview-2.0 \
pygobject-2.0 pygtk-2.0 \
pygtksourceview-2.0 enchant iso-codes"
echo_padded ()
{
echo -n " - $1 "
N=$(echo -n $1 | wc -m)
while test $N -le 20
do
echo -n " "
N=`expr $N + 1`
done
}
if (which gsettings >/dev/null)
then
echo "GSettings configuration dump:"
gsettings list-recursively org.x.editor
echo
fi
echo "Active plugins:"
gsettings get org.x.editor active-plugins \
| sed -r -e 's/^\[(.*)\]$/\1/' -e 's/, /\n/g' \
| sed -e 's/^.*$/ - \0/'
echo
# Manually installed plugins (in $HOME)
if [ -d $HOME/.config/xed/plugins ]
then
echo "Plugins in \$HOME:"
ls $HOME/.config/xed/plugins/*.xed-plugin \
| sed -r -e 's#.*/([^/]*)\.xed-plugin$# - \1#'
else
echo "No plugin installed in \$HOME."
fi
echo
echo "Module versions:"
if (which pkg-config > /dev/null)
then
for i in $PKG_CONFIG_MODULES
do
echo_padded "`echo -n $i | sed -r -e 's/^(.*)-[0-9]\.[0-9]$/\1/'`"
pkg-config --modversion $i 2>/dev/null || echo
done
else
echo " pkg-config unavailable"
fi
echo
echo "Python module versions:"
if test "$ENABLE_PYTHON" = "yes"
then
echo_padded "python"
python -V 2>&1 | cut -c8-
echo_padded "pygtk"
python -c "import gtk, sys; \
sys.stdout.write('%d.%d.%d ' % gtk.pygtk_version); \
sys.stdout.write('(GTK+ %d.%d.%d)' % gtk.gtk_version)" \
2>/dev/null
echo
else
echo " Python support was not enabled at compile time."
fi
echo

View File

@@ -1,12 +0,0 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
pluginsdir=@libdir@/xed/plugins
Name: xed
Description: xed
Requires: gtksourceview-@GTK_API_VERSION@
Version: @VERSION@
Cflags: -I${includedir}/xed
Libs: -L${libdir}

535
debian/changelog vendored
View File

@@ -1,3 +1,538 @@
xed (2.4.3) tricia; urgency=medium
[ okaestne ] [backported by wolfpackmars2]
* Implement #225: Options to render whitespace
* backported from xed-3
xed (2.4.2) tricia; urgency=medium
* l10n: Update translations
-- Clement Lefebvre <root@linuxmint.com> Wed, 11 Dec 2019 14:49:32 +0000
xed (2.4.1) tricia; urgency=medium
* l10n: Update translations
-- Clement Lefebvre <root@linuxmint.com> Tue, 26 Nov 2019 17:14:23 +0000
xed (2.4.0) tricia; urgency=medium
[ Michael Webster ]
* print-preview: add a print button to the preview toolbar, to immediately print the previewed document.
[ nardholio ]
* Packaging: remove dependency on libpeas-1.0-0-python3loader (#325)
[ Pavel Shlyak ]
* Cleanup (#321)
[ Leigh Scott ]
* add open uri plugin (#317)
[ Clement Lefebvre ]
* open-uri: Make the plugin built-in
* open-uri: Simplify and fix translations
* Print preview: Reuse existing msgid
-- Clement Lefebvre <root@linuxmint.com> Fri, 22 Nov 2019 12:12:12 +0000
xed (2.2.3) tina; urgency=medium
* l10n: Update translations
-- Clement Lefebvre <root@linuxmint.com> Sun, 28 Jul 2019 15:03:33 +0200
xed (2.2.2) tina; urgency=medium
* Preferences: Make dialog slightly taller
-- Clement Lefebvre <root@linuxmint.com> Thu, 25 Jul 2019 10:59:55 +0200
xed (2.2.1) tina; urgency=medium
[ Alexander Drozdov ]
* Automatically open new Xed window on current workspace... (#319)
[ Clement Lefebvre ]
* l10n: Update translations
-- Clement Lefebvre <root@linuxmint.com> Wed, 10 Jul 2019 11:26:12 +0200
xed (2.2.0) tina; urgency=medium
[ Eli Schwartz ]
* meson: require itstool command to be available (#266)
[ JosephMcc ]
* statusbar: Fix the menu button styling (#281)
* cleanup: Remove an unused Makefile.am (#280)
[ Stephen Collins ]
* print preview: fix layout drawing for 1X2 and 2X1 layouts (#291)
* Filebrowser: Kill the click policy property with fire (#293)
[ JosephMcc ]
* xed-window: Fix the tabs/spaces label in the statusbar (#283)
* xed-notebook: Always show the main notebook tabs (#285)
[ Stephen Collins ]
* Fix some deprecation warnings (#289)
* print preview: fix logic for forward button sensitivity (#292)
* Add toggle comment and toggle comment block actions w/ keybindings (#290)
[ Clement Lefebvre ]
* l10n: Update POT
[ Stephen Collins ]
* print job: replace some deprecated font button functions (#294)
* Replace deprecated gdk_cursor_new with gdk_cursor_new_for_display (#295)
* Print preview: remove a couple calls to gtk_adjustment_value_changed (#296)
* Search: replace a few functions that were deprecated in Gtk 3.22 (#297)
* Fix stuttering and disappearing of the toolbar when fullscreen (#300)
* Switch deprecated gtk_icon_info_free to g_object_unref (#301)
* Remove references to deprecated GTK_STOCK_* (#298)
* Remove deprecated call to gtk_widget_override_background_color (#299)
* Tab width popup: only select a menu item when the menu is open (#311)
* Simplify an if statement. The logic is identical, but easier to read (#314)
[ Leigh Scott ]
* Add minimum required version for xapp (#313)
[ Stephen Collins ]
* Prevent a warning when closing the window while print preview is open (#315)
[ Clement Lefebvre ]
* l10n: Update POT
-- Clement Lefebvre <root@linuxmint.com> Sat, 29 Jun 2019 17:23:48 +0200
xed (2.0.2) tessa; urgency=medium
[ Clement Lefebvre ]
* Fix non-translated desktop file
[ Michael Webster ]
* highlight mode window: Make activatable via shortcut (ctrl-shift-H), focus the search entry by default, and allow Escape to cancel the dialog from the search entry.
[ chingyinwan123 ]
* Fix warnings when building xed 2.0.1 (#264)
[ Clement Lefebvre ]
* l10n: Update translations
-- Clement Lefebvre <root@linuxmint.com> Tue, 11 Dec 2018 14:10:08 +0000
xed (2.0.1) tessa; urgency=medium
[ Leigh Scott ]
* Switch build instructions for meson port. (#263)
[ Clement Lefebvre ]
* l10n: Update translations
-- Clement Lefebvre <root@linuxmint.com> Tue, 27 Nov 2018 18:33:21 +0000
xed (2.0.0) tessa; urgency=medium
[ Tomasz Gąsior ]
* Import GeditHighlightModeDialog and -Selector from Gedit to Xed.
* Use highlight dialog instead submenu in "View" menu.
* XedWindow cleanup.
* Import GeditStatusMenuButton.
* Fix compilation warning.
* Use popover with highlight selector instead loooong menu in statusbar.
* Use XedStatusMenuButton instead -ComboBox in statusbar, for consistency.
* Kill XedStatusComboBox. It's not used now.
[ JosephMcc ]
* xed-window: Indicate if we are currently using spaces or tabs in statusbar (#246)
[ NikoKrause ]
* Use icon for keyboard shortcuts help entry (#255)
* Rearrange help entries (xapp consistency) (#256)
* close dialog: use "suggested-action" style class (#261)
[ Stephen Collins ]
* Port to meson (#258)
[ Clement Lefebvre ]
* Fix merge issues
* l10n: Update POT
-- Clement Lefebvre <root@linuxmint.com> Mon, 19 Nov 2018 11:34:46 +0000
xed (1.8.3) tara; urgency=medium
[ Michael Webster ]
* search bar/xed-history-entry: Set a 'width-chars' on the GtkEntry widgets of the search and replace entry widgets, and allow their labels to ellipsize upon resizing.
-- Clement Lefebvre <root@linuxmint.com> Tue, 17 Jul 2018 09:32:59 +0200
xed (1.8.2) tara; urgency=medium
[ NikoKrause ]
* missing l10n: Help -> Shortcuts (#229)
[ Clement Lefebvre ]
* l10n: Update POT file
* l10n: Update translations
-- Clement Lefebvre <root@linuxmint.com> Tue, 26 Jun 2018 13:21:55 +0200
xed (1.8.1) tara; urgency=medium
* l10n: Update translations
* l10n: Update files
-- Clement Lefebvre <root@linuxmint.com> Tue, 22 May 2018 12:53:38 +0100
xed (1.8.0) tara; urgency=medium
[ Clement Lefebvre ]
* Add CI configuration
[ Leigh Scott ]
* Fix clang compile issue (#209)
* Fix Py*DeprecationWarning (#202)
[ JosephMcc ]
* Pull upstream fixes for gtk and gtksourceview changes
* preferences-dialog: Complete revamp
* xed-window: Rework the fullscreen toolbar
* xed-status-combo-box: Remove some deprecated css functionality
* xed-view-frame: Fix the css for the minimap frame
* xed-notebook: Clean up some gtk3.20+ conditionals
* Add a shortcuts window
* xed-view: Add shortcuts for change case
* debian: Add --enable-silent-rules to debian/rules
* css: Add support for Adwaita
* xed-searchbar: Fix the size of the searchbar close button
* xed-spell-checker.c: Clean up the code formatting
* spell-plugin: Update for removal of some deprecated functionality
* xed-notebook: Allow changing tabs with mouse back/forward buttons
* Fix a couple of issues turned up by Codacy
* Clean up a few build warnings
* spell-plugin: Port to gspell
* spell-plugin: Fix a link to the help file
[ Nic ]
* Add C tags to the taglist plugin (#188)
[ Clement Lefebvre ]
* CI: Don't build for Mint 18
[ JosephMcc ]
* xed-window: Fix a potential crash
[ Mickael Albertus ]
* Creation of plugin Word completion (#199)
[ Clement Lefebvre ]
* Wordcompletion: Fix a few mgsids
* l10n: Update POT file
-- Clement Lefebvre <root@linuxmint.com> Sun, 06 May 2018 16:43:18 +0100
xed (1.6.3) sylvia; urgency=medium
* l10n: Update translations
-- Clement Lefebvre <root@linuxmint.com> Thu, 23 Nov 2017 12:24:36 +0000
xed (1.6.2) sylvia; urgency=medium
[ JosephMcc ]
* xed-status-combo-box: Simplify the widget heirarchy (#185)
-- Clement Lefebvre <root@linuxmint.com> Fri, 17 Nov 2017 10:42:21 +0000
xed (1.6.1) sylvia; urgency=medium
* l10n: Fix localization in TextSize plugin
-- Clement Lefebvre <root@linuxmint.com> Wed, 15 Nov 2017 13:11:20 +0000
xed (1.6.0) sylvia; urgency=medium
[ JosephMcc ]
* translations: Add the textsize plugin to POTFILES.in (#151)
[ Clement Lefebvre ]
* l10n: Update POT file
[ JosephMcc ]
* text zoom: Put a limit on the min and max zoom (#137)
[ Gavin D. Howard ]
* Make the trailsave plugin also strip trailing lines (#135)
[ JosephMcc ]
* Don't present users with the hidden highlight languages (#167)
* xed-view: Fix a crash when right clicking the left gutter (#166)
* Minimap (#175)
[ Clement Lefebvre ]
* l10n: Update POT file
* l10n: Update translations
-- Clement Lefebvre <root@linuxmint.com> Fri, 03 Nov 2017 21:13:44 +0000
xed (1.4.6) sonya; urgency=medium
[ githpr ]
* Use correct value to save the window state in gsettings. (#147)
-- Clement Lefebvre <root@linuxmint.com> Sat, 15 Jul 2017 21:37:18 +0200
xed (1.4.5) sonya; urgency=medium
[ JosephMcc ]
* Create ISSUE_TEMPLATE.md
[ Clement Lefebvre ]
* Packaging: Remove dependency on libpeas-1.0-0-python3loader in LMDE
-- Clement Lefebvre <root@linuxmint.com> Tue, 04 Jul 2017 13:11:46 +0200
xed (1.4.4) sonya; urgency=medium
* l10n: Update translations
-- Clement Lefebvre <root@linuxmint.com> Wed, 28 Jun 2017 10:11:34 +0200
xed (1.4.3) sonya; urgency=medium
[ Mike Krüger ]
* bugfix: ugly white border (gtk 3.20>) (#128)
[ JosephMcc ]
* filebrowser: Change an icon name (#132)
-- Clement Lefebvre <root@linuxmint.com> Tue, 20 Jun 2017 15:22:10 +0200
xed (1.4.2) sonya; urgency=medium
[ leigh123linux ]
* fix gtksourceprintcompositor.h includes warning (#117)
[ Clement Lefebvre ]
* l10n: Update translations
-- Clement Lefebvre <root@linuxmint.com> Tue, 23 May 2017 13:35:28 +0100
xed (1.4.1) sonya; urgency=medium
* Depend on gtksourceview-3.0 >= 3.14.0
* Only use gtk_text_view_set_top_margin() with GTK 3.18+
* Packaging: Change description
* l10n: Update translations
-- Clement Lefebvre <root@linuxmint.com> Sat, 06 May 2017 14:57:27 +0100
xed (1.4.0) sonya; urgency=medium
[ Clement Lefebvre ]
* Search: Don't jump to the next result when toggling search options
[ JosephMcc ]
* close-confirmation-dialog: Clean up code styling
* close-confirmation-dialog: Clean up some deprecations
* xed-encodings-dialog: Clean up code styling
* xed-encodings-dialog: Clean up some deprecations
* xed-encodings-combo-box: Clean up code styling
* xed-commands-file: Clean up code styling
* xed-commands-file: Clean up deprecations
* xed-app: Clean up code styling
* xed-app: Remove an unused variable
* xed-commands-search: Fix some missing casts
* xed-document: Clean up code style
* xed-document: Remove use of deprecated gdk_color_parse
* xed-documents-panel: Cleanup code styling
* xed-documents-panel: Remove an unused variable
* xed-message-bus: Clean up code styling
* xed-message-bus: Clean up an unused variables
* xed-io-error-message-area: Clean up code styling
* xed-io-error-message-area: Fix up some deprecations
* xed-panel: Clean up code formatting
* plugins: Drop support for old style python plugins
* build: Clean up a bit more of the gtk2 and --enable-python leftovers
* build GObject introspection data
* Fix some introspection warnings
* Remove a couple of invalid annotations
* xed-window: Remove an unused function
* Drop some leftover 2.xx comments from gnome/pluma
* Port plugin system to libpeas
* changecase-plugin: Port to libpeas
* docinfo-plugin: Port to libpeas
* filebrowser-plugin: Port to libpeas
* modelines-plugin: Port to libpeas
* sort-plugin: Port to libpeas
* spell-plugin: Port to libpeas
* taglist-plugin: Port to libpeas
* time-plugin: Port to libpeas
* trailsave-plugin: Port to libpeas
* plugins: Make them actually recognized and loaded by Xed
* Remove old plugin system and docs for it
* enable dh_girepository helper to fill ${gir:Depends} properly
* taglist plugin: don't look for taglist in non-existing legacy dirs
* xed-panel: Clean up the layout of the panels
* xed-sort-plugin.c: Clean up code styling
* Add buttons to the statusbar to show/hide the panels
* xed-window: Stop using deprecated (v/h)box
* xed-panel: Remove the header and close button
* xed-panel: Simplify panel building a bit
* xed-panel: Move the notebook tabs to the top
* Add a few style classes
* xed-statusbar: Clean up the styling a bit
* Add view menu entry for word wrap
* preferences-dialog: Clean up code styling
* preferences-dialog: Clean up uses of GtkStock
* Allow scrolling on notebook tabs to change the active page
* xed-prefs-manager-app: Remove some leftover logging
* xed-notebook.c: Clean up the code formatting
* xed-pref-manager-app.c: Clean up code style
* xed-prefs-manager-app.c: Clean up an unused variable
* notebooks: Don't show tabs when the notebook only has one page
* xed-window.c: Fix a few missing casts
* xed-utils: Clean up code styling
* xed-utils.h: Clean up code styling
* xed-utils: Remove a couple functions
* xed-panel: Clean up more uses of GtkStock
* xed-panel.c: Add a couple of missing casts
* xed-status-combo-box: Don't use deprecated GtkArrow
* xed-status-combo-box.c: Clean up some code styling
* xed-tab.c: Clean up code style
* xed-tab: Clean up some uses of GtkStock
* xed-window: Use a better icon for the documents panel tab
* xed-print-preview.c: Clean up code styling
* xed-print-preview.c: Restyle the toolbar
* xed-print-preview.c: Don't you deprecated gtk_layout_get_*adjustment
* xed-progress-message-area.c: Clean up code style
* xed-progress-message-area: Clean up more uses of GtkStock
* Install introspection data and lib into a private dir
* Add new (App/Window/View)Activatable interfaces for plugins
* docinfo-plugin: Update for WindowActivatable changes
* sort-plugin: Port the sort plugin to WindowActivatable
* spell-plugin: Update to the new WindowActivatable interface
* time-plugin: Port to WindowActivatable
* changecase-plugin: Port to WindowActivatable
* taglist-plugin: Port to WindowActivatable
* trailsave-plugin: Port to WindowActivatable
* time-plugin: Clean up a bit from libpeas port
* spell-plugin: Clean up a few things
* Clean up uses of deprecated GtkMisc
* xed-tab-label.c/h: Clean up code styling
* xed-file-dialog.c/h: Clean up code styling
* xed-statusbar.c/h: Clean up code styling
* xed-statusbar: Fix a missing cast
* xed-searchbar: Add a couple missing casts and remove an unused variable
* xed-searchbar.c/h: Clean up styling a bit
* Port to the use of GFile instead of URIs and merge gio document loader and saver into document loader and saver
* Revamp our handling of settings
* Clean up the docs a bit
* Redesign the goto line popup dialog
* xed-preferences-dialog: Fix a setting having the wrong sensitiviy
* tests: Fix to use GFile instead of uris
* xed-document-output-stream: Clean up code style
* xed-document-output-stream: Clean up code style
* Merge smart converter in the document output stream
* xed-document-output-stream: Factor out validate_and_insert method
* Pull some upstream changes from Gedit in prep for using more of the GtkSource* backend
* Remove the xed style scheme manager instance
* xed-document: Fix a couple of possible memory leaks
* Kill xed-language-manager and use gtksourcelanguagemanager directly
* xed-document: Rework externally modified/deleted check
* Remove xed_utils_location_has_file_scheme
* Clean up our GSettings use a bit more
* Port to the GtkSourceView search functionality
* Add _xed_document_needs_saving
* Plugins: Remove the changecase plugin
* xed-document: Do some cleanup
* Port to GtkSource* API
* Port xed to dbus and GtkApplication
* message-area: Rename message area to info bar
* info-bars: Don't use deprecated gtk_misc
* info-bars: Don't use deprecated GtkStock
* info-bar: Don't use icons in buttons
* xed-progress-info-bar: Properly expand the progress bar
* Don't use deprecated gtk_widget_set margin_left/right
* Remove the dialog utility library
* Start using GResource
* Set textdomain as soon as possible
* Don't use global vars for command line parsing
* xed-app: Handle also application::open
* xed-app: Shutdown metadata-manager after GTK+
* xed-app: Fix a typo
* xed-window: Fix getting the wrong window size when cloning a window
* Add a preference to allow using the dark variant of a theme if available
* Debian: Bring back the xed-doc package
* xed-view: Add some margin to the top and left of the text view
* Makefile: Forgot to git add changes
* debian: Add a dependency on xapps-common
* prefs-dialog: Fix a crash when removing style schemes
* docs: Start cleaning up the docs
* Implement font zooming in the editor
* Sort: Turn sort into a simpler and undoable action
* Focus view when opening files from the filebrowser or documents panel
* Fix g_free which should be g_object_unref in file browser
* Use slice allocator instead of g_new when appropriate
* xed-file-browser-widget: Clean up code styling
* filebrowser-view: Removed the unused "busy" cursor
* Do not leak file info for . and .. dirs
* filebrowser: Unref the enumerator in the filebrowser plugin
* file-browser-messages: Clean up formatting
* filebrowser: Don't leak GFiles
* filebrowser: Fix crash on open_terminal action
* filebrowser: Remove the back and forward toolbar dropdowns
* filebrowser: Support new location of gtk bookmarks file
* xed-file-browser-utils.c: Clean up code style
* filebrowser: "Rename" menu entry should have an ellipsis
* filebrowser: use Untitled File/Folder for new file/folders
* filebrowser: don't use deprecated GIOScheduler
* filebrowser: Redesign the toolbar in filebrowser
* filebrowser: Activate selected item when search is complete
* filebrowser: Don't use deprecated GtkStock
* filebrowser: Do not parse .hidden in the file browser
* filebrowser: Make the "Open terminal here" command work again
* filebrowser: Set the combobox insensitive when the bookmarks are showing
* build: Fix the python3 dependency
* Actually fix the python dependency
* Fix calling set_command_line_wait()
* Allow building with --disable-spell
* debian: Add dependency on libpeas-1.0-0-python3loader
* Focus a tab when attempting to close it with unsaved changes
* Add a new animated xed-paned
* xed-commands-view: Clean up code style
* time-plugin: Use GDateTime
* xed-utils: Add runtime checks for x11 specific functions
[ leigh123linux ]
* Fix FSF address
[ JosephMcc ]
* Use GtkApplication inhibit API
[ Clement Lefebvre ]
* Fix po/POTFILES.in and generate POT file
* Fix "gedit" occurence
-- Clement Lefebvre <root@linuxmint.com> Fri, 05 May 2017 08:38:39 +0100
xed (1.2.2) serena; urgency=medium
[ JosephMcc ]
* searchbar: Add a close button
* searchbar: Make sure we clear highlighting when the last character is removed
[ Clement Lefebvre ]
* Search: Fix search jumping to next result while typing
* Search: Perform a search when case-sensitive or entire-word buttons are clicked
* l10n: Add missing pot file
* l10n: Update translations
-- Clement Lefebvre <root@linuxmint.com> Mon, 12 Dec 2016 12:43:35 +0000
xed (1.2.1) serena; urgency=medium
* l10n: Improve some of the new msgids

1
debian/clean vendored Normal file
View File

@@ -0,0 +1 @@
debian/build/

26
debian/control vendored
View File

@@ -2,20 +2,25 @@ Source: xed
Section: x11
Priority: optional
Maintainer: Linux Mint <root@linuxmint.com>
Build-Depends: autotools-dev,
debhelper (>= 9),
Build-Depends: debhelper (>= 9),
gobject-introspection,
gtk-doc-tools,
intltool,
iso-codes,
libenchant-dev,
libgirepository1.0-dev,
libglib2.0-dev,
libgspell-1-dev,
libgtk-3-dev,
libgtksourceview-3.0-dev,
libpeas-dev,
libxapp-dev,
libsm-dev,
libx11-dev,
libxml2-dev,
gnome-common,
python3,
python3-gi,
yelp-tools,
meson
Standards-Version: 3.9.6
Package: xed
@@ -25,9 +30,12 @@ Depends: iso-codes,
${misc:Depends},
${python:Depends},
${shlibs:Depends},
python3,
python3-gi,
xapps-common,
zenity
XB-Python-Version: ${python:Versions}
Description: generic text editor
Description: Text editor
Xed is a text editor which supports most standard editor features,
extending this basic functionality with other features not usually
found in simple text editors. Xed is a graphical application which
@@ -47,7 +55,7 @@ Package: xed-common
Architecture: all
Depends: python,
${misc:Depends},
Description: generic text editor (common files)
Description: Text editor (common files)
Xed is a text editor which supports most standard editor features,
extending this basic functionality with other features not usually
found in simple text editors. Xed is a graphical application which
@@ -70,7 +78,7 @@ Architecture: any
Section: devel
Depends: xed (= ${binary:Version}),
${misc:Depends},
Description: generic text editor (development files)
Description: Text editor (development files)
Xed is a text editor which supports most standard editor features,
extending this basic functionality with other features not usually
found in simple text editors. Xed is a graphical application which
@@ -94,7 +102,7 @@ Priority: extra
Architecture: any
Depends: xed (= ${binary:Version}),
${misc:Depends},
Description: generic text editor (debugging symbols)
Description: Text editor (debugging symbols)
Xed is a text editor which supports most standard editor features,
extending this basic functionality with other features not usually
found in simple text editors. Xed is a graphical application which
@@ -120,7 +128,7 @@ Package: xed-doc
Section: doc
Architecture: all
Depends: ${misc:Depends},
Description: generic text editor (documentation files)
Description: Text editor (documentation files)
Xed is a text editor which supports most standard editor features,
extending this basic functionality with other features not usually
found in simple text editors. Xed is a graphical application which

29
debian/rules vendored
View File

@@ -3,31 +3,30 @@
DHFLAGS=--parallel
%:
dh $@ $(DHFLAGS)
override_dh_install:
rm -rfv debian/tmp/usr/lib/*/xed/plugin-loaders/*.la
rm -rfv debian/tmp/usr/lib/*/xed/plugins/*.la
dh_install --fail-missing
dh $@ $(DHFLAGS) --with gir
override_dh_auto_configure:
# upstream tarball is without configure. autogen.sh will create it
NOCONFIGURE=1 ./autogen.sh
dh_auto_configure $(DHFLAGS) -- \
--disable-silent-rules \
--libexecdir=/usr/lib/ \
--disable-python \
--enable-gtk-doc \
--with-gtk=3.0
meson debian/build \
--prefix=/usr \
--buildtype=plain \
-D docs=true \
-D deprecated_warnings=false
override_dh_installchangelogs:
dh_installchangelogs NEWS
override_dh_auto_test:
DEB_BUILD_OPTIONS=nocheck dh_auto_test
ninja -C debian/build test
override_dh_strip:
dh_strip --dbg-package=xed-dbg
get-orig-source:
uscan --noconf --force-download --rename --download-current-version --destdir=..
override_dh_auto_install:
DESTDIR=${CURDIR}/debian/tmp \
ninja -C debian/build install
override_dh_auto_build:
ninja -C debian/build

View File

@@ -1,7 +1,6 @@
usr/share/appdata/
usr/share/glib-2.0/
usr/share/help/
usr/share/locale/
usr/share/xed/icons/
usr/share/xed/plugins/
usr/share/xed/ui/
usr/share/metainfo
usr/share/xed/plugins
usr/share/glib-2.0
usr/share/help
usr/share/locale
usr/share/xed/icons

View File

@@ -1,2 +1,3 @@
usr/include/xed/
usr/include
usr/lib/*/pkgconfig/
usr/share/xed/gir-1.0

View File

@@ -1 +1 @@
usr/share/gtk-doc/
usr/share/gtk-doc

9
debian/xed.install vendored
View File

@@ -1,6 +1,7 @@
usr/bin/
usr/lib/*/xed/plugin-loaders/*.so
usr/bin/xed
usr/lib/*/xed/girepository-1.0/
usr/lib/*/xed/plugins/
usr/lib/xed/xed-bugreport.sh
usr/share/applications/
usr/lib/*/xed/*.so
usr/share/applications/xed.desktop
usr/share/dbus-1/
usr/share/man/

View File

@@ -1,5 +0,0 @@
SUBDIRS = reference
EXTRA_DIST = class-diagram.dia
-include $(top_srcdir)/git.mk

View File

@@ -1,119 +0,0 @@
## Process this file with automake to produce Makefile.in
# see /gtk-doc/examples/Makefile.am
# We require automake 1.6 at least.
AUTOMAKE_OPTIONS = 1.6
# The name of the module, e.g. 'glib'.
DOC_MODULE=xed
# The top-level SGML file. You can change this if you want to.
DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
# The directory containing the source code. Relative to $(srcdir).
# gtk-doc will search all .c & .h files beneath here for inline comments
# documenting the functions and macros.
DOC_SOURCE_DIR=../../xed
# Extra options to pass to gtkdoc-scangobj. Not normally needed.
SCANGOBJ_OPTIONS=
# Extra options to supply to gtkdoc-scan.
# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED"
SCAN_OPTIONS=
# Extra options to supply to gtkdoc-mkdb.
MKDB_OPTIONS=--sgml-mode --output-format=xml
# Extra options to supply to gtkdoc-mktmpl
# e.g. MKTMPL_OPTIONS=--only-section-tmpl
MKTMPL_OPTIONS=
# Extra options to supply to gtkdoc-fixref. Not normally needed.
# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html
FIXXREF_OPTIONS=
# Used for dependencies. The docs will be rebuilt if any of these change.
HFILE_GLOB=$(top_srcdir)/xed/*.h
CFILE_GLOB=$(top_srcdir)/xed/*.c
# Header files to ignore when scanning (These are internal to xed).
IGNORE_HFILES= \
xed-commands.h \
xed-document-loader.h \
xed-document-saver.h \
xed-documents-panel.h \
xed-io-error-message-area.h \
xed-languages-manager.h \
xed-object-module.h \
xed-plugin-manager.h \
xed-plugins-engine.h \
xed-prefs-manager-private.h \
xed-session.h \
xed-ui.h \
xed-window-private.h \
xed-output-window.h \
xed-close-confirmation-dialog.h \
xed-encodings-dialog.h \
xed-open-location-dialog.h \
xed-page-setup-dialog.h \
xed-preferences-dialog.h \
xed-search-dialog.h \
xed-marshal.h \
xed-enum-types.h
# These files are not part of xed but were copied into it for some reason.
# Do not parse them to make the docs.
IGNORE_HFILES += \
bacon-message-connection.h \
xedtextregion.h \
sexy-icon-entry.h
# Images to copy into HTML directory.
HTML_IMAGES=
# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE).
# e.g. content_files=running.sgml building.sgml changes-2.0.sgml
content_files=
# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded
# These files must be listed here *and* in content_files
# e.g. expand_content_files=running.sgml
expand_content_files=
# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library.
# Only needed if you are using gtkdoc-scangobj to dynamically query widget
# signals and properties.
GTKDOC_CFLAGS= \
-I$(top_srcdir)/xed \
-I$(top_builddir)/xed \
-I$(top_srcdir) \
-I$(top_builddir) \
$(XED_CFLAGS)
GTKDOC_LIBS= \
$(top_builddir)/xed/libxed.la \
$(XED_LIBS)
if ENABLE_PYTHON
GTKDOC_CFLAGS += \
$(NO_STRICT_ALIASING_CFLAGS) \
$(PYGTK_CFLAGS) \
$(PYTHON_CFLAGS) \
$(AM_CFLAGS)
GTKDOC_LIBS += \
$(top_builddir)/plugin-loaders/python/bindings/xed.la
endif
# This includes the standard gtk-doc make rules, copied by gtkdocize.
include $(top_srcdir)/gtk-doc.make
# Other files to distribute
# e.g. EXTRA_DIST += version.xml.in
regenerate-types:
grep _get_type $(DOC_SOURCE_DIR)/xed-*.h | grep -oR '^.*\.h' | sort | uniq - | sed -r 's/^.*\.h$/#include "\0"/' > xed.types
grep _get_type $(DOC_SOURCE_DIR)/xed-*.h | grep -oR '^.*\.h' | sort | uniq - | sed -re 'y/-/_/' -e 's/^(.*)\.h$/\1_get_type/' >> xed.types.new
-include $(top_srcdir)/git.mk

View File

@@ -0,0 +1,36 @@
docs_ignore_h = [
'xed-close-confirmation-dialog.h',
'xed-dirs.h',
'xed-commands.h',
'xed-documents-panel.h',
'xed-io-error-info-bar.h',
'xed-languages-manager.h',
'xed-plugins-engine.h',
'xed-session.h',
'xed-ui.h',
'xed-window-private.h',
'xed-output-window.h',
'xed-encodings-dialog.h',
'xed-open-location-dialog.h',
'xed-page-setup-dialog.h',
'xed-preferences-dialog.h',
'xed-search-dialog.h',
'xed-marshal.h',
'xed-enum-types.h'
]
gnome.gtkdoc(
'xed',
mode: 'xml',
install: true,
main_xml: 'xed-docs.xml',
gobject_typesfile: 'xed.types',
src_dir: [
join_paths(meson.source_root(), 'xed'),
join_paths(meson.build_root(), 'xed'),
],
ignore_headers: docs_ignore_h,
dependencies: libxed_dep,
scan_args: ['--rebuild-types'],
mkdb_args: ['--xml-mode', '--output-format=xml'],
)

View File

@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
<bookinfo>
@@ -9,29 +9,39 @@
<chapter>
<title>xed</title>
<xi:include href="xml/xed-app.xml"/>
<xi:include href="xml/xed-app-activatable.xml"/>
<xi:include href="xml/xed-document.xml"/>
<xi:include href="xml/xed-encodings-option-menu.xml"/>
<xi:include href="xml/xed-encodings-combo-box.xml"/>
<xi:include href="xml/xed-file-chooser-dialog.xml"/>
<xi:include href="xml/xed-message-bus.xml"/>
<xi:include href="xml/xed-message-type.xml"/>
<xi:include href="xml/xed-message.xml"/>
<xi:include href="xml/xed-notebook.xml"/>
<xi:include href="xml/xed-panel.xml"/>
<xi:include href="xml/xed-plugin.xml"/>
<xi:include href="xml/xed-print-job-preview.xml"/>
<xi:include href="xml/xed-print.xml"/>
<xi:include href="xml/xed-progress-message-area.xml"/>
<xi:include href="xml/xed-print-job.xml"/>
<xi:include href="xml/xed-progress-info-bar.xml"/>
<xi:include href="xml/xed-statusbar.xml"/>
<xi:include href="xml/xed-tab.xml"/>
<xi:include href="xml/xed-view.xml"/>
<xi:include href="xml/xed-view-activatable.xml"/>
<xi:include href="xml/xed-window.xml"/>
<xi:include href="xml/xed-convert.xml"/>
<xi:include href="xml/xed-debug.xml"/>
<xi:include href="xml/xed-encodings.xml"/>
<xi:include href="xml/xed-help.xml"/>
<xi:include href="xml/xed-metadata-manager.xml"/>
<xi:include href="xml/xed-prefs-manager-app.xml"/>
<xi:include href="xml/xed-prefs-manager.xml"/>
<xi:include href="xml/xed-utils.xml"/>
</chapter>
<chapter id="object-tree">
<title>Object Hierarchy</title>
<xi:include href="xml/tree_index.sgml"/>
</chapter>
<index id="api-index-full">
<title>Index of all symbols</title>
<xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
</index>
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
</book>

View File

@@ -1,14 +1,13 @@
<SECTION>
<FILE>xed-app</FILE>
XedAppPrivate
<TITLE>XedApp</TITLE>
XedApp
xed_app_get_default
xed_app_create_window
xed_app_get_windows
xed_app_get_active_window
xed_app_set_window_title
xed_app_get_main_windows
xed_app_get_documents
xed_app_get_views
xed_app_show_help
<SUBSECTION Standard>
XED_APP
XED_IS_APP
@@ -19,45 +18,40 @@ XED_IS_APP_CLASS
XED_APP_GET_CLASS
</SECTION>
<SECTION>
<FILE>xed-app-activatable</FILE>
<TITLE>XedAppActivatable</TITLE>
XedAppActivatable
xed_app_activatable_activate
xed_app_activatable_deactivate
<SUBSECTION Standard>
XED_TYPE_APP_ACTIVATABLE
XED_APP_ACTIVATABLE
XED_APP_ACTIVATABLE_IFACE
XED_IS_APP_ACTIVATABLE
XED_APP_ACTIVATABLE_GET_IFACE
xed_app_activatable_get_type
</SECTION>
<SECTION>
<FILE>xed-document</FILE>
XedSearchFlags
XedDocumentPrivate
<TITLE>XedDocument</TITLE>
XedDocument
XedDocumentSaveFlags
XED_DOCUMENT_ERROR
xed_document_error_quark
xed_document_new
xed_document_get_uri
xed_document_get_file
xed_document_get_uri_for_display
xed_document_get_short_name_for_display
xed_document_set_short_name_for_display
xed_document_get_mime_type
xed_document_get_readonly
xed_document_load
xed_document_insert_file
xed_document_load_cancel
xed_document_save
xed_document_save_as
xed_document_is_untouched
xed_document_is_untitled
xed_document_get_deleted
xed_document_goto_line
xed_document_set_search_text
xed_document_get_search_text
xed_document_get_can_search_again
xed_document_search_forward
xed_document_search_backward
xed_document_replace_all
xed_document_goto_line_offset
xed_document_set_language
xed_document_set_enable_search_highlighting
xed_document_get_enable_search_highlighting
XED_SEARCH_IS_DONT_SET_FLAGS
XED_SEARCH_SET_DONT_SET_FLAGS
XED_SEARCH_IS_ENTIRE_WORD
XED_SEARCH_SET_ENTIRE_WORD
XED_SEARCH_IS_CASE_SENSITIVE
XED_SEARCH_SET_CASE_SENSITIVE
xed_document_get_metadata
<SUBSECTION Standard>
XED_DOCUMENT
XED_IS_DOCUMENT
@@ -69,21 +63,20 @@ XED_DOCUMENT_GET_CLASS
</SECTION>
<SECTION>
<FILE>xed-encodings-option-menu</FILE>
XedEncodingsOptionMenuPrivate
<FILE>xed-encodings-combo-box</FILE>
<TITLE>XedEncodingsOptionMenu</TITLE>
XedEncodingsOptionMenu
xed_encodings_option_menu_new
xed_encodings_option_menu_get_selected_encoding
xed_encodings_option_menu_set_selected_encoding
XedEncodingsComboBox
xed_encodings_combo_box_new
xed_encodings_combo_box_get_selected_encoding
xed_encodings_combo_box_set_selected_encoding
<SUBSECTION Standard>
XED_ENCODINGS_OPTION_MENU
XED_IS_ENCODINGS_OPTION_MENU
XED_TYPE_ENCODINGS_OPTION_MENU
xed_encodings_option_menu_get_type
XED_ENCODINGS_OPTION_MENU_CLASS
XED_IS_ENCODINGS_OPTION_MENU_CLASS
XED_ENCODINGS_OPTION_MENU_GET_CLASS
XED_ENCODINGS_COMBO_BOX
XED_IS_ENCODINGS_COMBO_BOX
XED_TYPE_ENCODINGS_COMBO_BOX
xed_encodings_combo_box_get_type
XED_ENCODINGS_COMBO_BOX_CLASS
XED_IS_ENCODINGS_COMBO_BOX_CLASS
XED_ENCODINGS_COMBO_BOX_GET_CLASS
</SECTION>
<SECTION>
@@ -236,30 +229,6 @@ XED_IS_PANEL_CLASS
XED_PANEL_GET_CLASS
</SECTION>
<SECTION>
<FILE>xed-plugin</FILE>
<TITLE>XedPlugin</TITLE>
XedPlugin
xed_plugin_activate
xed_plugin_deactivate
xed_plugin_update_ui
xed_plugin_is_configurable
xed_plugin_create_configure_dialog
XED_PLUGIN_REGISTER_TYPE
<SUBSECTION Standard>
XED_PLUGIN
XED_IS_PLUGIN
XED_TYPE_PLUGIN
xed_plugin_get_type
XED_PLUGIN_CLASS
XED_IS_PLUGIN_CLASS
XED_PLUGIN_GET_CLASS
XED_PLUGIN_REGISTER_TYPE_WITH_CODE
XED_PLUGIN_REGISTER_TYPE
XED_PLUGIN_DEFINE_TYPE_WITH_CODE
XED_PLUGIN_DEFINE_TYPE
</SECTION>
<SECTION>
<FILE>xed-print-job-preview</FILE>
XedPrintJobPreviewPrivate
@@ -277,7 +246,7 @@ XED_PRINT_JOB_PREVIEW_GET_CLASS
</SECTION>
<SECTION>
<FILE>xed-print</FILE>
<FILE>xed-print-job</FILE>
<TITLE>XedPrintJob</TITLE>
XedPrintJob
xed_print_job_new
@@ -294,33 +263,30 @@ XED_PRINT_JOB_GET_CLASS
</SECTION>
<SECTION>
<FILE>xed-progress-message-area</FILE>
XedProgressMessageAreaPrivate
<TITLE>XedProgressMessageArea</TITLE>
XedProgressMessageArea
xed_progress_message_area_new
xed_progress_message_area_set_stock_image
xed_progress_message_area_set_markup
xed_progress_message_area_set_text
xed_progress_message_area_set_fraction
xed_progress_message_area_pulse
<FILE>xed-progress-info-bar</FILE>
<TITLE>XedProgressInfoBar</TITLE>
XedProgressInfoBar
xed_progress_info_bar_new
xed_progress_info_bar_set_icon_name
xed_progress_info_bar_set_markup
xed_progress_info_bar_set_text
xed_progress_info_bar_set_fraction
xed_progress_info_bar_pulse
<SUBSECTION Standard>
XED_PROGRESS_MESSAGE_AREA
XED_IS_PROGRESS_MESSAGE_AREA
XED_TYPE_PROGRESS_MESSAGE_AREA
xed_progress_message_area_get_type
XED_PROGRESS_MESSAGE_AREA_CLASS
XED_IS_PROGRESS_MESSAGE_AREA_CLASS
XED_PROGRESS_MESSAGE_AREA_GET_CLASS
XED_PROGRESS_INFO_BAR
XED_IS_PROGRESS_INFO_BAR
XED_TYPE_PROGRESS_INFO_BAR
xed_progress_info_bar_get_type
XED_PROGRESS_INFO_BAR_CLASS
XED_IS_PROGRESS_INFO_BAR_CLASS
XED_PROGRESS_INFO_BAR_GET_CLASS
</SECTION>
<SECTION>
<FILE>xed-statusbar</FILE>
XedStatusbarPrivate
<TITLE>XedStatusbar</TITLE>
XedStatusbar
xed_statusbar_new
XedStatus
xed_statusbar_set_window_state
xed_statusbar_set_overwrite
xed_statusbar_set_cursor_position
@@ -384,6 +350,22 @@ XED_IS_VIEW_CLASS
XED_VIEW_GET_CLASS
</SECTION>
<SECTION>
<FILE>xed-view-activatable</FILE>
<TITLE>XedViewActivatable</TITLE>
XedViewActivatable
xed_view_activatable_activate
xed_view_activatable_deactivate
xed_view_activatable_update_state
<SUBSECTION Standard>
XED_TYPE_VIEW_ACTIVATABLE
XED_VIEW_ACTIVATABLE
XED_VIEW_ACTIVATABLE_IFACE
XED_IS_VIEW_ACTIVATABLE
XED_VIEW_ACTIVATABLE_GET_IFACE
xed_view_activatable_get_type
</SECTION>
<SECTION>
<FILE>xed-window</FILE>
XedWindowState
@@ -391,7 +373,7 @@ XedWindowPrivate
<TITLE>XedWindow</TITLE>
XedWindow
xed_window_create_tab
xed_window_create_tab_from_uri
xed_window_create_tab_from_location
xed_window_close_tab
xed_window_close_all_tabs
xed_window_close_tabs
@@ -409,7 +391,6 @@ xed_window_get_statusbar
xed_window_get_ui_manager
xed_window_get_state
xed_window_get_tab_from_location
xed_window_get_tab_from_uri
xed_window_get_message_bus
<SUBSECTION Standard>
XED_WINDOW
@@ -421,6 +402,20 @@ XED_IS_WINDOW_CLASS
XED_WINDOW_GET_CLASS
</SECTION>
<FILE>xed-window-activatable</FILE>
<TITLE>XedWindowActivatable</TITLE>
XedWindowActivatable
xed_window_activatable_activate
xed_window_activatable_deactivate
xed_window_activatable_update_state
<SUBSECTION Standard>
XED_TYPE_WINDOW_ACTIVATABLE
XED_WINDOW_ACTIVATABLE
XED_WINDOW_ACTIVATABLE_IFACE
XED_IS_WINDOW_ACTIVATABLE
XED_WINDOW_ACTIVATABLE_GET_IFACE
xed_window_activatable_get_type
<SECTION>
<FILE>xed-convert</FILE>
XedConvertError
@@ -453,307 +448,16 @@ xed_debug
xed_debug_message
</SECTION>
<SECTION>
<FILE>xed-encodings</FILE>
XedEncoding
XED_TYPE_ENCODING
xed_encoding_get_type
xed_encoding_copy
xed_encoding_free
xed_encoding_get_from_charset
xed_encoding_get_from_index
xed_encoding_to_string
xed_encoding_get_name
xed_encoding_get_charset
xed_encoding_get_utf8
xed_encoding_get_current
</SECTION>
<SECTION>
<FILE>xed-help</FILE>
xed_help_display
</SECTION>
<SECTION>
<FILE>xed-metadata-manager</FILE>
xed_metadata_manager_shutdown
xed_metadata_manager_get
xed_metadata_manager_set
</SECTION>
<SECTION>
<FILE>xed-prefs-manager-app</FILE>
xed_prefs_manager_app_init
xed_prefs_manager_app_shutdown
xed_prefs_manager_get_window_state
xed_prefs_manager_set_window_state
xed_prefs_manager_window_state_can_set
xed_prefs_manager_get_window_size
xed_prefs_manager_get_default_window_size
xed_prefs_manager_set_window_size
xed_prefs_manager_window_size_can_set
xed_prefs_manager_get_side_panel_size
xed_prefs_manager_get_default_side_panel_size
xed_prefs_manager_set_side_panel_size
xed_prefs_manager_side_panel_size_can_set
xed_prefs_manager_get_bottom_panel_size
xed_prefs_manager_get_default_bottom_panel_size
xed_prefs_manager_set_bottom_panel_size
xed_prefs_manager_bottom_panel_size_can_set
</SECTION>
<SECTION>
<FILE>xed-prefs-manager</FILE>
XED_BASE_KEY
GPM_PREFS_DIR
GPM_FONT_DIR
GPM_USE_DEFAULT_FONT
GPM_EDITOR_FONT
GPM_COLORS_DIR
GPM_USE_DEFAULT_COLORS
GPM_BACKGROUND_COLOR
GPM_TEXT_COLOR
GPM_SELECTED_TEXT_COLOR
GPM_SELECTION_COLOR
GPM_SAVE_DIR
GPM_CREATE_BACKUP_COPY
GPM_BACKUP_COPY_EXTENSION
GPM_AUTO_SAVE
GPM_AUTO_SAVE_INTERVAL
GPM_UNDO_DIR
GPM_UNDO_ACTIONS_LIMIT
GPM_WRAP_MODE_DIR
GPM_WRAP_MODE
GPM_TABS_DIR
GPM_TABS_SIZE
GPM_INSERT_SPACES
GPM_AUTO_INDENT_DIR
GPM_AUTO_INDENT
GPM_LINE_NUMBERS_DIR
GPM_DISPLAY_LINE_NUMBERS
GPM_CURRENT_LINE_DIR
GPM_HIGHLIGHT_CURRENT_LINE
GPM_BRACKET_MATCHING_DIR
GPM_BRACKET_MATCHING
GPM_RIGHT_MARGIN_DIR
GPM_DISPLAY_RIGHT_MARGIN
GPM_RIGHT_MARGIN_POSITION
GPM_CURSOR_POSITION_DIR
GPM_RESTORE_CURSOR_POSITION
GPM_SEARCH_HIGHLIGHTING_DIR
GPM_SEARCH_HIGHLIGHTING_ENABLE
GPM_TOOLBAR_DIR
GPM_TOOLBAR_VISIBLE
GPM_TOOLBAR_BUTTONS_STYLE
GPM_STATUSBAR_DIR
GPM_STATUSBAR_VISIBLE
GPM_SIDE_PANE_DIR
GPM_SIDE_PANE_VISIBLE
GPM_BOTTOM_PANEL_DIR
GPM_BOTTOM_PANEL_VISIBLE
GPM_RECENTS_DIR
GPM_MAX_RECENTS
GPM_PRINT_PAGE_DIR
GPM_PRINT_SYNTAX
GPM_PRINT_HEADER
GPM_PRINT_WRAP_MODE
GPM_PRINT_LINE_NUMBERS
GPM_PRINT_FONT_DIR
GPM_PRINT_FONT_BODY
GPM_PRINT_FONT_BODY_PANGO
GPM_PRINT_FONT_HEADER
GPM_PRINT_FONT_HEADER_PANGO
GPM_PRINT_FONT_NUMBERS
GPM_PRINT_FONT_NUMBERS_PANGO
GPM_WINDOW_DIR
GPM_WINDOW_STATE
GPM_WINDOW_WIDTH
GPM_WINDOW_HEIGHT
GPM_SIDE_PANEL_SIZE
GPM_BOTTOM_PANEL_SIZE
GPM_ENCODINGS_DIR
GPM_AUTO_DETECTED_ENCODINGS
GPM_SHOWN_IN_MENU_ENCODINGS
GPM_SYNTAX_HL_DIR
GPM_SYNTAX_HL_ENABLE
GPM_WRITABLE_VFS_SCHEMES
GPM_DEFAULT_USE_DEFAULT_FONT
GPM_DEFAULT_EDITOR_FONT
GPM_DEFAULT_USE_DEFAULT_COLORS
GPM_DEFAULT_BACKGROUND_COLOR
GPM_DEFAULT_TEXT_COLOR
GPM_DEFAULT_SELECTED_TEXT_COLOR
GPM_DEFAULT_SELECTION_COLOR
GPM_DEFAULT_CREATE_BACKUP_COPY
GPM_DEFAULT_BACKUP_COPY_EXTENSION
GPM_DEFAULT_AUTO_SAVE
GPM_DEFAULT_AUTO_SAVE_INTERVAL
GPM_DEFAULT_UNDO_ACTIONS_LIMIT
GPM_DEFAULT_WRAP_MODE
GPM_DEFAULT_TABS_SIZE
GPM_DEFAULT_INSERT_SPACES
GPM_DEFAULT_AUTO_INDENT
GPM_DEFAULT_DISPLAY_LINE_NUMBERS
GPM_DEFAULT_AUTO_DETECTED_ENCODINGS
GPM_DEFAULT_TOOLBAR_VISIBLE
GPM_DEFAULT_TOOLBAR_BUTTONS_STYLE
GPM_DEFAULT_TOOLBAR_SHOW_TOOLTIPS
GPM_DEFAULT_STATUSBAR_VISIBLE
GPM_DEFAULT_SIDE_PANE_VISIBLE
GPM_DEFAULT_BOTTOM_PANEL_VISIBLE
GPM_DEFAULT_PRINT_SYNTAX
GPM_DEFAULT_PRINT_HEADER
GPM_DEFAULT_PRINT_WRAP_MODE
GPM_DEFAULT_PRINT_LINE_NUMBERS
GPM_DEFAULT_PRINT_FONT_BODY_PANGO
GPM_DEFAULT_PRINT_FONT_HEADER_PANGO
GPM_DEFAULT_PRINT_FONT_NUMBERS_PANGO
GPM_DEFAULT_MAX_RECENTS
GPM_DEFAULT_WINDOW_STATE
GPM_DEFAULT_WINDOW_WIDTH
GPM_DEFAULT_WINDOW_HEIGHT
GPM_DEFAULT_WINDOW_STATE_STR
GPM_DEFAULT_WINDOW_WIDTH_STR
GPM_DEFAULT_WINDOW_HEIGHT_STR
GPM_DEFAULT_SIDE_PANEL_SIZE
GPM_DEFAULT_BOTTOM_PANEL_SIZE
GPM_DEFAULT_SIDE_PANEL_SIZE_STR
GPM_DEFAULT_BOTTOM_PANEL_SIZE_STR
GPM_DEFAULT_HIGHLIGHT_CURRENT_LINE
GPM_DEFAULT_BRACKET_MATCHING
GPM_DEFAULT_DISPLAY_RIGHT_MARGIN
GPM_DEFAULT_RIGHT_MARGIN_POSITION
GPM_DEFAULT_SYNTAX_HL_ENABLE
GPM_DEFAULT_WRITABLE_VFS_SCHEMES
GPM_DEFAULT_RESTORE_CURSOR_POSITION
GPM_DEFAULT_SEARCH_HIGHLIGHTING_ENABLE
XedToolbarSetting
xed_prefs_manager_init
xed_prefs_manager_shutdown
xed_prefs_manager_get_use_default_font
xed_prefs_manager_set_use_default_font
xed_prefs_manager_use_default_font_can_set
xed_prefs_manager_get_editor_font
xed_prefs_manager_set_editor_font
xed_prefs_manager_editor_font_can_set
xed_prefs_manager_get_use_default_colors
xed_prefs_manager_set_use_default_colors
xed_prefs_manager_use_default_colors_can_set
xed_prefs_manager_get_background_color
xed_prefs_manager_set_background_color
xed_prefs_manager_background_color_can_set
xed_prefs_manager_get_text_color
xed_prefs_manager_set_text_color
xed_prefs_manager_text_color_can_set
xed_prefs_manager_get_selection_color
xed_prefs_manager_set_selection_color
xed_prefs_manager_selection_color_can_set
xed_prefs_manager_get_selected_text_color
xed_prefs_manager_set_selected_text_color
xed_prefs_manager_selected_text_color_can_set
xed_prefs_manager_get_create_backup_copy
xed_prefs_manager_set_create_backup_copy
xed_prefs_manager_create_backup_copy_can_set
xed_prefs_manager_get_backup_extension
xed_prefs_manager_get_auto_save
xed_prefs_manager_set_auto_save
xed_prefs_manager_auto_save_can_set
xed_prefs_manager_get_auto_save_interval
xed_prefs_manager_set_auto_save_interval
xed_prefs_manager_auto_save_interval_can_set
xed_prefs_manager_get_undo_actions_limit
xed_prefs_manager_set_undo_actions_limit
xed_prefs_manager_undo_actions_limit_can_set
xed_prefs_manager_get_wrap_mode
xed_prefs_manager_set_wrap_mode
xed_prefs_manager_wrap_mode_can_set
xed_prefs_manager_get_tabs_size
xed_prefs_manager_set_tabs_size
xed_prefs_manager_tabs_size_can_set
xed_prefs_manager_get_insert_spaces
xed_prefs_manager_set_insert_spaces
xed_prefs_manager_insert_spaces_can_set
xed_prefs_manager_get_auto_indent
xed_prefs_manager_set_auto_indent
xed_prefs_manager_auto_indent_can_set
xed_prefs_manager_get_display_line_numbers
xed_prefs_manager_set_display_line_numbers
xed_prefs_manager_display_line_numbers_can_set
xed_prefs_manager_get_toolbar_visible
xed_prefs_manager_set_toolbar_visible
xed_prefs_manager_toolbar_visible_can_set
xed_prefs_manager_get_toolbar_buttons_style
xed_prefs_manager_set_toolbar_buttons_style
xed_prefs_manager_toolbar_buttons_style_can_set
xed_prefs_manager_get_statusbar_visible
xed_prefs_manager_set_statusbar_visible
xed_prefs_manager_statusbar_visible_can_set
xed_prefs_manager_get_side_pane_visible
xed_prefs_manager_set_side_pane_visible
xed_prefs_manager_side_pane_visible_can_set
xed_prefs_manager_get_bottom_panel_visible
xed_prefs_manager_set_bottom_panel_visible
xed_prefs_manager_bottom_panel_visible_can_set
xed_prefs_manager_get_print_syntax_hl
xed_prefs_manager_set_print_syntax_hl
xed_prefs_manager_print_syntax_hl_can_set
xed_prefs_manager_get_print_header
xed_prefs_manager_set_print_header
xed_prefs_manager_print_header_can_set
xed_prefs_manager_get_print_wrap_mode
xed_prefs_manager_set_print_wrap_mode
xed_prefs_manager_print_wrap_mode_can_set
xed_prefs_manager_get_print_line_numbers
xed_prefs_manager_set_print_line_numbers
xed_prefs_manager_print_line_numbers_can_set
xed_prefs_manager_get_print_font_body
xed_prefs_manager_set_print_font_body
xed_prefs_manager_print_font_body_can_set
xed_prefs_manager_get_default_print_font_body
xed_prefs_manager_get_print_font_header
xed_prefs_manager_set_print_font_header
xed_prefs_manager_print_font_header_can_set
xed_prefs_manager_get_default_print_font_header
xed_prefs_manager_get_print_font_numbers
xed_prefs_manager_set_print_font_numbers
xed_prefs_manager_print_font_numbers_can_set
xed_prefs_manager_get_default_print_font_numbers
xed_prefs_manager_get_max_recents
xed_prefs_manager_get_auto_detected_encodings
xed_prefs_manager_get_shown_in_menu_encodings
xed_prefs_manager_set_shown_in_menu_encodings
xed_prefs_manager_shown_in_menu_encodings_can_set
xed_prefs_manager_get_highlight_current_line
xed_prefs_manager_set_highlight_current_line
xed_prefs_manager_highlight_current_line_can_set
xed_prefs_manager_get_bracket_matching
xed_prefs_manager_set_bracket_matching
xed_prefs_manager_bracket_matching_can_set
xed_prefs_manager_get_display_right_margin
xed_prefs_manager_set_display_right_margin
xed_prefs_manager_display_right_margin_can_set
xed_prefs_manager_get_right_margin_position
xed_prefs_manager_set_right_margin_position
xed_prefs_manager_right_margin_position_can_set
xed_prefs_manager_get_enable_syntax_highlighting
xed_prefs_manager_set_enable_syntax_highlighting
xed_prefs_manager_enable_syntax_highlighting_can_set
xed_prefs_manager_get_writable_vfs_schemes
xed_prefs_manager_get_restore_cursor_position
xed_prefs_manager_get_enable_search_highlighting
xed_prefs_manager_set_enable_search_highlighting
xed_prefs_manager_enable_search_highlighting_can_set
</SECTION>
<SECTION>
<FILE>xed-utils</FILE>
GBOOLEAN_TO_POINTER
GPOINTER_TO_BOOLEAN
IS_VALID_BOOLEAN
xed_utils_uri_has_writable_scheme
xed_utils_uri_has_file_scheme
xed_utils_menu_position_under_widget
xed_utils_menu_position_under_tree_view
xed_gtk_button_new_with_stock_icon
xed_dialog_add_button
xed_utils_escape_underscores
@@ -763,8 +467,6 @@ g_utf8_caselessnmatch
xed_utils_set_atk_name_description
xed_utils_set_atk_relation
xed_utils_uri_exists
xed_utils_escape_search_text
xed_utils_unescape_search_text
xed_utils_get_stdin
xed_warning
xed_utils_make_valid_utf8

View File

@@ -1,32 +0,0 @@
#include "xed-app.h"
#include "xed-document.h"
#include "xed-encodings.h"
#include "xed-encodings-combo-box.h"
#include "xed-file-chooser-dialog.h"
#include "xed-message.h"
#include "xed-message-bus.h"
#include "xed-message-type.h"
#include "xed-notebook.h"
#include "xed-panel.h"
#include "xed-plugin.h"
#include "xed-progress-message-area.h"
#include "xed-statusbar.h"
#include "xed-tab.h"
#include "xed-view.h"
#include "xed-window.h"
xed_app_get_type
xed_document_get_type
xed_encoding_get_type
xed_encodings_combo_box_get_type
xed_file_chooser_dialog_get_type
xed_message_get_type
xed_message_bus_get_type
xed_message_type_get_type
xed_notebook_get_type
xed_panel_get_type
xed_plugin_get_type
xed_progress_message_area_get_type
xed_statusbar_get_type
xed_tab_get_type
xed_view_get_type
xed_window_get_type

23
help/LINGUAS Normal file
View File

@@ -0,0 +1,23 @@
ar
bg
ca
cs
da
de
el
es
fi
fr
hu
it
ja
ko
oc
pt_BR
ru
sv
th
uk
zh_CN
zh_HK
zh_TW

View File

@@ -1,16 +0,0 @@
@YELP_HELP_RULES@
HELP_ID = xed
HELP_FILES = index.docbook legal.xml
HELP_MEDIA = \
figures/xed_format_bold.png \
figures/xed_format_italic.png \
figures/xed_format_strikethrough.png \
figures/xed_format_underline.png \
figures/xed_recent_files_menu_icon.png \
figures/xed_window.png
HELP_LINGUAS = ar bg ca cs da de el es fi fr hu it ja ko oc pt_BR ru sv th uk zh_CN zh_HK zh_TW
-include $(top_srcdir)/git.mk

20
help/meson.build Normal file
View File

@@ -0,0 +1,20 @@
help_sources = [
'index.docbook',
'legal.xml'
]
help_media = [
'figures/xed_format_bold.png',
'figures/xed_format_italic.png',
'figures/xed_format_strikethrough.png',
'figures/xed_format_underline.png',
'figures/xed_recent_files_menu_icon.png',
'figures/xed_window.png'
]
gnome.yelp(
meson.project_name(),
sources: help_sources,
media: help_media,
symlink_media: false
)

View File

@@ -1,62 +0,0 @@
## this one is commonly used with AM_PATH_PYTHONDIR ...
dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])
dnl Check if a module containing a given symbol is visible to python.
AC_DEFUN([AM_CHECK_PYMOD],
[AC_REQUIRE([AM_PATH_PYTHON])
py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1)
AC_CACHE_VAL(py_cv_mod_$py_mod_var, [
ifelse([$2],[], [prog="
import sys
try:
import $1
except ImportError:
sys.exit(1)
except:
sys.exit(0)
sys.exit(0)"], [prog="
import $1
$1.$2"])
if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
then
eval "py_cv_mod_$py_mod_var=yes"
else
eval "py_cv_mod_$py_mod_var=no"
fi
])
py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"`
if test "x$py_val" != xno; then
AC_MSG_RESULT(yes)
ifelse([$3], [],, [$3
])dnl
else
AC_MSG_RESULT(no)
ifelse([$4], [],, [$4
])dnl
fi
])
dnl a macro to check for ability to create python extensions
dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
dnl function also defines PYTHON_INCLUDES
AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
[AC_REQUIRE([AM_PATH_PYTHON])
AC_MSG_CHECKING(for headers required to compile python extensions)
dnl deduce PYTHON_INCLUDES
py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
if test "$py_prefix" != "$py_exec_prefix"; then
PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
fi
AC_SUBST(PYTHON_INCLUDES)
dnl check if the headers exist:
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
AC_TRY_CPP([#include <Python.h>],dnl
[AC_MSG_RESULT(found)
$1],dnl
[AC_MSG_RESULT(not found)
$2])
CPPFLAGS="$save_CPPFLAGS"
])

104
meson.build Normal file
View File

@@ -0,0 +1,104 @@
project('xed', 'c', version : '2.4.3')
gnome = import('gnome')
i18n = import('i18n')
pkgconfig = import('pkgconfig')
version = meson.project_version()
xed_conf = configuration_data()
xed_conf.set_quoted('VERSION', version)
xed_conf.set_quoted('GETTEXT_PACKAGE', 'xed')
# directories
prefix = get_option('prefix')
bindir = get_option('bindir')
datadir = get_option('datadir')
libdir = get_option('libdir')
includedir = get_option('includedir')
libexecdir = get_option('libexecdir')
desktopdir = join_paths(datadir, 'applications')
schema_dir = join_paths(datadir, 'glib-2.0', 'schemas')
po_dir = join_paths(meson.source_root(), 'po')
# dependencies
libxml = dependency('libxml-2.0', version: '>= 2.5.0')
glib = dependency('glib-2.0', version: '>= 2.40.0')
gthread = dependency('gthread-2.0', version: '>= 2.13.0')
gio = dependency('gio-2.0', version: '>= 2.40.0')
gtk = dependency('gtk+-3.0', version: '>= 3.19.3')
gtksourceview = dependency('gtksourceview-3.0', version: '>= 3.19.0')
libpeas = dependency('libpeas-1.0', version: '>= 1.12.0')
libpeas_gtk = dependency('libpeas-gtk-1.0', version: '>= 1.12.0')
gir_dep = dependency('gobject-introspection-1.0', version: '>= 0.6.7', required: false)
gmodule = dependency('gmodule-2.0')
xapp = dependency('xapp', version: '>= 1.4.0')
X11 = dependency('x11')
pango = dependency('pango')
if gir_dep.found()
xed_conf.set('ENABLE_INTROSPECTION', 1)
endif
enable_spell = get_option('enable_spell')
if enable_spell
gspell = dependency('gspell-1', version: '>= 0.2.5')
endif
if get_option('enable_gvfs_metadata')
xed_conf.set('ENABLE_GVFS_METADATA', true)
endif
# on some systems we need to find the math lib to make sure it builds
cc = meson.get_compiler('c')
math = cc.find_library('m', required: false)
intltool_merge = find_program('intltool-merge')
itstool = find_program('itstool')
# generate config.h
config_h_file = configure_file(
output : 'config.h',
configuration : xed_conf
)
config_h = declare_dependency(
sources: config_h_file
)
include_dirs = include_directories('.', 'xed')
# compiler flags
add_global_arguments('-DDATADIR="@0@"'.format(join_paths(prefix, datadir)), language: 'c')
add_global_arguments('-DLIBDIR="@0@"'.format(join_paths(prefix, libdir)), language: 'c')
# remove this later or add as build option
if not get_option('deprecated_warnings')
add_global_arguments([
'-Wno-deprecated-declarations',
'-Wno-deprecated',
'-Wno-declaration-after-statement',
],
language: 'c',
)
endif
subdir('xed')
subdir('pixmaps')
subdir('po')
subdir('data')
subdir('plugins')
subdir('help')
if get_option('docs')
subdir('docs/reference')
endif
message('prefix = @0@'.format(prefix))
message('bindir = @0@'.format(bindir))
message('datadir = @0@'.format(datadir))
message('libdir = @0@'.format(libdir))
message('includedir = @0@'.format(includedir))
message('libexecdir = @0@'.format(libexecdir))
message('desktopdir = @0@'.format(desktopdir))
message('schema_dir = @0@'.format(schema_dir))

23
meson_options.txt Normal file
View File

@@ -0,0 +1,23 @@
option(
'enable_spell',
type : 'boolean',
value : true,
description : 'enable gspell'
)
option(
'enable_gvfs_metadata',
type : 'boolean',
value : true,
description : 'enable gvfs metadata'
)
option('docs',
type: 'boolean',
value: false,
description: 'Build the API references (requires gtk-doc)'
)
option(
'deprecated_warnings',
type : 'boolean',
value : false,
description: 'Show build warnings for deprecations'
)

View File

@@ -1,8 +0,0 @@
icondir = $(datadir)/xed/icons
icon_DATA = xed-plugin.png
EXTRA_DIST = \
$(icon_DATA) \
xed.ico
-include $(top_srcdir)/git.mk

4
pixmaps/meson.build Normal file
View File

@@ -0,0 +1,4 @@
install_data(
'xed-plugin.png',
install_dir: join_paths(datadir, 'xed', 'icons')
)

View File

@@ -1,7 +0,0 @@
SUBDIRS = c
if ENABLE_PYTHON
SUBDIRS += python
endif
-include $(top_srcdir)/git.mk

View File

@@ -1,24 +0,0 @@
# C plugin loader
loaderdir = $(libdir)/xed/plugin-loaders
AM_CPPFLAGS = \
-I$(top_srcdir) \
$(XED_CFLAGS) \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS) \
-DXED_LOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
loader_LTLIBRARIES = libcloader.la
NOINST_H_FILES = \
xed-plugin-loader-c.h
libcloader_la_SOURCES = \
xed-plugin-loader-c.c \
$(NOINST_H_FILES)
libcloader_la_LDFLAGS = $(LOADER_LIBTOOL_FLAGS)
libcloader_la_LIBADD = $(XED_LIBS)
-include $(top_srcdir)/git.mk

View File

@@ -1,182 +0,0 @@
/*
* xed-plugin-loader-c.c
* This file is part of xed
*
* Copyright (C) 2008 - Jesse van den Kieboom
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "xed-plugin-loader-c.h"
#include <xed/xed-object-module.h>
#define XED_PLUGIN_LOADER_C_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), XED_TYPE_PLUGIN_LOADER_C, XedPluginLoaderCPrivate))
struct _XedPluginLoaderCPrivate
{
GHashTable *loaded_plugins;
};
static void xed_plugin_loader_iface_init (gpointer g_iface, gpointer iface_data);
XED_PLUGIN_LOADER_REGISTER_TYPE (XedPluginLoaderC, xed_plugin_loader_c, G_TYPE_OBJECT, xed_plugin_loader_iface_init);
static const gchar *
xed_plugin_loader_iface_get_id (void)
{
return "C";
}
static XedPlugin *
xed_plugin_loader_iface_load (XedPluginLoader *loader,
XedPluginInfo *info,
const gchar *path)
{
XedPluginLoaderC *cloader = XED_PLUGIN_LOADER_C (loader);
XedObjectModule *module;
const gchar *module_name;
XedPlugin *result;
module = (XedObjectModule *)g_hash_table_lookup (cloader->priv->loaded_plugins, info);
module_name = xed_plugin_info_get_module_name (info);
if (module == NULL)
{
/* For now we force all modules to be resident */
module = xed_object_module_new (module_name,
path,
"register_xed_plugin",
TRUE);
/* Infos are available for all the lifetime of the loader.
* If this changes, we should use weak refs or something */
g_hash_table_insert (cloader->priv->loaded_plugins, info, module);
}
if (!g_type_module_use (G_TYPE_MODULE (module)))
{
g_warning ("Could not load plugin module: %s", xed_plugin_info_get_name (info));
return NULL;
}
/* TODO: for now we force data-dir-name = module-name... if needed we can
* add a datadir field to the plugin descriptor file.
*/
result = (XedPlugin *)xed_object_module_new_object (module,
"install-dir", path,
"data-dir-name", module_name,
NULL);
if (!result)
{
g_warning ("Could not create plugin object: %s", xed_plugin_info_get_name (info));
g_type_module_unuse (G_TYPE_MODULE (module));
return NULL;
}
g_type_module_unuse (G_TYPE_MODULE (module));
return result;
}
static void
xed_plugin_loader_iface_unload (XedPluginLoader *loader,
XedPluginInfo *info)
{
//XedPluginLoaderC *cloader = XED_PLUGIN_LOADER_C (loader);
/* this is a no-op, since the type module will be properly unused as
the last reference to the plugin dies. When the plugin is activated
again, the library will be reloaded */
}
static void
xed_plugin_loader_iface_init (gpointer g_iface,
gpointer iface_data)
{
XedPluginLoaderInterface *iface = (XedPluginLoaderInterface *)g_iface;
iface->get_id = xed_plugin_loader_iface_get_id;
iface->load = xed_plugin_loader_iface_load;
iface->unload = xed_plugin_loader_iface_unload;
}
static void
xed_plugin_loader_c_finalize (GObject *object)
{
XedPluginLoaderC *cloader = XED_PLUGIN_LOADER_C (object);
GList *infos;
GList *item;
/* FIXME: this sanity check it's not efficient. Let's remove it
* once we are confident with the code */
infos = g_hash_table_get_keys (cloader->priv->loaded_plugins);
for (item = infos; item; item = item->next)
{
XedPluginInfo *info = (XedPluginInfo *)item->data;
if (xed_plugin_info_is_active (info))
{
g_warning ("There are still C plugins loaded during destruction");
break;
}
}
g_list_free (infos);
g_hash_table_destroy (cloader->priv->loaded_plugins);
G_OBJECT_CLASS (xed_plugin_loader_c_parent_class)->finalize (object);
}
static void
xed_plugin_loader_c_class_init (XedPluginLoaderCClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = xed_plugin_loader_c_finalize;
g_type_class_add_private (object_class, sizeof (XedPluginLoaderCPrivate));
}
static void
xed_plugin_loader_c_class_finalize (XedPluginLoaderCClass *klass)
{
}
static void
xed_plugin_loader_c_init (XedPluginLoaderC *self)
{
self->priv = XED_PLUGIN_LOADER_C_GET_PRIVATE (self);
/* loaded_plugins maps XedPluginInfo to a XedObjectModule */
self->priv->loaded_plugins = g_hash_table_new (g_direct_hash,
g_direct_equal);
}
XedPluginLoaderC *
xed_plugin_loader_c_new ()
{
GObject *loader = g_object_new (XED_TYPE_PLUGIN_LOADER_C, NULL);
return XED_PLUGIN_LOADER_C (loader);
}

View File

@@ -1,60 +0,0 @@
/*
* xed-plugin-loader-c.h
* This file is part of xed
*
* Copyright (C) 2008 - Jesse van den Kieboom
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __XED_PLUGIN_LOADER_C_H__
#define __XED_PLUGIN_LOADER_C_H__
#include <xed/xed-plugin-loader.h>
G_BEGIN_DECLS
#define XED_TYPE_PLUGIN_LOADER_C (xed_plugin_loader_c_get_type ())
#define XED_PLUGIN_LOADER_C(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XED_TYPE_PLUGIN_LOADER_C, XedPluginLoaderC))
#define XED_PLUGIN_LOADER_C_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XED_TYPE_PLUGIN_LOADER_C, XedPluginLoaderC const))
#define XED_PLUGIN_LOADER_C_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XED_TYPE_PLUGIN_LOADER_C, XedPluginLoaderCClass))
#define XED_IS_PLUGIN_LOADER_C(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XED_TYPE_PLUGIN_LOADER_C))
#define XED_IS_PLUGIN_LOADER_C_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XED_TYPE_PLUGIN_LOADER_C))
#define XED_PLUGIN_LOADER_C_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XED_TYPE_PLUGIN_LOADER_C, XedPluginLoaderCClass))
typedef struct _XedPluginLoaderC XedPluginLoaderC;
typedef struct _XedPluginLoaderCClass XedPluginLoaderCClass;
typedef struct _XedPluginLoaderCPrivate XedPluginLoaderCPrivate;
struct _XedPluginLoaderC {
GObject parent;
XedPluginLoaderCPrivate *priv;
};
struct _XedPluginLoaderCClass {
GObjectClass parent_class;
};
GType xed_plugin_loader_c_get_type (void) G_GNUC_CONST;
XedPluginLoaderC *xed_plugin_loader_c_new(void);
/* All the loaders must implement this function */
G_MODULE_EXPORT GType register_xed_plugin_loader (GTypeModule * module);
G_END_DECLS
#endif /* __XED_PLUGIN_LOADER_C_H__ */

View File

@@ -1,36 +0,0 @@
# C plugin loader
SUBDIRS = bindings
loaderdir = $(libdir)/xed/plugin-loaders
AM_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_builddir) \
-I$(top_srcdir)/xed \
-I$(top_builddir)/xed \
$(XED_CFLAGS) \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS) \
$(PYGTK_CFLAGS) \
$(PYTHON_CFLAGS) \
-DXED_PLUGINS_LIBS_DIR=\"$(XED_PLUGINS_LIBS_DIR)\" \
-DXED_LOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
loader_LTLIBRARIES = libpythonloader.la
NOINST_H_FILES = \
xed-plugin-loader-python.h \
xed-plugin-python.h
libpythonloader_la_SOURCES = \
xed-plugin-loader-python.c \
xed-plugin-python.c \
$(NOINST_H_FILES)
libpythonloader_la_LDFLAGS = $(LOADER_LIBTOOL_FLAGS)
libpythonloader_la_LIBADD = \
$(XED_LIBS) \
bindings/xed.la
-include $(top_srcdir)/git.mk

View File

@@ -1,115 +0,0 @@
## Process this file with automake to produce Makefile.in
noinst_LTLIBRARIES = \
xed.la
nodist_xed_la_SOURCES = \
xed.c \
xedutils.c \
xedcommands.c
xed_la_LDFLAGS = \
-module -avoid-version
xed_la_LIBADD = \
$(PYTHON_LIB_LOC) \
$(PYTHON_LIBS) \
$(PYTHON_EXTRA_LIBS) \
$(PYGTK_LIBS)
xed_la_CFLAGS = \
-I$(top_srcdir) \
-I$(top_builddir) \
-I$(top_srcdir)/xed \
-I$(top_builddir)/xed \
-I$(top_srcdir)/plugin-loaders/python \
-I$(top_builddir)/plugin-loaders/python \
$(XED_CFLAGS) \
$(NO_STRICT_ALIASING_CFLAGS) \
$(PYGTK_CFLAGS) \
$(PYTHON_CFLAGS) \
$(AM_CFLAGS)
$(top_builddir)/xed/xed-enum-types.h:
cd $(top_builddir)/xed && $(MAKE) xed-enum-types.h
xed.c: xed.defs xed.override xedplugin.override xedmessage.override $(top_builddir)/xed/xed-enum-types.h
( cd $(srcdir) && $(PYGTK_CODEGEN) \
--register $(PYGTK_DEFSDIR)/pango-types.defs \
--register $(PYGTK_DEFSDIR)/gdk-types.defs \
--register $(PYGTK_DEFSDIR)/gtk-types.defs \
--register $(PYGTK_DEFSDIR)/gtksourceview2.defs \
--register $(PYGOBJECT_DEFSDIR)/gio-types.defs \
--override $*.override \
--prefix py$* $(<F) ) > $@
xedutils.c: xedutils.defs xedutils.override
( cd $(srcdir) && $(PYGTK_CODEGEN) \
--override $*.override \
--prefix py$* $(<F) ) > $@
xedcommands.c: xedcommands.defs xedcommands.override xed.defs
( cd $(srcdir) && $(PYGTK_CODEGEN) \
--register xed.defs \
--register $(PYGTK_DEFSDIR)/gtk-types.defs \
--override $*.override \
--prefix py$* $(<F) ) > $@
BINDING_XED_HEADERS_SRCDIR_IN = \
xed/xed-app.h \
xed/xed-document.h \
xed/xed-encodings.h \
xed/xed-plugin.h \
plugin-loaders/python/xed-plugin-python.h \
xed/xed-view.h \
xed/xed-statusbar.h \
xed/xed-tab.h \
xed/xed-panel.h \
xed/xed-window.h \
xed/xed-help.h \
xed/xed-debug.h \
xed/xed-message-type.h \
xed/xed-message.h \
xed/xed-message-bus.h \
xed/xed-language-manager.h
BINDING_UTILS_HEADERS_SRCDIR_IN = \
xed/xed-utils.h
BINDING_COMMANDS_HEADERS_SRCDIR_IN = \
xed/xed-commands.h
BINDING_HEADERS_BUILDDIR_IN =
BINDING_XED_HEADERS_SRCDIR := $(addprefix $(top_srcdir)/,$(BINDING_XED_HEADERS_SRCDIR_IN))
BINDING_UTILS_HEADERS_SRCDIR := $(addprefix $(top_srcdir)/,$(BINDING_UTILS_HEADERS_SRCDIR_IN))
BINDING_COMMANDS_HEADERS_SRCDIR := $(addprefix $(top_srcdir)/,$(BINDING_COMMANDS_HEADERS_SRCDIR_IN))
BINDING_HEADERS_BUILDDIR := $(addprefix $(top_builddir)/,$(BINDING_HEADERS_BUILDDIR_IN))
regenerate-python-binding:
$(PYGTK_H2DEF) $(sort $(BINDING_XED_HEADERS_SRCDIR) $(BINDING_HEADERS_BUILDDIR)) > xed.defs.new
$(PYGTK_H2DEF) $(sort $(BINDING_UTILS_HEADERS_SRCDIR) $(BINDING_HEADERS_BUILDDIR)) > xedutils.defs.new
$(PYGTK_H2DEF) $(sort $(BINDING_COMMANDS_HEADERS_SRCDIR) $(BINDING_HEADERS_BUILDDIR)) > xedcommands.defs.new
BUILT_SOURCES = \
xed.c \
xedutils.c \
xedcommands.c
EXTRA_DIST = \
xed.override \
xed.defs \
xedutils.override \
xedutils.defs \
xedcommands.override \
xedcommands.defs \
xedmessage.override \
xedplugin.override
CLEANFILES = $(BUILT_SOURCES)
dist-hook:
cd $(distdir); rm -f $(BUILT_SOURCES)
-include $(top_srcdir)/git.mk

File diff suppressed because it is too large Load Diff

View File

@@ -1,461 +0,0 @@
%%
headers
#include <pygobject.h>
#include <pygtk/pygtk.h>
#include <xed/xed-language-manager.h>
#include <xed/xed-plugin.h>
#include <xed/xed-app.h>
#include <xed/xed-encodings.h>
#include <xed/xed-enum-types.h>
#include <xed/xed-statusbar.h>
#include <xed/xed-debug.h>
#include <xed/xed-help.h>
#include "xed-plugin-python.h"
void pyxed_register_classes (PyObject *d);
void pyxed_add_constants (PyObject *module, const gchar *strip_prefix);
static PyObject *
_helper_wrap_gobject_glist (const GList *list)
{
PyObject *py_list;
const GList *tmp;
if ((py_list = PyList_New(0)) == NULL) {
return NULL;
}
for (tmp = list; tmp != NULL; tmp = tmp->next) {
PyObject *py_obj = pygobject_new(G_OBJECT(tmp->data));
if (py_obj == NULL) {
Py_DECREF(py_list);
return NULL;
}
PyList_Append(py_list, py_obj);
Py_DECREF(py_obj);
}
return py_list;
}
static PyObject *
_helper_wrap_gobject_gslist (const GSList *list)
{
PyObject *py_list;
const GSList *tmp;
if ((py_list = PyList_New(0)) == NULL) {
return NULL;
}
for (tmp = list; tmp != NULL; tmp = tmp->next) {
PyObject *py_obj = pygobject_new(G_OBJECT(tmp->data));
if (py_obj == NULL) {
Py_DECREF(py_list);
return NULL;
}
PyList_Append(py_list, py_obj);
Py_DECREF(py_obj);
}
return py_list;
}
%%
include
xedplugin.override
xedmessage.override
%%
modulename xed
%%
import gtk.Widget as PyGtkWidget_Type
import gobject.GObject as PyGObject_Type
import gtk.gdk.Screen as PyGdkScreen_Type
import gtk.VBox as PyGtkVBox_Type
import gtk.Window as PyGtkWindow_Type
import gtk.Image as PyGtkImage_Type
import gtk.Statusbar as PyGtkStatusbar_Type
import gtksourceview2.Buffer as PyGtkSourceBuffer_Type
import gtksourceview2.View as PyGtkSourceView_Type
import gtksourceview2.Language as PyGtkSourceLanguage_Type
import gtksourceview2.LanguageManager as PyGtkSourceLanguageManager_Type
%%
ignore-glob
*_get_type
xed_document_error_quark
xed_panel_add_item_with_stock_icon
%%
override xed_app_create_window kwargs
static PyObject *
_wrap_xed_app_create_window(PyGObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "screen", NULL};
PyGObject *screen = NULL;
XedWindow *ret;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"|O!", kwlist,
&PyGdkScreen_Type, &screen))
return NULL;
ret = xed_app_create_window(XED_APP(self->obj),
screen ? GDK_SCREEN(screen->obj) : NULL);
/* pygobject_new handles NULL checking */
return pygobject_new((GObject *)ret);
}
%%
override xed_app_get_windows
static PyObject *
_wrap_xed_app_get_windows(PyGObject *self)
{
const GList *list;
PyObject *py_list;
list = xed_app_get_windows (XED_APP (self->obj));
py_list = _helper_wrap_gobject_glist (list);
return py_list;
}
%%
override xed_app_get_views
static PyObject *
_wrap_xed_app_get_views(PyGObject *self)
{
GList *list;
PyObject *py_list;
list = xed_app_get_views (XED_APP (self->obj));
py_list = _helper_wrap_gobject_glist (list);
g_list_free (list);
return py_list;
}
%%
override xed_app_get_documents
static PyObject *
_wrap_xed_app_get_documents(PyGObject *self)
{
GList *list;
PyObject *py_list;
list = xed_app_get_documents (XED_APP (self->obj));
py_list = _helper_wrap_gobject_glist (list);
g_list_free (list);
return py_list;
}
%%
override xed_window_get_documents
static PyObject *
_wrap_xed_window_get_documents(PyGObject *self)
{
GList *list;
PyObject *py_list;
list = xed_window_get_documents (XED_WINDOW (self->obj));
py_list = _helper_wrap_gobject_glist (list);
g_list_free(list);
return py_list;
}
%%
override xed_window_get_unsaved_documents
static PyObject *
_wrap_xed_window_get_unsaved_documents(PyGObject *self)
{
GList *list;
PyObject *py_list;
list = xed_window_get_unsaved_documents (XED_WINDOW (self->obj));
py_list = _helper_wrap_gobject_glist (list);
g_list_free(list);
return py_list;
}
%%
override xed_window_get_views
static PyObject *
_wrap_xed_window_get_views(PyGObject *self)
{
GList *list;
PyObject *py_list;
list = xed_window_get_views (XED_WINDOW (self->obj));
py_list = _helper_wrap_gobject_glist (list);
g_list_free(list);
return py_list;
}
%%
override xed_window_close_tabs kwargs
static PyObject *
_wrap_xed_window_close_tabs (PyGObject *self,
PyObject *args,
PyObject *kwargs)
{
static char *kwlist[] = { "tabs", NULL };
PyObject *list, *item;
GList *glist = NULL;
int len, i;
if (!PyArg_ParseTupleAndKeywords (args, kwargs,
"O:XedWindow.close_tabs", kwlist,
&list))
return NULL;
if (!PySequence_Check (list))
{
PyErr_SetString (PyExc_TypeError,
"first argument must be a sequence");
return NULL;
}
len = PySequence_Length (list);
for (i = 0; i < len; i++)
{
item = PySequence_GetItem (list, i);
Py_DECREF(item);
if (!pygobject_check (item, &PyXedTab_Type))
{
PyErr_SetString (PyExc_TypeError,
"sequence item not a Gtkwidget object");
g_list_free (glist);
return NULL;
}
glist = g_list_append (glist, pygobject_get (item));
}
xed_window_close_tabs (XED_WINDOW (self->obj), glist);
g_list_free (glist);
Py_INCREF (Py_None);
return Py_None;
}
%%
override xed_document_get_search_text
static PyObject *
_wrap_xed_document_get_search_text(PyGObject *self)
{
PyObject *tuple, *string;
guint flags;
gchar *ret;
ret = xed_document_get_search_text (XED_DOCUMENT (self->obj), &flags);
tuple = PyTuple_New(2);
if (ret) {
string = PyString_FromString(ret);
PyTuple_SetItem(tuple, 0, string);
} else {
Py_INCREF(Py_None);
PyTuple_SetItem(tuple, 0, Py_None);
}
PyTuple_SetItem(tuple, 1, PyInt_FromLong(flags));
g_free(ret);
return tuple;
}
%%
override xed_panel_add_item kwargs
static PyObject *
_wrap_xed_panel_add_item(PyGObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist1[] = { "item", "name", "image", NULL };
static char *kwlist2[] = { "item", "name", "stock_id", NULL };
PyGObject *item, *image;
char *name = NULL;
char *stock_id = NULL;
if (PyArg_ParseTupleAndKeywords(args, kwargs, "O!sO!:XedPanel.add_item", kwlist1, &PyGtkWidget_Type, &item, &name, &PyGtkImage_Type, &image)) {
xed_panel_add_item(XED_PANEL(self->obj), GTK_WIDGET(item->obj), name, GTK_WIDGET(image->obj));
Py_INCREF(Py_None);
return Py_None;
}
PyErr_Clear();
if (PyArg_ParseTupleAndKeywords(args, kwargs, "O!ss:XedPanel.add_item", kwlist2, &PyGtkWidget_Type, &item, &name, &stock_id)) {
xed_panel_add_item_with_stock_icon(XED_PANEL(self->obj), GTK_WIDGET(item->obj), name, stock_id);
Py_INCREF(Py_None);
return Py_None;
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError, "the last arg should be either a gtk.Image or a stock_id string");
return NULL;
}
%%
override xed_app_get_default_deprecated
/* deprecated wrappers */
static PyObject *
_wrap_xed_app_get_default_deprecated(PyObject *self)
{
if (PyErr_Warn(PyExc_DeprecationWarning, "use xed.app_get_default instead") < 0)
return NULL;
return _wrap_xed_app_get_default(self);
}
%%
override xed_encoding_get_from_charset_deprecated kwargs
static PyObject *
_wrap_xed_encoding_get_from_charset_deprecated(PyObject *self, PyObject *args, PyObject *kwargs)
{
if (PyErr_Warn(PyExc_DeprecationWarning, "use xed.encoding_get_from_charset instead") < 0)
return NULL;
return _wrap_xed_encoding_get_from_charset(self, args, kwargs);
}
%%
override xed_encoding_get_from_index_deprecated kwargs
static PyObject *
_wrap_xed_encoding_get_from_index_deprecated(PyObject *self, PyObject *args, PyObject *kwargs)
{
if (PyErr_Warn(PyExc_DeprecationWarning, "use xed.encoding_get_from_index instead") < 0)
return NULL;
return _wrap_xed_encoding_get_from_index(self, args, kwargs);
}
%%
override xed_encoding_get_utf8_deprecated
static PyObject *
_wrap_xed_encoding_get_utf8_deprecated(PyObject *self)
{
if (PyErr_Warn(PyExc_DeprecationWarning, "use xed.encoding_get_utf8 instead") < 0)
return NULL;
return _wrap_xed_encoding_get_utf8(self);
}
%%
override xed_encoding_get_current_deprecated
static PyObject *
_wrap_xed_encoding_get_current_deprecated(PyObject *self)
{
if (PyErr_Warn(PyExc_DeprecationWarning, "use xed.encoding_get_current instead") < 0)
return NULL;
return _wrap_xed_encoding_get_current(self);
}
%%
override xed_tab_get_from_document_deprecated kwargs
static PyObject *
_wrap_xed_tab_get_from_document_deprecated(PyObject *self, PyObject *args, PyObject *kwargs)
{
if (PyErr_Warn(PyExc_DeprecationWarning, "use xed.tab_get_from_document instead") < 0)
return NULL;
return _wrap_xed_tab_get_from_document(self, args, kwargs);
}
%%
override xed_language_manager_list_languages_sorted kwargs
static PyObject *
_wrap_xed_language_manager_list_languages_sorted(PyObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "lm", "include_hidden", NULL };
PyGObject *lm;
int include_hidden;
PyObject *py_list;
GSList *list;
if (!PyArg_ParseTupleAndKeywords (args, kwargs,
"O!i:language_manager_list_languages_sorted",
kwlist, &PyGtkSourceLanguageManager_Type, &lm,
&include_hidden))
return NULL;
list = xed_language_manager_list_languages_sorted (GTK_SOURCE_LANGUAGE_MANAGER (lm->obj),
include_hidden);
py_list = _helper_wrap_gobject_gslist (list);
g_slist_free (list);
return py_list;
}
%%
override xed_debug kwargs
static PyObject *
_wrap_xed_debug(PyObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "message", NULL };
PyObject *traceback_module, *mdict, *func, *traceback, *tuple;
PyObject *filename, *lineno, *funcname;
char *message = NULL;
if (g_getenv ("XED_DEBUG_PLUGINS") == NULL)
{
Py_INCREF (Py_None);
return Py_None;
}
if (!PyArg_ParseTupleAndKeywords (args, kwargs, "|s", kwlist, &message))
return NULL;
traceback_module = PyImport_ImportModule ("traceback");
if (traceback_module == NULL)
{
g_warning ("traceback module cannot be imported");
Py_INCREF (Py_None);
return Py_None;
}
mdict = PyModule_GetDict (traceback_module);
func = PyDict_GetItemString (mdict, "extract_stack");
traceback = PyObject_CallFunction (func, "zi", NULL, 1);
tuple = PyList_GetItem (traceback, 0);
if (tuple == NULL || !PyTuple_Check (tuple))
{
g_warning ("traceback tuple is null!");
}
else
{
filename = PyTuple_GetItem (tuple, 0);
lineno = PyTuple_GetItem (tuple, 1);
funcname = PyTuple_GetItem (tuple, 2);
if (message == NULL)
xed_debug (XED_DEBUG_PLUGINS,
PyString_AsString (filename),
PyInt_AsLong (lineno),
PyString_AsString (funcname));
else
xed_debug_message (XED_DEBUG_PLUGINS,
PyString_AsString (filename),
PyInt_AsLong (lineno),
PyString_AsString (funcname),
"%s",
message);
}
Py_DECREF (traceback);
Py_DECREF (traceback_module);
Py_INCREF (Py_None);
return Py_None;
}
%%
override xed_statusbar_flash_message kwargs
static PyObject *
_wrap_xed_statusbar_flash_message(PyGObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "context_id", "message", NULL };
int context_id;
char *message;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,"is:XedStatusbar.flash_message", kwlist, &context_id, &message))
return NULL;
xed_statusbar_flash_message(XED_STATUSBAR(self->obj), context_id, "%s", message);
Py_INCREF(Py_None);
return Py_None;
}
%%

View File

@@ -1,45 +0,0 @@
;; -*- scheme -*-
; object definitions ...
;; Enumerations and flags ...
;; From ../../xed/xed-commands.h
(define-function load_uri
(c-name "xed_commands_load_uri")
(return-type "none")
(parameters
'("XedWindow*" "window")
'("const-gchar*" "uri")
'("const-XedEncoding*" "encoding")
'("gint" "line_pos")
)
)
(define-function load_uris
(c-name "xed_commands_load_uris")
(return-type "gint")
(parameters
'("XedWindow*" "window")
'("const-GSList*" "uris")
'("const-XedEncoding*" "encoding")
'("gint" "line_pos")
)
)
(define-function save_document
(c-name "xed_commands_save_document")
(return-type "none")
(parameters
'("XedWindow*" "window")
'("XedDocument*" "document")
)
)
(define-function save_all_documents
(c-name "xed_commands_save_all_documents")
(return-type "none")
(parameters
'("XedWindow*" "window")
)
)

View File

@@ -1,122 +0,0 @@
%%
headers
#define NO_IMPORT_PYGOBJECT
#define NO_IMPORT_PYGTK
#include <pygobject.h>
#include <pygtk/pygtk.h>
#include "xed-commands.h"
#include "xed-window.h"
void pyxedcommands_register_classes (PyObject *d);
void pyxedcommands_add_constants (PyObject *module, const gchar *strip_prefix);
%%
modulename xed.commands
%%
import xed.Window as PyXedWindow_Type
import xed.Document as PyXedDocument_Type
%%
ignore-glob
_*
%%
override xed_commands_load_uri kwargs
static PyObject *
_wrap_xed_commands_load_uri (PyObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "window", "uri", "encoding", "line_pos", NULL };
PyGObject *window;
char *uri;
int line_pos = 0;
PyObject *py_encoding = NULL;
XedEncoding *encoding = NULL;
if (!PyArg_ParseTupleAndKeywords (args, kwargs, "O!s|Oi:load_uri",
kwlist, &PyXedWindow_Type,
&window, &uri, &py_encoding,
&line_pos))
return NULL;
if (py_encoding != NULL && py_encoding != Py_None)
{
if (pyg_boxed_check (py_encoding, XED_TYPE_ENCODING))
encoding = pyg_boxed_get (py_encoding, XedEncoding);
else
{
PyErr_SetString (PyExc_TypeError,
"encoding should be a XedEncoding");
return NULL;
}
}
xed_commands_load_uri (XED_WINDOW (window->obj), uri, encoding,
line_pos);
Py_INCREF (Py_None);
return Py_None;
}
%%
override xed_commands_load_uris kwargs
static PyObject *
_wrap_xed_commands_load_uris (PyObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "window", "uris", "encoding", "line_pos", NULL };
PyGObject *window;
GSList *uris = NULL;
int line_pos = 0;
PyObject *py_encoding = NULL;
PyObject *list;
PyObject *item;
XedEncoding *encoding = NULL;
int len;
int i;
if (!PyArg_ParseTupleAndKeywords (args, kwargs, "O!O|Oi:load_uri",
kwlist, &PyXedWindow_Type,
&window, &list, &py_encoding,
&line_pos))
return NULL;
if (py_encoding != NULL && py_encoding != Py_None)
{
if (pyg_boxed_check (py_encoding, XED_TYPE_ENCODING))
encoding = pyg_boxed_get (py_encoding, XedEncoding);
else {
PyErr_SetString (PyExc_TypeError,
"encoding should be a XedEncoding");
return NULL;
}
}
if (!PySequence_Check (list))
{
PyErr_SetString (PyExc_TypeError,
"second argument must be a sequence");
return NULL;
}
len = PySequence_Length (list);
for (i = 0; i < len; i++)
{
item = PySequence_GetItem (list, i);
Py_DECREF (item);
if (!PyString_Check (item))
{
PyErr_SetString (PyExc_TypeError,
"sequence item not a string");
g_slist_free (uris);
return NULL;
}
uris = g_slist_prepend (uris, PyString_AsString (item));
}
uris = g_slist_reverse (uris);
xed_commands_load_uris (XED_WINDOW (window->obj), uris,
encoding, line_pos);
g_slist_free (uris);
Py_INCREF (Py_None);
return Py_None;
}

View File

@@ -1,556 +0,0 @@
%%
headers
#include <xed/xed-message-bus.h>
#include <xed/xed-message.h>
static GType
_helper_wrap_get_gtype_from_pytype (PyObject *pytype)
{
PyTypeObject *type = (PyTypeObject *)pytype;
if (type == &PyList_Type || type == &PyTuple_Type)
return G_TYPE_STRV;
return pyg_type_from_object (pytype);
}
static gchar *
_helper_wrap_get_string (PyObject *obj)
{
PyObject *str;
gchar *result;
str = PyObject_Str (obj);
if (!str)
return NULL;
result = g_strdup (PyString_AsString (str));
Py_DECREF (str);
return result;
}
static int
_helper_wrap_list_to_gvalue (GValue *gvalue, PyObject *pyvalue)
{
int num;
gchar **lst;
gint i;
num = PySequence_Size (pyvalue);
lst = g_new0 (gchar *, num + 1);
for (i = 0; i < num; i++)
{
lst[i] = _helper_wrap_get_string (PySequence_GetItem (pyvalue, i));
if (lst[i] == NULL)
{
g_strfreev (lst);
return 1;
}
}
g_value_set_boxed (gvalue, lst);
g_strfreev (lst);
return 0;
}
static int
_helper_wrap_get_gvalue_from_pyobject (GValue *gvalue, PyObject *pyvalue)
{
if (pyvalue->ob_type == &PyList_Type || pyvalue->ob_type == &PyTuple_Type)
return _helper_wrap_list_to_gvalue (gvalue, pyvalue);
return pyg_value_from_pyobject(gvalue, pyvalue);
}
static int
_helper_wrap_message_set_value(XedMessage *message, PyObject *pykey, PyObject *pyvalue)
{
gchar *key;
GType gtype;
GValue value = {0,};
key = _helper_wrap_get_string(pykey);
if (key == NULL)
return 0;
gtype = xed_message_get_key_type(message, key);
if (gtype == 0) {
PyErr_SetString(PyExc_TypeError, "invalid key");
g_free (key);
return 0;
}
g_value_init(&value, gtype);
if (_helper_wrap_get_gvalue_from_pyobject (&value, pyvalue)) {
PyErr_SetString(PyExc_TypeError,
"value is of the wrong type for this key");
g_free (key);
return 0;
}
xed_message_set_value(message, key, &value);
g_value_unset(&value);
g_free (key);
return 1;
}
typedef void (*ParsePairFunc)(PyObject *key, PyObject *value, gpointer user_data);
static void
_helper_parse_pairs_dict (PyObject *dict, ParsePairFunc func, gpointer user_data)
{
if (!dict)
return;
PyObject *key, *value;
Py_ssize_t i = 0;
while (PyDict_Next(dict, &i, &key, &value))
{
func(key, value, user_data);
}
}
static void
_helper_parse_pairs(PyObject *args, PyObject *kwargs, ParsePairFunc func, gpointer user_data)
{
guint len;
guint i;
len = PyTuple_Size(args);
for (i = 0; i < len; ++i)
{
PyObject *d = PyTuple_GetItem(args, i);
if (PyDict_Check(d))
_helper_parse_pairs_dict(d, func, user_data);
}
_helper_parse_pairs_dict(kwargs, func, user_data);
}
static void
_helper_message_set(PyObject *key, PyObject *value, XedMessage *message)
{
_helper_wrap_message_set_value(message, key, value);
}
static void
_helper_message_set_values(XedMessage *message, PyObject *args, PyObject *kwargs)
{
_helper_parse_pairs(args, kwargs, (ParsePairFunc)_helper_message_set, message);
}
static XedMessage *
_helper_wrap_create_message(XedMessageBus *bus, PyObject *args, PyObject *kwargs)
{
PyObject *pypath, *pymethod, *pydict;
if (!PyArg_ParseTuple(args, "OO|O:XedMessage.create", &pypath, &pymethod, &pydict))
return NULL;
gchar *object_path = _helper_wrap_get_string(pypath);
gchar *method = _helper_wrap_get_string(pymethod);
XedMessageType *message_type = xed_message_bus_lookup (bus, object_path, method);
XedMessage *message;
if (message_type)
{
message = xed_message_type_instantiate(message_type, NULL);
_helper_message_set_values(message, args, kwargs);
}
else
{
PyErr_SetString(PyExc_StandardError, "Message type does not exist");
message = NULL;
}
g_free(object_path);
g_free(method);
return message;
}
typedef struct {
PyObject *func;
PyObject *data;
} PyXedCustomNotify;
static void
pyxed_custom_destroy_notify(gpointer user_data)
{
PyXedCustomNotify *cunote = user_data;
PyGILState_STATE state;
g_return_if_fail(user_data);
state = pyg_gil_state_ensure();
Py_XDECREF(cunote->func);
Py_XDECREF(cunote->data);
pyg_gil_state_release(state);
g_free(cunote);
}
%%
ignore-glob
*_get_type
xed_message_type_foreach
xed_message_type_instantiate_valist
xed_message_type_new_valist
xed_message_get_valist
xed_message_set_valist
xed_message_set_valuesv
xed_message_bus_disconnect_by_func
xed_message_bus_block_by_func
xed_message_bus_unblock_by_func
%%
override xed_message_type_new kwargs
typedef struct
{
XedMessageType *message_type;
PyObject *optional;
} MessageTypeSetInfo;
static void
_message_type_set(PyObject *key, PyObject *value, MessageTypeSetInfo *info)
{
GType gtype;
gchar *k = _helper_wrap_get_string(key);
if (!k)
return;
gtype = _helper_wrap_get_gtype_from_pytype(value);
gboolean optional = info->optional && PySequence_Contains(info->optional, key);
xed_message_type_set(info->message_type, optional, k, gtype, NULL);
g_free(k);
}
static int
_wrap_xed_message_type_new(PyGObject *self, PyObject *args, PyObject *kwargs)
{
PyObject *pypath, *pymethod, *optional = NULL, *pydict;
if (!PyArg_ParseTuple(args, "OO|OO:XedMessageType.new", &pypath, &pymethod, &optional, &pydict))
return -1;
XedMessageType *message_type = XED_MESSAGE_TYPE(g_object_new(pyg_type_from_object((PyObject *) self), NULL));
MessageTypeSetInfo info = {message_type, optional && PySequence_Check(optional) ? optional : NULL};
_helper_parse_pairs (args, kwargs, (ParsePairFunc)_message_type_set, &info);
self->obj = (GObject *)message_type;
pygobject_register_wrapper((PyObject *) self);
return 0;
}
%%
override xed_message_type_instantiate kwargs
static PyObject *
_wrap_xed_message_type_instantiate(PyGObject *self, PyObject *args, PyObject *kwargs)
{
XedMessageType *message_type = XED_MESSAGE_TYPE (self->obj);
XedMessage *message = xed_message_type_instantiate(message_type, NULL);
_helper_message_set_values(message, args, kwargs);
return pygobject_new((GObject *)message);
}
%%
override xed_message_get args
static PyObject *
_wrap_xed_message_get(PyGObject *self, PyObject *args)
{
guint len, i;
PyObject *ret;
len = PyTuple_Size(args);
ret = PyTuple_New(len);
for (i = 0; i < len; i++) {
GValue value = { 0, };
PyObject *py_key = PyTuple_GetItem(args, i);
gchar *key = _helper_wrap_get_string(py_key);
if (!key) {
PyErr_SetString(PyExc_TypeError, "keys must be strings");
Py_DECREF(ret);
return NULL;
}
xed_message_get_value (XED_MESSAGE (self->obj), key, &value);
g_free (key);
PyTuple_SetItem(ret, i, pyg_value_as_pyobject(&value, TRUE));
g_value_unset(&value);
}
return ret;
}
%%
override xed_message_get_value kwargs
static PyObject *
_wrap_xed_message_get_value(PyGObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "key", NULL };
const gchar *key;
PyObject *ret;
GValue value = { 0, };
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s:XedMessage.get_value", kwlist, &key))
return NULL;
xed_message_get_value(XED_MESSAGE(self->obj), key, &value);
ret = pyg_value_as_pyobject(&value, TRUE);
g_value_unset(&value);
return ret;
}
%%
override xed_message_set_value kwargs
static PyObject *
_wrap_xed_message_set_value(PyGObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "key", "value", NULL };
PyObject *pykey, *pyvalue;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:XedMessage.set_value", kwlist, &pykey, &pyvalue))
return NULL;
if (!_helper_wrap_message_set_value(XED_MESSAGE(self->obj), pykey, pyvalue))
return NULL;
Py_INCREF(Py_None);
return Py_None;
}
%%
override xed_message_set kwargs
static PyObject *
_wrap_xed_message_set (PyGObject *self, PyObject *args, PyObject *kwargs) {
_helper_message_set_values(XED_MESSAGE(self->obj), args, kwargs);
Py_INCREF(Py_None);
return Py_None;
}
%%
override xed_message_bus_new
static int
_wrap_xed_message_bus_new(PyGObject *self)
{
pygobject_construct (self, NULL);
if (!self->obj) {
PyErr_SetString (PyExc_RuntimeError, "could not create xed.MessageBus object");
return -1;
}
return 0;
}
%%
new-constructor XED_TYPE_MESSAGE_BUS
%%
override xed_message_bus_register kwargs
static PyObject *
_wrap_xed_message_bus_register(PyGObject *self, PyObject *args, PyObject *kwargs)
{
PyObject *pypath, *pymethod, *optional = NULL, *pydict;
XedMessageBus *bus = XED_MESSAGE_BUS(self->obj);
if (!PyArg_ParseTuple(args, "OO|OO:XedMessageBus.register", &pypath, &pymethod, &optional, &pydict))
return NULL;
gchar *object_path = _helper_wrap_get_string(pypath);
gchar *method = _helper_wrap_get_string(pymethod);
XedMessageType *message_type = xed_message_bus_register(bus, object_path, method, 0, NULL);
g_free(object_path);
g_free(method);
if (!message_type)
{
PyErr_SetString(PyExc_StandardError, "Message type already exists");
return NULL;
}
MessageTypeSetInfo info = {message_type, optional && PySequence_Check(optional) ? optional : NULL};
_helper_parse_pairs (args, kwargs, (ParsePairFunc)_message_type_set, &info);
return pyg_boxed_new(XED_TYPE_MESSAGE_TYPE, message_type, TRUE, TRUE);
}
%%
override xed_message_bus_connect kwargs
static void
pyxed_message_bus_connect_cb(XedMessageBus *bus, XedMessage *message, gpointer data)
{
PyGILState_STATE state;
PyXedCustomNotify *cunote = data;
PyObject *pybus, *pymessage, *retobj;
g_assert(cunote->func);
state = pyg_gil_state_ensure();
pybus = pygobject_new((GObject *)bus);
pymessage = pygobject_new((GObject *)message);
if (cunote->data) {
retobj = PyEval_CallFunction(cunote->func, "(NNO)", pybus, pymessage, cunote->data);
} else {
retobj = PyEval_CallFunction(cunote->func, "(NN)", pybus, pymessage);
}
if (PyErr_Occurred()) {
PyErr_Print();
}
Py_XDECREF(retobj);
pyg_gil_state_release(state);
}
static PyObject *
_wrap_xed_message_bus_connect(PyGObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "domain", "name", "func", "data", NULL };
PyObject *pyfunc, *pyarg = NULL;
const gchar *domain;
const gchar *name;
PyXedCustomNotify *cunote;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"ssO|O:XedMessageBus.connect",
kwlist, &domain, &name, &pyfunc, &pyarg))
return NULL;
if (!PyCallable_Check(pyfunc)) {
PyErr_SetString(PyExc_TypeError, "func must be a callable object");
return NULL;
}
cunote = g_new(PyXedCustomNotify, 1);
Py_INCREF(pyfunc);
cunote->func = pyfunc;
Py_XINCREF(pyarg);
cunote->data = pyarg;
guint id = xed_message_bus_connect(XED_MESSAGE_BUS(self->obj),
domain,
name,
pyxed_message_bus_connect_cb,
(gpointer)cunote,
pyxed_custom_destroy_notify);
return PyLong_FromUnsignedLong(id);
}
%%
override xed_message_bus_send kwargs
static PyObject *
_wrap_xed_message_bus_send(PyGObject *self, PyObject *args, PyObject *kwargs)
{
/* create a new message object */
XedMessage *message;
XedMessageBus *bus = XED_MESSAGE_BUS(self->obj);
message = _helper_wrap_create_message(bus, args, kwargs);
if (!message)
return NULL;
xed_message_bus_send_message(bus, message);
g_object_unref (message);
Py_INCREF(Py_None);
return Py_None;
}
%%
override xed_message_bus_send_sync kwargs
static PyObject *
_wrap_xed_message_bus_send_sync(PyGObject *self, PyObject *args, PyObject *kwargs)
{
/* create a new message object */
XedMessage *message;
XedMessageBus *bus = XED_MESSAGE_BUS(self->obj);
message = _helper_wrap_create_message(bus, args, kwargs);
if (!message)
return NULL;
xed_message_bus_send_message_sync(bus, message);
return pygobject_new((GObject *)message);
}
%%
override-slot XedMessage.tp_getattro
static PyObject *
_wrap_xed_message_tp_getattro(PyObject *self, PyObject *attrname)
{
XedMessage *message = XED_MESSAGE(((PyGObject *)self)->obj);
XedMessageType *type;
gchar *name = _helper_wrap_get_string (attrname);
gboolean exists;
gboolean intype;
PyObject *ret;
if (name == NULL)
{
PyErr_SetString(PyExc_TypeError, "attr name somehow not a string");
return NULL;
}
g_object_get (message, "type", &type, NULL);
intype = xed_message_type_lookup (type, name) != G_TYPE_INVALID;
xed_message_type_unref (type);
exists = xed_message_has_key (message, name);
if (!intype)
{
ret = PyObject_GenericGetAttr(self, attrname);
}
else if (exists)
{
GValue value = { 0, };
xed_message_get_value (message, name, &value);
ret = pyg_value_as_pyobject(&value, TRUE);
g_value_unset (&value);
}
else
{
Py_INCREF(Py_None);
ret = Py_None;
}
g_free (name);
return ret;
}
%%
override-slot XedMessage.tp_setattro
static int
_wrap_xed_message_tp_setattro(PyObject *self, PyObject *attrname, PyObject *value)
{
XedMessage *message = XED_MESSAGE(((PyGObject *)self)->obj);
if (!_helper_wrap_message_set_value(message, attrname, value))
{
return PyObject_GenericSetAttr(self, attrname, value);
}
else
{
return 1;
}
}

View File

@@ -1,193 +0,0 @@
%%
headers
#include <xed/xed-plugin.h>
#include <xed/xed-window.h>
%%
override xed_plugin_activate kwargs
static PyObject *
_wrap_xed_plugin_activate(PyGObject *self, PyObject *args, PyObject *kwargs)
{
gpointer klass, klass2;
static char *kwlist[] = { "window", NULL };
PyGObject *window;
PyObject *cls = (PyObject *)(((PyObject *)self)->ob_type);
if (!PyArg_ParseTupleAndKeywords (args,
kwargs,
"O!:XedPlugin.activate",
kwlist,
&PyXedWindow_Type,
&window))
return NULL;
klass = g_type_class_ref (pyg_type_from_object (cls));
if (XED_IS_PLUGIN_PYTHON_CLASS (klass))
{
klass2 = g_type_class_peek_parent (klass);
g_type_class_unref (klass);
klass = g_type_class_ref (G_TYPE_FROM_CLASS (klass2));
}
if (XED_PLUGIN_CLASS (klass)->activate)
XED_PLUGIN_CLASS (klass)->activate (XED_PLUGIN (self->obj),
XED_WINDOW (window->obj));
else {
PyErr_SetString (PyExc_NotImplementedError,
"virtual method XedPlugin.activate not implemented");
g_type_class_unref (klass);
return NULL;
}
g_type_class_unref (klass);
Py_INCREF(Py_None);
return Py_None;
}
%%
override xed_plugin_deactivate kwargs
static PyObject *
_wrap_xed_plugin_deactivate(PyGObject *self, PyObject *args, PyObject *kwargs)
{
gpointer klass, klass2;
static char *kwlist[] = {"window", NULL};
PyGObject *window;
PyObject *cls = (PyObject *)(((PyObject *)self)->ob_type);
if (!PyArg_ParseTupleAndKeywords (args,
kwargs,
"O!:XedPlugin.deactivate",
kwlist,
&PyXedWindow_Type,
&window))
return NULL;
klass = g_type_class_ref (pyg_type_from_object (cls));
if (XED_IS_PLUGIN_PYTHON_CLASS (klass))
{
klass2 = g_type_class_peek_parent (klass);
g_type_class_unref (klass);
klass = g_type_class_ref (G_TYPE_FROM_CLASS (klass2));
}
if (XED_PLUGIN_CLASS (klass)->deactivate)
XED_PLUGIN_CLASS (klass)->deactivate (XED_PLUGIN (self->obj),
XED_WINDOW (window->obj));
else {
PyErr_SetString (PyExc_NotImplementedError,
"virtual method XedPlugin.deactivate not implemented");
g_type_class_unref (klass);
return NULL;
}
g_type_class_unref (klass);
Py_INCREF(Py_None);
return Py_None;
}
%%
override xed_plugin_update_ui kwargs
static PyObject *
_wrap_xed_plugin_update_ui (PyGObject *self, PyObject *args, PyObject *kwargs)
{
gpointer klass, klass2;
static char *kwlist[] = {"window", NULL};
PyGObject *window;
PyObject *cls = (PyObject *)(((PyObject *)self)->ob_type);
if (!PyArg_ParseTupleAndKeywords (args,
kwargs,
"O!:XedPlugin.update_ui",
kwlist,
&PyXedWindow_Type,
&window))
return NULL;
klass = g_type_class_ref (pyg_type_from_object (cls));
if (XED_IS_PLUGIN_PYTHON_CLASS (klass))
{
klass2 = g_type_class_peek_parent (klass);
g_type_class_unref (klass);
klass = g_type_class_ref (G_TYPE_FROM_CLASS (klass2));
}
if (XED_PLUGIN_CLASS (klass)->update_ui)
XED_PLUGIN_CLASS (klass)->update_ui (XED_PLUGIN (self->obj),
XED_WINDOW (window->obj));
else {
PyErr_SetString (PyExc_NotImplementedError,
"virtual method XedPlugin.update_ui not implemented");
g_type_class_unref (klass);
return NULL;
}
g_type_class_unref (klass);
Py_INCREF(Py_None);
return Py_None;
}
%%
override xed_plugin_is_configurable
static PyObject *
_wrap_xed_plugin_is_configurable (PyGObject *self)
{
int ret;
gpointer klass, klass2;
PyObject *cls = (PyObject *)(((PyObject *)self)->ob_type);
klass = g_type_class_ref (pyg_type_from_object (cls));
if (XED_IS_PLUGIN_PYTHON_CLASS (klass))
{
klass2 = g_type_class_peek_parent (klass);
g_type_class_unref (klass);
klass = g_type_class_ref (G_TYPE_FROM_CLASS (klass2));
}
if (XED_PLUGIN_CLASS (klass)->is_configurable)
ret = XED_PLUGIN_CLASS (klass)->is_configurable (XED_PLUGIN (self->obj));
else {
PyErr_SetString (PyExc_NotImplementedError,
"virtual method XedPlugin.is_configurable not implemented");
g_type_class_unref (klass);
return NULL;
}
g_type_class_unref (klass);
return PyBool_FromLong (ret);
}
%%
override xed_plugin_configure_dialog
static PyObject *
_wrap_xed_plugin_create_configure_dialog (PyGObject *self)
{
GtkWidget *ret;
gpointer klass, klass2;
PyObject *cls = (PyObject *)(((PyObject *)self)->ob_type);
klass = g_type_class_ref(pyg_type_from_object (cls));
if (XED_IS_PLUGIN_PYTHON_CLASS (klass))
{
klass2 = g_type_class_peek_parent (klass);
g_type_class_unref (klass);
klass = g_type_class_ref (G_TYPE_FROM_CLASS (klass2));
}
if (XED_PLUGIN_CLASS (klass)->create_configure_dialog)
ret = XED_PLUGIN_CLASS (klass)->create_configure_dialog (XED_PLUGIN (self->obj));
else {
PyErr_SetString (PyExc_NotImplementedError,
"virtual method XedPlugin.create_configure_dialog not implemented");
g_type_class_unref (klass);
return NULL;
}
g_type_class_unref (klass);
/* pygobject_new handles NULL checking */
return pygobject_new ((GObject *)ret);
}

View File

@@ -1,67 +0,0 @@
;; -*- scheme -*-
;; From ../../xed/xed-utils.h
(define-function uri_has_writable_scheme
(c-name "xed_utils_uri_has_writable_scheme")
(return-type "gboolean")
(parameters
'("const-gchar*" "uri")
)
)
(define-function uri_has_file_scheme
(c-name "xed_utils_uri_has_file_scheme")
(return-type "gboolean")
(parameters
'("const-gchar*" "uri")
)
)
(define-function uri_exists
(c-name "xed_utils_uri_exists")
(return-type "gboolean")
(parameters
'("const-gchar*" "text_uri")
)
)
(define-function uri_is_valid
(c-name "xed_utils_is_valid_uri")
(return-type "gboolean")
(parameters
'("const-gchar*" "uri")
)
)
(define-function uri_get_dirname
(c-name "xed_utils_uri_get_dirname")
(return-type "gchar*")
(parameters
'("const-char*" "uri")
)
)
(define-function menu_position_under_widget
(c-name "xed_utils_menu_position_under_widget")
(return-type "none")
(parameters
'("GtkMenu*" "menu")
'("gint*" "x")
'("gint*" "y")
'("gboolean*" "push_in")
'("gpointer" "user_data")
)
)
(define-function menu_position_under_tree_view
(c-name "xed_utils_menu_position_under_tree_view")
(return-type "none")
(parameters
'("GtkMenu*" "menu")
'("gint*" "x")
'("gint*" "y")
'("gboolean*" "push_in")
'("gpointer" "user_data")
)
)

View File

@@ -1,85 +0,0 @@
%%
headers
#define NO_IMPORT_PYGOBJECT
#define NO_IMPORT_PYGTK
#include <pygobject.h>
#include <pygtk/pygtk.h>
#include "xed-utils.h"
void pyxedutils_register_classes (PyObject *d);
void pyxedutils_add_constants (PyObject *module, const gchar *strip_prefix);
%%
modulename xed.utils
%%
import gtk.Widget as PyGtkWidget_Type
import gtk.TreeView as PyGtkTreeView_Type
import gtk.Menu as PyGtkMenu_Type
%%
ignore-glob
_*
%%
override xed_utils_menu_position_under_widget kwargs
static PyObject *
_wrap_xed_utils_menu_position_under_widget (PyObject *self,
PyObject *args,
PyObject *kwargs)
{
static char *kwlist[] = { "menu", "widget", NULL };
PyObject *py_menu, *py_widget;
GtkMenu *menu;
GtkWidget *widget;
gint x, y;
gboolean push_in;
PyObject *tuple;
if (!PyArg_ParseTupleAndKeywords (args, kwargs,
"O!O!", kwlist,
&PyGtkMenu_Type, &py_menu,
&PyGtkWidget_Type, &py_widget))
return NULL;
menu = GTK_MENU (pygobject_get (py_menu));
widget = GTK_WIDGET (pygobject_get (py_widget));
xed_utils_menu_position_under_widget (menu, &x, &y, &push_in, widget);
tuple = PyTuple_New (3);
PyTuple_SetItem (tuple, 0, PyInt_FromLong (x));
PyTuple_SetItem (tuple, 1, PyInt_FromLong (y));
PyTuple_SetItem (tuple, 2, PyBool_FromLong (push_in));
return tuple;
}
%%
override xed_utils_menu_position_under_tree_view kwargs
static PyObject *
_wrap_xed_utils_menu_position_under_tree_view (PyObject *self,
PyObject *args,
PyObject *kwargs)
{
static char *kwlist[] = { "menu", "tree_view", NULL };
PyObject *py_menu, *py_view;
GtkMenu *menu;
GtkTreeView *view;
gint x, y;
gboolean push_in;
PyObject *tuple;
if (!PyArg_ParseTupleAndKeywords (args, kwargs,
"O!O!", kwlist,
&PyGtkMenu_Type, &py_menu,
&PyGtkTreeView_Type, &py_view))
return NULL;
menu = GTK_MENU (pygobject_get (py_menu));
view = GTK_TREE_VIEW (pygobject_get (py_view));
xed_utils_menu_position_under_widget (menu, &x, &y, &push_in, view);
tuple = PyTuple_New (3);
PyTuple_SetItem (tuple, 0, PyInt_FromLong (x));
PyTuple_SetItem (tuple, 1, PyInt_FromLong (y));
PyTuple_SetItem (tuple, 2, PyBool_FromLong (push_in));
return tuple;
}

View File

@@ -1,719 +0,0 @@
/*
* xed-plugin-loader-python.c
* This file is part of xed
*
* Copyright (C) 2008 - Jesse van den Kieboom
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "xed-plugin-loader-python.h"
#include "xed-plugin-python.h"
#include <xed/xed-object-module.h>
#define NO_IMPORT_PYGOBJECT
#define NO_IMPORT_PYGTK
#include <Python.h>
#include <pygobject.h>
#include <pygtk/pygtk.h>
#include <signal.h>
#include "config.h"
#if PY_VERSION_HEX < 0x02050000
typedef int Py_ssize_t;
#define PY_SSIZE_T_MAX INT_MAX
#define PY_SSIZE_T_MIN INT_MIN
#endif
#define XED_PLUGIN_LOADER_PYTHON_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), XED_TYPE_PLUGIN_LOADER_PYTHON, XedPluginLoaderPythonPrivate))
struct _XedPluginLoaderPythonPrivate
{
GHashTable *loaded_plugins;
guint idle_gc;
gboolean init_failed;
};
typedef struct
{
PyObject *type;
PyObject *instance;
gchar *path;
} PythonInfo;
static void xed_plugin_loader_iface_init (gpointer g_iface, gpointer iface_data);
/* Exported by pyxed module */
void pyxed_register_classes (PyObject *d);
void pyxed_add_constants (PyObject *module, const gchar *strip_prefix);
extern PyMethodDef pyxed_functions[];
/* Exported by pyxedutils module */
void pyxedutils_register_classes (PyObject *d);
extern PyMethodDef pyxedutils_functions[];
/* Exported by pyxedcommands module */
void pyxedcommands_register_classes (PyObject *d);
extern PyMethodDef pyxedcommands_functions[];
/* We retreive this to check for correct class hierarchy */
static PyTypeObject *PyXedPlugin_Type;
XED_PLUGIN_LOADER_REGISTER_TYPE (XedPluginLoaderPython, xed_plugin_loader_python, G_TYPE_OBJECT, xed_plugin_loader_iface_init);
static PyObject *
find_python_plugin_type (XedPluginInfo *info,
PyObject *pymodule)
{
PyObject *locals, *key, *value;
Py_ssize_t pos = 0;
locals = PyModule_GetDict (pymodule);
while (PyDict_Next (locals, &pos, &key, &value))
{
if (!PyType_Check(value))
continue;
if (PyObject_IsSubclass (value, (PyObject*) PyXedPlugin_Type))
return value;
}
g_warning ("No XedPlugin derivative found in Python plugin '%s'",
xed_plugin_info_get_name (info));
return NULL;
}
static XedPlugin *
new_plugin_from_info (XedPluginLoaderPython *loader,
XedPluginInfo *info)
{
PythonInfo *pyinfo;
PyTypeObject *pytype;
PyObject *pyobject;
PyGObject *pygobject;
XedPlugin *instance;
PyObject *emptyarg;
pyinfo = (PythonInfo *)g_hash_table_lookup (loader->priv->loaded_plugins, info);
if (pyinfo == NULL)
return NULL;
pytype = (PyTypeObject *)pyinfo->type;
if (pytype->tp_new == NULL)
return NULL;
emptyarg = PyTuple_New(0);
pyobject = pytype->tp_new (pytype, emptyarg, NULL);
Py_DECREF (emptyarg);
if (pyobject == NULL)
{
g_error ("Could not create instance for %s.", xed_plugin_info_get_name (info));
return NULL;
}
pygobject = (PyGObject *)pyobject;
if (pygobject->obj != NULL)
{
Py_DECREF (pyobject);
g_error ("Could not create instance for %s (GObject already initialized).", xed_plugin_info_get_name (info));
return NULL;
}
pygobject_construct (pygobject,
"install-dir", pyinfo->path,
"data-dir-name", xed_plugin_info_get_module_name (info),
NULL);
if (pygobject->obj == NULL)
{
g_error ("Could not create instance for %s (GObject not constructed).", xed_plugin_info_get_name (info));
Py_DECREF (pyobject);
return NULL;
}
/* now call tp_init manually */
if (PyType_IsSubtype (pyobject->ob_type, pytype) &&
pyobject->ob_type->tp_init != NULL)
{
emptyarg = PyTuple_New(0);
pyobject->ob_type->tp_init (pyobject, emptyarg, NULL);
Py_DECREF (emptyarg);
}
instance = XED_PLUGIN (pygobject->obj);
pyinfo->instance = (PyObject *)pygobject;
/* make sure to register the python instance for the XedPluginPython
object to it can wrap the virtual xed plugin funcs back to python */
_xed_plugin_python_set_instance (XED_PLUGIN_PYTHON (instance), (PyObject *)pygobject);
/* we return a reference here because the other is owned by python */
return XED_PLUGIN (g_object_ref (instance));
}
static XedPlugin *
add_python_info (XedPluginLoaderPython *loader,
XedPluginInfo *info,
PyObject *module,
const gchar *path,
PyObject *type)
{
PythonInfo *pyinfo;
pyinfo = g_new (PythonInfo, 1);
pyinfo->path = g_strdup (path);
pyinfo->type = type;
Py_INCREF (pyinfo->type);
g_hash_table_insert (loader->priv->loaded_plugins, info, pyinfo);
return new_plugin_from_info (loader, info);
}
static const gchar *
xed_plugin_loader_iface_get_id (void)
{
return "Python";
}
static XedPlugin *
xed_plugin_loader_iface_load (XedPluginLoader *loader,
XedPluginInfo *info,
const gchar *path)
{
XedPluginLoaderPython *pyloader = XED_PLUGIN_LOADER_PYTHON (loader);
PyObject *main_module, *main_locals, *pytype;
PyObject *pymodule, *fromlist;
gchar *module_name;
XedPlugin *result;
if (pyloader->priv->init_failed)
{
g_warning ("Cannot load python plugin Python '%s' since xed was"
"not able to initialize the Python interpreter.",
xed_plugin_info_get_name (info));
return NULL;
}
/* see if py definition for the plugin is already loaded */
result = new_plugin_from_info (pyloader, info);
if (result != NULL)
return result;
main_module = PyImport_AddModule ("xed.plugins");
if (main_module == NULL)
{
g_warning ("Could not get xed.plugins.");
return NULL;
}
/* If we have a special path, we register it */
if (path != NULL)
{
PyObject *sys_path = PySys_GetObject ("path");
PyObject *pypath = PyString_FromString (path);
if (PySequence_Contains (sys_path, pypath) == 0)
PyList_Insert (sys_path, 0, pypath);
Py_DECREF (pypath);
}
main_locals = PyModule_GetDict (main_module);
/* we need a fromlist to be able to import modules with a '.' in the
name. */
fromlist = PyTuple_New(0);
module_name = g_strdup (xed_plugin_info_get_module_name (info));
pymodule = PyImport_ImportModuleEx (module_name,
main_locals,
main_locals,
fromlist);
Py_DECREF(fromlist);
if (!pymodule)
{
g_free (module_name);
PyErr_Print ();
return NULL;
}
PyDict_SetItemString (main_locals, module_name, pymodule);
g_free (module_name);
pytype = find_python_plugin_type (info, pymodule);
if (pytype)
return add_python_info (pyloader, info, pymodule, path, pytype);
return NULL;
}
static void
xed_plugin_loader_iface_unload (XedPluginLoader *loader,
XedPluginInfo *info)
{
XedPluginLoaderPython *pyloader = XED_PLUGIN_LOADER_PYTHON (loader);
PythonInfo *pyinfo;
PyGILState_STATE state;
pyinfo = (PythonInfo *)g_hash_table_lookup (pyloader->priv->loaded_plugins, info);
if (!pyinfo)
return;
state = pyg_gil_state_ensure ();
Py_XDECREF (pyinfo->instance);
pyg_gil_state_release (state);
pyinfo->instance = NULL;
}
static gboolean
run_gc (XedPluginLoaderPython *loader)
{
while (PyGC_Collect ())
;
loader->priv->idle_gc = 0;
return FALSE;
}
static void
xed_plugin_loader_iface_garbage_collect (XedPluginLoader *loader)
{
XedPluginLoaderPython *pyloader;
if (!Py_IsInitialized())
return;
pyloader = XED_PLUGIN_LOADER_PYTHON (loader);
/*
* We both run the GC right now and we schedule
* a further collection in the main loop.
*/
while (PyGC_Collect ())
;
if (pyloader->priv->idle_gc == 0)
pyloader->priv->idle_gc = g_idle_add ((GSourceFunc)run_gc, pyloader);
}
static void
xed_plugin_loader_iface_init (gpointer g_iface,
gpointer iface_data)
{
XedPluginLoaderInterface *iface = (XedPluginLoaderInterface *)g_iface;
iface->get_id = xed_plugin_loader_iface_get_id;
iface->load = xed_plugin_loader_iface_load;
iface->unload = xed_plugin_loader_iface_unload;
iface->garbage_collect = xed_plugin_loader_iface_garbage_collect;
}
static void
xed_python_shutdown (XedPluginLoaderPython *loader)
{
if (!Py_IsInitialized ())
return;
if (loader->priv->idle_gc != 0)
{
g_source_remove (loader->priv->idle_gc);
loader->priv->idle_gc = 0;
}
while (PyGC_Collect ())
;
Py_Finalize ();
}
/* C equivalent of
* import pygtk
* pygtk.require ("2.0")
*/
static gboolean
xed_check_pygtk2 (void)
{
PyObject *pygtk, *mdict, *require;
/* pygtk.require("2.0") */
pygtk = PyImport_ImportModule ("pygtk");
if (pygtk == NULL)
{
g_warning ("Error initializing Python interpreter: could not import pygtk.");
return FALSE;
}
mdict = PyModule_GetDict (pygtk);
require = PyDict_GetItemString (mdict, "require");
PyObject_CallObject (require,
Py_BuildValue ("(S)", PyString_FromString ("2.0")));
if (PyErr_Occurred())
{
g_warning ("Error initializing Python interpreter: pygtk 2 is required.");
return FALSE;
}
return TRUE;
}
/* Note: the following two functions are needed because
* init_pyobject and init_pygtk which are *macros* which in case
* case of error set the PyErr and then make the calling
* function return behind our back.
* It's up to the caller to check the result with PyErr_Occurred()
*/
static void
xed_init_pygobject (void)
{
init_pygobject_check (2, 11, 5); /* FIXME: get from config */
}
static void
xed_init_pygtk (void)
{
PyObject *gtk, *mdict, *version, *required_version;
init_pygtk ();
/* there isn't init_pygtk_check(), do the version
* check ourselves */
gtk = PyImport_ImportModule("gtk");
mdict = PyModule_GetDict(gtk);
version = PyDict_GetItemString (mdict, "pygtk_version");
if (!version)
{
PyErr_SetString (PyExc_ImportError,
"PyGObject version too old");
return;
}
required_version = Py_BuildValue ("(iii)", 2, 4, 0); /* FIXME */
if (PyObject_Compare (version, required_version) == -1)
{
PyErr_SetString (PyExc_ImportError,
"PyGObject version too old");
Py_DECREF (required_version);
return;
}
Py_DECREF (required_version);
}
static void
old_gtksourceview_init (void)
{
PyErr_SetString(PyExc_ImportError,
"gtksourceview module not allowed, use gtksourceview2");
}
static void
xed_init_pygtksourceview (void)
{
PyObject *gtksourceview, *mdict, *version, *required_version;
gtksourceview = PyImport_ImportModule("gtksourceview2");
if (gtksourceview == NULL)
{
PyErr_SetString (PyExc_ImportError,
"could not import gtksourceview");
return;
}
mdict = PyModule_GetDict (gtksourceview);
version = PyDict_GetItemString (mdict, "pygtksourceview2_version");
if (!version)
{
PyErr_SetString (PyExc_ImportError,
"PyGtkSourceView version too old");
return;
}
required_version = Py_BuildValue ("(iii)", 0, 8, 0); /* FIXME */
if (PyObject_Compare (version, required_version) == -1)
{
PyErr_SetString (PyExc_ImportError,
"PyGtkSourceView version too old");
Py_DECREF (required_version);
return;
}
Py_DECREF (required_version);
/* Create a dummy 'gtksourceview' module to prevent
* loading of the old 'gtksourceview' modules that
* has conflicting symbols with the gtksourceview2 module.
* Raise an exception when trying to import it.
*/
PyImport_AppendInittab ("gtksourceview", old_gtksourceview_init);
}
static gboolean
xed_python_init (XedPluginLoaderPython *loader)
{
PyObject *mdict, *tuple;
PyObject *xed, *xedutils, *xedcommands, *xedplugins;
PyObject *gettext, *install, *gettext_args;
//char *argv[] = { "xed", NULL };
char *argv[] = { XED_PLUGINS_LIBS_DIR, NULL };
#ifdef HAVE_SIGACTION
gint res;
struct sigaction old_sigint;
#endif
if (loader->priv->init_failed)
{
/* We already failed to initialized Python, don't need to
* retry again */
return FALSE;
}
if (Py_IsInitialized ())
{
/* Python has already been successfully initialized */
return TRUE;
}
/* We are trying to initialize Python for the first time,
set init_failed to FALSE only if the entire initialization process
ends with success */
loader->priv->init_failed = TRUE;
/* Hack to make python not overwrite SIGINT: this is needed to avoid
* the crash reported on bug #326191 */
/* CHECK: can't we use Py_InitializeEx instead of Py_Initialize in order
to avoid to manage signal handlers ? - Paolo (Dec. 31, 2006) */
#ifdef HAVE_SIGACTION
/* Save old handler */
res = sigaction (SIGINT, NULL, &old_sigint);
if (res != 0)
{
g_warning ("Error initializing Python interpreter: cannot get "
"handler to SIGINT signal (%s)",
g_strerror (errno));
return FALSE;
}
#endif
/* Python initialization */
Py_Initialize ();
#ifdef HAVE_SIGACTION
/* Restore old handler */
res = sigaction (SIGINT, &old_sigint, NULL);
if (res != 0)
{
g_warning ("Error initializing Python interpreter: cannot restore "
"handler to SIGINT signal (%s).",
g_strerror (errno));
goto python_init_error;
}
#endif
PySys_SetArgv (1, argv);
if (!xed_check_pygtk2 ())
{
/* Warning message already printed in check_pygtk2 */
goto python_init_error;
}
/* import gobject */
xed_init_pygobject ();
if (PyErr_Occurred ())
{
g_warning ("Error initializing Python interpreter: could not import pygobject.");
goto python_init_error;
}
/* import gtk */
xed_init_pygtk ();
if (PyErr_Occurred ())
{
g_warning ("Error initializing Python interpreter: could not import pygtk.");
goto python_init_error;
}
/* import gtksourceview */
xed_init_pygtksourceview ();
if (PyErr_Occurred ())
{
PyErr_Print ();
g_warning ("Error initializing Python interpreter: could not import pygtksourceview.");
goto python_init_error;
}
/* import xed */
xed = Py_InitModule ("xed", pyxed_functions);
mdict = PyModule_GetDict (xed);
pyxed_register_classes (mdict);
pyxed_add_constants (xed, "XED_");
/* xed version */
tuple = Py_BuildValue("(iii)",
XED_MAJOR_VERSION,
XED_MINOR_VERSION,
XED_MICRO_VERSION);
PyDict_SetItemString(mdict, "version", tuple);
Py_DECREF(tuple);
/* Retrieve the Python type for xed.Plugin */
PyXedPlugin_Type = (PyTypeObject *) PyDict_GetItemString (mdict, "Plugin");
if (PyXedPlugin_Type == NULL)
{
PyErr_Print ();
goto python_init_error;
}
/* import xed.utils */
xedutils = Py_InitModule ("xed.utils", pyxedutils_functions);
PyDict_SetItemString (mdict, "utils", xedutils);
/* import xed.commands */
xedcommands = Py_InitModule ("xed.commands", pyxedcommands_functions);
PyDict_SetItemString (mdict, "commands", xedcommands);
/* initialize empty xed.plugins module */
xedplugins = Py_InitModule ("xed.plugins", NULL);
PyDict_SetItemString (mdict, "plugins", xedplugins);
mdict = PyModule_GetDict (xedutils);
pyxedutils_register_classes (mdict);
mdict = PyModule_GetDict (xedcommands);
pyxedcommands_register_classes (mdict);
/* i18n support */
gettext = PyImport_ImportModule ("gettext");
if (gettext == NULL)
{
g_warning ("Error initializing Python interpreter: could not import gettext.");
goto python_init_error;
}
mdict = PyModule_GetDict (gettext);
install = PyDict_GetItemString (mdict, "install");
gettext_args = Py_BuildValue ("ss", GETTEXT_PACKAGE, XED_LOCALEDIR);
PyObject_CallObject (install, gettext_args);
Py_DECREF (gettext_args);
/* Python has been successfully initialized */
loader->priv->init_failed = FALSE;
return TRUE;
python_init_error:
g_warning ("Please check the installation of all the Python related packages required "
"by xed and try again.");
PyErr_Clear ();
xed_python_shutdown (loader);
return FALSE;
}
static void
xed_plugin_loader_python_finalize (GObject *object)
{
XedPluginLoaderPython *pyloader = XED_PLUGIN_LOADER_PYTHON (object);
g_hash_table_destroy (pyloader->priv->loaded_plugins);
xed_python_shutdown (pyloader);
G_OBJECT_CLASS (xed_plugin_loader_python_parent_class)->finalize (object);
}
static void
xed_plugin_loader_python_class_init (XedPluginLoaderPythonClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = xed_plugin_loader_python_finalize;
g_type_class_add_private (object_class, sizeof (XedPluginLoaderPythonPrivate));
}
static void
xed_plugin_loader_python_class_finalize (XedPluginLoaderPythonClass *klass)
{
}
static void
destroy_python_info (PythonInfo *info)
{
PyGILState_STATE state = pyg_gil_state_ensure ();
Py_XDECREF (info->type);
pyg_gil_state_release (state);
g_free (info->path);
g_free (info);
}
static void
xed_plugin_loader_python_init (XedPluginLoaderPython *self)
{
self->priv = XED_PLUGIN_LOADER_PYTHON_GET_PRIVATE (self);
/* initialize python interpreter */
xed_python_init (self);
/* loaded_plugins maps XedPluginInfo to a PythonInfo */
self->priv->loaded_plugins = g_hash_table_new_full (g_direct_hash,
g_direct_equal,
NULL,
(GDestroyNotify)destroy_python_info);
}
XedPluginLoaderPython *
xed_plugin_loader_python_new ()
{
GObject *loader = g_object_new (XED_TYPE_PLUGIN_LOADER_PYTHON, NULL);
return XED_PLUGIN_LOADER_PYTHON (loader);
}

View File

@@ -1,61 +0,0 @@
/*
* xed-plugin-loader-python.h
* This file is part of xed
*
* Copyright (C) 2008 - Jesse van den Kieboom
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __XED_PLUGIN_LOADER_PYTHON_H__
#define __XED_PLUGIN_LOADER_PYTHON_H__
#include <xed/xed-plugin-loader.h>
G_BEGIN_DECLS
#define XED_TYPE_PLUGIN_LOADER_PYTHON (xed_plugin_loader_python_get_type ())
#define XED_PLUGIN_LOADER_PYTHON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XED_TYPE_PLUGIN_LOADER_PYTHON, XedPluginLoaderPython))
#define XED_PLUGIN_LOADER_PYTHON_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XED_TYPE_PLUGIN_LOADER_PYTHON, XedPluginLoaderPython const))
#define XED_PLUGIN_LOADER_PYTHON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XED_TYPE_PLUGIN_LOADER_PYTHON, XedPluginLoaderPythonClass))
#define XED_IS_PLUGIN_LOADER_PYTHON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XED_TYPE_PLUGIN_LOADER_PYTHON))
#define XED_IS_PLUGIN_LOADER_PYTHON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XED_TYPE_PLUGIN_LOADER_PYTHON))
#define XED_PLUGIN_LOADER_PYTHON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XED_TYPE_PLUGIN_LOADER_PYTHON, XedPluginLoaderPythonClass))
typedef struct _XedPluginLoaderPython XedPluginLoaderPython;
typedef struct _XedPluginLoaderPythonClass XedPluginLoaderPythonClass;
typedef struct _XedPluginLoaderPythonPrivate XedPluginLoaderPythonPrivate;
struct _XedPluginLoaderPython {
GObject parent;
XedPluginLoaderPythonPrivate *priv;
};
struct _XedPluginLoaderPythonClass {
GObjectClass parent_class;
};
GType xed_plugin_loader_python_get_type (void) G_GNUC_CONST;
XedPluginLoaderPython *xed_plugin_loader_python_new(void);
/* All the loaders must implement this function */
G_MODULE_EXPORT GType register_xed_plugin_loader (GTypeModule * module);
G_END_DECLS
#endif /* __XED_PLUGIN_LOADER_PYTHON_H__ */

View File

@@ -1,281 +0,0 @@
/*
* xed-plugin-python.c
* This file is part of xed
*
* Copyright (C) 2005 Raphael Slinckx
* Copyright (C) 2008 Jesse van den Kieboom
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include <config.h>
#include "xed-plugin-python.h"
#include <xed/xed-plugin.h>
#include <xed/xed-debug.h>
#include <pygobject.h>
#include <string.h>
#define XED_PLUGIN_PYTHON_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), XED_TYPE_PLUGIN_PYTHON, XedPluginPythonPrivate))
static GObjectClass *parent_class;
struct _XedPluginPythonPrivate
{
PyObject *instance;
};
static void xed_plugin_python_class_init (XedPluginPythonClass *klass);
static void xed_plugin_python_init (XedPluginPython *plugin);
G_DEFINE_TYPE (XedPluginPython, xed_plugin_python, XED_TYPE_PLUGIN)
static PyObject *
call_python_method (XedPluginPythonPrivate *priv,
XedWindow *window,
gchar *method)
{
PyObject *py_ret = NULL;
g_return_val_if_fail (PyObject_HasAttrString (priv->instance, method), NULL);
if (window == NULL)
{
py_ret = PyObject_CallMethod (priv->instance,
method,
NULL);
}
else
{
py_ret = PyObject_CallMethod (priv->instance,
method,
"(N)",
pygobject_new (G_OBJECT (window)));
}
if (!py_ret)
PyErr_Print ();
return py_ret;
}
static gboolean
check_py_object_is_gtk_widget (PyObject *py_obj)
{
static PyTypeObject *_PyGtkWidget_Type = NULL;
if (_PyGtkWidget_Type == NULL)
{
PyObject *module;
if ((module = PyImport_ImportModule ("gtk")))
{
PyObject *moddict = PyModule_GetDict (module);
_PyGtkWidget_Type = (PyTypeObject *) PyDict_GetItemString (moddict, "Widget");
}
if (_PyGtkWidget_Type == NULL)
{
PyErr_SetString(PyExc_TypeError, "could not find Python gtk widget type");
PyErr_Print();
return FALSE;
}
}
return PyObject_TypeCheck (py_obj, _PyGtkWidget_Type) ? TRUE : FALSE;
}
static void
impl_update_ui (XedPlugin *plugin,
XedWindow *window)
{
PyGILState_STATE state = pyg_gil_state_ensure ();
XedPluginPythonPrivate *priv = XED_PLUGIN_PYTHON(plugin)->priv;
if (PyObject_HasAttrString (priv->instance, "update_ui"))
{
PyObject *py_ret = call_python_method (priv, window, "update_ui");
if (py_ret)
{
Py_XDECREF (py_ret);
}
}
else
XED_PLUGIN_CLASS (parent_class)->update_ui (plugin, window);
pyg_gil_state_release (state);
}
static void
impl_deactivate (XedPlugin *plugin,
XedWindow *window)
{
PyGILState_STATE state = pyg_gil_state_ensure ();
XedPluginPythonPrivate *priv = XED_PLUGIN_PYTHON(plugin)->priv;
if (PyObject_HasAttrString (priv->instance, "deactivate"))
{
PyObject *py_ret = call_python_method (priv, window, "deactivate");
if (py_ret)
{
Py_XDECREF (py_ret);
}
}
else
XED_PLUGIN_CLASS (parent_class)->deactivate (plugin, window);
pyg_gil_state_release (state);
}
static void
impl_activate (XedPlugin *plugin,
XedWindow *window)
{
PyGILState_STATE state = pyg_gil_state_ensure ();
XedPluginPythonPrivate *priv = XED_PLUGIN_PYTHON(plugin)->priv;
if (PyObject_HasAttrString (priv->instance, "activate"))
{
PyObject *py_ret = call_python_method (priv, window, "activate");
if (py_ret)
{
Py_XDECREF (py_ret);
}
}
else
XED_PLUGIN_CLASS (parent_class)->activate (plugin, window);
pyg_gil_state_release (state);
}
static GtkWidget *
impl_create_configure_dialog (XedPlugin *plugin)
{
PyGILState_STATE state = pyg_gil_state_ensure ();
XedPluginPythonPrivate *priv = XED_PLUGIN_PYTHON(plugin)->priv;
GtkWidget *ret = NULL;
if (PyObject_HasAttrString (priv->instance, "create_configure_dialog"))
{
PyObject *py_ret = call_python_method (priv, NULL, "create_configure_dialog");
if (py_ret)
{
if (check_py_object_is_gtk_widget (py_ret))
{
ret = GTK_WIDGET (pygobject_get (py_ret));
g_object_ref (ret);
}
else
{
PyErr_SetString(PyExc_TypeError, "return value for create_configure_dialog is not a GtkWidget");
PyErr_Print();
}
Py_DECREF (py_ret);
}
}
else
ret = XED_PLUGIN_CLASS (parent_class)->create_configure_dialog (plugin);
pyg_gil_state_release (state);
return ret;
}
static gboolean
impl_is_configurable (XedPlugin *plugin)
{
PyGILState_STATE state = pyg_gil_state_ensure ();
XedPluginPythonPrivate *priv = XED_PLUGIN_PYTHON(plugin)->priv;
PyObject *dict = priv->instance->ob_type->tp_dict;
gboolean result;
if (dict == NULL)
result = FALSE;
else if (!PyDict_Check(dict))
result = FALSE;
else
result = PyDict_GetItemString(dict, "create_configure_dialog") != NULL;
pyg_gil_state_release (state);
return result;
}
void
_xed_plugin_python_set_instance (XedPluginPython *plugin,
PyObject *instance)
{
PyGILState_STATE state = pyg_gil_state_ensure ();
/* we don't increment the instance here because we are the instance,
when it dies, we also die */
plugin->priv->instance = instance;
pyg_gil_state_release (state);
}
PyObject *
_xed_plugin_python_get_instance (XedPluginPython *plugin)
{
return plugin->priv->instance;
}
static void
xed_plugin_python_init (XedPluginPython *plugin)
{
plugin->priv = XED_PLUGIN_PYTHON_GET_PRIVATE(plugin);
xed_debug_message (DEBUG_PLUGINS, "Creating Python plugin instance");
plugin->priv->instance = 0;
}
static void
xed_plugin_python_finalize (GObject *object)
{
PyGILState_STATE state;
xed_debug_message (DEBUG_PLUGINS, "Finalizing Python plugin instance");
state = pyg_gil_state_ensure ();
Py_XDECREF (XED_PLUGIN_PYTHON(object)->priv->instance);
pyg_gil_state_release (state);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
xed_plugin_python_class_init (XedPluginPythonClass *klass)
{
XedPluginClass *plugin_class = XED_PLUGIN_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
g_type_class_add_private (klass, sizeof (XedPluginPythonPrivate));
G_OBJECT_CLASS (klass)->finalize = xed_plugin_python_finalize;
plugin_class->activate = impl_activate;
plugin_class->deactivate = impl_deactivate;
plugin_class->update_ui = impl_update_ui;
plugin_class->create_configure_dialog = impl_create_configure_dialog;
plugin_class->is_configurable = impl_is_configurable;
}

View File

@@ -1,88 +0,0 @@
/*
* xed-plugin-python.h
* This file is part of xed
*
* Copyright (C) 2005 - Raphael Slinckx
* Copyright (C) 2008 - Jesse van den Kieboom
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __XED_PLUGIN_PYTHON_H__
#define __XED_PLUGIN_PYTHON_H__
#define NO_IMPORT_PYGOBJECT
#include <glib-object.h>
#include <pygobject.h>
#include <xed/xed-plugin.h>
G_BEGIN_DECLS
/*
* Type checking and casting macros
*/
#define XED_TYPE_PLUGIN_PYTHON (xed_plugin_python_get_type())
#define XED_PLUGIN_PYTHON(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), XED_TYPE_PLUGIN_PYTHON, XedPluginPython))
#define XED_PLUGIN_PYTHON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), XED_TYPE_PLUGIN_PYTHON, XedPluginPythonClass))
#define XED_IS_PLUGIN_PYTHON(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), XED_TYPE_PLUGIN_PYTHON))
#define XED_IS_PLUGIN_PYTHON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XED_TYPE_PLUGIN_PYTHON))
#define XED_PLUGIN_PYTHON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), XED_TYPE_PLUGIN_PYTHON, XedPluginPythonClass))
/* Private structure type */
typedef struct _XedPluginPythonPrivate XedPluginPythonPrivate;
/*
* Main object structure
*/
typedef struct _XedPluginPython XedPluginPython;
struct _XedPluginPython
{
XedPlugin parent;
/*< private > */
XedPluginPythonPrivate *priv;
};
/*
* Class definition
*/
typedef struct _XedPluginPythonClass XedPluginPythonClass;
struct _XedPluginPythonClass
{
XedPluginClass parent_class;
};
/*
* Public methods
*/
GType xed_plugin_python_get_type (void) G_GNUC_CONST;
/*
* Private methods
*/
void _xed_plugin_python_set_instance (XedPluginPython *plugin,
PyObject *instance);
PyObject *_xed_plugin_python_get_instance (XedPluginPython *plugin);
G_END_DECLS
#endif /* __XED_PLUGIN_PYTHON_H__ */

View File

@@ -1,26 +0,0 @@
DIST_SUBDIRS = \
changecase \
docinfo \
filebrowser \
modelines \
sort \
spell \
taglist \
time \
trailsave
SUBDIRS = \
changecase \
docinfo \
filebrowser \
modelines \
sort \
taglist \
time \
trailsave
if ENABLE_ENCHANT
SUBDIRS += spell
endif
-include $(top_srcdir)/git.mk

View File

@@ -1,34 +0,0 @@
# changecase plugin
plugindir = $(XED_PLUGINS_LIBS_DIR)
AM_CPPFLAGS = \
-I$(top_srcdir) \
$(XED_CFLAGS) \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS)
plugin_LTLIBRARIES = libchangecase.la
libchangecase_la_SOURCES = \
xed-changecase-plugin.h \
xed-changecase-plugin.c
libchangecase_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
libchangecase_la_LIBADD = $(XED_LIBS)
uidir = $(XED_PLUGINS_DATA_DIR)/changecase
ui_DATA =
plugin_in_files = changecase.xed-plugin.desktop.in
%.xed-plugin: %.xed-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
plugin_DATA = $(plugin_in_files:.xed-plugin.desktop.in=.xed-plugin)
EXTRA_DIST = $(ui_DATA) $(plugin_in_files)
CLEANFILES = $(plugin_DATA)
DISTCLEANFILES = $(plugin_DATA)
-include $(top_srcdir)/git.mk

View File

@@ -1,8 +0,0 @@
[Xed Plugin]
Module=changecase
IAge=2
_Name=Change Case
_Description=Changes the case of selected text.
Authors=Paolo Borelli <pborelli@katamail.com>
Copyright=Copyright © 2004-2005 Paolo Borelli
Website=http://www.mate-desktop.org

View File

@@ -1,395 +0,0 @@
/*
* xed-changecase-plugin.c
*
* Copyright (C) 2004-2005 - Paolo Borelli
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $Id$
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "xed-changecase-plugin.h"
#include <glib/gi18n-lib.h>
#include <gmodule.h>
#include <xed/xed-debug.h>
#define WINDOW_DATA_KEY "XedChangecasePluginWindowData"
XED_PLUGIN_REGISTER_TYPE(XedChangecasePlugin, xed_changecase_plugin)
typedef enum {
TO_UPPER_CASE,
TO_LOWER_CASE,
INVERT_CASE,
TO_TITLE_CASE,
} ChangeCaseChoice;
static void
do_upper_case (GtkTextBuffer *buffer,
GtkTextIter *start,
GtkTextIter *end)
{
GString *s = g_string_new (NULL);
while (!gtk_text_iter_is_end (start) &&
!gtk_text_iter_equal (start, end))
{
gunichar c, nc;
c = gtk_text_iter_get_char (start);
nc = g_unichar_toupper (c);
g_string_append_unichar (s, nc);
gtk_text_iter_forward_char (start);
}
gtk_text_buffer_delete_selection (buffer, TRUE, TRUE);
gtk_text_buffer_insert_at_cursor (buffer, s->str, s->len);
g_string_free (s, TRUE);
}
static void
do_lower_case (GtkTextBuffer *buffer,
GtkTextIter *start,
GtkTextIter *end)
{
GString *s = g_string_new (NULL);
while (!gtk_text_iter_is_end (start) &&
!gtk_text_iter_equal (start, end))
{
gunichar c, nc;
c = gtk_text_iter_get_char (start);
nc = g_unichar_tolower (c);
g_string_append_unichar (s, nc);
gtk_text_iter_forward_char (start);
}
gtk_text_buffer_delete_selection (buffer, TRUE, TRUE);
gtk_text_buffer_insert_at_cursor (buffer, s->str, s->len);
g_string_free (s, TRUE);
}
static void
do_invert_case (GtkTextBuffer *buffer,
GtkTextIter *start,
GtkTextIter *end)
{
GString *s = g_string_new (NULL);
while (!gtk_text_iter_is_end (start) &&
!gtk_text_iter_equal (start, end))
{
gunichar c, nc;
c = gtk_text_iter_get_char (start);
if (g_unichar_islower (c))
nc = g_unichar_toupper (c);
else
nc = g_unichar_tolower (c);
g_string_append_unichar (s, nc);
gtk_text_iter_forward_char (start);
}
gtk_text_buffer_delete_selection (buffer, TRUE, TRUE);
gtk_text_buffer_insert_at_cursor (buffer, s->str, s->len);
g_string_free (s, TRUE);
}
static void
do_title_case (GtkTextBuffer *buffer,
GtkTextIter *start,
GtkTextIter *end)
{
GString *s = g_string_new (NULL);
while (!gtk_text_iter_is_end (start) &&
!gtk_text_iter_equal (start, end))
{
gunichar c, nc;
c = gtk_text_iter_get_char (start);
if (gtk_text_iter_starts_word (start))
nc = g_unichar_totitle (c);
else
nc = g_unichar_tolower (c);
g_string_append_unichar (s, nc);
gtk_text_iter_forward_char (start);
}
gtk_text_buffer_delete_selection (buffer, TRUE, TRUE);
gtk_text_buffer_insert_at_cursor (buffer, s->str, s->len);
g_string_free (s, TRUE);
}
static void
change_case (XedWindow *window,
ChangeCaseChoice choice)
{
XedDocument *doc;
GtkTextIter start, end;
xed_debug (DEBUG_PLUGINS);
doc = xed_window_get_active_document (window);
g_return_if_fail (doc != NULL);
if (!gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER (doc),
&start, &end))
{
return;
}
gtk_text_buffer_begin_user_action (GTK_TEXT_BUFFER (doc));
switch (choice)
{
case TO_UPPER_CASE:
do_upper_case (GTK_TEXT_BUFFER (doc), &start, &end);
break;
case TO_LOWER_CASE:
do_lower_case (GTK_TEXT_BUFFER (doc), &start, &end);
break;
case INVERT_CASE:
do_invert_case (GTK_TEXT_BUFFER (doc), &start, &end);
break;
case TO_TITLE_CASE:
do_title_case (GTK_TEXT_BUFFER (doc), &start, &end);
break;
default:
g_return_if_reached ();
}
gtk_text_buffer_end_user_action (GTK_TEXT_BUFFER (doc));
}
static void
upper_case_cb (GtkAction *action,
XedWindow *window)
{
change_case (window, TO_UPPER_CASE);
}
static void
lower_case_cb (GtkAction *action,
XedWindow *window)
{
change_case (window, TO_LOWER_CASE);
}
static void
invert_case_cb (GtkAction *action,
XedWindow *window)
{
change_case (window, INVERT_CASE);
}
static void
title_case_cb (GtkAction *action,
XedWindow *window)
{
change_case (window, TO_TITLE_CASE);
}
static const GtkActionEntry action_entries[] =
{
{ "ChangeCase", NULL, N_("C_hange Case") },
{ "UpperCase", NULL, N_("All _Upper Case"), NULL,
N_("Change selected text to upper case"),
G_CALLBACK (upper_case_cb) },
{ "LowerCase", NULL, N_("All _Lower Case"), NULL,
N_("Change selected text to lower case"),
G_CALLBACK (lower_case_cb) },
{ "InvertCase", NULL, N_("_Invert Case"), NULL,
N_("Invert the case of selected text"),
G_CALLBACK (invert_case_cb) },
{ "TitleCase", NULL, N_("_Title Case"), NULL,
N_("Capitalize the first letter of each selected word"),
G_CALLBACK (title_case_cb) }
};
const gchar submenu[] =
"<ui>"
" <menubar name='MenuBar'>"
" <menu name='EditMenu' action='Edit'>"
" <placeholder name='EditOps_6'>"
" <menu action='ChangeCase'>"
" <menuitem action='UpperCase'/>"
" <menuitem action='LowerCase'/>"
" <menuitem action='InvertCase'/>"
" <menuitem action='TitleCase'/>"
" </menu>"
" </placeholder>"
" </menu>"
" </menubar>"
"</ui>";
static void
xed_changecase_plugin_init (XedChangecasePlugin *plugin)
{
xed_debug_message (DEBUG_PLUGINS, "XedChangecasePlugin initializing");
}
static void
xed_changecase_plugin_finalize (GObject *object)
{
G_OBJECT_CLASS (xed_changecase_plugin_parent_class)->finalize (object);
xed_debug_message (DEBUG_PLUGINS, "XedChangecasePlugin finalizing");
}
typedef struct
{
GtkActionGroup *action_group;
guint ui_id;
} WindowData;
static void
free_window_data (WindowData *data)
{
g_return_if_fail (data != NULL);
g_slice_free (WindowData, data);
}
static void
update_ui_real (XedWindow *window,
WindowData *data)
{
GtkTextView *view;
GtkAction *action;
gboolean sensitive = FALSE;
xed_debug (DEBUG_PLUGINS);
view = GTK_TEXT_VIEW (xed_window_get_active_view (window));
if (view != NULL)
{
GtkTextBuffer *buffer;
buffer = gtk_text_view_get_buffer (view);
sensitive = (gtk_text_view_get_editable (view) &&
gtk_text_buffer_get_has_selection (buffer));
}
action = gtk_action_group_get_action (data->action_group,
"ChangeCase");
gtk_action_set_sensitive (action, sensitive);
}
static void
impl_activate (XedPlugin *plugin,
XedWindow *window)
{
GtkUIManager *manager;
WindowData *data;
GError *error = NULL;
xed_debug (DEBUG_PLUGINS);
data = g_slice_new (WindowData);
manager = xed_window_get_ui_manager (window);
data->action_group = gtk_action_group_new ("XedChangecasePluginActions");
gtk_action_group_set_translation_domain (data->action_group,
GETTEXT_PACKAGE);
gtk_action_group_add_actions (data->action_group,
action_entries,
G_N_ELEMENTS (action_entries),
window);
gtk_ui_manager_insert_action_group (manager, data->action_group, -1);
data->ui_id = gtk_ui_manager_add_ui_from_string (manager,
submenu,
-1,
&error);
if (data->ui_id == 0)
{
g_warning ("%s", error->message);
free_window_data (data);
return;
}
g_object_set_data_full (G_OBJECT (window),
WINDOW_DATA_KEY,
data,
(GDestroyNotify) free_window_data);
update_ui_real (window, data);
}
static void
impl_deactivate (XedPlugin *plugin,
XedWindow *window)
{
GtkUIManager *manager;
WindowData *data;
xed_debug (DEBUG_PLUGINS);
manager = xed_window_get_ui_manager (window);
data = (WindowData *) g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY);
g_return_if_fail (data != NULL);
gtk_ui_manager_remove_ui (manager, data->ui_id);
gtk_ui_manager_remove_action_group (manager, data->action_group);
g_object_set_data (G_OBJECT (window), WINDOW_DATA_KEY, NULL);
}
static void
impl_update_ui (XedPlugin *plugin,
XedWindow *window)
{
WindowData *data;
xed_debug (DEBUG_PLUGINS);
data = (WindowData *) g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY);
g_return_if_fail (data != NULL);
update_ui_real (window, data);
}
static void
xed_changecase_plugin_class_init (XedChangecasePluginClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
XedPluginClass *plugin_class = XED_PLUGIN_CLASS (klass);
object_class->finalize = xed_changecase_plugin_finalize;
plugin_class->activate = impl_activate;
plugin_class->deactivate = impl_deactivate;
plugin_class->update_ui = impl_update_ui;
}

View File

@@ -1,72 +0,0 @@
/*
* xed-changecase-plugin.h
*
* Copyright (C) 2004-2005 - Paolo Borelli
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $Id$
*/
#ifndef __XED_CHANGECASE_PLUGIN_H__
#define __XED_CHANGECASE_PLUGIN_H__
#include <glib.h>
#include <glib-object.h>
#include <xed/xed-plugin.h>
G_BEGIN_DECLS
/*
* Type checking and casting macros
*/
#define XED_TYPE_CHANGECASE_PLUGIN (xed_changecase_plugin_get_type ())
#define XED_CHANGECASE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XED_TYPE_CHANGECASE_PLUGIN, XedChangecasePlugin))
#define XED_CHANGECASE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XED_TYPE_CHANGECASE_PLUGIN, XedChangecasePluginClass))
#define XED_IS_CHANGECASE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XED_TYPE_CHANGECASE_PLUGIN))
#define XED_IS_CHANGECASE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XED_TYPE_CHANGECASE_PLUGIN))
#define XED_CHANGECASE_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XED_TYPE_CHANGECASE_PLUGIN, XedChangecasePluginClass))
/*
* Main object structure
*/
typedef struct _XedChangecasePlugin XedChangecasePlugin;
struct _XedChangecasePlugin
{
XedPlugin parent_instance;
};
/*
* Class definition
*/
typedef struct _XedChangecasePluginClass XedChangecasePluginClass;
struct _XedChangecasePluginClass
{
XedPluginClass parent_class;
};
/*
* Public methods
*/
GType xed_changecase_plugin_get_type (void) G_GNUC_CONST;
/* All the plugins must implement this function */
G_MODULE_EXPORT GType register_xed_plugin (GTypeModule *module);
G_END_DECLS
#endif /* __XED_CHANGECASE_PLUGIN_H__ */

View File

@@ -1,34 +0,0 @@
# docinfo plugin
plugindir = $(XED_PLUGINS_LIBS_DIR)
AM_CPPFLAGS = \
-I$(top_srcdir) \
$(XED_CFLAGS) \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS)
plugin_LTLIBRARIES = libdocinfo.la
libdocinfo_la_SOURCES = \
xed-docinfo-plugin.h \
xed-docinfo-plugin.c
libdocinfo_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
libdocinfo_la_LIBADD = $(XED_LIBS)
uidir = $(XED_PLUGINS_DATA_DIR)/docinfo
ui_DATA = docinfo.ui
plugin_in_files = docinfo.xed-plugin.desktop.in
%.xed-plugin: %.xed-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
plugin_DATA = $(plugin_in_files:.xed-plugin.desktop.in=.xed-plugin)
EXTRA_DIST = $(ui_DATA) $(plugin_in_files)
CLEANFILES = $(plugin_DATA)
DISTCLEANFILES = $(plugin_DATA)
-include $(top_srcdir)/git.mk

View File

@@ -1,4 +1,4 @@
[Xed Plugin]
[Plugin]
Module=docinfo
IAge=2
_Name=Document Statistics

View File

@@ -0,0 +1,37 @@
docinfo_sources = [
'xed-docinfo-plugin.h',
'xed-docinfo-plugin.c'
]
docinfo_deps = [
config_h,
glib,
gmodule,
gtksourceview,
libpeas,
pango
]
library('docinfo',
docinfo_sources,
dependencies: docinfo_deps,
include_directories: include_dirs,
link_with: libxed,
install_rpath: join_paths(prefix, libdir, 'xed'),
install: true,
install_dir: join_paths(libdir, 'xed', 'plugins')
)
install_data(
'docinfo.ui',
install_dir: join_paths(pluginsdatadir, 'docinfo')
)
docinfo_desktop = custom_target(
'docinfo_desktop',
input: 'docinfo.plugin.desktop.in',
output: 'docinfo.plugin',
command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'],
install: true,
install_dir: pluginslibdir,
)

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
/*
* xed-docinfo-plugin.h
*
* Copyright (C) 2002-2005 Paolo Maggi
*
* Copyright (C) 2002-2005 Paolo Maggi
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -25,50 +25,39 @@
#include <glib.h>
#include <glib-object.h>
#include <xed/xed-plugin.h>
#include <libpeas/peas-extension-base.h>
#include <libpeas/peas-object-module.h>
G_BEGIN_DECLS
/*
* Type checking and casting macros
*/
#define XED_TYPE_DOCINFO_PLUGIN (xed_docinfo_plugin_get_type ())
#define XED_DOCINFO_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XED_TYPE_DOCINFO_PLUGIN, XedDocInfoPlugin))
#define XED_DOCINFO_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XED_TYPE_DOCINFO_PLUGIN, XedDocInfoPluginClass))
#define XED_IS_DOCINFO_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XED_TYPE_DOCINFO_PLUGIN))
#define XED_IS_DOCINFO_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XED_TYPE_DOCINFO_PLUGIN))
#define XED_DOCINFO_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XED_TYPE_DOCINFO_PLUGIN, XedDocInfoPluginClass))
#define XED_TYPE_DOCINFO_PLUGIN (xed_docinfo_plugin_get_type ())
#define XED_DOCINFO_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XED_TYPE_DOCINFO_PLUGIN, XedDocInfoPlugin))
#define XED_DOCINFO_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XED_TYPE_DOCINFO_PLUGIN, XedDocInfoPluginClass))
#define XED_IS_DOCINFO_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XED_TYPE_DOCINFO_PLUGIN))
#define XED_IS_DOCINFO_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XED_TYPE_DOCINFO_PLUGIN))
#define XED_DOCINFO_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XED_TYPE_DOCINFO_PLUGIN, XedDocInfoPluginClass))
/* Private structure type */
typedef struct _XedDocInfoPluginPrivate XedDocInfoPluginPrivate;
/*
* Main object structure
*/
typedef struct _XedDocInfoPlugin XedDocInfoPlugin;
typedef struct _XedDocInfoPlugin XedDocInfoPlugin;
typedef struct _XedDocInfoPluginPrivate XedDocInfoPluginPrivate;
typedef struct _XedDocInfoPluginClass XedDocInfoPluginClass;
struct _XedDocInfoPlugin
{
XedPlugin parent_instance;
PeasExtensionBase parent;
XedDocInfoPluginPrivate *priv;
};
/*
* Class definition
*/
typedef struct _XedDocInfoPluginClass XedDocInfoPluginClass;
typedef struct _XedDocInfoPluginClass XedDocInfoPluginClass;
struct _XedDocInfoPluginClass
{
XedPluginClass parent_class;
PeasExtensionBaseClass parent_class;
};
/*
* Public methods
*/
GType xed_docinfo_plugin_get_type (void) G_GNUC_CONST;
GType xed_docinfo_plugin_get_type (void) G_GNUC_CONST;
/* All the plugins must implement this function */
G_MODULE_EXPORT GType register_xed_plugin (GTypeModule *module);
G_MODULE_EXPORT void peas_register_types (PeasObjectModule *module);
G_END_DECLS

View File

@@ -1,94 +0,0 @@
# filebrowser
plugindir = $(XED_PLUGINS_LIBS_DIR)
AM_CPPFLAGS = \
-I$(top_srcdir) \
$(XED_CFLAGS) \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS)
BUILT_SOURCES = \
xed-file-browser-enum-types.h \
xed-file-browser-enum-types.c \
xed-file-browser-marshal.h \
xed-file-browser-marshal.c
plugin_LTLIBRARIES = libfilebrowser.la
NOINST_H_FILES = \
xed-file-bookmarks-store.h \
xed-file-browser-store.h \
xed-file-browser-view.h \
xed-file-browser-widget.h \
xed-file-browser-error.h \
xed-file-browser-utils.h \
xed-file-browser-plugin.h \
xed-file-browser-messages.h
libfilebrowser_la_SOURCES = \
$(BUILT_SOURCES) \
xed-file-bookmarks-store.c \
xed-file-browser-store.c \
xed-file-browser-view.c \
xed-file-browser-widget.c \
xed-file-browser-utils.c \
xed-file-browser-plugin.c \
xed-file-browser-messages.c \
$(NOINST_H_FILES)
libfilebrowser_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
libfilebrowser_la_LIBADD = $(XED_LIBS)
# UI files (if you use ui for your plugin, list those files here)
uidir = $(XED_PLUGINS_DATA_DIR)/filebrowser
ui_DATA = xed-file-browser-widget-ui.xml
plugin_in_files = filebrowser.xed-plugin.desktop.in
%.xed-plugin: %.xed-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
xed-file-browser-enum-types.h: xed-file-browser-enum-types.h.template $(NOINST_H_FILES) $(GLIB_MKENUMS)
(cd $(srcdir) && $(GLIB_MKENUMS) --template xed-file-browser-enum-types.h.template $(NOINST_H_FILES)) > $@
xed-file-browser-enum-types.c: xed-file-browser-enum-types.c.template xed-file-browser-enum-register.c.template $(NOINST_H_FILES) $(GLIB_MKENUMS)
$(AM_V_GEN) (cd $(srcdir) && \
$(GLIB_MKENUMS) --template xed-file-browser-enum-types.c.template $(NOINST_H_FILES) && \
$(GLIB_MKENUMS) --template xed-file-browser-enum-register.c.template $(NOINST_H_FILES)) > $@
xed-file-browser-marshal.h: xed-file-browser-marshal.list $(GLIB_GENMARSHAL)
$(AM_V_GEN) $(GLIB_GENMARSHAL) $< --header --prefix=xed_file_browser_marshal > $@
xed-file-browser-marshal.c: xed-file-browser-marshal.list $(GLIB_GENMARSHAL)
$(AM_V_GEN) echo "#include \"xed-file-browser-marshal.h\"" > $@ && \
$(GLIB_GENMARSHAL) $< --body --prefix=xed_file_browser_marshal >> $@
plugin_DATA = $(plugin_in_files:.xed-plugin.desktop.in=.xed-plugin)
@INTLTOOL_XML_NOMERGE_RULE@
filebrowser_gschema_in = org.x.editor.plugins.filebrowser.gschema.xml.in
gsettings_SCHEMAS = $(filebrowser_gschema_in:.xml.in=.xml)
@GSETTINGS_RULES@
EXTRA_DIST = \
$(ui_DATA) \
$(plugin_in_files) \
$(filebrowser_gschema_in) \
xed-file-browser-enum-types.h.template \
xed-file-browser-enum-types.c.template \
xed-file-browser-enum-register.c.template \
xed-file-browser-marshal.list
CLEANFILES = \
$(plugin_DATA) \
$(gsettings_SCHEMAS_in) \
$(gsettings_SCHEMAS) \
$(BUILT_SOURCES)
DISTCLEANFILES = \
$(plugin_DATA) \
$(gsettings_SCHEMAS_in) \
$(gsettings_SCHEMAS) \
$(BUILT_SOURCES)
-include $(top_srcdir)/git.mk

View File

@@ -1,4 +1,4 @@
[Xed Plugin]
[Plugin]
Loader=C
Module=filebrowser
IAge=2

View File

@@ -0,0 +1,73 @@
filebrowser_headers = [
'xed-file-bookmarks-store.h',
'xed-file-browser-store.h',
'xed-file-browser-view.h',
'xed-file-browser-widget.h',
'xed-file-browser-error.h',
'xed-file-browser-utils.h',
'xed-file-browser-plugin.h',
'xed-file-browser-messages.h'
]
filebrowser_lib_sources = [
'xed-file-bookmarks-store.c',
'xed-file-browser-store.c',
'xed-file-browser-view.c',
'xed-file-browser-widget.c',
'xed-file-browser-utils.c',
'xed-file-browser-plugin.c',
'xed-file-browser-messages.c'
]
filebrowser_enums = gnome.mkenums_simple(
'xed-file-browser-enum-types',
sources : filebrowser_headers,
identifier_prefix : 'XedFileBrowser',
symbol_prefix : 'xed_file_browser'
)
filebrowser_marshal = gnome.genmarshal(
'xed-file-browser-marshal',
sources: 'xed-file-browser-marshal.list',
prefix: 'xed_file_browser_marshal'
)
filebrowser_deps = [
config_h,
gio,
glib,
gmodule,
gtk,
gtksourceview,
libpeas
]
library(
'filebrowser',
filebrowser_headers + filebrowser_lib_sources + filebrowser_enums + filebrowser_marshal,
link_with: libxed,
dependencies: filebrowser_deps,
include_directories: include_dirs,
install_rpath: join_paths(prefix, libdir, 'xed'),
install: true,
install_dir: join_paths(libdir, 'xed', 'plugins')
)
install_data(
'xed-file-browser-widget-ui.xml',
install_dir: join_paths(pluginsdatadir, 'filebrowser')
)
filebrowser_desktop = custom_target(
'filebrowser_desktop',
input: 'filebrowser.plugin.desktop.in',
output: 'filebrowser.plugin',
command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'],
install: true,
install_dir: pluginslibdir,
)
install_data(
'org.x.editor.plugins.filebrowser.gschema.xml',
install_dir: schema_dir
)

View File

@@ -16,6 +16,11 @@
<summary>File Browser Filter Pattern</summary>
<description>The filter pattern to filter the file browser with. This filter works on top of the filter_mode.</description>
</key>
<key name="terminal-command" type="s">
<default>'x-terminal-emulator'</default>
<summary>Terminal Command</summary>
<description>The terminal command when using the "Open terminal here" command.</description>
</key>
<child name="on-load" schema="org.x.editor.plugins.filebrowser.on-load"/>
</schema>
<schema id="org.x.editor.plugins.filebrowser.on-load" path="/org/x/editor/plugins/filebrowser/on-load/">

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
/*
* xed-file-bookmarks-store.h - Xed plugin providing easy file access
* xed-file-bookmarks-store.h - Xed plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
@@ -25,66 +25,66 @@
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define XED_TYPE_FILE_BOOKMARKS_STORE (xed_file_bookmarks_store_get_type ())
#define XED_FILE_BOOKMARKS_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XED_TYPE_FILE_BOOKMARKS_STORE, XedFileBookmarksStore))
#define XED_FILE_BOOKMARKS_STORE_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XED_TYPE_FILE_BOOKMARKS_STORE, XedFileBookmarksStore const))
#define XED_FILE_BOOKMARKS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XED_TYPE_FILE_BOOKMARKS_STORE, XedFileBookmarksStoreClass))
#define XED_IS_FILE_BOOKMARKS_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XED_TYPE_FILE_BOOKMARKS_STORE))
#define XED_IS_FILE_BOOKMARKS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XED_TYPE_FILE_BOOKMARKS_STORE))
#define XED_FILE_BOOKMARKS_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XED_TYPE_FILE_BOOKMARKS_STORE, XedFileBookmarksStoreClass))
#define XED_TYPE_FILE_BOOKMARKS_STORE (xed_file_bookmarks_store_get_type ())
#define XED_FILE_BOOKMARKS_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XED_TYPE_FILE_BOOKMARKS_STORE, XedFileBookmarksStore))
#define XED_FILE_BOOKMARKS_STORE_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XED_TYPE_FILE_BOOKMARKS_STORE, XedFileBookmarksStore const))
#define XED_FILE_BOOKMARKS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XED_TYPE_FILE_BOOKMARKS_STORE, XedFileBookmarksStoreClass))
#define XED_IS_FILE_BOOKMARKS_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XED_TYPE_FILE_BOOKMARKS_STORE))
#define XED_IS_FILE_BOOKMARKS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XED_TYPE_FILE_BOOKMARKS_STORE))
#define XED_FILE_BOOKMARKS_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XED_TYPE_FILE_BOOKMARKS_STORE, XedFileBookmarksStoreClass))
typedef struct _XedFileBookmarksStore XedFileBookmarksStore;
typedef struct _XedFileBookmarksStoreClass XedFileBookmarksStoreClass;
typedef struct _XedFileBookmarksStorePrivate XedFileBookmarksStorePrivate;
enum
enum
{
XED_FILE_BOOKMARKS_STORE_COLUMN_ICON = 0,
XED_FILE_BOOKMARKS_STORE_COLUMN_NAME,
XED_FILE_BOOKMARKS_STORE_COLUMN_OBJECT,
XED_FILE_BOOKMARKS_STORE_COLUMN_FLAGS,
XED_FILE_BOOKMARKS_STORE_N_COLUMNS
XED_FILE_BOOKMARKS_STORE_COLUMN_ICON = 0,
XED_FILE_BOOKMARKS_STORE_COLUMN_NAME,
XED_FILE_BOOKMARKS_STORE_COLUMN_OBJECT,
XED_FILE_BOOKMARKS_STORE_COLUMN_FLAGS,
XED_FILE_BOOKMARKS_STORE_N_COLUMNS
};
enum
enum
{
XED_FILE_BOOKMARKS_STORE_NONE = 0,
XED_FILE_BOOKMARKS_STORE_IS_SEPARATOR = 1 << 0, /* Separator item */
XED_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR = 1 << 1, /* Special user dir */
XED_FILE_BOOKMARKS_STORE_IS_HOME = 1 << 2, /* The special Home user directory */
XED_FILE_BOOKMARKS_STORE_IS_DESKTOP = 1 << 3, /* The special Desktop user directory */
XED_FILE_BOOKMARKS_STORE_IS_DOCUMENTS = 1 << 4, /* The special Documents user directory */
XED_FILE_BOOKMARKS_STORE_IS_FS = 1 << 5, /* A mount object */
XED_FILE_BOOKMARKS_STORE_IS_MOUNT = 1 << 6, /* A mount object */
XED_FILE_BOOKMARKS_STORE_IS_VOLUME = 1 << 7, /* A volume object */
XED_FILE_BOOKMARKS_STORE_IS_DRIVE = 1 << 8, /* A drive object */
XED_FILE_BOOKMARKS_STORE_IS_ROOT = 1 << 9, /* The root file system (file:///) */
XED_FILE_BOOKMARKS_STORE_IS_BOOKMARK = 1 << 10, /* A gtk bookmark */
XED_FILE_BOOKMARKS_STORE_IS_REMOTE_BOOKMARK = 1 << 11, /* A remote gtk bookmark */
XED_FILE_BOOKMARKS_STORE_IS_LOCAL_BOOKMARK = 1 << 12 /* A local gtk bookmark */
XED_FILE_BOOKMARKS_STORE_NONE = 0,
XED_FILE_BOOKMARKS_STORE_IS_SEPARATOR = 1 << 0, /* Separator item */
XED_FILE_BOOKMARKS_STORE_IS_SPECIAL_DIR = 1 << 1, /* Special user dir */
XED_FILE_BOOKMARKS_STORE_IS_HOME = 1 << 2, /* The special Home user directory */
XED_FILE_BOOKMARKS_STORE_IS_DESKTOP = 1 << 3, /* The special Desktop user directory */
XED_FILE_BOOKMARKS_STORE_IS_DOCUMENTS = 1 << 4, /* The special Documents user directory */
XED_FILE_BOOKMARKS_STORE_IS_FS = 1 << 5, /* A mount object */
XED_FILE_BOOKMARKS_STORE_IS_MOUNT = 1 << 6, /* A mount object */
XED_FILE_BOOKMARKS_STORE_IS_VOLUME = 1 << 7, /* A volume object */
XED_FILE_BOOKMARKS_STORE_IS_DRIVE = 1 << 8, /* A drive object */
XED_FILE_BOOKMARKS_STORE_IS_ROOT = 1 << 9, /* The root file system (file:///) */
XED_FILE_BOOKMARKS_STORE_IS_BOOKMARK = 1 << 10, /* A gtk bookmark */
XED_FILE_BOOKMARKS_STORE_IS_REMOTE_BOOKMARK = 1 << 11, /* A remote gtk bookmark */
XED_FILE_BOOKMARKS_STORE_IS_LOCAL_BOOKMARK = 1 << 12 /* A local gtk bookmark */
};
struct _XedFileBookmarksStore
struct _XedFileBookmarksStore
{
GtkTreeStore parent;
GtkTreeStore parent;
XedFileBookmarksStorePrivate *priv;
XedFileBookmarksStorePrivate *priv;
};
struct _XedFileBookmarksStoreClass
struct _XedFileBookmarksStoreClass
{
GtkTreeStoreClass parent_class;
GtkTreeStoreClass parent_class;
};
GType xed_file_bookmarks_store_get_type (void) G_GNUC_CONST;
GType xed_file_bookmarks_store_register_type (GTypeModule * module);
GType xed_file_bookmarks_store_get_type (void) G_GNUC_CONST;
void _xed_file_bookmarks_store_register_type (GTypeModule *type_module);
XedFileBookmarksStore *xed_file_bookmarks_store_new (void);
gchar *xed_file_bookmarks_store_get_uri (XedFileBookmarksStore * model,
GtkTreeIter * iter);
void xed_file_bookmarks_store_refresh (XedFileBookmarksStore * model);
GFile *xed_file_bookmarks_store_get_location (XedFileBookmarksStore * model,
GtkTreeIter * iter);
void xed_file_bookmarks_store_refresh (XedFileBookmarksStore * model);
G_END_DECLS
#endif /* __XED_FILE_BOOKMARKS_STORE_H__ */
#endif /* __XED_FILE_BOOKMARKS_STORE_H__ */
// ex:ts=8:noet:

View File

@@ -1,20 +0,0 @@
/*** BEGIN file-header ***/
void
xed_file_browser_enum_and_flag_register_type (GTypeModule * module)
{
/*** END file-header ***/
/*** BEGIN file-production ***/
/* Enumerations from "@filename@" */
/*** END file-production ***/
/*** BEGIN enumeration-production ***/
register_@enum_name@ (module);
/*** END enumeration-production ***/
/*** BEGIN file-tail ***/
}
/*** END file-tail ***/

View File

@@ -1,45 +0,0 @@
/*** BEGIN file-header ***/
#include "xed-file-browser-enum-types.h"
/*** END file-header ***/
/*** BEGIN file-production ***/
/* enumerations from "@filename@" */
#include "@filename@"
/*** END file-production ***/
/*** BEGIN value-header ***/
static GType @enum_name@_type = 0;
static GType
register_@enum_name@ (GTypeModule *module)
{
static const G@Type@Value values[] = {
/*** END value-header ***/
/*** BEGIN value-production ***/
{ @VALUENAME@,
"@VALUENAME@",
"@valuenick@" },
/*** END value-production ***/
/*** BEGIN value-tail ***/
{ 0, NULL, NULL }
};
@enum_name@_type =
g_type_module_register_@type@ (module,
"@EnumName@",
values);
return @enum_name@_type;
}
GType
@enum_name@_get_type (void)
{
return @enum_name@_type;
}
/*** END value-tail ***/

View File

@@ -1,29 +0,0 @@
/*** BEGIN file-header ***/
#ifndef __XED_FILE_BROWSER_ENUM_TYPES_H__
#define __XED_FILE_BROWSER_ENUM_TYPES_H__
#include <glib-object.h>
G_BEGIN_DECLS
/*** END file-header ***/
/*** BEGIN file-production ***/
/* Enumerations from "@filename@" */
/*** END file-production ***/
/*** BEGIN enumeration-production ***/
#define XED_TYPE_@ENUMSHORT@ (@enum_name@_get_type())
GType @enum_name@_get_type (void) G_GNUC_CONST;
/*** END enumeration-production ***/
/*** BEGIN file-tail ***/
void xed_file_browser_enum_and_flag_register_type (GTypeModule * module);
G_END_DECLS
#endif /* __XED_FILE_BROWSER_ENUM_TYPES_H__ */
/*** END file-tail ***/

View File

@@ -1,5 +1,5 @@
VOID:UINT,STRING
VOID:STRING,STRING
BOOL:OBJECT,POINTER
BOOL:POINTER
BOOL:VOID
VOID:OBJECT,OBJECT
BOOLEAN:OBJECT,POINTER
BOOLEAN:POINTER
BOOLEAN:VOID

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
/*
* xed-file-browser-plugin.h - Xed plugin providing easy file access
* xed-file-browser-plugin.h - Xed plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
@@ -24,46 +24,48 @@
#include <glib.h>
#include <glib-object.h>
#include <xed/xed-plugin.h>
#include <libpeas/peas-extension-base.h>
#include <libpeas/peas-object-module.h>
G_BEGIN_DECLS
/*
* Type checking and casting macros
*/
#define XED_TYPE_FILE_BROWSER_PLUGIN (filetree_plugin_get_type ())
#define XED_FILE_BROWSER_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XED_TYPE_FILE_BROWSER_PLUGIN, XedFileBrowserPlugin))
#define XED_FILE_BROWSER_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XED_TYPE_FILE_BROWSER_PLUGIN, XedFileBrowserPluginClass))
#define XED_IS_FILE_BROWSER_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XED_TYPE_FILE_BROWSER_PLUGIN))
#define XED_IS_FILE_BROWSER_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XED_TYPE_FILE_BROWSER_PLUGIN))
#define XED_FILE_BROWSER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XED_TYPE_FILE_BROWSER_PLUGIN, XedFileBrowserPluginClass))
#define XED_TYPE_FILE_BROWSER_PLUGIN (xed_file_browser_plugin_get_type ())
#define XED_FILE_BROWSER_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XED_TYPE_FILE_BROWSER_PLUGIN, XedFileBrowserPlugin))
#define XED_FILE_BROWSER_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XED_TYPE_FILE_BROWSER_PLUGIN, XedFileBrowserPluginClass))
#define XED_IS_FILE_BROWSER_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XED_TYPE_FILE_BROWSER_PLUGIN))
#define XED_IS_FILE_BROWSER_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XED_TYPE_FILE_BROWSER_PLUGIN))
#define XED_FILE_BROWSER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XED_TYPE_FILE_BROWSER_PLUGIN, XedFileBrowserPluginClass))
/* Private structure type */
typedef struct _XedFileBrowserPluginPrivate XedFileBrowserPluginPrivate;
typedef struct _XedFileBrowserPlugin XedFileBrowserPlugin;
typedef struct _XedFileBrowserPluginClass XedFileBrowserPluginClass;
struct _XedFileBrowserPlugin
struct _XedFileBrowserPlugin
{
XedPlugin parent_instance;
PeasExtensionBase parent_instance;
/*< private > */
XedFileBrowserPluginPrivate *priv;
/*< private > */
XedFileBrowserPluginPrivate *priv;
};
struct _XedFileBrowserPluginClass
struct _XedFileBrowserPluginClass
{
XedPluginClass parent_class;
PeasExtensionBaseClass parent_class;
};
/*
* Public methods
*/
GType filetree_plugin_get_type (void) G_GNUC_CONST;
GType xed_file_browser_plugin_get_type (void) G_GNUC_CONST;
/* All the plugins must implement this function */
G_MODULE_EXPORT GType register_xed_plugin (GTypeModule * module);
G_MODULE_EXPORT void peas_register_types (PeasObjectModule *module);
G_END_DECLS
#endif /* __XED_FILE_BROWSER_PLUGIN_H__ */

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
/*
* xed-file-browser-store.h - Xed plugin providing easy file access
* xed-file-browser-store.h - Xed plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
@@ -25,176 +25,164 @@
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define XED_TYPE_FILE_BROWSER_STORE (xed_file_browser_store_get_type ())
#define XED_FILE_BROWSER_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XED_TYPE_FILE_BROWSER_STORE, XedFileBrowserStore))
#define XED_FILE_BROWSER_STORE_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XED_TYPE_FILE_BROWSER_STORE, XedFileBrowserStore const))
#define XED_FILE_BROWSER_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XED_TYPE_FILE_BROWSER_STORE, XedFileBrowserStoreClass))
#define XED_IS_FILE_BROWSER_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XED_TYPE_FILE_BROWSER_STORE))
#define XED_IS_FILE_BROWSER_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XED_TYPE_FILE_BROWSER_STORE))
#define XED_FILE_BROWSER_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XED_TYPE_FILE_BROWSER_STORE, XedFileBrowserStoreClass))
#define XED_TYPE_FILE_BROWSER_STORE (xed_file_browser_store_get_type ())
#define XED_FILE_BROWSER_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XED_TYPE_FILE_BROWSER_STORE, XedFileBrowserStore))
#define XED_FILE_BROWSER_STORE_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XED_TYPE_FILE_BROWSER_STORE, XedFileBrowserStore const))
#define XED_FILE_BROWSER_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XED_TYPE_FILE_BROWSER_STORE, XedFileBrowserStoreClass))
#define XED_IS_FILE_BROWSER_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XED_TYPE_FILE_BROWSER_STORE))
#define XED_IS_FILE_BROWSER_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XED_TYPE_FILE_BROWSER_STORE))
#define XED_FILE_BROWSER_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XED_TYPE_FILE_BROWSER_STORE, XedFileBrowserStoreClass))
typedef enum
typedef enum
{
XED_FILE_BROWSER_STORE_COLUMN_ICON = 0,
XED_FILE_BROWSER_STORE_COLUMN_NAME,
XED_FILE_BROWSER_STORE_COLUMN_URI,
XED_FILE_BROWSER_STORE_COLUMN_FLAGS,
XED_FILE_BROWSER_STORE_COLUMN_EMBLEM,
XED_FILE_BROWSER_STORE_COLUMN_NUM
XED_FILE_BROWSER_STORE_COLUMN_ICON = 0,
XED_FILE_BROWSER_STORE_COLUMN_NAME,
XED_FILE_BROWSER_STORE_COLUMN_LOCATION,
XED_FILE_BROWSER_STORE_COLUMN_FLAGS,
XED_FILE_BROWSER_STORE_COLUMN_EMBLEM,
XED_FILE_BROWSER_STORE_COLUMN_NUM
} XedFileBrowserStoreColumn;
typedef enum
typedef enum
{
XED_FILE_BROWSER_STORE_FLAG_IS_DIRECTORY = 1 << 0,
XED_FILE_BROWSER_STORE_FLAG_IS_HIDDEN = 1 << 1,
XED_FILE_BROWSER_STORE_FLAG_IS_TEXT = 1 << 2,
XED_FILE_BROWSER_STORE_FLAG_LOADED = 1 << 3,
XED_FILE_BROWSER_STORE_FLAG_IS_FILTERED = 1 << 4,
XED_FILE_BROWSER_STORE_FLAG_IS_DUMMY = 1 << 5
XED_FILE_BROWSER_STORE_FLAG_IS_DIRECTORY = 1 << 0,
XED_FILE_BROWSER_STORE_FLAG_IS_HIDDEN = 1 << 1,
XED_FILE_BROWSER_STORE_FLAG_IS_TEXT = 1 << 2,
XED_FILE_BROWSER_STORE_FLAG_LOADED = 1 << 3,
XED_FILE_BROWSER_STORE_FLAG_IS_FILTERED = 1 << 4,
XED_FILE_BROWSER_STORE_FLAG_IS_DUMMY = 1 << 5
} XedFileBrowserStoreFlag;
typedef enum
typedef enum
{
XED_FILE_BROWSER_STORE_RESULT_OK,
XED_FILE_BROWSER_STORE_RESULT_NO_CHANGE,
XED_FILE_BROWSER_STORE_RESULT_ERROR,
XED_FILE_BROWSER_STORE_RESULT_NO_TRASH,
XED_FILE_BROWSER_STORE_RESULT_MOUNTING,
XED_FILE_BROWSER_STORE_RESULT_NUM
XED_FILE_BROWSER_STORE_RESULT_OK,
XED_FILE_BROWSER_STORE_RESULT_NO_CHANGE,
XED_FILE_BROWSER_STORE_RESULT_ERROR,
XED_FILE_BROWSER_STORE_RESULT_NO_TRASH,
XED_FILE_BROWSER_STORE_RESULT_MOUNTING,
XED_FILE_BROWSER_STORE_RESULT_NUM
} XedFileBrowserStoreResult;
typedef enum
typedef enum
{
XED_FILE_BROWSER_STORE_FILTER_MODE_NONE = 0,
XED_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN = 1 << 0,
XED_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY = 1 << 1
XED_FILE_BROWSER_STORE_FILTER_MODE_NONE = 0,
XED_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN = 1 << 0,
XED_FILE_BROWSER_STORE_FILTER_MODE_HIDE_BINARY = 1 << 1
} XedFileBrowserStoreFilterMode;
#define FILE_IS_DIR(flags) (flags & XED_FILE_BROWSER_STORE_FLAG_IS_DIRECTORY)
#define FILE_IS_HIDDEN(flags) (flags & XED_FILE_BROWSER_STORE_FLAG_IS_HIDDEN)
#define FILE_IS_TEXT(flags) (flags & XED_FILE_BROWSER_STORE_FLAG_IS_TEXT)
#define FILE_LOADED(flags) (flags & XED_FILE_BROWSER_STORE_FLAG_LOADED)
#define FILE_IS_FILTERED(flags) (flags & XED_FILE_BROWSER_STORE_FLAG_IS_FILTERED)
#define FILE_IS_DUMMY(flags) (flags & XED_FILE_BROWSER_STORE_FLAG_IS_DUMMY)
#define FILE_IS_DIR(flags) (flags & XED_FILE_BROWSER_STORE_FLAG_IS_DIRECTORY)
#define FILE_IS_HIDDEN(flags) (flags & XED_FILE_BROWSER_STORE_FLAG_IS_HIDDEN)
#define FILE_IS_TEXT(flags) (flags & XED_FILE_BROWSER_STORE_FLAG_IS_TEXT)
#define FILE_LOADED(flags) (flags & XED_FILE_BROWSER_STORE_FLAG_LOADED)
#define FILE_IS_FILTERED(flags) (flags & XED_FILE_BROWSER_STORE_FLAG_IS_FILTERED)
#define FILE_IS_DUMMY(flags) (flags & XED_FILE_BROWSER_STORE_FLAG_IS_DUMMY)
typedef struct _XedFileBrowserStore XedFileBrowserStore;
typedef struct _XedFileBrowserStoreClass XedFileBrowserStoreClass;
typedef struct _XedFileBrowserStorePrivate XedFileBrowserStorePrivate;
typedef gboolean (*XedFileBrowserStoreFilterFunc) (XedFileBrowserStore
* model,
GtkTreeIter * iter,
gpointer user_data);
typedef gboolean (*XedFileBrowserStoreFilterFunc) (XedFileBrowserStore *model,
GtkTreeIter *iter,
gpointer user_data);
struct _XedFileBrowserStore
struct _XedFileBrowserStore
{
GObject parent;
GObject parent;
XedFileBrowserStorePrivate *priv;
XedFileBrowserStorePrivate *priv;
};
struct _XedFileBrowserStoreClass {
GObjectClass parent_class;
GObjectClass parent_class;
/* Signals */
void (*begin_loading) (XedFileBrowserStore * model,
GtkTreeIter * iter);
void (*end_loading) (XedFileBrowserStore * model,
GtkTreeIter * iter);
void (*error) (XedFileBrowserStore * model,
guint code,
gchar * message);
gboolean (*no_trash) (XedFileBrowserStore * model,
GList * files);
void (*rename) (XedFileBrowserStore * model,
const gchar * olduri,
const gchar * newuri);
void (*begin_refresh) (XedFileBrowserStore * model);
void (*end_refresh) (XedFileBrowserStore * model);
void (*unload) (XedFileBrowserStore * model,
const gchar * uri);
/* Signals */
void (*begin_loading) (XedFileBrowserStore *model,
GtkTreeIter *iter);
void (*end_loading) (XedFileBrowserStore *model,
GtkTreeIter *iter);
void (*error) (XedFileBrowserStore *model,
guint code,
gchar *message);
gboolean (*no_trash) (XedFileBrowserStore *model,
GList *files);
void (*rename) (XedFileBrowserStore *model,
GFile *oldfile,
GFile *newfile);
void (*begin_refresh) (XedFileBrowserStore *model);
void (*end_refresh) (XedFileBrowserStore *model);
void (*unload) (XedFileBrowserStore *model,
GFile *location);
};
GType xed_file_browser_store_get_type (void) G_GNUC_CONST;
GType xed_file_browser_store_register_type (GTypeModule * module);
GType xed_file_browser_store_get_type (void) G_GNUC_CONST;
void _xed_file_browser_store_register_type (GTypeModule *type_module);
XedFileBrowserStore *xed_file_browser_store_new (gchar const *root);
XedFileBrowserStore *xed_file_browser_store_new (GFile *root);
XedFileBrowserStoreResult
xed_file_browser_store_set_root_and_virtual_root (XedFileBrowserStore * model,
gchar const *root,
gchar const *virtual_root);
XedFileBrowserStoreResult
xed_file_browser_store_set_root (XedFileBrowserStore * model,
gchar const *root);
XedFileBrowserStoreResult
xed_file_browser_store_set_virtual_root (XedFileBrowserStore * model,
GtkTreeIter * iter);
XedFileBrowserStoreResult
xed_file_browser_store_set_virtual_root_from_string (XedFileBrowserStore * model,
gchar const *root);
XedFileBrowserStoreResult
xed_file_browser_store_set_virtual_root_up (XedFileBrowserStore * model);
XedFileBrowserStoreResult
xed_file_browser_store_set_virtual_root_top (XedFileBrowserStore * model);
XedFileBrowserStoreResult xed_file_browser_store_set_root_and_virtual_root (XedFileBrowserStore *model,
GFile *root,
GFile *virtual_root);
XedFileBrowserStoreResult xed_file_browser_store_set_root (XedFileBrowserStore *model,
GFile *root);
XedFileBrowserStoreResult xed_file_browser_store_set_virtual_root (XedFileBrowserStore *model,
GtkTreeIter *iter);
XedFileBrowserStoreResult xed_file_browser_store_set_virtual_root_from_location (XedFileBrowserStore *model,
GFile *root);
XedFileBrowserStoreResult xed_file_browser_store_set_virtual_root_up (XedFileBrowserStore *model);
XedFileBrowserStoreResult xed_file_browser_store_set_virtual_root_top (XedFileBrowserStore *model);
gboolean
xed_file_browser_store_get_iter_virtual_root (XedFileBrowserStore * model,
GtkTreeIter * iter);
gboolean xed_file_browser_store_get_iter_root (XedFileBrowserStore * model,
GtkTreeIter * iter);
gchar * xed_file_browser_store_get_root (XedFileBrowserStore * model);
gchar * xed_file_browser_store_get_virtual_root (XedFileBrowserStore * model);
gboolean xed_file_browser_store_get_iter_virtual_root (XedFileBrowserStore *model,
GtkTreeIter *iter);
gboolean xed_file_browser_store_get_iter_root (XedFileBrowserStore *model,
GtkTreeIter *iter);
GFile * xed_file_browser_store_get_root (XedFileBrowserStore *model);
GFile * xed_file_browser_store_get_virtual_root (XedFileBrowserStore *model);
gboolean xed_file_browser_store_iter_equal (XedFileBrowserStore * model,
GtkTreeIter * iter1,
GtkTreeIter * iter2);
gboolean xed_file_browser_store_iter_equal (XedFileBrowserStore *model,
GtkTreeIter *iter1,
GtkTreeIter *iter2);
void xed_file_browser_store_set_value (XedFileBrowserStore * tree_model,
GtkTreeIter * iter,
gint column,
GValue * value);
void xed_file_browser_store_set_value (XedFileBrowserStore *tree_model,
GtkTreeIter *iter,
gint column,
GValue *value);
void _xed_file_browser_store_iter_expanded (XedFileBrowserStore * model,
GtkTreeIter * iter);
void _xed_file_browser_store_iter_collapsed (XedFileBrowserStore * model,
GtkTreeIter * iter);
void _xed_file_browser_store_iter_expanded (XedFileBrowserStore *model,
GtkTreeIter *iter);
void _xed_file_browser_store_iter_collapsed (XedFileBrowserStore *model,
GtkTreeIter *iter);
XedFileBrowserStoreFilterMode
xed_file_browser_store_get_filter_mode (XedFileBrowserStore * model);
void xed_file_browser_store_set_filter_mode (XedFileBrowserStore * model,
XedFileBrowserStoreFilterMode mode);
void xed_file_browser_store_set_filter_func (XedFileBrowserStore * model,
XedFileBrowserStoreFilterFunc func,
gpointer user_data);
void xed_file_browser_store_refilter (XedFileBrowserStore * model);
XedFileBrowserStoreFilterMode
xed_file_browser_store_filter_mode_get_default (void);
XedFileBrowserStoreFilterMode xed_file_browser_store_get_filter_mode (XedFileBrowserStore *model);
void xed_file_browser_store_set_filter_mode (XedFileBrowserStore *model,
XedFileBrowserStoreFilterMode mode);
void xed_file_browser_store_set_filter_func (XedFileBrowserStore *model,
XedFileBrowserStoreFilterFunc func,
gpointer user_data);
void xed_file_browser_store_refilter (XedFileBrowserStore *model);
XedFileBrowserStoreFilterMode xed_file_browser_store_filter_mode_get_default (void);
void xed_file_browser_store_refresh (XedFileBrowserStore * model);
gboolean xed_file_browser_store_rename (XedFileBrowserStore * model,
GtkTreeIter * iter,
gchar const *new_name,
GError ** error);
XedFileBrowserStoreResult
xed_file_browser_store_delete (XedFileBrowserStore * model,
GtkTreeIter * iter,
gboolean trash);
XedFileBrowserStoreResult
xed_file_browser_store_delete_all (XedFileBrowserStore * model,
GList *rows,
gboolean trash);
void xed_file_browser_store_refresh (XedFileBrowserStore * model);
gboolean xed_file_browser_store_rename (XedFileBrowserStore *model,
GtkTreeIter *iter,
gchar const *new_name,
GError **error);
XedFileBrowserStoreResult xed_file_browser_store_delete (XedFileBrowserStore *model,
GtkTreeIter *iter,
gboolean trash);
XedFileBrowserStoreResult xed_file_browser_store_delete_all (XedFileBrowserStore *model,
GList *rows,
gboolean trash);
gboolean xed_file_browser_store_new_file (XedFileBrowserStore * model,
GtkTreeIter * parent,
GtkTreeIter * iter);
gboolean xed_file_browser_store_new_directory (XedFileBrowserStore * model,
GtkTreeIter * parent,
GtkTreeIter * iter);
gboolean xed_file_browser_store_new_file (XedFileBrowserStore *model,
GtkTreeIter *parent,
GtkTreeIter *iter);
gboolean xed_file_browser_store_new_directory (XedFileBrowserStore *model,
GtkTreeIter *parent,
GtkTreeIter *iter);
void xed_file_browser_store_cancel_mount_operation (XedFileBrowserStore *store);
void xed_file_browser_store_cancel_mount_operation (XedFileBrowserStore *store);
G_END_DECLS
#endif /* __XED_FILE_BROWSER_STORE_H__ */
#endif /* __XED_FILE_BROWSER_STORE_H__ */
// ex:ts=8:noet:

View File

@@ -1,5 +1,5 @@
/*
* xed-file-bookmarks-store.c - Xed plugin providing easy file access
* xed-file-browser-utils.c - Xed plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
@@ -19,180 +19,145 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "xed-file-browser-utils.h"
#include <config.h>
#include <glib/gi18n-lib.h>
#include <xed/xed-utils.h>
#include "xed-file-browser-utils.h"
static GdkPixbuf *
process_icon_pixbuf (GdkPixbuf * pixbuf,
gchar const * name,
gint size,
GError * error)
process_icon_pixbuf (GdkPixbuf *pixbuf,
gchar const *name,
gint size,
GError *error)
{
GdkPixbuf * scale;
GdkPixbuf *scale;
if (error != NULL) {
g_warning ("Could not load theme icon %s: %s",
name,
error->message);
g_error_free (error);
}
if (pixbuf && gdk_pixbuf_get_width (pixbuf) > size) {
scale = gdk_pixbuf_scale_simple (pixbuf,
size,
size,
GDK_INTERP_BILINEAR);
g_object_unref (pixbuf);
pixbuf = scale;
}
if (error != NULL)
{
g_warning ("Could not load theme icon %s: %s", name, error->message);
g_error_free (error);
}
return pixbuf;
if (pixbuf && gdk_pixbuf_get_width (pixbuf) > size)
{
scale = gdk_pixbuf_scale_simple (pixbuf, size, size, GDK_INTERP_BILINEAR);
g_object_unref (pixbuf);
pixbuf = scale;
}
return pixbuf;
}
GdkPixbuf *
xed_file_browser_utils_pixbuf_from_theme (gchar const * name,
GtkIconSize size)
xed_file_browser_utils_pixbuf_from_theme (gchar const *name,
GtkIconSize size)
{
gint width;
GError *error = NULL;
GdkPixbuf *pixbuf;
gint width;
GError *error = NULL;
GdkPixbuf *pixbuf;
gtk_icon_size_lookup (size, &width, NULL);
gtk_icon_size_lookup (size, &width, NULL);
pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
name,
width,
0,
&error);
pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (), name, width, 0, &error);
pixbuf = process_icon_pixbuf (pixbuf, name, width, error);
pixbuf = process_icon_pixbuf (pixbuf, name, width, error);
return pixbuf;
return pixbuf;
}
GdkPixbuf *
xed_file_browser_utils_pixbuf_from_icon (GIcon * icon,
GtkIconSize size)
xed_file_browser_utils_pixbuf_from_icon (GIcon *icon,
GtkIconSize size)
{
GdkPixbuf * ret = NULL;
GtkIconTheme *theme;
GtkIconInfo *info;
gint width;
GdkPixbuf *ret = NULL;
GtkIconTheme *theme;
GtkIconInfo *info;
gint width;
if (!icon)
return NULL;
if (!icon)
{
return NULL;
}
theme = gtk_icon_theme_get_default ();
gtk_icon_size_lookup (size, &width, NULL);
info = gtk_icon_theme_lookup_by_gicon (theme,
icon,
width,
GTK_ICON_LOOKUP_USE_BUILTIN);
theme = gtk_icon_theme_get_default ();
gtk_icon_size_lookup (size, &width, NULL);
if (!info)
return NULL;
ret = gtk_icon_info_load_icon (info, NULL);
gtk_icon_info_free (info);
return ret;
info = gtk_icon_theme_lookup_by_gicon (theme, icon, width, GTK_ICON_LOOKUP_USE_BUILTIN);
if (!info)
{
return NULL;
}
ret = gtk_icon_info_load_icon (info, NULL);
g_object_unref (info);
return ret;
}
GdkPixbuf *
xed_file_browser_utils_pixbuf_from_file (GFile * file,
GtkIconSize size)
xed_file_browser_utils_pixbuf_from_file (GFile *file,
GtkIconSize size)
{
GIcon * icon;
GFileInfo * info;
GdkPixbuf * ret = NULL;
GIcon *icon;
GFileInfo *info;
GdkPixbuf *ret = NULL;
info = g_file_query_info (file,
G_FILE_ATTRIBUTE_STANDARD_ICON,
G_FILE_QUERY_INFO_NONE,
NULL,
NULL);
if (!info)
return NULL;
info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_ICON, G_FILE_QUERY_INFO_NONE, NULL, NULL);
icon = g_file_info_get_icon (info);
if (icon != NULL)
ret = xed_file_browser_utils_pixbuf_from_icon (icon, size);
if (!info)
{
return NULL;
}
g_object_unref (info);
return ret;
icon = g_file_info_get_icon (info);
if (icon != NULL)
{
ret = xed_file_browser_utils_pixbuf_from_icon (icon, size);
}
g_object_unref (info);
return ret;
}
gchar *
xed_file_browser_utils_file_basename (GFile * file)
xed_file_browser_utils_file_basename (GFile *file)
{
gchar *uri;
gchar *ret;
uri = g_file_get_uri (file);
ret = xed_file_browser_utils_uri_basename (uri);
g_free (uri);
return ret;
}
gchar *
xed_file_browser_utils_uri_basename (gchar const * uri)
{
return xed_utils_basename_for_display (uri);
return xed_utils_basename_for_display (file);
}
gboolean
xed_file_browser_utils_confirmation_dialog (XedWindow * window,
GtkMessageType type,
gchar const *message,
gchar const *secondary,
gchar const * button_stock,
gchar const * button_label)
xed_file_browser_utils_confirmation_dialog (XedWindow *window,
GtkMessageType type,
gchar const *message,
gchar const *secondary,
gchar const *button_label)
{
GtkWidget *dlg;
gint ret;
GtkWidget *button;
GtkWidget *dlg;
gint ret;
dlg = gtk_message_dialog_new (GTK_WINDOW (window),
GTK_DIALOG_MODAL |
GTK_DIALOG_DESTROY_WITH_PARENT,
type,
GTK_BUTTONS_NONE, "%s", message);
dlg = gtk_message_dialog_new (GTK_WINDOW (window),
GTK_DIALOG_MODAL |
GTK_DIALOG_DESTROY_WITH_PARENT,
type,
GTK_BUTTONS_NONE, "%s", message);
if (secondary)
gtk_message_dialog_format_secondary_text
(GTK_MESSAGE_DIALOG (dlg), "%s", secondary);
if (secondary)
{
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dlg), "%s", secondary);
}
/* Add a cancel button */
button = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
gtk_widget_show (button);
gtk_dialog_add_buttons (GTK_DIALOG (dlg),
_("_Cancel"), GTK_RESPONSE_CANCEL,
button_label, GTK_RESPONSE_OK,
NULL);
gtk_widget_set_can_default (button, TRUE);
gtk_dialog_add_action_widget (GTK_DIALOG (dlg),
button,
GTK_RESPONSE_CANCEL);
gtk_dialog_set_default_response (GTK_DIALOG (dlg), GTK_RESPONSE_CANCEL);
/* Add custom button */
button = gtk_button_new_from_stock (button_stock);
if (button_label) {
gtk_button_set_use_stock (GTK_BUTTON (button), FALSE);
gtk_button_set_label (GTK_BUTTON (button), button_label);
}
gtk_widget_show (button);
gtk_widget_set_can_default (button, TRUE);
gtk_dialog_add_action_widget (GTK_DIALOG (dlg),
button,
GTK_RESPONSE_OK);
ret = gtk_dialog_run (GTK_DIALOG (dlg));
gtk_widget_destroy (dlg);
ret = gtk_dialog_run (GTK_DIALOG (dlg));
gtk_widget_destroy (dlg);
return (ret == GTK_RESPONSE_OK);
return (ret == GTK_RESPONSE_OK);
}
// ex:ts=8:noet:

View File

@@ -4,23 +4,21 @@
#include <xed/xed-window.h>
#include <gio/gio.h>
GdkPixbuf *xed_file_browser_utils_pixbuf_from_theme (gchar const *name,
GtkIconSize size);
GdkPixbuf *xed_file_browser_utils_pixbuf_from_theme (gchar const *name,
GtkIconSize size);
GdkPixbuf *xed_file_browser_utils_pixbuf_from_icon (GIcon * icon,
GtkIconSize size);
GdkPixbuf *xed_file_browser_utils_pixbuf_from_file (GFile * file,
GtkIconSize size);
GdkPixbuf *xed_file_browser_utils_pixbuf_from_icon (GIcon *icon,
GtkIconSize size);
GdkPixbuf *xed_file_browser_utils_pixbuf_from_file (GFile *file,
GtkIconSize size);
gchar * xed_file_browser_utils_file_basename (GFile * file);
gchar * xed_file_browser_utils_uri_basename (gchar const * uri);
gchar * xed_file_browser_utils_file_basename (GFile *file);
gboolean xed_file_browser_utils_confirmation_dialog (XedWindow * window,
GtkMessageType type,
gchar const *message,
gchar const *secondary,
gchar const * button_stock,
gchar const * button_label);
gboolean xed_file_browser_utils_confirmation_dialog (XedWindow *window,
GtkMessageType type,
gchar const *message,
gchar const *secondary,
gchar const *button_label);
#endif /* __XED_FILE_BROWSER_UTILS_H__ */

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
/*
* xed-file-browser-view.h - Xed plugin providing easy file access
* xed-file-browser-view.h - Xed plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
@@ -25,60 +25,53 @@
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define XED_TYPE_FILE_BROWSER_VIEW (xed_file_browser_view_get_type ())
#define XED_FILE_BROWSER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XED_TYPE_FILE_BROWSER_VIEW, XedFileBrowserView))
#define XED_FILE_BROWSER_VIEW_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XED_TYPE_FILE_BROWSER_VIEW, XedFileBrowserView const))
#define XED_FILE_BROWSER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XED_TYPE_FILE_BROWSER_VIEW, XedFileBrowserViewClass))
#define XED_IS_FILE_BROWSER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XED_TYPE_FILE_BROWSER_VIEW))
#define XED_IS_FILE_BROWSER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XED_TYPE_FILE_BROWSER_VIEW))
#define XED_FILE_BROWSER_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XED_TYPE_FILE_BROWSER_VIEW, XedFileBrowserViewClass))
#define XED_TYPE_FILE_BROWSER_VIEW (xed_file_browser_view_get_type ())
#define XED_FILE_BROWSER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XED_TYPE_FILE_BROWSER_VIEW, XedFileBrowserView))
#define XED_FILE_BROWSER_VIEW_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XED_TYPE_FILE_BROWSER_VIEW, XedFileBrowserView const))
#define XED_FILE_BROWSER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XED_TYPE_FILE_BROWSER_VIEW, XedFileBrowserViewClass))
#define XED_IS_FILE_BROWSER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XED_TYPE_FILE_BROWSER_VIEW))
#define XED_IS_FILE_BROWSER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XED_TYPE_FILE_BROWSER_VIEW))
#define XED_FILE_BROWSER_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XED_TYPE_FILE_BROWSER_VIEW, XedFileBrowserViewClass))
typedef struct _XedFileBrowserView XedFileBrowserView;
typedef struct _XedFileBrowserViewClass XedFileBrowserViewClass;
typedef struct _XedFileBrowserViewPrivate XedFileBrowserViewPrivate;
typedef enum {
XED_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE,
XED_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE
} XedFileBrowserViewClickPolicy;
struct _XedFileBrowserView
struct _XedFileBrowserView
{
GtkTreeView parent;
GtkTreeView parent;
XedFileBrowserViewPrivate *priv;
XedFileBrowserViewPrivate *priv;
};
struct _XedFileBrowserViewClass
struct _XedFileBrowserViewClass
{
GtkTreeViewClass parent_class;
GtkTreeViewClass parent_class;
/* Signals */
void (*error) (XedFileBrowserView * filetree,
guint code,
gchar const *message);
void (*file_activated) (XedFileBrowserView * filetree,
GtkTreeIter *iter);
void (*directory_activated) (XedFileBrowserView * filetree,
GtkTreeIter *iter);
void (*bookmark_activated) (XedFileBrowserView * filetree,
GtkTreeIter *iter);
/* Signals */
void (*error) (XedFileBrowserView *filetree,
guint code,
gchar const *message);
void (*file_activated) (XedFileBrowserView *filetree,
GtkTreeIter *iter);
void (*directory_activated) (XedFileBrowserView *filetree,
GtkTreeIter *iter);
void (*bookmark_activated) (XedFileBrowserView *filetree,
GtkTreeIter *iter);
};
GType xed_file_browser_view_get_type (void) G_GNUC_CONST;
GType xed_file_browser_view_register_type (GTypeModule * module);
GType xed_file_browser_view_get_type (void) G_GNUC_CONST;
void _xed_file_browser_view_register_type (GTypeModule *type_module);
GtkWidget *xed_file_browser_view_new (void);
void xed_file_browser_view_set_model (XedFileBrowserView * tree_view,
GtkTreeModel * model);
void xed_file_browser_view_start_rename (XedFileBrowserView * tree_view,
GtkTreeIter * iter);
void xed_file_browser_view_set_click_policy (XedFileBrowserView * tree_view,
XedFileBrowserViewClickPolicy policy);
void xed_file_browser_view_set_restore_expand_state (XedFileBrowserView * tree_view,
gboolean restore_expand_state);
GtkWidget *xed_file_browser_view_new (void);
void xed_file_browser_view_set_model (XedFileBrowserView *tree_view,
GtkTreeModel *model);
void xed_file_browser_view_start_rename (XedFileBrowserView *tree_view,
GtkTreeIter *iter);
void xed_file_browser_view_set_restore_expand_state (XedFileBrowserView *tree_view,
gboolean restore_expand_state);
G_END_DECLS
#endif /* __XED_FILE_BROWSER_VIEW_H__ */
#endif /* __XED_FILE_BROWSER_VIEW_H__ */
// ex:ts=8:noet:

View File

@@ -1,14 +1,9 @@
<ui>
<toolbar name="ToolBar">
<placeholder name="Tool_Opt1"/>
<toolitem action="DirectoryPrevious"/>
<toolitem action="DirectoryNext"/>
<toolitem action="DirectoryUp"/>
<separator/>
<toolitem action="DirectoryRefresh"/>
<separator/>
<placeholder name="Tool_Opt2"/>
<separator/>
<toolitem action="FilterHidden"/>
<separator/>
<placeholder name="Tool_Opt3"/>
</toolbar>

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
/*
* xed-file-browser-widget.h - Xed plugin providing easy file access
* xed-file-browser-widget.h - Xed plugin providing easy file access
* from the sidepanel
*
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
@@ -28,13 +28,13 @@
#include "xed-file-browser-view.h"
G_BEGIN_DECLS
#define XED_TYPE_FILE_BROWSER_WIDGET (xed_file_browser_widget_get_type ())
#define XED_FILE_BROWSER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XED_TYPE_FILE_BROWSER_WIDGET, XedFileBrowserWidget))
#define XED_FILE_BROWSER_WIDGET_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XED_TYPE_FILE_BROWSER_WIDGET, XedFileBrowserWidget const))
#define XED_FILE_BROWSER_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XED_TYPE_FILE_BROWSER_WIDGET, XedFileBrowserWidgetClass))
#define XED_IS_FILE_BROWSER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XED_TYPE_FILE_BROWSER_WIDGET))
#define XED_IS_FILE_BROWSER_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XED_TYPE_FILE_BROWSER_WIDGET))
#define XED_FILE_BROWSER_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XED_TYPE_FILE_BROWSER_WIDGET, XedFileBrowserWidgetClass))
#define XED_TYPE_FILE_BROWSER_WIDGET (xed_file_browser_widget_get_type ())
#define XED_FILE_BROWSER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XED_TYPE_FILE_BROWSER_WIDGET, XedFileBrowserWidget))
#define XED_FILE_BROWSER_WIDGET_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XED_TYPE_FILE_BROWSER_WIDGET, XedFileBrowserWidget const))
#define XED_FILE_BROWSER_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XED_TYPE_FILE_BROWSER_WIDGET, XedFileBrowserWidgetClass))
#define XED_IS_FILE_BROWSER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XED_TYPE_FILE_BROWSER_WIDGET))
#define XED_IS_FILE_BROWSER_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XED_TYPE_FILE_BROWSER_WIDGET))
#define XED_FILE_BROWSER_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XED_TYPE_FILE_BROWSER_WIDGET, XedFileBrowserWidgetClass))
typedef struct _XedFileBrowserWidget XedFileBrowserWidget;
typedef struct _XedFileBrowserWidgetClass XedFileBrowserWidgetClass;
@@ -42,36 +42,36 @@ typedef struct _XedFileBrowserWidgetPrivate XedFileBrowserWidgetPrivate;
typedef
gboolean (*XedFileBrowserWidgetFilterFunc) (XedFileBrowserWidget * obj,
XedFileBrowserStore *
model, GtkTreeIter * iter,
gpointer user_data);
XedFileBrowserStore *
model, GtkTreeIter * iter,
gpointer user_data);
struct _XedFileBrowserWidget
struct _XedFileBrowserWidget
{
GtkBox parent;
GtkBox parent;
XedFileBrowserWidgetPrivate *priv;
XedFileBrowserWidgetPrivate *priv;
};
struct _XedFileBrowserWidgetClass
struct _XedFileBrowserWidgetClass
{
GtkBoxClass parent_class;
GtkBoxClass parent_class;
/* Signals */
void (*uri_activated) (XedFileBrowserWidget * widget,
gchar const *uri);
void (*error) (XedFileBrowserWidget * widget,
guint code,
gchar const *message);
gboolean (*confirm_delete) (XedFileBrowserWidget * widget,
XedFileBrowserStore * model,
GList *list);
gboolean (*confirm_no_trash) (XedFileBrowserWidget * widget,
GList *list);
/* Signals */
void (*location_activated) (XedFileBrowserWidget * widget,
GFile *location);
void (*error) (XedFileBrowserWidget * widget,
guint code,
gchar const *message);
gboolean (*confirm_delete) (XedFileBrowserWidget * widget,
XedFileBrowserStore * model,
GList *list);
gboolean (*confirm_no_trash) (XedFileBrowserWidget * widget,
GList *list);
};
GType xed_file_browser_widget_get_type (void) G_GNUC_CONST;
GType xed_file_browser_widget_register_type (GTypeModule * module);
void _xed_file_browser_widget_register_type (GTypeModule *type_module);
GtkWidget *xed_file_browser_widget_new (const gchar *data_dir);
@@ -79,31 +79,31 @@ void xed_file_browser_widget_show_bookmarks (XedFileBrowserWidget * obj);
void xed_file_browser_widget_show_files (XedFileBrowserWidget * obj);
void xed_file_browser_widget_set_root (XedFileBrowserWidget * obj,
gchar const *root,
GFile *root,
gboolean virtual_root);
void
xed_file_browser_widget_set_root_and_virtual_root (XedFileBrowserWidget * obj,
gchar const *root,
gchar const *virtual_root);
GFile *root,
GFile *virtual_root);
gboolean
xed_file_browser_widget_get_selected_directory (XedFileBrowserWidget * obj,
xed_file_browser_widget_get_selected_directory (XedFileBrowserWidget * obj,
GtkTreeIter * iter);
XedFileBrowserStore *
XedFileBrowserStore *
xed_file_browser_widget_get_browser_store (XedFileBrowserWidget * obj);
XedFileBookmarksStore *
XedFileBookmarksStore *
xed_file_browser_widget_get_bookmarks_store (XedFileBrowserWidget * obj);
XedFileBrowserView *
xed_file_browser_widget_get_browser_view (XedFileBrowserWidget * obj);
GtkWidget *
xed_file_browser_widget_get_filter_entry (XedFileBrowserWidget * obj);
GtkUIManager *
GtkUIManager *
xed_file_browser_widget_get_ui_manager (XedFileBrowserWidget * obj);
gulong xed_file_browser_widget_add_filter (XedFileBrowserWidget * obj,
XedFileBrowserWidgetFilterFunc func,
XedFileBrowserWidgetFilterFunc func,
gpointer user_data,
GDestroyNotify notify);
void xed_file_browser_widget_remove_filter (XedFileBrowserWidget * obj,
@@ -111,9 +111,9 @@ void xed_file_browser_widget_remove_filter (XedFileBrowserWidget * obj,
void xed_file_browser_widget_set_filter_pattern (XedFileBrowserWidget * obj,
gchar const *pattern);
void xed_file_browser_widget_refresh (XedFileBrowserWidget * obj);
void xed_file_browser_widget_history_back (XedFileBrowserWidget * obj);
void xed_file_browser_widget_history_forward (XedFileBrowserWidget * obj);
void xed_file_browser_widget_refresh (XedFileBrowserWidget * obj);
void xed_file_browser_widget_history_back (XedFileBrowserWidget * obj);
void xed_file_browser_widget_history_forward (XedFileBrowserWidget * obj);
G_END_DECLS
#endif /* __XED_FILE_BROWSER_WIDGET_H__ */

17
plugins/meson.build Normal file
View File

@@ -0,0 +1,17 @@
pluginsdatadir = join_paths(datadir, 'xed', 'plugins')
pluginslibdir = join_paths(libdir, 'xed', 'plugins')
subdir('docinfo')
subdir('filebrowser')
subdir('modelines')
subdir('open-uri-context-menu')
subdir('sort')
subdir('taglist')
subdir('textsize')
subdir('time')
subdir('trailsave')
subdir('wordcompletion')
if enable_spell
subdir('spell')
endif

View File

@@ -1,38 +0,0 @@
# Modelines Plugin
plugindir = $(XED_PLUGINS_LIBS_DIR)
AM_CPPFLAGS = \
-I$(top_srcdir) \
$(XED_CFLAGS) \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS)
modelinesdir = $(XED_PLUGINS_DATA_DIR)/modelines
modelines_DATA = \
language-mappings
plugin_LTLIBRARIES = libmodelines.la
libmodelines_la_SOURCES = \
xed-modeline-plugin.h \
xed-modeline-plugin.c \
modeline-parser.h \
modeline-parser.c
libmodelines_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
libmodelines_la_LIBADD = $(XED_LIBS)
plugin_in_files = modelines.xed-plugin.desktop.in
%.xed-plugin: %.xed-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
plugin_DATA = $(plugin_in_files:.xed-plugin.desktop.in=.xed-plugin)
EXTRA_DIST = \
$(plugin_in_files) \
$(modelines_DATA)
CLEANFILES = $(plugin_DATA)
DISTCLEANFILES = $(plugin_DATA)
-include $(top_srcdir)/git.mk

View File

@@ -0,0 +1,40 @@
modelines_sources = [
'xed-modeline-plugin.h',
'xed-modeline-plugin.c',
'modeline-parser.h',
'modeline-parser.c'
]
modelines_deps = [
config_h,
glib,
gmodule,
gtk,
gtksourceview,
libpeas
]
library(
'modelines',
modelines_sources,
link_with: libxed,
dependencies: modelines_deps,
include_directories: include_dirs,
install_rpath: join_paths(prefix, libdir, 'xed'),
install: true,
install_dir: join_paths(libdir, 'xed', 'plugins')
)
install_data(
'language-mappings',
install_dir: join_paths(pluginsdatadir, 'modelines')
)
modelines_desktop = custom_target(
'modelines_desktop',
input: 'modelines.plugin.desktop.in',
output: 'modelines.plugin',
command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'],
install: true,
install_dir: pluginslibdir,
)

View File

@@ -24,9 +24,9 @@
#include <stdio.h>
#include <gtk/gtk.h>
#include <gtksourceview/gtksource.h>
#include <xed/xed-language-manager.h>
#include <xed/xed-prefs-manager.h>
#include <xed/xed-debug.h>
#include <xed/xed-settings.h>
#include <xed/xed-utils.h>
#include "modeline-parser.h"
#define MODELINES_LANGUAGE_MAPPINGS_FILE "language-mappings"
@@ -64,7 +64,7 @@ typedef struct _ModelineOptions
GtkWrapMode wrap_mode;
gboolean display_right_margin;
guint right_margin_position;
ModelineSet set;
} ModelineOptions;
@@ -80,7 +80,10 @@ has_option (ModelineOptions *options,
void
modeline_parser_init (const gchar *data_dir)
{
modelines_data_dir = g_strdup (data_dir);
if (modelines_data_dir == NULL)
{
modelines_data_dir = g_strdup (data_dir);
}
}
void
@@ -94,12 +97,13 @@ modeline_parser_shutdown ()
if (kate_languages != NULL)
g_hash_table_destroy (kate_languages);
vim_languages = NULL;
emacs_languages = NULL;
kate_languages = NULL;
g_free (modelines_data_dir);
modelines_data_dir = NULL;
}
static GHashTable *
@@ -224,7 +228,7 @@ skip_whitespaces (gchar **s)
}
/* Parse vi(m) modelines.
* Vi(m) modelines looks like this:
* Vi(m) modelines looks like this:
* - first form: [text]{white}{vi:|vim:|ex:}[white]{options}
* - second form: [text]{white}{vi:|vim:|ex:}[white]se[t] {options}:[text]
* They can happen on the three first or last lines.
@@ -289,7 +293,7 @@ parse_vim_modeline (gchar *s,
{
g_free (options->language_id);
options->language_id = get_language_id_vim (value->str);
options->set |= MODELINE_SET_LANGUAGE;
}
else if (strcmp (key->str, "et") == 0 ||
@@ -302,7 +306,7 @@ parse_vim_modeline (gchar *s,
strcmp (key->str, "tabstop") == 0)
{
intval = atoi (value->str);
if (intval)
{
options->tab_width = intval;
@@ -313,7 +317,7 @@ parse_vim_modeline (gchar *s,
strcmp (key->str, "shiftwidth") == 0)
{
intval = atoi (value->str);
if (intval)
{
options->indent_width = intval;
@@ -326,18 +330,18 @@ parse_vim_modeline (gchar *s,
options->set |= MODELINE_SET_WRAP_MODE;
}
else if (strcmp (key->str, "textwidth") == 0)
else if (strcmp (key->str, "textwidth") == 0 || strcmp (key->str, "tw") == 0)
{
intval = atoi (value->str);
if (intval)
{
options->right_margin_position = intval;
options->display_right_margin = TRUE;
options->set |= MODELINE_SET_SHOW_RIGHT_MARGIN |
MODELINE_SET_RIGHT_MARGIN_POSITION;
}
}
}
@@ -406,13 +410,13 @@ parse_emacs_modeline (gchar *s,
{
g_free (options->language_id);
options->language_id = get_language_id_emacs (value->str);
options->set |= MODELINE_SET_LANGUAGE;
}
else if (strcmp (key->str, "tab-width") == 0)
{
intval = atoi (value->str);
if (intval)
{
options->tab_width = intval;
@@ -422,7 +426,7 @@ parse_emacs_modeline (gchar *s,
else if (strcmp (key->str, "indent-offset") == 0)
{
intval = atoi (value->str);
if (intval)
{
options->indent_width = intval;
@@ -433,14 +437,14 @@ parse_emacs_modeline (gchar *s,
{
intval = strcmp (value->str, "nil") == 0;
options->insert_spaces = intval;
options->set |= MODELINE_SET_INSERT_SPACES;
}
else if (strcmp (key->str, "autowrap") == 0)
{
intval = strcmp (value->str, "nil") != 0;
options->wrap_mode = intval ? GTK_WRAP_WORD : GTK_WRAP_NONE;
options->set |= MODELINE_SET_WRAP_MODE;
}
}
@@ -504,13 +508,13 @@ parse_kate_modeline (gchar *s,
{
g_free (options->language_id);
options->language_id = get_language_id_kate (value->str);
options->set |= MODELINE_SET_LANGUAGE;
}
else if (strcmp (key->str, "tab-width") == 0)
{
intval = atoi (value->str);
if (intval)
{
options->tab_width = intval;
@@ -539,17 +543,17 @@ parse_kate_modeline (gchar *s,
options->wrap_mode = intval ? GTK_WRAP_WORD : GTK_WRAP_NONE;
options->set |= MODELINE_SET_WRAP_MODE;
options->set |= MODELINE_SET_WRAP_MODE;
}
else if (strcmp (key->str, "word-wrap-column") == 0)
{
intval = atoi (value->str);
if (intval)
{
options->right_margin_position = intval;
options->display_right_margin = TRUE;
options->set |= MODELINE_SET_RIGHT_MARGIN_POSITION |
MODELINE_SET_SHOW_RIGHT_MARGIN;
}
@@ -611,7 +615,7 @@ check_previous (GtkSourceView *view,
ModelineSet set)
{
GtkSourceBuffer *buffer = GTK_SOURCE_BUFFER (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)));
/* Do not restore default when this is the first time */
if (!previous)
return FALSE;
@@ -648,7 +652,7 @@ check_previous (GtkSourceView *view,
case MODELINE_SET_LANGUAGE:
{
GtkSourceLanguage *language = gtk_source_buffer_get_language (buffer);
return (language == NULL && previous->language_id == NULL) ||
(language != NULL && g_strcmp0 (gtk_source_language_get_id (language),
previous->language_id) == 0);
@@ -674,7 +678,8 @@ modeline_parser_apply_modeline (GtkSourceView *view)
GtkTextBuffer *buffer;
GtkTextIter iter, liter;
gint line_count;
GSettings *settings;
options.language_id = NULL;
options.set = MODELINE_SET_NONE;
@@ -746,7 +751,7 @@ modeline_parser_apply_modeline (GtkSourceView *view)
GtkSourceLanguageManager *manager;
GtkSourceLanguage *language;
manager = xed_get_language_manager ();
manager = gtk_source_language_manager_get_default ();
language = gtk_source_language_manager_get_language
(manager, options.language_id);
@@ -757,9 +762,11 @@ modeline_parser_apply_modeline (GtkSourceView *view)
}
}
ModelineOptions *previous = g_object_get_data (G_OBJECT (buffer),
ModelineOptions *previous = g_object_get_data (G_OBJECT (buffer),
MODELINE_OPTIONS_DATA_KEY);
settings = g_settings_new ("org.x.editor.preferences.editor");
/* Apply the options we got from modelines and restore defaults if
we set them before */
if (has_option (&options, MODELINE_SET_INSERT_SPACES))
@@ -769,21 +776,24 @@ modeline_parser_apply_modeline (GtkSourceView *view)
}
else if (check_previous (view, previous, MODELINE_SET_INSERT_SPACES))
{
gtk_source_view_set_insert_spaces_instead_of_tabs
(view,
xed_prefs_manager_get_insert_spaces ());
gboolean insert_spaces;
insert_spaces = g_settings_get_boolean (settings, XED_SETTINGS_INSERT_SPACES);
gtk_source_view_set_insert_spaces_instead_of_tabs (view, insert_spaces);
}
if (has_option (&options, MODELINE_SET_TAB_WIDTH))
{
gtk_source_view_set_tab_width (view, options.tab_width);
}
else if (check_previous (view, previous, MODELINE_SET_TAB_WIDTH))
{
gtk_source_view_set_tab_width (view,
xed_prefs_manager_get_tabs_size ());
guint tab_width;
tab_width = g_settings_get_uint (settings, XED_SETTINGS_TABS_SIZE);
gtk_source_view_set_tab_width (view, tab_width);
}
if (has_option (&options, MODELINE_SET_INDENT_WIDTH))
{
gtk_source_view_set_indent_width (view, options.indent_width);
@@ -792,39 +802,46 @@ modeline_parser_apply_modeline (GtkSourceView *view)
{
gtk_source_view_set_indent_width (view, -1);
}
if (has_option (&options, MODELINE_SET_WRAP_MODE))
{
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (view), options.wrap_mode);
}
else if (check_previous (view, previous, MODELINE_SET_WRAP_MODE))
{
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (view),
xed_prefs_manager_get_wrap_mode ());
GtkWrapMode mode;
mode = g_settings_get_enum (settings, XED_SETTINGS_WRAP_MODE);
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (view), mode);
}
if (has_option (&options, MODELINE_SET_RIGHT_MARGIN_POSITION))
{
gtk_source_view_set_right_margin_position (view, options.right_margin_position);
}
else if (check_previous (view, previous, MODELINE_SET_RIGHT_MARGIN_POSITION))
{
gtk_source_view_set_right_margin_position (view,
xed_prefs_manager_get_right_margin_position ());
guint right_margin_pos;
right_margin_pos = g_settings_get_uint (settings, XED_SETTINGS_RIGHT_MARGIN_POSITION);
gtk_source_view_set_right_margin_position (view, right_margin_pos);
}
if (has_option (&options, MODELINE_SET_SHOW_RIGHT_MARGIN))
{
gtk_source_view_set_show_right_margin (view, options.display_right_margin);
}
else if (check_previous (view, previous, MODELINE_SET_SHOW_RIGHT_MARGIN))
{
gtk_source_view_set_show_right_margin (view,
xed_prefs_manager_get_display_right_margin ());
gboolean display_right_margin;
display_right_margin = g_settings_get_boolean (settings, XED_SETTINGS_DISPLAY_RIGHT_MARGIN);
gtk_source_view_set_show_right_margin (view, display_right_margin);
}
if (previous)
{
g_free (previous->language_id);
*previous = options;
previous->language_id = g_strdup (options.language_id);
}
@@ -833,13 +850,13 @@ modeline_parser_apply_modeline (GtkSourceView *view)
previous = g_slice_new (ModelineOptions);
*previous = options;
previous->language_id = g_strdup (options.language_id);
g_object_set_data_full (G_OBJECT (buffer),
MODELINE_OPTIONS_DATA_KEY,
g_object_set_data_full (G_OBJECT (buffer),
MODELINE_OPTIONS_DATA_KEY,
previous,
(GDestroyNotify)free_modeline_options);
}
g_free (options.language_id);
}

View File

@@ -1,14 +1,14 @@
/*
* modelie-parser.h
* Emacs, Kate and Vim-style modelines support for xed.
*
*
* Copyright (C) 2005-2007 - Steve Frécinaux <code@istique.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@@ -23,14 +23,14 @@
#define __MODELINE_PARSER_H__
#include <glib.h>
#include <gtksourceview/gtksourceview.h>
#include <gtksourceview/gtksource.h>
G_BEGIN_DECLS
void modeline_parser_init (const gchar *data_dir);
void modeline_parser_shutdown (void);
void modeline_parser_apply_modeline (GtkSourceView *view);
void modeline_parser_deactivate (GtkSourceView *view);
void modeline_parser_init (const gchar *data_dir);
void modeline_parser_shutdown (void);
void modeline_parser_apply_modeline (GtkSourceView *view);
void modeline_parser_deactivate (GtkSourceView *view);
G_END_DECLS

View File

@@ -1,4 +1,4 @@
[Xed Plugin]
[Plugin]
Module=modelines
IAge=2
_Name=Modelines

View File

@@ -1,14 +1,14 @@
/*
* xed-modeline-plugin.c
* Emacs, Kate and Vim-style modelines support for xed.
*
*
* Copyright (C) 2005-2007 - Steve Frécinaux <code@istique.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@@ -18,231 +18,204 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <config.h>
#include <glib/gi18n-lib.h>
#include <gmodule.h>
#include <xed/xed-debug.h>
#include <xed/xed-view-activatable.h>
#include <xed/xed-view.h>
#include "xed-modeline-plugin.h"
#include "modeline-parser.h"
#include <xed/xed-debug.h>
#include <xed/xed-utils.h>
#define WINDOW_DATA_KEY "XedModelinePluginWindowData"
#define DOCUMENT_DATA_KEY "XedModelinePluginDocumentData"
typedef struct
struct _XedModelinePluginPrivate
{
gulong tab_added_handler_id;
gulong tab_removed_handler_id;
} WindowData;
XedView *view;
typedef struct
gulong document_loaded_handler_id;
gulong document_saved_handler_id;
};
enum
{
gulong document_loaded_handler_id;
gulong document_saved_handler_id;
} DocumentData;
PROP_0,
PROP_VIEW
};
static void xed_modeline_plugin_activate (XedPlugin *plugin, XedWindow *window);
static void xed_modeline_plugin_deactivate (XedPlugin *plugin, XedWindow *window);
static GObject *xed_modeline_plugin_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_param);
static void xed_modeline_plugin_finalize (GObject *object);
static void xed_view_activatable_iface_init (XedViewActivatableInterface *iface);
XED_PLUGIN_REGISTER_TYPE(XedModelinePlugin, xed_modeline_plugin)
G_DEFINE_DYNAMIC_TYPE_EXTENDED (XedModelinePlugin,
xed_modeline_plugin,
PEAS_TYPE_EXTENSION_BASE,
0,
G_IMPLEMENT_INTERFACE_DYNAMIC (XED_TYPE_VIEW_ACTIVATABLE,
xed_view_activatable_iface_init))
static void
window_data_free (WindowData *wdata)
xed_modeline_plugin_constructed (GObject *object)
{
g_slice_free (WindowData, wdata);
}
gchar *data_dir;
static void
document_data_free (DocumentData *ddata)
{
g_slice_free (DocumentData, ddata);
}
data_dir = peas_extension_base_get_data_dir (PEAS_EXTENSION_BASE (object));
static void
xed_modeline_plugin_class_init (XedModelinePluginClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
XedPluginClass *plugin_class = XED_PLUGIN_CLASS (klass);
modeline_parser_init (data_dir);
object_class->constructor = xed_modeline_plugin_constructor;
object_class->finalize = xed_modeline_plugin_finalize;
g_free (data_dir);
plugin_class->activate = xed_modeline_plugin_activate;
plugin_class->deactivate = xed_modeline_plugin_deactivate;
}
static GObject *
xed_modeline_plugin_constructor (GType type,
guint n_construct_properties,
GObjectConstructParam *construct_param)
{
GObject *object;
gchar *data_dir;
object = G_OBJECT_CLASS (xed_modeline_plugin_parent_class)->constructor (type,
n_construct_properties,
construct_param);
data_dir = xed_plugin_get_data_dir (XED_PLUGIN (object));
modeline_parser_init (data_dir);
g_free (data_dir);
return object;
G_OBJECT_CLASS (xed_modeline_plugin_parent_class)->constructed (object);
}
static void
xed_modeline_plugin_init (XedModelinePlugin *plugin)
{
xed_debug_message (DEBUG_PLUGINS, "XedModelinePlugin initializing");
xed_debug_message (DEBUG_PLUGINS, "XedModelinePlugin initializing");
plugin->priv = G_TYPE_INSTANCE_GET_PRIVATE (plugin,
XED_TYPE_MODELINE_PLUGIN,
XedModelinePluginPrivate);
}
static void
xed_modeline_plugin_dispose (GObject *object)
{
XedModelinePlugin *plugin = XED_MODELINE_PLUGIN (object);
xed_debug_message (DEBUG_PLUGINS, "XedModelinePlugin disposing");
g_clear_object (&plugin->priv->view);
G_OBJECT_CLASS (xed_modeline_plugin_parent_class)->dispose (object);
}
static void
xed_modeline_plugin_finalize (GObject *object)
{
xed_debug_message (DEBUG_PLUGINS, "XedModelinePlugin finalizing");
xed_debug_message (DEBUG_PLUGINS, "XedModelinePlugin finalizing");
modeline_parser_shutdown ();
modeline_parser_shutdown ();
G_OBJECT_CLASS (xed_modeline_plugin_parent_class)->finalize (object);
G_OBJECT_CLASS (xed_modeline_plugin_parent_class)->finalize (object);
}
static void
on_document_loaded_or_saved (XedDocument *document,
const GError *error,
GtkSourceView *view)
xed_modeline_plugin_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
modeline_parser_apply_modeline (view);
XedModelinePlugin *plugin = XED_MODELINE_PLUGIN (object);
switch (prop_id)
{
case PROP_VIEW:
plugin->priv->view = XED_VIEW (g_value_dup_object (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
connect_handlers (XedView *view)
xed_modeline_plugin_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
DocumentData *data;
GtkTextBuffer *doc;
XedModelinePlugin *plugin = XED_MODELINE_PLUGIN (object);
doc = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
data = g_slice_new (DocumentData);
data->document_loaded_handler_id =
g_signal_connect (doc, "loaded",
G_CALLBACK (on_document_loaded_or_saved),
view);
data->document_saved_handler_id =
g_signal_connect (doc, "saved",
G_CALLBACK (on_document_loaded_or_saved),
view);
g_object_set_data_full (G_OBJECT (doc), DOCUMENT_DATA_KEY,
data, (GDestroyNotify) document_data_free);
switch (prop_id)
{
case PROP_VIEW:
g_value_set_object (value, plugin->priv->view);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
disconnect_handlers (XedView *view)
on_document_loaded_or_saved (XedDocument *document,
GtkSourceView *view)
{
DocumentData *data;
GtkTextBuffer *doc;
doc = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
data = g_object_steal_data (G_OBJECT (doc), DOCUMENT_DATA_KEY);
if (data)
{
g_signal_handler_disconnect (doc, data->document_loaded_handler_id);
g_signal_handler_disconnect (doc, data->document_saved_handler_id);
document_data_free (data);
}
else
{
g_warning ("Modeline handlers not found");
}
modeline_parser_apply_modeline (view);
}
static void
on_window_tab_added (XedWindow *window,
XedTab *tab,
gpointer user_data)
xed_modeline_plugin_activate (XedViewActivatable *activatable)
{
connect_handlers (xed_tab_get_view (tab));
XedModelinePlugin *plugin;
GtkTextBuffer *doc;
xed_debug (DEBUG_PLUGINS);
plugin = XED_MODELINE_PLUGIN (activatable);
modeline_parser_apply_modeline (GTK_SOURCE_VIEW (plugin->priv->view));
doc = gtk_text_view_get_buffer (GTK_TEXT_VIEW (plugin->priv->view));
plugin->priv->document_loaded_handler_id =
g_signal_connect (doc, "loaded",
G_CALLBACK (on_document_loaded_or_saved), plugin->priv->view);
plugin->priv->document_saved_handler_id =
g_signal_connect (doc, "saved",
G_CALLBACK (on_document_loaded_or_saved), plugin->priv->view);
}
static void
on_window_tab_removed (XedWindow *window,
XedTab *tab,
gpointer user_data)
xed_modeline_plugin_deactivate (XedViewActivatable *activatable)
{
disconnect_handlers (xed_tab_get_view (tab));
XedModelinePlugin *plugin;
GtkTextBuffer *doc;
xed_debug (DEBUG_PLUGINS);
plugin = XED_MODELINE_PLUGIN (activatable);
doc = gtk_text_view_get_buffer (GTK_TEXT_VIEW (plugin->priv->view));
g_signal_handler_disconnect (doc, plugin->priv->document_loaded_handler_id);
g_signal_handler_disconnect (doc, plugin->priv->document_saved_handler_id);
}
static void
xed_modeline_plugin_activate (XedPlugin *plugin,
XedWindow *window)
xed_modeline_plugin_class_init (XedModelinePluginClass *klass)
{
WindowData *wdata;
GList *views;
GList *l;
GObjectClass *object_class = G_OBJECT_CLASS (klass);
xed_debug (DEBUG_PLUGINS);
object_class->constructed = xed_modeline_plugin_constructed;
object_class->dispose = xed_modeline_plugin_dispose;
object_class->finalize = xed_modeline_plugin_finalize;
object_class->set_property = xed_modeline_plugin_set_property;
object_class->get_property = xed_modeline_plugin_get_property;
views = xed_window_get_views (window);
for (l = views; l != NULL; l = l->next)
{
connect_handlers (XED_VIEW (l->data));
modeline_parser_apply_modeline (GTK_SOURCE_VIEW (l->data));
}
g_list_free (views);
g_object_class_override_property (object_class, PROP_VIEW, "view");
wdata = g_slice_new (WindowData);
wdata->tab_added_handler_id =
g_signal_connect (window, "tab-added",
G_CALLBACK (on_window_tab_added), NULL);
wdata->tab_removed_handler_id =
g_signal_connect (window, "tab-removed",
G_CALLBACK (on_window_tab_removed), NULL);
g_object_set_data_full (G_OBJECT (window), WINDOW_DATA_KEY,
wdata, (GDestroyNotify) window_data_free);
g_type_class_add_private (klass, sizeof (XedModelinePluginPrivate));
}
static void
xed_modeline_plugin_deactivate (XedPlugin *plugin,
XedWindow *window)
xed_view_activatable_iface_init (XedViewActivatableInterface *iface)
{
WindowData *wdata;
GList *views;
GList *l;
xed_debug (DEBUG_PLUGINS);
wdata = g_object_steal_data (G_OBJECT (window), WINDOW_DATA_KEY);
g_signal_handler_disconnect (window, wdata->tab_added_handler_id);
g_signal_handler_disconnect (window, wdata->tab_removed_handler_id);
window_data_free (wdata);
views = xed_window_get_views (window);
for (l = views; l != NULL; l = l->next)
{
disconnect_handlers (XED_VIEW (l->data));
modeline_parser_deactivate (GTK_SOURCE_VIEW (l->data));
}
g_list_free (views);
iface->activate = xed_modeline_plugin_activate;
iface->deactivate = xed_modeline_plugin_deactivate;
}
static void
xed_modeline_plugin_class_finalize (XedModelinePluginClass *klass)
{
/* dummy function - used by G_DEFINE_DYNAMIC_TYPE_EXTENDED */
}
G_MODULE_EXPORT void
peas_register_types (PeasObjectModule *module)
{
xed_modeline_plugin_register_type (G_TYPE_MODULE (module));
peas_object_module_register_extension_type (module,
XED_TYPE_VIEW_ACTIVATABLE,
XED_TYPE_MODELINE_PLUGIN);
}

View File

@@ -1,7 +1,7 @@
/*
* xed-modeline-plugin.h
* Emacs, Kate and Vim-style modelines support for xed.
*
*
* Copyright (C) 2005-2007 - Steve Frécinaux <code@istique.net>
*
* This program is free software; you can redistribute it and/or modify
@@ -24,24 +24,41 @@
#include <glib.h>
#include <glib-object.h>
#include <xed/xed-plugin.h>
#include <libpeas/peas-extension-base.h>
#include <libpeas/peas-object-module.h>
G_BEGIN_DECLS
#define XED_TYPE_MODELINE_PLUGIN (xed_modeline_plugin_get_type ())
#define XED_MODELINE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XED_TYPE_MODELINE_PLUGIN, XedModelinePlugin))
#define XED_MODELINE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XED_TYPE_MODELINE_PLUGIN, XedModelinePluginClass))
#define XED_IS_MODELINE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XED_TYPE_MODELINE_PLUGIN))
#define XED_IS_MODELINE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XED_TYPE_MODELINE_PLUGIN))
#define XED_MODELINE_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XED_TYPE_MODELINE_PLUGIN, XedModelinePluginClass))
#define XED_TYPE_MODELINE_PLUGIN (xed_modeline_plugin_get_type ())
#define XED_MODELINE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), XED_TYPE_MODELINE_PLUGIN, XedModelinePlugin))
#define XED_MODELINE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), XED_TYPE_MODELINE_PLUGIN, XedModelinePluginClass))
#define XED_IS_MODELINE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), XED_TYPE_MODELINE_PLUGIN))
#define XED_IS_MODELINE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), XED_TYPE_MODELINE_PLUGIN))
#define XED_MODELINE_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), XED_TYPE_MODELINE_PLUGIN, XedModelinePluginClass))
/* Private structure type */
typedef XedPluginClass XedModelinePluginClass;
typedef XedPlugin XedModelinePlugin;
typedef struct _XedModelinePlugin XedModelinePlugin;
typedef struct _XedModelinePluginPrivate XedModelinePluginPrivate;
typedef struct _XedModelinePluginClass XedModelinePluginClass;
GType xed_modeline_plugin_get_type (void) G_GNUC_CONST;
struct _XedModelinePlugin
{
PeasExtensionBase parent;
G_MODULE_EXPORT GType register_xed_plugin (GTypeModule *module);
/*< private >*/
XedModelinePluginPrivate *priv;
};
typedef struct _XedModelinePluginClass XedModelinePluginClass;
struct _XedModelinePluginClass
{
PeasExtensionBaseClass parent_class;
};
GType xed_modeline_plugin_get_type (void) G_GNUC_CONST;
G_MODULE_EXPORT void peas_register_types (PeasObjectModule *module);
G_END_DECLS

View File

@@ -0,0 +1,4 @@
install_subdir(
'open-uri-context-menu',
install_dir: pluginslibdir
)

View File

@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@@ -0,0 +1,11 @@
[Plugin]
Loader=python3
Module=open-uri-context-menu
IAge=3
Name=Open URI
Description=Adds context menu item to open an URI at the pointer position.
Icon=gtk-open
Authors=Martin Szulecki <opensuse@sukimashita.com>\nJean-Philippe Fleury <contact@jpfleury.net>
Copyright=Copyright © 2007-2008 Martin Szulecki\nCopyright © 2011 Jean-Philippe Fleury
Website=https://github.com/jpfleury/open-uri-context-menu
Builtin=true

View File

@@ -0,0 +1,179 @@
# Copyright (C) 2007-2008 Martin Szulecki
# Copyright (C) 2011 Jean-Philippe Fleury <contact@jpfleury.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
'''
Adds context menu item to open an URI at the pointer position
'''
from gi.repository import Gtk, Xed, Gio, GObject, GtkSource
import gettext
import re
import sys
import os
import subprocess
import string
gettext.install("xed")
ACCEPTED_SCHEMES = ['file', 'ftp', 'sftp', 'smb', 'dav', 'davs', 'ssh', 'http', 'https']
RE_DELIM = re.compile(r'[\w#/\?:%@&\=\+\.\\~-]+', re.UNICODE|re.MULTILINE)
RE_URI_RFC2396 = re.compile("((([a-zA-Z][0-9a-zA-Z+\\-\\.]*):)?/{0,2}([0-9a-zA-Z;:,/\?@&=\+\$\.\-_!~\*'\(\)%]+))?(#[0-9a-zA-Z;,/\?:@&\=+$\.\\-_!~\*'\(\)%]+)?")
class OpenURIContextMenuPlugin(GObject.Object, Xed.WindowActivatable):
__gtype_name__ = "OpenURIContextMenuPlugin"
window = GObject.property(type=Xed.Window)
def __init__(self):
GObject.Object.__init__(self)
self.uri = ""
self.window = None
self.encoding = GtkSource.Encoding.get_from_charset("UTF-8")
def do_activate(self):
handler_ids = []
for signal in ('tab-added', 'tab-removed'):
method = getattr(self, 'on_window_' + signal.replace('-', '_'))
handler_ids.append(self.window.connect(signal, method))
self.window.OpenURIContextMenuPluginID = handler_ids
for view in self.window.get_views():
self.connect_view(view)
def do_deactivate(self):
widgets = [self.window] + self.window.get_views()
for widget in widgets:
handler_ids = widget.OpenURIContextMenuPluginID
if not handler_ids is None:
for handler_id in handler_ids:
widget.disconnect(handler_id)
widget.OpenURIContextMenuPluginID = None
self.window = None
def connect_view(self, view):
handler_id = view.connect('populate-popup', self.on_view_populate_popup)
view.OpenURIContextMenuPluginID = [handler_id]
def update_ui(self, window):
pass
def browse_url(self, menu_item, url):
command = ['xdg-open', url]
# Avoid to run the browser as user root
if os.getuid() == 0 and os.environ.has_key('SUDO_USER'):
command = ['sudo', '-u', os.environ['SUDO_USER']] + command
subprocess.Popen(command)
def on_window_tab_added(self, window, tab):
self.connect_view(tab.get_view())
def on_window_tab_removed(self, window, tab):
pass
def on_view_populate_popup(self, view, menu):
doc = view.get_buffer()
win = view.get_window(Gtk.TextWindowType.TEXT);
ptr_window, x, y, mod = win.get_pointer()
x, y = view.window_to_buffer_coords(Gtk.TextWindowType.TEXT, x, y);
# First try at pointer location
# Starting with GTK 3.20, get_iter_at_location returns a tuple of type
# (gboolean, GtkTextIter). Earlier versions return only the GtkTextIter.
insert = view.get_iter_at_location(x, y);
if isinstance(insert, tuple):
insert = insert[1] if insert[0] else None
# Second try at cursor
if insert == None:
insert = doc.get_iter_at_mark(doc.get_insert())
if isinstance(insert, tuple):
insert = insert[1] if insert[0] else None
while insert.forward_char():
if not RE_DELIM.match(insert.get_char()):
break
start = insert.copy()
while start.backward_char():
if not RE_DELIM.match(start.get_char()):
start.forward_char();
break
word = doc.get_text(start, insert, False)
if len(word) == 0:
return True
word = self.validate_uri(word)
if not word:
return True
displayed_word = word
if len(displayed_word) > 50:
displayed_word = displayed_word[:50] + u"\u2026"
browse_to = False
if word.startswith("http://") or word.startswith("https://"):
browse_to = True
if browse_to:
browse_uri_item = Gtk.MenuItem(_("Open '%s'") % (displayed_word))
browse_uri_item.connect('activate', self.browse_url, word);
browse_uri_item.show();
separator = Gtk.SeparatorMenuItem()
separator.show();
menu.prepend(separator)
menu.prepend(browse_uri_item)
return True
def validate_uri(self, uri):
m = RE_URI_RFC2396.search(uri);
if not m:
return False
target = m.group()
if m.group(4) == None or m.group(4) == "/":
return False
if m.group(2) != None:
if m.group(3) in ACCEPTED_SCHEMES:
return target
else:
return False
else:
if m.group(4).startswith("www."):
return 'http://' + target
target = os.path.expanduser(target)
if os.path.isfile(target):
if os.path.isabs(target):
return 'file://' + target
doc_dir = self.window.get_active_document().get_uri_for_display()
if doc_dir != None:
if doc_dir.startswith('file://'):
f = os.path.join(os.path.dirname(doc_dir), target)
if os.path.isfile(f.replace('file://', '', 1)):
return f
else:
return os.path.join(os.path.dirname(doc_dir), target)
paths = string.split(os.environ["PATH"], os.pathsep)
for dirname in paths:
f = os.path.join(os.path.dirname(dirname), 'include', target)
if os.path.isfile(f):
return 'file://' + f
return False

View File

@@ -1,34 +0,0 @@
# sort plugin
plugindir = $(XED_PLUGINS_LIBS_DIR)
AM_CPPFLAGS = \
-I$(top_srcdir) \
$(XED_CFLAGS) \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS)
plugin_LTLIBRARIES = libsort.la
libsort_la_SOURCES = \
xed-sort-plugin.h \
xed-sort-plugin.c
libsort_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
libsort_la_LIBADD = $(XED_LIBS)
uidir = $(XED_PLUGINS_DATA_DIR)/sort
ui_DATA = sort.ui
plugin_in_files = sort.xed-plugin.desktop.in
%.xed-plugin: %.xed-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
plugin_DATA = $(plugin_in_files:.xed-plugin.desktop.in=.xed-plugin)
EXTRA_DIST = $(ui_DATA) $(plugin_in_files)
CLEANFILES = $(plugin_DATA)
DISTCLEANFILES = $(plugin_DATA)
-include $(top_srcdir)/git.mk

31
plugins/sort/meson.build Normal file
View File

@@ -0,0 +1,31 @@
sort_sources = [
'xed-sort-plugin.h',
'xed-sort-plugin.c'
]
sort_deps = [
config_h,
glib,
gtksourceview,
libpeas
]
library(
'sort',
sort_sources,
link_with: libxed,
dependencies: sort_deps,
include_directories: include_dirs,
install_rpath: join_paths(prefix, libdir, 'xed'),
install: true,
install_dir: join_paths(libdir, 'xed', 'plugins'),
)
sort_desktop = custom_target(
'sort_desktop',
input: 'sort.plugin.desktop.in',
output: 'sort.plugin',
command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'],
install: true,
install_dir: pluginslibdir,
)

View File

@@ -1,4 +1,4 @@
[Xed Plugin]
[Plugin]
Module=sort
IAge=2
_Name=Sort
@@ -7,3 +7,4 @@ Icon=gtk-sort-ascending
Authors=Carlo Borreo <borreo@softhome.net>;Lee Mallabone <mate@fonicmonkey.net>;Paolo Maggi <paolo.maggi@polito.it>;Jorge Alberto Torres H. <jorge@deadoak.com>
Copyright=Copyright © 2001 Carlo Borreo\nCopyright © 2002-2003 Lee Mallabone, Paolo Maggi\nCopyright © 2004-2005 Paolo Maggi
Website=http://www.mate-desktop.org
Builtin=true

Some files were not shown because too many files have changed in this diff Show More