• Login
Community
  • Login

Plugin Source

Scheduled Pinned Locked Moved Notepad++ & Plugin Development
14 Posts 6 Posters 2.7k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P
    PeterJones
    last edited by Mar 13, 2019, 10:31 PM

    There is no requirement for a plugin to publish its source code. Even when available, the source code usually won’t come bundled if you download it through the Plugins Admin. You can check the plugin’s individual website to see if it’s available.

    1 Reply Last reply Reply Quote 2
    • A
      andrecool-68
      last edited by andrecool-68 Mar 13, 2019, 10:37 PM Mar 13, 2019, 10:34 PM

      Something strange …plugins which I use you can freely download the source code

      And the authors of these plugins helped me with advice on how to compile these projects! For which they thank you!

      M 1 Reply Last reply Mar 13, 2019, 10:47 PM Reply Quote 1
      • M
        Meta Chuh moderator @andrecool-68
        last edited by Mar 13, 2019, 10:47 PM

        @andrecool-68

        yes, and most of the plugins are open source.

        but there are many developers that published source code, and had a very bad experience, as some rogue entities took profit on selling it, and worst case, trying or accomplishing to patent, what they have taken from another person’s open source project.

        so i can fully understand why some developers, especially the ones with a lot of bad experiences, choose to omit to publish any further source codes.

        A 1 Reply Last reply Mar 13, 2019, 10:51 PM Reply Quote 1
        • A
          andrecool-68 @Meta Chuh
          last edited by andrecool-68 Mar 13, 2019, 10:52 PM Mar 13, 2019, 10:51 PM

          @Meta-Chuh
          Me a thief and a bad seller turns out)))
          Parents are not taught to steal)))

          M 1 Reply Last reply Mar 13, 2019, 11:02 PM Reply Quote 1
          • M
            Meta Chuh moderator @andrecool-68
            last edited by Mar 13, 2019, 11:02 PM

            @andrecool-68

            of course i did not mean you, but big, big enterprises.
            i hope this was a joke from you, because otherwise maybe you need a better translator after all 😉

            A 1 Reply Last reply Mar 13, 2019, 11:21 PM Reply Quote 2
            • A
              andrecool-68 @Meta Chuh
              last edited by Mar 13, 2019, 11:21 PM

              @Meta-Chuh
              A translator is a robot, not a living person. You want to say one thing, but it turns out quite another.

              1 Reply Last reply Reply Quote 1
              • T
                Tod Mar
                last edited by Mar 14, 2019, 1:40 PM

                Super I’m glad I started the conversation but my 2nd question was where to find any doc. about adding icons to the toolbar and getting their events. I can search and find it but if anyone can point me anywhere. Also…the code here is classic Windows code without even MFC or ATL/WTL I assume?

                A 1 Reply Last reply Mar 14, 2019, 1:55 PM Reply Quote 1
                • A
                  Alan Kilborn @Tod Mar
                  last edited by Mar 14, 2019, 1:55 PM

                  @Tod-Mar said:

                  the code here is classic Windows code without even MFC or ATL/WTL I assume?

                  Yes…double-edged sword I guess. Personally, I’m glad it is not MFC-based. I always found MFC to be a joke.

                  1 Reply Last reply Reply Quote 0
                  • T
                    Tod Mar
                    last edited by Mar 14, 2019, 3:52 PM

                    Yet some plugins are C#. I thought C# was only a .Net platform, but they could be compiled with .NET Native…

                    A 1 Reply Last reply Mar 14, 2019, 3:58 PM Reply Quote 0
                    • A
                      Alan Kilborn @Tod Mar
                      last edited by Alan Kilborn Mar 14, 2019, 4:00 PM Mar 14, 2019, 3:58 PM

                      @Tod-Mar

                      You can write plugins in a lot of languages. Notepad++ itself is as you said, “classic Windows code”, C++ and straight Windows API function calls, so maybe the natural choice for a plugin is to stick with same.

                      1 Reply Last reply Reply Quote 0
                      • T
                        Tod Mar
                        last edited by Mar 14, 2019, 5:51 PM

                        So you do everything using window handles and messages? how about icons/images? (looking at the toolbar…)

                        1 Reply Last reply Reply Quote 0
                        • D
                          dinkumoil
                          last edited by dinkumoil Mar 14, 2019, 6:45 PM Mar 14, 2019, 6:44 PM

                          @Tod-Mar

                          When I started to develop plugins for Notepad++ the following links have been helpful:

                          How to develop a plugin or a lexer
                          Messages and notifications
                          Sources of plugin interface
                          Scintilla documentation

                          Regarding toolbar buttons

                          The handling of toolbar buttons is totally transparent to a plugin developer because they work like a menu entry.

                          A plugin developer has to fill an array at plugin’s startup that contains structs of type FuncItem. Every array element describes a menu entry of the plugin (text, click handler function, menu command id, Checked state, and keyboard shortcut).

                          Notepad++ queries a pointer to this array at a certain time in the startup process. It generates the menu entry of the plugin in the Plugins menu, adds for every array element a submenu entry and fills the menu command id member of the array elements. So you know the menu command ids of your menu entries.

                          If you want to have a toolbar button you have to hook the NPPN_TB_MODIFICATION event sent by Notepad++ to your plugin. In the handler of this event you have to fill a struct of type toolbarIcons (please note: you have to fill only one of its two members, either hToolbarBmp or hToolbarIcon but it seems only the first one works). The bitmap whose handle you provide has to be in a 8 bits-per-pixel palletized format (max. 256 colors) and its size has to be 16x16 pixels. Then you can send a NPPM_ADDTOOLBARICON event to Notepad++ where you provide the menu command id of the menu entry which you want to connect with your toolbar button and a pointer to the toolbarIcons struct you filled before.

                          1 Reply Last reply Reply Quote 3
                          12 out of 14
                          • First post
                            12/14
                            Last post
                          The Community of users of the Notepad++ text editor.
                          Powered by NodeBB | Contributors