Working version of dynamics editor and its menu.

Dynamics editor shows up when clicked on dockable menu.
This commit is contained in:
zhenfeng zhao 2009-08-07 20:29:34 -03:00
parent 7adb01a589
commit 997db31a2e
4 changed files with 26 additions and 5 deletions

View File

@ -33,6 +33,8 @@ libappwidgets_a_sources = \
gimpblobeditor.h \ gimpblobeditor.h \
gimpbrusheditor.c \ gimpbrusheditor.c \
gimpbrusheditor.h \ gimpbrusheditor.h \
gimpdynamicseditor.c \
gimpdynamicseditor.h \
gimpbrushfactoryview.c \ gimpbrushfactoryview.c \
gimpbrushfactoryview.h \ gimpbrushfactoryview.h \
gimpbrushselect.c \ gimpbrushselect.c \

View File

@ -16,6 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#define DYNAMICS_VIEW_SIZE 96
#include "config.h" #include "config.h"
#include <string.h> #include <string.h>
@ -37,7 +40,10 @@
#include "gimp-intl.h" #include "gimp-intl.h"
#include "gimpmenufactory.h"
#include "widgets/gimpdynamicseditor.h" #include "widgets/gimpdynamicseditor.h"
#include "core/gimpbrush.h"
//To do: //To do:
// discard unneeded ones. // discard unneeded ones.
// needs to be fixed to gimppaintdynamics.h when that works. // needs to be fixed to gimppaintdynamics.h when that works.
@ -75,8 +81,8 @@ static GObject * gimp_dynamics_editor_constructor (GType type,
guint n_params, guint n_params,
GObjectConstructParam *params); GObjectConstructParam *params);
static void gimp_dynamics_editor_set_data (GimpDataEditor *editor, //static void gimp_dynamics_editor_set_data (GimpDataEditor *editor,
GimpData *data); // GimpData *data);
static void gimp_dynamics_editor_set_context (GimpDocked *docked, static void gimp_dynamics_editor_set_context (GimpDocked *docked,
GimpContext *context); GimpContext *context);
@ -138,7 +144,7 @@ gimp_dynamics_editor_class_init (GimpDynamicsEditorClass *klass)
object_class->constructor = gimp_dynamics_editor_constructor; object_class->constructor = gimp_dynamics_editor_constructor;
editor_class->set_data = gimp_dynamics_editor_set_data; //editor_class->set_data = gimp_dynamics_editor_set_data;
editor_class->title = _("Dynamics Editor"); editor_class->title = _("Dynamics Editor");
} }
@ -175,6 +181,19 @@ gimp_dynamics_editor_init (GimpDynamicsEditor *editor)
gtk_box_pack_start (GTK_BOX (editor), frame, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (editor), frame, TRUE, TRUE, 0);
gtk_widget_show (frame); gtk_widget_show (frame);
data_editor->view = gimp_view_new_full_by_types (NULL,
GIMP_TYPE_VIEW,
GIMP_TYPE_BRUSH,
DYNAMICS_VIEW_SIZE,
DYNAMICS_VIEW_SIZE, 0,
FALSE, FALSE, TRUE);
gtk_widget_set_size_request (data_editor->view, -1, DYNAMICS_VIEW_SIZE);
gimp_view_set_expand (GIMP_VIEW (data_editor->view), TRUE);
gtk_container_add (GTK_CONTAINER (frame), data_editor->view);
gtk_widget_show (data_editor->view);
//editor->shape_group = NULL;
} }
static GObject * static GObject *

View File

@ -61,7 +61,7 @@ typedef struct _GimpDataEditor GimpDataEditor;
typedef struct _GimpBrushEditor GimpBrushEditor; typedef struct _GimpBrushEditor GimpBrushEditor;
typedef struct _GimpGradientEditor GimpGradientEditor; typedef struct _GimpGradientEditor GimpGradientEditor;
typedef struct _GimpPaletteEditor GimpPaletteEditor; typedef struct _GimpPaletteEditor GimpPaletteEditor;
typedef struct _GimpDynamicsEditor GimpDynamicsEditor;
/* GimpImageEditor widgets */ /* GimpImageEditor widgets */