[Cin] Theme "bright" color inconsistence?

Good Guy good1.2guy at gmail.com
Sat Sep 12 04:03:05 CEST 2020

A Theme is a base class object that is created and customized as ThemeName.
It is constructed during program initialization in a theme plugin
defined in a plugins/theme_name source directory.

theme_name.C and theme_name.h are derived "Theme" class object constructors.
A Theme is constructed during initialization in init_theme (mwindow.C).
The theme
plugin is accessed using the "name" from preferences, and that theme plugin
is loaded,
and it contains the code to construct that theme.  A Theme object has
functions and data
that cinelerra uses to do a variety of customizations, such as
and it can modify gui defaults, like default_text_color, when it is
initialized.  The theme
plugin contains a "new_theme" function, that allocates and constructs a
object, with a base classes of BC_Theme (gui setup), Theme (cin defaults),
ThemeName, with definitions and overrides that create the custom theme.

To create a new theme, a new plugin is needed:
==== Code:

#include "header files.h"
PluginClient* new_plugin(PluginServer *server)
        return new NameMain(server);

NameMain::NameMain(PluginServer *server)
 : PluginTClient(server)

const char* NameMain::plugin_title() { return N_("Name"); }

Theme* NameMain::new_theme()
        theme = new ThemeName;
        extern unsigned char _binary_theme_name_data_start[];
        return theme;

 : Theme()

        delete stuff;

When a theme is constructed by NameMain::new_theme(), it sets a pointer to a
block of data created in the plugin build that contains all of the png data
files in the
plugins/theme_name/data directory.  These images may define or override the
appearance of gui images, such as "ok.png" (the ok button).  There are
a large number of images that need to be defined.  The theme plugin adds
to the theme image data in the theme->initialize() function.  The best list
of theme image setup is probably in SUV (plugins/theme_suv/suv.[Ch]).

The easy way to create a new theme is to copy an existing theme and change
name to ThemeName, and be sure to change plugin_title() to the new name,
then tweak the definitions until you are happy with the results.   The file
and Makefile also need to be updated to the new theme "name".  The source
can by manually re/built by invoking make in the plugins/theme_name
Once it is built into the plugin library, it will be discovered by the
plugin probe,
and it will become an available theme in the preferences.

If you are ready to add it to the main build, then theme_name should be
in the DIRS targets of the plugins/Makefile, and the plugin_defs needs
in the themes list.

Themes usually require considerable time to create from scratch.  For
the SUV theme has over 800 lines in the initialize function, and has over
png images in the data directory.  Most of these images and data values are
required to be initialized by the custom theme constructor; very tedious and
time consuming work.  Creating a new theme is usually a lot of work.


On Thu, Sep 10, 2020 at 11:06 AM Andrew Randrianasulu via Cin <
cin at lists.cinelerra-gg.org> wrote:

> Hi, all!
> User asked me how to make new themes for CinelerraGG. While I was unable
> to answer this question, I at least tried few themes more, and found theme
> "Bright" to have  too-coloriful (IMO, for mostly-b/w theme) icon for
> 'locklablels'. I tried to GIMP them into something acceptable, but I
> literally can't make straight line (checkmark for activated icon) even with
> automatic line drawing!
> Attached are png files I de-colorized. I uncheked all of 'exif' stuff in
> GIMP"s png export dialog - this made files smaller, and I also run
> 'optipng' over them, and compile-tested them:
> root at slax:/dev/shm/tmp/cinelerra-goodguy-20200905/cinelerra-5.1/plugins/theme_bright#
> make clean && make
> cp ../../bin/plugins/themes/theme_bright.plugin
> /usr/lib/cin/plugins/themes/
> cin launched without libpng's CRC errors (I had some if I left GIMP to
> write exif to png, as it did by default). And those icons kinda
> ..less-coloriful now.
> I think artistic user can start from copying existing theme and just
> modifying icons one by one, but what to do with hypothetical
> mytheme_theme.c and h  files? They can remain the same if line colors not
> changed?
> --
> Cin mailing list
> Cin at lists.cinelerra-gg.org
> https://lists.cinelerra-gg.org/mailman/listinfo/cin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20200911/80cfeaed/attachment.htm>

More information about the Cin mailing list